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
Returns compiled notification text.
public function getCompiledText() { return $this->owner->compileText($this->getType(), $this->getData()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function NotificationContent(){\n\t\treturn $this->config()->html_notifications ? $this->NotificationHTML : $this->NotificationText;\n\t}", "function GetNotificationOutput($priority=2) {\n\t\treturn '';\n\t}", "private function _messages ()\n\t{\n\t\t$string = '<!DOCTYPE html>\n\t\t<html>\n\t\t<head>\n\t\t <meta charset=\"utf-8\">\n\t\t <title>Generator script Phutv</title>\n\t\t <script type=\"text/javascript\">\n\n\t\t\t\tsetInterval(function () {\n\t\t\t\t\twindow.location.reload();\n\t\t\t\t}, 1000);\n\n\t\t\t\t</script>\n\t\t</head>\n\t\t<body style=\"background: #FCF7E3;\">\n\t\t\t<div style=\"width: 600px; margin: 40px auto; font-family: arial, sans-serif; background: #fff; border: 1px dotted #000; padding: 30px; \">\n\t\t\t<h1>Generator script run Phutv</h1>\n\t\t\t\t' . ul($this->msg) . '\n\t\t\t</div>\n\t\t</body>\n\t\t</html>';\n\t\treturn $string;\n\t\t\n\t}", "public function getMailBodyText(Notification $notification) : string;", "public function getTextShort(Notification $notification) : string;", "public function _buildNotification($encrypt=false)\n {\n $notif = Session::get('ses_notif');\n \n Session::forget('ses_notif');\n \n $mesage = view('global.notif', ['notif'=>$notif]);\n \n return $encrypt ? base64_encode($mesage) : $mesage;\n }", "protected function NotesText() {\n\t$out = NULL;\n \n\t$sPkgNotes = $this->Value('PkgNotes');\n\tif (!is_null($sPkgNotes)) {\n\t $out .= '<b>Pkg</b>: '.$sPkgNotes;\n\t}\n\t\n\t$sOrdNotes = $this->Value('OrdNotes');\n\tif (!is_null($sOrdNotes)) {\n\t $out .= '<b>Ord</b>: '.$sOrdNotes;\n\t}\n\t\n\treturn $out;\n }", "public function getNotifyMsg()\n {\n return $this->get(self::_NOTIFY_MSG);\n }", "private function notificationJs() {\n $notifyJs = \"\";\n $notifyJs .= '<script type=\"text/javascript\" src=\" ' . $this->baseUrl(\"assets/js/angular-growl.min.js\") . ' \"></script>';\n\n return $notifyJs;\n }", "protected static function getPlainMessage()\n {\n return PHP_EOL . static::getMessage() . PHP_EOL;\n }", "public static function getNotificationsAsHTML()\n {\n $db = true;\n include GEO_BASE_DIR . 'get_common_vars.php';\n\n $notifications = Notifications::getNotifications();\n if (!(is_array($notifications) && count($notifications))) {\n $notifications = '';\n } else {\n ob_start();\n if ($db->get_site_setting(\"developer_supress_notify\") != 1) {\n include 'templates/notification_box.tpl.php';\n }\n $notifications = ob_get_contents();\n ob_end_clean();\n }\n return $notifications;\n }", "public function get_message() {\n\t\t// translators: Placeholders refer to a file name, and a theme / plugin name (e.g. \"index.php\", \"Stream\")\n\t\treturn _x(\n\t\t\t'\"%1$s\" in \"%2$s\" updated',\n\t\t\t'1: File name, 2: Theme/plugin name',\n\t\t\t'stream'\n\t\t);\n\t}", "public function render() {\n $notifications = $this->session->get('toastr::notifications');\n if(!$notifications) $notifications = [];\n\n $output = '<script type=\"text/javascript\">';\n $lastConfig = [];\n foreach($notifications as $notification) {\n\n $config = $this->config->get('toastr.options');\n\n if(count($notification['options']) > 0) {\n // Merge user supplied options with default options\n $config = array_merge($config, $notification['options']);\n }\n\n // Config persists between toasts\n if($config != $lastConfig) {\n $output .= 'toastr.options = ' . json_encode($config) . ';'; \n $lastConfig = $config;\n }\n\n // Toastr output\n $output .= 'toastr.' . $notification['type'] . \"('\" . str_replace(\"'\", \"\\\\'\", str_replace(['&lt;', '&gt;'], ['<', '>'], e($notification['message']))) . \"'\" . (isset($notification['title']) ? \", '\" . str_replace(\"'\", \"\\\\'\", htmlentities($notification['title'])) . \"'\" : null) . ');';\n }\n $output .= '</script>';\n\n return $output;\n }", "protected function _toHtml(){\n if(!$this->getPendingNotificationCount()) return '';\n return parent::_toHtml();\n }", "public function message() : string\n {\n $app = Di::getDefault()->get('app');\n\n return Template::generate(\n 'users-registration',\n [\n 'entity' => $this->entity->toArray(),\n 'app' => $app\n ]\n );\n }", "public function getMessageText() {\n\treturn ($this->messageText);\n}", "function comment_notification_text($notify_message, $comment_id) {\n extract($this->get_comment_data($comment_id));\n if ($comment->comment_type == 'facebook') {\n ob_start();\n $content = strip_tags($comment->comment_content);\n ?>\nNew Facebook Comment on your post \"<?php echo $post->post_title ?>\"\n\nAuthor : <?php echo $comment->comment_author ?> \nURL : <?php echo $comment->comment_author_url ?> \n\nComment:\n\n<?php echo $content ?> \n\nParticipate in the conversation here:\n<?php echo $this->get_permalink($post->ID) ?> \n\n <?php\n return ob_get_clean();\n } else {\n return $notify_message;\n }\n }", "private function renderJS()\n {\n return '<script>var host = \\'' . config('notifier.host') . '\\';' .\n 'var port = \\'' . config('notifier.port') . '\\';' .\n 'var socket = new WebSocket(\\'' . config('notifier.connection') . '://\\' + host + \\':\\' + port);' .\n 'socket.onopen = function(e) {' .\n 'socket.send(location.pathname);' .\n 'console.log(\"Connection established!\");' .\n '};' .\n '</script>' . PHP_EOL;\n }", "public function getText()\n {\n return __($this->configuration->getWarningMessage());\n }", "public function getMailBodyHTML(Notification $notification) : string;", "public static function message()\n {\n if (static::isClean()) {\n return static::command(\"git log --pretty=format:'%s' -n 1\");\n }\n }", "function ajan_core_render_message() {\n\n\t// Get ActivityNotifications\n\t$ajan = activitynotifications();\n\n\tif ( !empty( $ajan->template_message ) ) :\n\t\t$type = ( 'success' === $ajan->template_message_type ) ? 'updated' : 'error';\n\t\t$content = apply_filters( 'ajan_core_render_message_content', $ajan->template_message, $type ); ?>\n\n\t\t<div id=\"message\" class=\"ajan-template-notice <?php echo esc_attr( $type ); ?>\">\n\n\t\t\t<?php echo $content; ?>\n\n\t\t</div>\n\n\t<?php\n\n\t\tdo_action( 'ajan_core_render_message' );\n\n\tendif;\n}", "protected function getFooterMessage()\n {\n $bullet = '<i class=\"' . $this->getDefaultIconPrefix() . 'arrow-right\"></i>';\n $link1 = '<a href=\"http://michelf.ca/projects/php-markdown/extra/\" target=\"_blank\">' . Yii::t('kvmarkdown',\n 'PHP Markdown Extra') . '</a>';\n $link2 = '<a href=\"http://michelf.ca/projects/php-smartypants/typographer/\" target=\"_blank\">' . Yii::t('kvmarkdown',\n 'PHP SmartyPants Typographer') . '</a>';\n $link = $this->_module->smartyPants ? $link1 . ' ' . Yii::t('kvmarkdown', 'and') . ' ' . $link2 : $link1;\n $msg1 = Yii::t('kvmarkdown', '{bullet} You may use {link} syntax.', [\n 'bullet' => $bullet,\n 'link' => $link,\n ]);\n $keys = '<kbd>' . Yii::t('kvmarkdown', 'CTRL-Z') . '</kbd> / <kbd>' . Yii::t('kvmarkdown', 'CTRL-Y') . '</kbd>';\n $msg2 = Yii::t('kvmarkdown',\n '{bullet} To undo / redo, press {keys}. You can also undo most button actions by clicking it again.', [\n 'bullet' => $bullet,\n 'keys' => $keys,\n ]);\n return $msg1 . '<br>' . $msg2;\n }", "public function getMessage() {\n\t\treturn preg_replace('%(\\r\\n|\\r|\\n)%', self::$crlf, $this->message . (MAIL_SIGNATURE ? self::$crlf . self::$crlf . MAIL_SIGNATURE : ''));\n\t}", "public function toString()\n {\n return 'Assert that notice message is displayed';\n }", "public function getMessageText(): string\n {\n return $this->message_text;\n }", "function build_email_txt_bottom(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= 'Thanks,'.\"\\n\".\n\t\t\t\t'One nutty fan.';\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "public function message() {\n $message = $this->rawMessage();\n\n return t($message['message'], $message['options'], array('context' => 'bibdk_holdingstatus'));;\n }", "public function message()\n {\n return 'Mot cau hoi chi duoc phep co 1 cau tra loi dung';\n }", "function build_email_txt($database = \"\"){\n\t\t\n\t\t$output = '';\n\t\t$output .= 'Visitors that script can\\'t dectect browser versions report:'.\"\\n\\n\";\n\t\t$output .= $this ->get_list_of_visitor_browsercap_txt($database);\n\t\t$output .= 'Visitors that are using out of date browsers report:'.\"\\n\\n\";\n\t\t$output .= $this ->get_list_of_visitor_unsupported_browsers_txt($database);\n\t\t$output .= 'All visitors report:'.\"\\n\\n\";\n\t\t$output .= $this ->get_list_of_visitor_txt($database);\n\t\t$output .= $this ->build_email_txt_bottom();\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "public function getMessages()\n {\n if ((true === empty($this->aLines)) &&\n (true === empty($this->aInfoLines))) {\n\n $this->iResult = 0;\n $this->sText = '';\n return '';\n }\n\n // Marks the start of the text that will be shown.\n $this->sText = \"\\n\";\n\n // First the Info listener lines.\n if (false === empty($this->aInfoLines)) {\n $this->sText .= implode(\"\\n\", $this->aInfoLines);\n }\n\n // Listener lines for the files.\n if (false === empty($this->aLines)) {\n $bPrintLine = false;\n foreach ($this->aLines as $sFile => $aFileLines) {\n if (true === $bPrintLine) {\n $this->sText .= \"\\n\\n\";\n }\n\n $this->sText .= '/' . str_repeat('*', (strlen($sFile) + 10)) . \"\\n\";\n $this->sText .= ' * FILE: ' . $sFile . \"\\n\\n\";\n\n $this->sText .= implode(\"\\n\", $aFileLines);\n $this->sText .= str_repeat('=', 80) . \"\\n\";\n\n $bPrintLine = true;\n }\n }\n\n $this->sText .= \"\\n\\n\";\n\n $this->aLines = array();\n $this->aInfoLines = array();\n $this->iResult = 1;\n\n return $this->sText;\n }", "public function build()\n {\n return $this->markdown('login.emails.forgot');\n }", "public function text()\n {\n // Implement text rendering\n return Mailblade\\Text::make($this->view)\n ->with($this->data)\n ->render();\n }", "protected function getEmailNotificationsSubject()\n {\n $env = Str::upper(app()->environment());\n $name = $this->getName();\n\n return \"[{$env}] %level_name% in `{$name}` command\";\n }", "public static function enable_notifications() : string {\n global $PAGE, $USER;\n $conf = get_config('local_csp');\n $cansee = false;\n if (get_capability_info('local/csp:seenotifications')) {\n $cansee = has_capability('local/csp:seenotifications', $PAGE->context, $USER->id);\n }\n\n if (!$cansee) {\n return '';\n }\n\n $notificationsenableenforced = !empty($conf->notifications_enable_enforced);\n $notificationsenablereported = !empty($conf->notifications_enable_reported);\n if (!$notificationsenableenforced && !$notificationsenablereported) {\n return '';\n }\n\n $collectenforced = $notificationsenableenforced == 1 ? 'true' : 'false';\n $collectreported = $notificationsenablereported == 1 ? 'true' : 'false';\n\n $PAGE->requires->js_call_amd(\n 'local_csp/notifications',\n 'init',\n [1000] // TODO: Consider making the event trigger timeout value a setting in the admin panel.\n );\n return \"\n <script>\n /* Start listening to violation events */\n let localCspViolationsEnforced = [];\n let localCspViolationsReported = [];\n document.addEventListener('securitypolicyviolation', (event) => {\n if ($collectenforced && event.disposition === 'enforce') {\n localCspViolationsEnforced.push(event);\n } else if ($collectreported && event.disposition === 'report') {\n localCspViolationsReported.push(event);\n }\n });\n </script>\" . PHP_EOL;\n }", "public function message()\n {\n return 'La cuenta debe contar con al menos ' . $this->monto_permitido . ' Bs';\n }", "public function getTranslation(): string\n {\n return CronTranslator::translate($this->expression);\n }", "protected function getCommitMessageHead() {\n return \"WordPress updated to version \" . $this->getVersion();\n }", "public function getMessage() {\n $ret = \"\";\n if ($this->message !== \"\") {\n $ret = <<<EOF\n <p class=\"dice-message\">{$this->message}</p>\nEOF;\n }\n return $ret;\n }", "public function message(): string\n {\n return sprintf('%s在评论中@了你', $this->sender->name);\n }", "public function getUpdateNotification(){\n\t\t//render the view\n\t\treturn $this->renderView('update-notification-partial');\n\t}", "public function render()\n\t{\n\t\tif (!$this->config->get('outmess::enabled')) return '';\n\n\t\t$output = '';\n\n\t\tforeach ($this->messages as $message)\n\t\t\t$output .= $this->renderOne($message);\n\n\t\treturn $output;\n\t}", "static function getTextMessages() {return implode(PHP_EOL, self::$messages);}", "private function getNotificationMessage($isoCode)\n {\n switch ($isoCode) {\n case 'de_DE':\n $notificationMessage = 'WARNUNG Für die Bereitstellung der besten Dienste für Sie, '\n . 'um Sie über neuere Versionen des Plugins und auch '\n . 'über Sicherheitsprobleme zu informieren, sammelt VR pay einige '\n . 'grundlegende und technische Informationen aus dem Shop-System '\n . '(für Details siehe Handbuch). Die Informationen werden unter keinen '\n . 'Umständen für Marketing- und / oder Werbezwecke verwendet. '\n . 'Bitte beachten Sie, dass das Deaktivieren des Versions-Trackers '\n . 'die Servicequalität sowie wichtige Sicherheits- und '\n . 'Aktualisierungsinformationen beeinträchtigen kann.';\n break;\n default:\n $notificationMessage = 'WARNING For providing the best service to you, '\n . 'to inform you about newer versions of the '\n . 'plugin and also about security issues, VR pay is '\n . 'gathering some basic and technical information '\n . 'from the shop system (for details please see the manual). '\n . 'The information will under no circumstances be used '\n . 'for marketing and/or advertising purposes.Please be '\n . 'aware that deactivating the version tracker may affect '\n . 'the service quality and also important security and '\n . 'update information.';\n }\n return $notificationMessage;\n }", "public function getSource()\n {\n return 'notice';\n }", "public function getDescription() : string\n\t{\n\t\treturn $this->getContext()->getI18n()->dt( 'controller/jobs', 'Send email to vendor when new order received with link in it' );\n\t}", "function getPostHookString(){\n\t\t$NL=\"\\r\\n\";\n\t\t$s_style = 'font-size:'.$this->_emailFontSize.'; font-family:'.$this->_emailFontFamily.';';\n\t\t\n\t\t$s_footHTML_raw = $this->_emailFootHtml;\n\t\t$s_footHTML\t= str_replace(\n\t\t\tarray('{{fromEmailAddress}}','{{subject}}'),\n\t\t\tarray(htmlspecialchars($this->_emailFromAddress),htmlspecialchars($this->_emailSubject)),\n\t\t\t$s_footHTML_raw\n\t\t);\n\n\t\t$s_ret='<div style=\"'.$s_style.'\">'.$NL.$this->_emailHeadHtml.$NL\n\t\t.$this->getFormTableContent().$NL\n\t\t.$s_footHTML.$NL\n\t\t.'</div>';\n\t\t\n\t\treturn $s_ret;\n\t}", "public function getMessage(): string\n {\n return $this->commitData['commit']['message'];\n }", "public function getContent(): string\n {\n return $this->initiator . ' ' . $this->message;\n }", "private function notificationCss() {\n $notific = \"\";\n $notific .= ' <link rel=\"stylesheet\" href=\" ' . $this->baseUrl(\"assets/css/angular-growl.min.css\") . ' \"> ';\n\n return $notific;\n }", "private function notificationCss() {\n $notific = \"\";\n $notific .= ' <link rel=\"stylesheet\" href=\" ' . $this->baseUrl(\"assets/css/angular-growl.min.css\") . ' \"> ';\n\n return $notific;\n }", "public function message()\n {\n $menus = $this->menus();\n array_walk($menus, function (&$value, $key) {\n $value = \"{$key}. $value\";\n });\n $menus = implode(\"\\r\\n\", $menus);\n\n return \"Welcome to PHP USSD (PhUSSD) \\r\\n\\r\\n{$menus}\";\n }", "public function getHtml(Notification $notification) : ?string;", "protected function getContextMessage()\n\t{\n\t\tif (ROOT_DIRECTORY !== getcwd()) {\n\t\t\tchdir(ROOT_DIRECTORY);\n\t\t}\n\t\t$result = '';\n\t\tforeach (\\yii\\helpers\\ArrayHelper::filter($GLOBALS, $this->logVars) as $key => $value) {\n\t\t\t$result .= \"\\n\\${$key} = \" . \\yii\\helpers\\VarDumper::dumpAsString($value);\n\t\t}\n\t\tforeach (\\App\\Utils\\ConfReport::getAllErrors(true) as $key => $value) {\n\t\t\t$result .= \"\\n\\${$key} = \" . \\yii\\helpers\\VarDumper::dumpAsString($value);\n\t\t}\n\t\t$result .= PHP_EOL;\n\t\treturn $result . \"====================================================================================================================================\\n\";\n\t}", "public function getTextOutput()\n {\n $patchLevel = $this->getPatchLevel();\n\n $commands = array(sprintf('-- Patch level %d structural changes', $patchLevel));\n $lastLocation = '';\n $lastName = '';\n $noOutput = true;\n foreach ($this->getStructuralPatches($patchLevel) as $patch) {\n if ($patch['gpa_location'] != $lastLocation) {\n $commands[] = sprintf(\"\\n-- DATABASE LOCATION: %s\", $patch['gpa_location']);\n $lastLocation = $patch['gpa_location'];\n }\n if ($patch['gpa_name'] != $lastName) {\n $commands[] = sprintf(\"\\n-- PATCH: %s\", $patch['gpa_name']);\n $lastName = $patch['gpa_name'];\n }\n $commands[] = $patch['gpa_sql'] . ';';\n $noOutput = false;\n }\n\n if ($noOutput) {\n $commands[] = sprintf(\"\\n-- No structural changes in patchlevel %d\", $patchLevel);\n }\n $commands[] = '';\n\n return implode(\"\\n\", $commands);\n }", "public function toString()\n {\n return 'Template success create message is present.';\n }", "public function getMailSubject(Notification $notification) : string;", "public function __toString() {\n if ($this->code) {\n return \"[{$this->code}] {$this->message}\\n\";\n } else {\n return \"{$this->message}\\n\";\n }\n }", "public function messages()\n {\n $_output = '';\n foreach ($this->messages as $message)\n {\n $messageLang = $this->lang->line($message) ? $this->lang->line($message) : '##' . $message . '##';\n $_output .= $this->message_start_delimiter . $messageLang . $this->message_end_delimiter;\n }\n\n return $_output;\n }", "public function message()\n {\n return 'Mã xác nhận không chính xác hoặc đã hết hạn';\n }", "public function as_string() {\n return sprintf('%d %s', $this->code, self::$messages[$this->code]);\n }", "public function getMessage() {\n return $this->__(\n $this->escapeHtml(Mage::getStoreConfig(self::CONFIG_PREFIX . 'message', $this->getStore()))\n );\n }", "function makeTXT()\n {\n $calendar_text = \"No calendar information available.\";\n if (isset($this->calendar->events)) {\n $calendar_text = \"\";\n foreach ($this->calendar->events as $event) {\n $description_seperator = \" - \";\n $description = \"description\";\n if ($this->description_flag != \"on\") {\n $description_seperator = \"\";\n $description = \"\";\n }\n\n $t =\n $this->textCalendar($event, [\n \"timestamp Y-m-d H:i\",\n \" \",\n // 'timezone',\n // ' ',\n \"summary\",\n \" [\",\n \"runtime\",\n \"]\",\n $description_seperator,\n $description,\n ]) . \"\\n\";\n\n $calendar_text .= $t;\n }\n }\n\n $txt =\n \"CALENDAR \" .\n $this->time_zone .\n \"\\n\\n\" .\n $calendar_text .\n \"\\n\\n\" .\n $this->response;\n\n $this->txt = $txt;\n $this->thing_report[\"txt\"] = $txt;\n }", "protected function generateOutput()\n {\n $output = '';\n foreach ($this->messageArray as $messageItem) {\n /** @var \\TYPO3\\CMS\\Core\\Messaging\\FlashMessage $flashMessage */\n $flashMessage = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\n \\TYPO3\\CMS\\Core\\Messaging\\FlashMessage::class,\n $messageItem[2],\n $messageItem[1],\n $messageItem[0]);\n $output .= $flashMessage->getMessage();\n }\n\n return $output;\n }", "public function render():string\n {\n return \"<div class='message button {$this->getType()}'>{$this->getText()}</div>\";\n }", "public function rawMessage(){\n $return = array(\n 'message' => '',\n 'options' => array(),\n );\n if ($this->getWillLend() && $this->isItHome()) {\n $return['message'] = 'bibdk_holding_material_is_home';\n }\n else if (!$this->isItHome() && $this->getExpectedDelivery()) {\n $return['message'] = 'bibdk_holding_material_will_be_home @date';\n $return['options'] = array('@date' => format_date($this->getExpectedDelivery(), 'custom', 'd.m.Y'));\n }\n else if ($note = $this->hasNote()){\n $return['message'] = $note;\n }\n else if ($error = $this->getErrorMessage()) {\n $return['message'] = $error;\n }\n else {\n $return['message'] = 'bibdk_holding_someting_went_wrong';\n }\n\n return $return;\n }", "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}", "function toString() {\n return $this->getClassName().'('.$this->code.') {\"'.$this->message.'\"}';\n }", "protected function renderNotifications()\n {\n $notifications = Yii::$app->getModule('notification')->getMailNotifications($this->user, $this->interval);\n\n $result['html'] = '';\n $result['text'] = '';\n\n foreach ($notifications as $notification) {\n $result['html'] .= $notification->render(BaseNotification::OUTPUT_MAIL);\n $result['text'] .= $notification->render(BaseNotification::OUTPUT_MAIL_PLAINTEXT);\n }\n\n return $result;\n }", "function wiki_email_moderation_message()\n{\n\treturn <<<EOT\nA new revision has been posted for title: {title}\n\nURL to View Revision: {path:view_revision}\nURL to Open Revision: {path:open_revision}\nView Topic: {path:view_article}\n\nRevision Content:\n\n{content}\n\nEOT;\n}", "public function get_message_text()\n {\n return $this->message_text;\n }", "public function getLogMessage()\n {\n if (null === $this->logMessage) {\n $renderer = new Placeholder();\n $this->logMessage = $renderer->render([$this->getRawMessage()], $this->getParameters());\n }\n\n return $this->logMessage;\n }", "function template_severity_text($params,&$smarty)\n {\n extract($params);\n return severity_text($sev);\n }", "public function getText()\n {\n if (\n !$this->Get('cached_content') ||\n (($this->Get('edittime') ? $this->Get('edittime') :\n $this->Get('dateline')) > ($this->Get('last_modified')))\n ) {\n $this->ForumCache($this->Get('message'));\n }\n \n return $this->Get('cached_content');\n }", "public function getMessageText() {\n return $this->pluginDefinition['message_text'];\n }", "public function getMessage()\n {\n return '';\n }", "public function message()\n {\n return 'Rezerwacja musi być co najmniej na ' . $this->settings->min_booking_days . ' dni.';\n }", "public function notices()\r\n\t{\r\n\t\t$notices = array();\r\n\t\t\r\n\t\tforeach (Notices::get(TRUE, TRUE) as $notice)\r\n\t\t{\t\t\t\r\n\t\t\t// Build our data array\r\n\t\t\t$notices[] = (object) array(\r\n\t\t\t\t'type' => $notice['type'],\r\n\t\t\t\t'message' => $notice['values']['message'],\r\n\t\t\t\t'hash' => $notice['values']['hash'],\r\n\t\t\t\t'is_persistent' => $notice['values']['is_persistent'],\r\n\t\t\t\t'key' => $notice['key']\r\n\t\t\t);\r\n\t\t}\r\n\t\t\r\n\t\t$output = '';\r\n\t\t\r\n\t\tforeach ($notices as $notice)\r\n\t\t{\r\n\t\t\t// It's not a mustache template, but it came with the module. Don't judge me.\r\n\t\t\t$output .= View::factory('notices/notice')->set('notice', $notice);\r\n\t\t}\r\n\t\t\r\n\t\treturn $output;\r\n\t}", "public function __toString() {\n $this->_txtOutput = str_replace(\"#ROOT#\", CFG_WEB_ROOT, $this->_txtOutput);\n\n $this->_txtOutput = preg_replace_callback('/#CONST:([\\w]*?)#/u', array($this, '_getConstreplacement'), $this->_txtOutput);\n $this->_txtOutput = preg_replace_callback('/#TPL:([\\w]*?)#/u', array($this, '_getTplreplacement'), $this->_txtOutput);\n $this->_txtOutput = preg_replace_callback('/#IF:([!=<>:\\-\\(\\)\\$\\[\\]\\'\\w]*?)#(.*?)#\\/IF#/us', array($this, '_getIfreplacement'), $this->_txtOutput);\n $this->_txtOutput = preg_replace_callback('/#FOREACH:([\\w]*?)#(.*?)#\\/FOREACH#/us', array($this, '_getForeachreplacement'), $this->_txtOutput);\n $this->_txtOutput = preg_replace_callback('/#VAR:([\\w]*?)#/u', array($this, '_getVarreplacement'), $this->_txtOutput);\n\n return $this->_txtOutput;\n }", "public function displayMessage()\n {\n if(empty($this->data)) {\n return trans('messages.event_not_set_yet');\n }\n\n $msg = '';\n switch ($this->event_type) {\n case self::TYPE_SPECIFIC_DATETIME:\n $msg = trans('messages.on_the_specific_date', [\n 'date' => \\Acelle\\Library\\Tool::dayStringFromTimestamp(\\Acelle\\Library\\Tool::dateTimeFromString($this->getDataValue('datetime'))),\n 'time' => \\Acelle\\Library\\Tool::timeStringFromTimestamp(\\Acelle\\Library\\Tool::dateTimeFromString($this->getDataValue('datetime')))\n ]);\n break;\n case self::TYPE_WEEKLY_RECURRING:\n $msg = trans('messages.weekly_recurring_description', [\n 'weekdays' => implode(', ', \\Acelle\\Library\\Tool::numberArrayToWeekdaysArray($this->getDataValue('weekdays'))),\n 'weeks' => implode(', ', \\Acelle\\Library\\Tool::numberArrayToWeeksArray($this->getDataValue('weeks'))),\n 'months' => implode(', ', \\Acelle\\Library\\Tool::numberArrayToMonthsArray($this->getDataValue('months'))),\n 'time' => \\Acelle\\Library\\Tool::timeStringFromTimestamp(\\Acelle\\Library\\Tool::dateTimeFromString($this->getDataValue('time'))),\n ]);\n break;\n case self::TYPE_MONTHLY_RECURRING:\n $msg = trans('messages.monthly_recurring_description', [\n 'days' => implode(', ', \\Acelle\\Library\\Tool::getDayNamesFromArrayOfNumber($this->getDataValue('days'))),\n 'months' => implode(', ', \\Acelle\\Library\\Tool::numberArrayToMonthsArray($this->getDataValue('months'))),\n 'time' => \\Acelle\\Library\\Tool::timeStringFromTimestamp(\\Acelle\\Library\\Tool::dateTimeFromString($this->getDataValue('time'))),\n ]);\n break;\n case self::TYPE_LIST_SUBSCRIPTION:\n if(!empty($this->getDataValue('delay_value'))) {\n $msg = trans('messages.event_type_list_subscription_description_with_delay', [\n 'list_name' => $this->automation->defaultMailList->name,\n 'delay' => $this->getDelayMessage()\n ]);\n } else {\n $msg = trans('messages.event_type_list_subscription_description', [\n 'list_name' => $this->automation->defaultMailList->name\n ]);\n }\n break;\n case self::TYPE_LIST_UNSUBSCRIPTION:\n if(!empty($this->getDataValue('delay_value'))) {\n $msg = trans('messages.event_type_list_unsubscription_description_with_delay', [\n 'list_name' => $this->automation->defaultMailList->name,\n 'delay' => $this->getDelayMessage()\n ]);\n } else {\n $msg = trans('messages.event_type_list_unsubscription_description', [\n 'list_name' => $this->automation->defaultMailList->name\n ]);\n }\n break;\n case self::TYPE_SUBSCRIBER_EVENT:\n $event = $this->getDataValue('event');\n\n // check if event with field uid\n if($event != 'subscription_date') {\n $field = \\Acelle\\Model\\Field::findByUid($event);\n $text = is_object($field) ? strtolower(trans('messages.subscriber_s_field', ['name' => $field->label])) : '';\n } else {\n $text = strtolower(trans('messages.subscriber_s_field', ['name' => trans('messages.' . $event)]));\n }\n if(!empty($this->getDataValue('delay_value'))) {\n $msg = trans('messages.event_type_subscriber_event_description_with_delay', [\n 'event' => $text,\n 'delay' => $this->getDelayMessage()\n ]);\n } else {\n $msg = trans('messages.event_type_subscriber_event_description', [\n 'event' => $text\n ]);\n }\n break;\n case self::TYPE_CUSTOM_CRITERIA:\n $strings = [];\n foreach($this->getDataValue('criteria') as $criteria) {\n $field = Field::findByUid($criteria[\"field_uid\"]);\n if (is_object($field)) {\n if(in_array($criteria['operator'], [AutoEvent::OPERATOR_BLANK, AutoEvent::OPERATOR_NOT_BLANK])) {\n $strings[] = trans('messages.event_type_custom_criteria_description_2', [\n 'field' => $field->label,\n 'operator' => trans('messages.' . $criteria[\"operator\"]),\n 'value' => $criteria[\"value\"],\n ]);\n } else {\n $strings[] = trans('messages.event_type_custom_criteria_description', [\n 'field' => $field->label,\n 'operator' => trans('messages.' . $criteria[\"operator\"]),\n 'value' => $criteria[\"value\"],\n ]);\n }\n }\n }\n\n if(!empty($this->getDataValue('delay_value'))) {\n $msg = trans('messages.event_type_custom_criterias_description_with_delay', [\n 'conditions' => implode(' ' . trans('messages.criteria_and') . ' ', $strings),\n 'delay' => $this->getDelayMessage()\n ]);\n } else {\n $msg = trans('messages.event_type_custom_criterias_description', [\n 'conditions' => implode(' ' . trans('messages.criteria_and') . ' ', $strings)\n ]);\n }\n break;\n case self::TYPE_FOLLOW_UP:\n case self::TYPE_FOLLOW_UP_OPENED:\n case self::TYPE_FOLLOW_UP_NOT_OPENED:\n case self::TYPE_FOLLOW_UP_CLICKED:\n case self::TYPE_FOLLOW_UP_NOT_CLICKED:\n if(empty($this->getDataValue('delay_value'))) {\n $msg = trans('messages.follow_up_send_right_after', [\n 'event' => trans('messages.follow_up_event_' . $this->event_type)\n ]);\n } else {\n $msg = trans('messages.follow_up_description', [\n 'value' => $this->getDataValue('delay_value'),\n 'unit' => \\Acelle\\Library\\Tool::getPluralPrase($this->getDataValue('delay_unit'), $this->getDataValue('delay_value')),\n 'event' => trans('messages.follow_up_event_' . $this->event_type)\n ]);\n }\n break;\n case self::TYPE_API_CALL:\n $msg = trans('messages.event_type_api_description');\n break;\n }\n\n return $msg;\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 printEmail() {\n\t\t$value = $this->value();\n\n\t\tif ($value['added']) {\n\t\t\tif(! function_exists('get_name')) { function get_name($file) { return $file['name']; } }\n\t\t\t$names = array_map('get_name', $value['added']);\n\t\t\treturn '<em>'.join('</em><br/><em>', $names).'</em>';\n\t\t} else {\n\t\t\treturn '<em>None</em>';\n\t\t}\n\t}", "public function text()\n {\n if($this->escapeText) {\n return $this->purifier->clean($this->object->text, 'ma_messageboard.mb_purifier_conf');\n }\n\n return $this->object->text;\n }", "public function text()\n {\n if($this->escapeText) {\n return $this->purifier->clean($this->object->text, 'ma_messageboard.mb_purifier_conf');\n }\n\n return $this->object->text;\n }", "public function text()\n {\n if ($this->text_translated) {\n return cms_trans($this->text_translated);\n }\n\n return $this->text;\n }", "public function message()\n {\n return 'Mật khẩu bạn đã nhập không chính xác !';\n }", "public function getFormattedString()\r\n {\r\n $string = (string) $this->code;\r\n\r\n if (null !== $this->message) {\r\n $string = $string . ' ' . $this->message;\r\n }\r\n\r\n return $string;\r\n }", "public function getMessageTpl(){\n return $this->templates['message'];\n }", "protected function get_templates_text() {\n $text = '';\n foreach ($this->editors as $editor) {\n $text .= $this->$editor ? ' '. $this->$editor : '';\n }\n return trim($text);\n }", "function returnUserNotificationTypeText( $type ) {\n\tglobal $NOTIFICATION_TYPES;\n\n\treturn apply_filters( 'returnUserNotificationTypeText', __( $NOTIFICATION_TYPES[ $type ] ), $type );\n}", "public function msg() {\n return '';\n }", "public function msg() {\n return '';\n }", "private function construct_notice($text, $class = 'notifymessage') {\n $attributes = array('class' => $class);\n return html_writer::tag('p', $text, $attributes);\n }", "public function getSource()\n {\n $ret = ' * ';\n\n $ret .= '@'.$this->type;\n\n if (strlen($this->datatype) > 0) {\n $ret .= ' '.$this->datatype;\n }\n\n if (strlen($this->variableName) > 0) {\n $ret .= ' $'.$this->variableName;\n }\n\n if (strlen($this->description) > 0) {\n $ret .= ' '.$this->description;\n }\n\n $ret .= PHP_EOL;\n\n return $ret;\n }", "public function __toString()\n\t{\n\t\t$str = '' ;\n\t\tif ($this->code != 0) {\n\t\t\t$str .= $this->code . ': ';\n\t\t}\n\t\treturn $str . $this->message;\n\t}", "public function buildChangedMessage() {\n\t\t\tvar_dump(array_diff($this->data, $this->original_data));\n\t\t\t$message = array();\n\t\t\t$this->changed_message = implode(' ', $message);\n\t\t}", "function _erpal_contract_helper_get_billable_text() {\n\n $default_text = t('Payment for !service_category_token contract \"!contract_title_token\"', array('!service_category_token' => '[erpal_contract_billable_subject:service_category]', '!contract_title_token' => '[erpal_contract_billable_subject:contract_title]'));\n return variable_get('erpal_billable_text_erpal_contract', $default_text);\n}", "function main() {\n\t\t$content = '';\n\t\t$objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\n\t\t/** @var ClassCacheManager $classCacheManager */\n\t\t$classCacheManager = $objectManager->get('SJBR\\\\StaticInfoTables\\\\Cache\\\\ClassCacheManager');\n\t\t$classCacheManager->reBuild();\n\n\t\t/** @var DatabaseUpdateUtility $databaseUpdateUtility */\n\t\t$databaseUpdateUtility = $objectManager->get('SJBR\\\\StaticInfoTables\\\\Utility\\\\DatabaseUpdateUtility');\n\t\t$databaseUpdateUtility->doUpdate('static_info_tables_zh');\n\n\t\t$content .= '<p>' . \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate('updateLanguageLabels', 'StaticInfoTables', ['static_info_tables_zh']) . '.</p>';\n\t\treturn $content;\n\t}", "public function notify($type, $message)\n {\n return $message?<<<NOTIFY\n<div class=\"hide notifier\" data-class-name=\"$type\">\n$message\n</div>\nNOTIFY\n: null;\n }", "public function MarkUp()\n {\n return '\n <div class=\"comment\"><span style=\"font-size:15px;font-weight:bold;\"><img src=\"'.$this->getUserpic().'\" class=\"avatar\"/>&nbsp;'.\n $this->getCommentUser()->getUserName().'</span>\n <span class=\"commentDate\">'.$this->commentDate->format('Y-M-d').'</span>\n <div>'.$this->comment.'</div></div>';\n\n }" ]
[ "0.67754334", "0.64897966", "0.6282054", "0.62654656", "0.6218037", "0.6074245", "0.6065346", "0.6014093", "0.5985696", "0.5916009", "0.5915982", "0.5893237", "0.5888731", "0.5871858", "0.5862266", "0.5849072", "0.58286446", "0.5828159", "0.58036906", "0.5785058", "0.5782644", "0.57454926", "0.57429767", "0.57399476", "0.5711312", "0.5705068", "0.5659122", "0.56582326", "0.56565636", "0.5655196", "0.56532466", "0.5641645", "0.5630835", "0.5630616", "0.5629632", "0.56280226", "0.5625203", "0.5609107", "0.56064796", "0.55879897", "0.5578669", "0.5566558", "0.55590993", "0.55585724", "0.55545497", "0.55491525", "0.5542957", "0.55387634", "0.5533356", "0.5525345", "0.5525345", "0.5506729", "0.5502777", "0.5500191", "0.54965305", "0.54965234", "0.54880625", "0.5474419", "0.5463014", "0.54620975", "0.5459756", "0.5430659", "0.5407623", "0.54001606", "0.53959256", "0.5390674", "0.53877264", "0.53875595", "0.53870606", "0.53822875", "0.53681844", "0.5365981", "0.5365212", "0.53520894", "0.5350134", "0.53484255", "0.5342899", "0.5340534", "0.5338241", "0.5337237", "0.5332875", "0.53321433", "0.5331822", "0.5331822", "0.5313524", "0.53115714", "0.53111947", "0.5307864", "0.5303757", "0.52987176", "0.5293502", "0.5293502", "0.52831066", "0.52794355", "0.5278822", "0.52764213", "0.52690136", "0.52653056", "0.5261637", "0.525748" ]
0.63553876
2
Sets current notification ID.
public function setId($id) { $this->id = $id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setID($v)\n { return $this->set('id', $v ? $v : JSONMessage::generateID()); }", "function SetId($value) { $this->id=$value; }", "public function set_current_user_id($id)\n {\n $this->current_user_id = $id;\n }", "private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}", "public function setIdentifier($id)\n {\n $this->uid = (int)$id;\n }", "function setId($id) {\r\n $this->_id = $id;\r\n }", "public function setID($id) {\n $this->id = $id; \n }", "function setId($id) {\n\t\t$this->_id = $id;\n\t}", "function set_id($id) {\n\t\t$this->id = $id;\n\t}", "public function setID($id){\n $this->ID = $id;\n }", "function setId($value) {\n $this->_id = intval($value);\n }", "public function updateId() {\n $this->Id = session_id();\n }", "function set_id($id)\r\n {\r\n $this->set_default_property(self :: PROPERTY_ID, $id);\r\n }", "public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }", "public function setID($id){\n $this->id = $id;\n }", "function set_id($id)\n {\n $this->id = $id;\n }", "public function setID($id) {\n\t\t$this->id = $id;\n\t}", "private function set_id(int $id)\n {\n $this->_id = $id;\n }", "public static function setCurrentID($id) {\n Session::put(Privilege::SESSION_NAME_ID, $id);\n }", "function set_id($id)\n {\n $this->set_default_property(self :: PROPERTY_ID, $id);\n }", "public function setId($id){\n $this->_id = $id;\n }", "public function setId($id) {\r\n $this->_id = $id;\r\n }", "public function setID($id)\n {\n $this->ID = $id;\n }", "public function set_id( $id ) {\n\t\t\t$this->id = $id;\n\t\t}", "public function setId($x) { $this->id = $x; }", "function setId($id) {\n $this->id = $id;\n }", "function setId($id) {\n $this->id = $id;\n }", "private function SetID($value)\n\t\t{\n\t\t\t$this->id = $value;\n\t\t}", "public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setID($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->_id = $id;\n }", "private function setId($id)\n {\n $this->id = $id;\n }", "public function setID($id){\n $this->id=$id;\n }", "public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}", "public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}", "function setId($id)\n {\n $this->id = $id;\n }", "protected function setId($id)\n {\n $this->id = $id;\n }", "function setId($id) {\n\t\t$this->setData('id', $id);\n\t}", "public function set_id($id){\n $this->id = $id;\n }", "public function setId($id)\r\n\t\t{\r\n\t\t\t$this->_id = $id;\r\n\t\t}", "public function setId($id)\r\n {\r\n $this->_id = (int) $id;\r\n }", "function setId($id){\r\n\t\t$this->id = $id;\r\n\t}", "function setId_note($id_note) {\r\n\t\t$this->id_note = $id_note;\r\n\t}", "public function setId($id){\n\t\t\t$this->id = $id;\n\t\t}", "function setId($id){\n\t\t$this->id = $id;\n\t}", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\r\n $this->id = $id;\r\n }", "public function setId($id) {\r\n $this->id = $id;\r\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id) { $this->id = $id; }", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id)\n {\n $id = (int) $id;\n \n if ($id > 0)\n {\n $this->_id = $id;\n }\n }", "public function setID(int $id) {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id ? $id : uniqid();\n }", "public function setId($id)\n {\n $this->_id = (int)$id;\n }", "public function setIdNotificacion($idNotificacion) {\n\t\t$this->idNotificacion = $idNotificacion;\n\t}", "public function setId($id) {\n $this->id = $id;\n }", "function setId($id)\n\t{\n\t\t// Set id\n\t\t$this->_id\t = $id;\n\t}", "public function setId($id){\n\t\t$this->id = $id;\n\t}", "public function setIDSender($idSender){\n $this->IDsender = $idSender;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setMensajeId($data)\n {\n if ($this->_mensajeId != $data) {\n\n $this->_logChange('mensajeId');\n }\n\t\tif (!is_null($data)) {\n \t$this->_mensajeId = (int) $data;\n \t} else {\n \t $this->_mensajeId = $data;\n \t}\n return $this;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setID($id);", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId( $id )\n {\n $this->id = $id;\n }", "public static function setId($id)\n {\n self::$id = $id;\n }", "public function set_id( $id ) {\n\t\t$this->id = absint( $id );\n\t}", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId()\n {\n $apiKey = new ApiKey;\n $apiKey->setId();\n $this->id = $apiKey->getId();\n }", "public function setId($id) {\n\t\t$this->id = (integer)$id;\n\t}", "function setId($id) {\r\n\t\t// Set id and wipe data\r\n\t\t$this->_id = $id;\r\n\t}" ]
[ "0.6227426", "0.6172172", "0.60502124", "0.60310405", "0.5957207", "0.59358484", "0.59312576", "0.59150445", "0.59088415", "0.5902174", "0.58997124", "0.58955276", "0.5894064", "0.58874273", "0.5882621", "0.58718556", "0.5867419", "0.58624846", "0.58610904", "0.5844035", "0.5841829", "0.5840111", "0.5835219", "0.5827058", "0.5822264", "0.581536", "0.581536", "0.5802292", "0.5797545", "0.57948476", "0.57895494", "0.57866764", "0.57841414", "0.5781352", "0.5777033", "0.5764657", "0.57646227", "0.57619894", "0.57385576", "0.5736415", "0.57248884", "0.5720512", "0.57175934", "0.5704017", "0.56978935", "0.56908274", "0.56891376", "0.5688672", "0.5688672", "0.5683687", "0.5683687", "0.56833005", "0.5680037", "0.5678774", "0.5678774", "0.5678774", "0.5678774", "0.5678774", "0.56781465", "0.56758976", "0.5675379", "0.5669253", "0.5668006", "0.5664571", "0.566189", "0.56580186", "0.56561714", "0.565458", "0.56432337", "0.5638066", "0.56369585", "0.5632202", "0.5632202", "0.5632202", "0.5632202", "0.56267214", "0.56252795", "0.56232584", "0.5622497", "0.5622497", "0.5622497", "0.56183046", "0.5610287", "0.560998" ]
0.0
-1
Returns type of this notification.
public function getType() { return $this->type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getType(): string\n {\n return $this->rawData['notificationType'];\n }", "public function get_type()\n\t{\n\t\treturn 'notification.type.pm';\n\t}", "function getType(){\n\t\t\treturn $this->message_type;\n\t\t}", "public function get_type()\n\t{\n\t\treturn 'notification.type.approve_post';\n\t}", "public function getType()\n\t{\n\t\treturn $this->get('type');\n\t}", "public function getType()\r\n {\r\n return $this->m_type;\r\n }", "public function getType()\n {\n return $this->baseEvent->getType();\n }", "public function getType()\n {\n return $this->getProperty('type');\n }", "public function getType() {\n return $this->type;\n }", "public function getType() {\n return $this->type;\n }", "public function getType() {\n return $this->type;\n }", "public function getType() {\n return $this->type;\n }", "public function getType() {\n return $this->type;\n }", "public function getType() {\n return $this->type;\n }", "public function getType() {\n return $this->type;\n }", "public function getType() {\n return $this->type;\n }", "public function getType() {\n return $this->type;\n }", "public function getType() {\n return $this->type;\n }", "function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function type()\n {\n return $this->type;\n }", "public function type()\n {\n return $this->type;\n }", "public function type()\n {\n return $this->type;\n }", "function getType () {\n\t\treturn $this->type;\n\t}", "public function getType() {\n return $this->_type;\n }", "public function getType() {\n return $this->_type;\n }" ]
[ "0.8461923", "0.77300394", "0.7699885", "0.7549481", "0.74040896", "0.7378634", "0.7355518", "0.7346417", "0.73443013", "0.73443013", "0.73443013", "0.73443013", "0.73443013", "0.73443013", "0.73443013", "0.73443013", "0.73443013", "0.73443013", "0.7344112", "0.73385733", "0.73385733", "0.73385733", "0.73385733", "0.73361963", "0.73361963", "0.73361963", "0.73348814", "0.733379", "0.733379" ]
0.0
-1
Returns data for this notification. Which will be used when displaying notification info.
public function getData() { return $this->data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function data()\n {\n return [\n 'MsgType' => $this->type(),\n 'MsgContent' => [\n 'UUID' => $this->UUID,\n 'ImageFormat' => $this->ImageFormat,\n 'ImageInfoArray' => $this->ImageInfoArray,\n ],\n ];\n }", "public function NotificationContent(){\n\t\treturn $this->config()->html_notifications ? $this->NotificationHTML : $this->NotificationText;\n\t}", "public function getInfoData() {\n return [\n 'name' => $this->name,\n 'brand' => $this->brand,\n 'price' => $this->price,\n 'shipping_price' => $this->shippingPrice,\n 'shipping_time' => $this->shippingTime\n ];\n }", "public function getNotification()\n {\n return $this->notification;\n }", "public function data()\n {\n $email_subject = $this->getEmailSubject();\n $email_body = $this->getEmailBody();\n $headers = Helper::getMailHeader($this->email_headers);\n \n return [\n 'to' => [\n 'email' => $this->email_address\n ],\n 'headers' => $headers,\n 'subject' => $email_subject,\n 'body' => $email_body,\n 'campaign_id' => $this->campaign_id,\n 'id' => $this->id,\n 'subscriber_id' => $this->subscriber_id\n ];\n }", "public function getData()\n\t{\n\t\t$data = array(\n\t\t\t'nt_id'\t\t\t\t=> $this->getId(),\n\t\t\t'usr_id'\t\t\t=> $this->getUserId(),\n\t\t\t'nt_title'\t\t\t=> $this->getTitle(),\n\t\t\t'nt_description'\t=> $this->getDescription(),\n//\t\t\t'nt_image'\t\t\t=> $this->getImage(),\n\t\t\t'nt_location_street'=> $this->getLocationStreet(),\n\t\t\t'nt_location_zip'\t=> $this->getLocationZip(),\n\t\t\t'nt_location_city'\t=> $this->getLocationCity(),\n\t\t\t'user_name'\t\t\t=> $this->getuserName(),\n\t\t\t'nt_user_phone'\t\t=> $this->getUserPhone(),\n\t\t\t'nt_user_email'\t\t=> $this->getUserEmail(),\n\t\t\t'nt_price'\t\t\t=> $this->getPrice(),\n\t\t\t'nt_price_type'\t\t=> $this->getPriceType(),\n\t\t\t'nt_create_date'\t=> $this->getCreateDate(),\n\t\t\t'nt_mod_date'\t\t=> $this->getModDate(),\n\t\t\t'nt_deleted'\t\t=> $this->getDeleted(),\n\t\t\t'nt_hidden'\t\t\t=> $this->getHidden(),\n\t\t\t'nt_category_id'\t=> $this->getCategoryId(),\n//\t\t\t'nt_validity'\t\t=> $this->getValidity(),\n\t\t\t'nt_until_date'\t\t=> $this->getUntilDate()\n\t\t\t\n\t\t);\n\t\t\n\t\treturn $data;\n\t}", "public function data()\n\t{\n\t\t// the start of a new topic, so assign the topic_id to itself\n\t\t// and assign the topic accordingly\n\t\t\n\t\t//$type = $this->topic ? GalaxyAPIConstants::kTypeForumMessage : GalaxyAPIConstants::kTypeForumTopic;\n\t\t$topic = $this->topic ? $this->topic : $this->id;\n\t\t\n\t\treturn array('_id' => $this->id,\n\t\t\t 'title' => $this->title,\n\t\t 'body' => $this->body,\n\t\t 'author' => $this->author,\n\t\t 'source' => $this->context->source(),\n\t\t 'topic' => $topic,\n\t\t 'topic_origin' => $this->topic_origin,\n\t\t 'created' => $this->created,\n\t\t 'type' => GalaxyAPIConstants::kTypeForumMessage);\n\t}", "public function getInfo ()\n {\n return $this->info;\n }", "public function getInformation()\n {\n return $this->values[\"info\"];\n }", "public function getInformation()\n {\n return $this->information;\n }", "public function getNotifyData()\n {\n if (!empty($this->notify)) {\n return $this->notify;\n }\n\n $resdata = array();\n $xml = strval($this->request->getContent());\n\n $this->isValid = Xml::decryptResXml($xml, $resdata);\n\n //记录日志\n if (true === Config::get('debug')) {\n $this->log('notify xml: ' . var_export($xml, true), 'Info');\n $this->log('notify data: ' . var_export($resdata, true), 'Info');\n $this->log('isValid: ' . $this->isValid, 'Info');\n }\n\n return $this->notify = new Collection($resdata);\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\r\n {\r\n return $this->info;\r\n }", "public function getInfo()\n\t{\n\t\treturn $this->resource->get($this->name)->getContent();\n\t}", "public function getInfo()\n\t{\n\t\treturn $this->info;\n\t}", "public function getInfo()\n\t{\n\t\treturn $this->info;\n\t}", "public function info()\n {\n return $this->info;\n }", "public function info()\n {\n return $this->info;\n }", "function getData() {\n\t\treturn $this->data;\n\t}", "public function getNotification()\n\t{\n\t\treturn $this->notification;\n\t}", "public function get_data() {\r\n\t\treturn $this->data;\r\n\t}", "public function get_data() {\n\t\treturn $this->data;\n\t}", "public function get_data() {\n return $this->data;\n }", "protected function getData()\n {\n return $this->data;\n }", "public function getData()\n {\n return $this->data->reply;\n }", "public function getData () {\n return $this->data;\n }", "public function data ()\n {\n return $this->_data;\n }", "public function getData() {\n\t\treturn $this->data;\n\t}", "public function getData() {\n\t\treturn $this->data;\n\t}", "public function get_data() {\r\n return $this->data;\r\n }", "public function getData() {\r\n return $this->data;\r\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getData() {\n return $this->data;\n }", "public function getData() {\n return $this->data;\n }", "public function getData() {\n return $this->data;\n }", "public function getData() {\n return $this->data;\n }", "public function getData()\r\n {\r\n return $this->data;\r\n }", "public function getData()\n\t{\n\t\treturn $this->data;\n\t}", "public function getData()\n\t{\n\t\treturn $this->data;\n\t}", "public function getData()\n\t{\n\t\treturn $this->data;\n\t}", "public function getData()\n\t{\n\t\treturn $this->data;\n\t}", "public function get_data()\n {\n return $this->_data;\n }", "public function data()\n {\n return $this->data;\n }", "public function data()\n {\n return $this->data;\n }", "public function data()\n {\n return $this->data;\n }", "public function data()\n {\n return $this->data;\n }", "public function data()\n {\n return $this->data;\n }", "public function data()\n {\n return $this->data;\n }", "public function getCustomInfo() {\n\t\treturn $this->custom_info;\n\t}", "public function getData() {\n\t\treturn $this->_data;\n\t}" ]
[ "0.724636", "0.68190444", "0.6643304", "0.6618731", "0.658242", "0.6573311", "0.6568539", "0.6559772", "0.65556735", "0.6540891", "0.6531765", "0.6505748", "0.6505748", "0.6505748", "0.6505748", "0.6505748", "0.6505748", "0.6505748", "0.6505106", "0.64913476", "0.6467621", "0.6467621", "0.6452461", "0.6452461", "0.6446601", "0.6439568", "0.64240813", "0.6409163", "0.6378399", "0.6371583", "0.63580483", "0.63577676", "0.635718", "0.63542634", "0.63542634", "0.63458365", "0.6321227", "0.63143146", "0.63143146", "0.63143146", "0.63143146", "0.63143146", "0.631266", "0.631266", "0.631266", "0.631266", "0.6306146", "0.6303086", "0.6303086", "0.6303086", "0.6303086", "0.6302941", "0.6300992", "0.6300992", "0.6300992", "0.6300992", "0.6300992", "0.6300992", "0.6297184", "0.62968946" ]
0.63088864
85
Returns timestamp of this notification.
public function getTimestamp() { return $this->timestamp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTimestamp() {\n return $this->timestamp;\n }", "public function getTimestamp() {\n return $this->timestamp;\n }", "public function getTimestamp() {\n\n return $this->timestamp;\n }", "public function getTimestamp()\n\t{\n\t\treturn $this->getValue('timestamp');\n\t}", "public function getTimestamp()\n\t\t\t{\n\t\t\t\treturn $this->timestamp;\n\t\t\t}", "public function getTimestamp()\n {\n return $this->_timestamp;\n }", "public function getTimestamp()\n {\n return $this->timestamp;\n }", "public function getTimeStamp() {\n return $this->timestamp;\n }", "public function getTimestamp()\r\n {\r\n return $this->_timestamp;\r\n }", "public function getTimestamp() \n\t{\n\t\treturn $this->timestamp;\n\t}", "function getTimestamp() {\r\r\n\t\treturn $this->timestamp;\r\r\n\t}", "public function getTimestamp()\n\t{\n\t\treturn $this->_timestamp;\n\t}", "public function getTimestamp()\n {\n return $this->baseEvent->getTimestamp();\n }", "function getTimestamp() {\n return $this->time_stamp;\n }", "public function getTimestamp(){\n\t\treturn $this->_timestamp;\n\t}", "public function getTimestamp()\n { return $this->get('timestamp'); }", "public function getTimestamp()\n {\n return time();\n }", "public function getTimeStamp() {\n\t\treturn $this->timeStamp;\n\t}", "public function getTimestamp() { \n\t\tif ($this->change) {\n\t\t\t$this->_calc();\n\t\t}\n\t\t\n\t\treturn $this->timestamp; \n\t}", "public function getTimestamp()\n {\n return $this->proxyBase->timestamp;\n }", "public function getTimeStamp()\n\t{\n\t\treturn $this->_current_timestamp;\n\t}", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp();", "public static function getTimestamp(){\r\n\t\treturn time();\r\n\t}", "public function timestamp() {\n return strtotime($this->updated_at);\n }", "public function getTstamp()\n {\n return $this->tstamp;\n }", "public function getTimestamp()\n {\n return $this->dateIssued->getTimestamp();\n }", "public function getTstamp() {\n\t\treturn $this->tstamp;\n\t}", "public function getTimestamp()\n {\n return strtotime($this->getValue());\n }", "public static function timestamp(){\n $timestamp = time();\n return $timestamp;\n }", "public function _getTimestamp()\n {\n $DateTime = new DateTime($this->_getDatePublish());\n return $DateTime->getTimestamp();\n }", "public function getTimestamp()\n {\n }", "public function getTimestamp()\n {\n return $this->server['REQUEST_TIME'];\n }", "protected function getTimeStamp(){\n\t\t$result = $this->getFile()->getProperty('tstamp');\n\t\tif ($this->processedFile) {\n\t\t\t$result = $this->processedFile->getProperty('tstamp');\n\t\t}\n\t\treturn $result;\n\t}", "public function getUpdateTimestamp()\n {\n return $this->updateTimestamp;\n }", "public function getTimestamp()\n {\n return $this->readOneof(3);\n }", "protected function getTimestamp()\r\n {\r\n return gmdate(\"Y-m-d\\TH:i:s.\\\\0\\\\0\\\\0\\\\Z\", time());\r\n }", "public function timestamp();", "protected function getTimeStamp()\n {\n return time() . ' (' . strftime('%Y.%m.%d %H:%I:%S', time()) . ')';\n }", "public function getTimestampCreated()\n {\n return $this->_getData(self::TIMESTAMP_CREATED);\n }", "protected function getTimeStamp() {\n return time().' ('.strftime( '%Y.%m.%d %H:%I:%S', time() ).')';\n }", "public function expirationTimestamp()\n {\n if ($this->expiration instanceof \\DateTime) {\n return $this->expiration->getTimestamp();\n }\n }", "private function getTimestamp() {\n\t$dateTime = new DateTime('now', new DateTimeZone(self::TIME_ZONE));\n\treturn $dateTime->format(self::DATE_FORMAT);\n }", "public function getTimestamp() : float\n {\n return $this->timestamp;\n }", "public function getEventTimestamp();", "public function getTimestamp()\n {\n return $this->currentMonth[0];\n }", "public function getTimestamp()\n {\n $timestamp = $this->getData('timestamp');\n $attributeCodeThis = $this->getData('attribute_code');\n $attributeCodeObj = $this->getAttributeObject()->getAttributeCode();\n if (is_null($timestamp) || $attributeCodeThis != $attributeCodeObj) {\n $value = $this->getValue();\n if ($value) {\n if (is_numeric($value)) {\n $timestamp = $value;\n } else {\n $timestamp = strtotime($value);\n }\n } else {\n $timestamp = false;\n }\n $this->setData('timestamp', $timestamp);\n $this->setData('attribute_code', $attributeCodeObj);\n }\n return $timestamp;\n }", "private static function timeStamp() {\n return date(\"Y-m-d H:i:s\");\n }", "protected static function getTimestamp()\n\t{\n\t\treturn date(\"Y-m-d H:00:00\");\n\t}", "function get_unix_time()\n {\n return $this->timestamp;\n }", "static public function timestamp()\r\n {\r\n $output = date('Y-m-d H:i:s', time());\r\n return $output;\r\n }", "public function getStamp()\n {\n return $this->_list->getStamp();\n }", "public function getStamp()\n {\n return $this->_list->getStamp();\n }", "function timeStamp()\n {\n return date(\"YmdHis\");\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getTime() {\n return $this->time;\n }", "public function getTime()\n {\n return $this->time;\n }", "public function getCommentTimestamp(): \\DateTime {\n\t\treturn ($this->commentTimestamp);\n\t}", "public function getMsgTs()\n {\n return $this->msg_ts;\n }", "private function getTimestamp()\n {\n $originalTime = microtime(true);\n $micro = sprintf(\"%06d\", ($originalTime - floor($originalTime)) * 1000000);\n $date = new DateTime(date('Y-m-d H:i:s.'.$micro, $originalTime));\n\n return $date->format($this->config['dateFormat']);\n }", "public function getTimestampUpdated()\n {\n return $this->_getData(self::TIMESTAMP_UPDATED);\n }", "public static function curTimestamp()\n {\n return date_timestamp_get(new DateTime());\n }", "public static function timestamp() {}", "public function getTimeStamp() : float\n {\n return $this->timeStamp;\n \n }", "public function get_time() {\n return $this->_time;\n }", "public function getTimestamp()\n {\n return (int) floor(microtime(true) / $this->keyRegeneration);\n }", "public function getTimestampSent(): string\n {\n $temp=$this->timestampSent;\n return $temp->format('D H:i');\n }", "public function getTime() {\n\t\treturn $this->_time;\n\t}", "public function getInvoiceTimestamp();", "public static function timestamp() {\n return time(); \n }", "public function getTimestamp(): int;", "public function getTimestamp(): int;", "public function getTime()\n {\n return $this->get(self::TIME);\n }", "public function getPresentationTimestamp() {}", "public function freshTimestampString()\n {\n if(!is_null($this->dateFormat)){\n return date($this->dateFormat);\n }\n return time();\n }", "public function getApplicationTimeStamp()\n {\n return $this->applicationTimeStamp;\n }", "public function getCreateTime()\n {\n return $this->CreateTime;\n }", "public function getTime()\n {\n return $this->get(self::_TIME);\n }", "public function getTime()\n {\n return $this->get(self::_TIME);\n }" ]
[ "0.80785197", "0.80785197", "0.80293584", "0.8026936", "0.80030304", "0.7980695", "0.7973116", "0.7969048", "0.7946364", "0.7937652", "0.7936291", "0.7908156", "0.7900119", "0.789132", "0.77912396", "0.7786742", "0.7776296", "0.77078795", "0.7676574", "0.7668925", "0.75983185", "0.75582993", "0.75582993", "0.75582993", "0.7532715", "0.75185037", "0.75032943", "0.74901867", "0.74308646", "0.73778576", "0.73376423", "0.72754306", "0.72687304", "0.72519344", "0.71849746", "0.7180223", "0.7160721", "0.7152001", "0.7129004", "0.71225107", "0.7122479", "0.7115866", "0.7106088", "0.7078158", "0.70439637", "0.7042536", "0.7026566", "0.69950545", "0.6988175", "0.6986673", "0.6976252", "0.6960544", "0.6945101", "0.6945101", "0.6944802", "0.6919045", "0.6919045", "0.6919045", "0.6919045", "0.6919045", "0.6919045", "0.6919045", "0.6919045", "0.6919045", "0.6919045", "0.6919045", "0.6905245", "0.6903184", "0.6890891", "0.688552", "0.6854499", "0.68335927", "0.6829943", "0.6827699", "0.6815147", "0.68112063", "0.68055904", "0.678556", "0.67642254", "0.67577916", "0.6752523", "0.6746427", "0.6746427", "0.6736766", "0.6723505", "0.67231756", "0.67136705", "0.6709555", "0.6672647", "0.66721445" ]
0.80768067
10
Returns whether or not notification is read.
public function isRead() { return $this->isRead; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasRead()\n {\n return ($this->status == NOTIFICATION_VIEWED);\n }", "public function isRead() {\n\t\treturn $this -> data['is_read'] == 1;\n\t}", "public function getWasRead()\n {\n if (!is_null($this->time_read)){\n return true;\n }\n return false;\n }", "public function isRead()\n {\n return (bool) $this->readAt;\n }", "public function read()\n {\n return $this->read_at !== null;\n }", "public function getIsRead()\n {\n return $this->isRead;\n }", "public function isRead()\n {\n return $this->object->isRead();\n }", "public function unread()\n {\n return $this->read_at === null;\n }", "public function read(): bool\n {\n return $this->isAllowed(self::READ);\n }", "public function read()\n {\n return ! ! $this->read_at;\n }", "public function isReadCompleted(): bool;", "public function isUnread();", "public function hasReadReference(): bool\n {\n return $this->getPhanFlagsHasState(Flags::WAS_PROPERTY_READ);\n }", "public function has_unread_restriction() {\n return false;\n }", "function isReadable() { return $this->flagAccessRead; }", "public function readable ()\n {\n $this->_init_handler ();\n return isset ($this->_handler);\n }", "public function read(): bool\n {\n }", "public function read(): bool\n {\n }", "protected function read()\n {\n return true;\n }", "public function isRead(){\n $read = VolumeRead::where('user_id', Auth()->user()->id)->where('volume_id', $this->id)->first();\n if($read){\n return true;\n }\n return false;\n }", "public function hasReadOffset(){\n return $this->_has(2);\n }", "public function hasNotifications()\n {\n return count($this->notifications) > 0;\n }", "public function isReadProtected() {\n\t\treturn $this->getReadProtected();\n\t}", "public function markAsRead($notification)\n\t{\n\t\t$notification = NotificationsModel::model()->find(\"id=\".$notification);\n\t\tif($notification)\n\t\t{\n\t\t\t$notification->seen = \"1\";\n\t\t\t$notification->save();\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 isReadCompleted(): bool {\n return $this->_builder->isReadCompleted();\n }", "public function allowsRead()\n {\n if ($this->plus) {\n return true;\n }\n\n return $this->base == 'r';\n }", "public function can_read () {\r\n\r\n return $this->permissions[\"R\"] ? true : false;\r\n\r\n }", "public function markNotificationAsRead()\n\t{\n\t\t//get current login user\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$this->MeetingUser->updateAll(\n\t\t\t\tarray('MeetingUser.is_read' => 1),\n\t\t\t\tarray('MeetingUser.to_user' => $user)\n\t\t);\n\t\techo \"true\";\n\t\texit;\n\t}", "public function isReadable() {\n\t\treturn $this->readable;\n\t}", "public function Read()\n\t{\n\t\treturn $this->OnRead();\n\t}", "public function markAsRead(Message $message): bool;", "public function isReadResource();", "public function postReadAllNotification () {\n $owner_id = Auth::user()->id;\n\n $readAll = PosteNotification::where('owner_id', $owner_id)->update(['status' => 1]);\n if ($readAll) {\n return 1;\n }\n return 0;\n }", "public function isReadable()\n {\n return $this->readable;\n }", "public function getWatchStatus()\n\t\t{\n\t\t\treturn ($this->getModel()->is_watched == 'yes');\n\t\t}", "public function hasReadLimit(){\n return $this->_has(3);\n }", "public function readOrUnread()\n {\n $state = 0;\n\n if($this->state == 0){\n $state = 1;\n }\n\n $this->update(['state' => $state]);\n\n return $state;\n }", "public function unread()\n {\n return $this->unseen();\n }", "public function hasWritePending();", "public function onReading(){\n $read = VolumeRead::where('volume_id', Auth()->user()->last_volume)->where('user_id', Auth()->user()->id)->first();\n if(!$read){\n if(Auth()->user()->last_volume == $this->id){\n return true;\n }\n }\n return false;\n }", "public function readable()\n {\n return is_readable($this->path);\n }", "public function read()\n {\n $ids = request()->get('ids');\n Auth::user()->notifications()->whereIn('id', $ids)->update(['is_seen' => true]);\n\n return $this->empty();\n }", "public function isReadable(): bool;", "public function isSeen()\n {\n return\n $this->hasFlag(Zend\\Mail\\Storage::FLAG_SEEN)\n || $this->hasFlag(Zend\\Mail\\Storage::FLAG_DELETED)\n || $this->hasFlag(Zend\\Mail\\Storage::FLAG_ANSWERED);\n }", "public function supportsTopicNotification() {\n \treturn $this->manager->supportsTopicNotification();\n\t}", "public function isWatching()\n {\n return $this->watching;\n }", "public function isPending(): bool;", "public function isSubscribed(): bool;", "protected function getSendNotificationFlag()\n {\n return (bool) \\XLite\\Core\\Request::getInstance()->sendNotification;\n }", "public function isEvent()\n {\n return isset($this->status_changed) && ! is_null($this->status_changed);\n }", "public function readAndDispatch(): bool\n {\n }", "public function isReadRelationship();", "public function isNotificationsSupported() {\n return false;\n }", "public function isRetrieved()\n {\n return $this->retrieved;\n }", "public function isAutocreateNotification()\n {\n return (1 == $this->getConfig('autocreate/autocreate_notify'));\n }", "public function markAsRead($notification)\n {\n if ( $this->hasError() ) return false;\n \n try {\n $this->notification = $this->user->unreadNotifications()->findOrFail($notification);\n $this->notification->markAsRead(); \n } catch ( \\Exception $e ) {\n $this->setError('Could not mark the notification as read.', 500);\n return false;\n }\n\n $this->setSuccess('Successfully marked the notification as read.', 200);\n \n return true;\n }", "public function hasMsg(){\n return $this->_has(18);\n }", "public function isReceiving()\n {\n return ( $this->_stateManager->getState() === self::STATE_RECEIVING );\n }", "public function markAllAsRead()\n {\n if ( $this->hasError() ) return false;\n \n try {\n $this->user->unreadNotifications->markAsRead(); \n } catch ( \\Exception $e ) {\n $this->setError('Could not mark the users notifications as read.', 500);\n return false;\n }\n\n $this->setSuccess('Successfully marked the users notifications as read.', 200);\n \n return true;\n }", "public function isReported()\n\t{\n\t\tif ($this->get('state') == self::APP_STATE_FLAGGED)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function read() {\n\n $id = Input::get('data_id');\n\n DB::table('user_notifications')\n ->where('user_id', Auth::user()->id)\n ->where('notification_id', $id)\n ->update(array('read' => 1));\n }", "public function isReadable();", "public function supportsTermNotification() {\n \treturn $this->manager->supportsTermNotification();\n\t}", "public function isRinging() {\n\t\treturn $this->getRinger()->isRinging();\n\t}", "function read_notifications($userID, $id){\n\t\t\t$query = \"update notifications set read_message = 'yes' where content = '$id' and user_id = '$userID'\";\n\t\t\t$this->db->query($query);\n\t\t}", "public function hasNotes()\n {\n return (bool) $this->notes;\n }", "public function isReadable() {}", "public function hasIfmsg(){\n return $this->_has(28);\n }", "public function getReadProtected() {\n\t\t$readProtected = FALSE;\n\t\tif ($this->getUsersWithReadAccess()->count() > 0) {\n\t\t\t$readProtected = TRUE;\n\t\t}\n\t\tif ($this->getGroupsWithReadAccess()->count() > 0) {\n\t\t\t$readProtected = TRUE;\n\t\t}\n\n\t\treturn $readProtected;\n\t}", "public function isReadable()\n {\n if (!$this->metadata) {\n return false;\n }\n\n $mode = $this->metadata['mode'];\n\n return (\n strstr($mode, 'r')\n || strstr($mode, '+')\n );\n }", "public function isSubscribed($key) {\n if (isset($this->notifications['all']) && !$this->notifications['all']) {\n return false;\n }\n if (isset($this->notifications[$key]) && !$this->notifications[$key]) {\n return false;\n }\n return true;\n }", "public static function checkNotificationsOn()\n {\n $user = $_SESSION[\"staff_id\"];\n $con = $GLOBALS[\"con\"];\n $sql = \"select notificationsOn from user where staff_id = $user\";\n $result = mysqli_query($con, $sql);\n $row = mysqli_fetch_assoc($result);\n return $row[\"notificationsOn\"];\n }", "public function isReadable()\n {\n return true;\n }", "public function isReadable()\n {\n return true;\n }", "public function hasFlashNotification()\n {\n return Session::has('flash_notification');\n }", "function markUserNotificationAsRead( $userID, $notificationID ) {\n\tglobal $ftsdb;\n\n\t$result = $ftsdb->update( DBTABLEPREFIX . 'notifications',\n\t\tarray( 'read' => 1 ),\n\t\t\"id = :id AND user_id = :user_id\",\n\t\tarray(\n\t\t\t\":user_id\" => $userID,\n\t\t\t\":id\" => $notificationID,\n\t\t) );\n\n\treturn $result;\n}", "public function isSeekable()\n {\n return $this->metadata && $this->metadata['seekable'];\n }", "public function hasMessage()\n {\n return $this->hasMessage;\n }", "public function canRead()\n {\n // Test if forum Node is Hidden\n if ( !$this->forumNode()->canRead() || \n ($this->forumNode()->attribute( 'is_invisible' ) && !eZContentObjectTreeNode::showInvisibleNodes()) ||\n \t !SimpleForumTools::checkAccess($this->forumNode()) )\n {\n return false;\n }\n \n // Test if topic is moderated\n if ( !self::showModeratedTopics() &&\n \t $this->isModerated() )\n {\n \treturn false;\n }\n \n return true;\n }", "public function isTrackingNotification()\n {\n return (1 == $this->getConfig('notification/tracking_notification'));\n }", "public function is_ready() {\n return $this->isready;\n }", "public function hasMessages()\r\n {\n return $this->fm->hasMessages();\n }", "public function isPending()\n {\n return true;\n }", "public function isReady()\n {\n return $this->isReady;\n }", "function readable() {\n\t\treturn is_file($this->path) && is_readable($this->path);\n\t}", "public function read($id)\n\t{\n\t\t// Fetch the notification from the database\n\t\t$notification = Models\\Notifications::find($id);\n\n\t\t// Update the read status\n\t\t$notification->read = true;\n\t\t$notification->save();\n\n\t\t// Trigger event listeners\n\t\t$this->emitEvent('read', $notification);\n\n\t\t// Save the updated notification\n\t\treturn $notification;\n\t}", "public function get_notification_types()\n {\n return false;\n }", "public function getStillWanted() {\n $wanted = Event::fireReturn($this->getEventID(), $this->type, $this->filter, 'ping');\n if ($wanted || count($wanted)) {\n return true;\n }\n return false;\n }", "public function isReadable()\n {\n if (!in_array($this->mode, ['r', 'r+', 'w+', 'a+', 'x+', 'c+'])) {\n return true;\n }\n return false;\n }", "public function isReadable() {\n\t\treturn $this->pathway->getTitleObject()->userCan( 'read' );\n\t}", "public function hasFrameToRead()\n {\n $read = array($this->_socket);\n $write = null;\n $except = null;\n\n $has_frame_to_read = @stream_select($read, $write, $except, $this->_read_timeout_seconds, $this->_read_timeout_milliseconds);\n\n // This is commented out because it always returns false on connect with ActiveMQ.\n// if ($has_frame_to_read !== false)\n $has_frame_to_read = count($read);\n\n\n if ($has_frame_to_read === false) {\n throw new StompException('Check failed to determine if the socket is readable');\n } else if ($has_frame_to_read > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function getHasUnreadAttribute(): ?string\n {\n // Find current user.\n $user = request()->user();\n if (!$user) {\n return false;\n }\n /** @var Message $lastMessage */\n $lastMessage = $this->messages()->orderByDesc('created_at')->first();\n if (!$lastMessage) {\n return false;\n }\n return $lastMessage->user_id !== $user->id\n && $lastMessage->users()->where('id', $user->id)->doesntExist();\n }", "public function fetchNotifications(): StreamObserverNotificationState\n {\n return $this->notificationState;\n }", "public function isReadable()\n {\n }", "public function read()\n {\n request()->user()->unreadNotifications()->update(['read_at' => now()]);\n\n return response()->json(request()->user()->notifications);\n }", "public function isSubscribed()\n {\n return null !== $this->queue;\n }", "public static function isReadMethod($method);", "protected function canRead(){\n $emptyComment = $this->getCommentShell();\n\n // Check socialQuestion->isActive instead of socialQuestion->canRead, because when allowing the ability\n // to read comments on suspended questions, we get into serious weirdness when displaying bestAnswers,\n // and knowing when to display the rovingCommentEditor. We would also need to change socialComment->canUpdateStatus\n // to allow for non-active questions, which gets into a lot of strange edge cases.\n // In summary, leave the socialQuestion->isActive check there.\n return $this->socialQuestion &&\n $this->socialQuestion->SocialPermissions->isActive() &&\n ($this->isActive() || $this->canUpdateStatus($emptyComment) || ($this->isPending() && $this->isAuthor())) &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_READ, $emptyComment);\n }", "public function setNotificationsAsRead() {\n \tif (Auth::check()) {\n \t\tforeach (Auth::user()->unreadNotifications as $notification) {\n \t\t\t$notification->markAsRead();\n \t\t}\n \t\treturn response(null,200);\n \t} else {\n \t\treturn response(null, 403);\n \t}\n }", "protected function should_show_notification() {\n\t\t// Don't show a notification if the indexing has already been started earlier.\n\t\tif ( $this->indexing_helper->get_started() > 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Never show a notification when nothing should be indexed.\n\t\treturn $this->indexing_helper->get_filtered_unindexed_count() > 0;\n\t}" ]
[ "0.82238615", "0.7970942", "0.77267706", "0.7702125", "0.7638603", "0.7615032", "0.7557968", "0.7215249", "0.69990945", "0.69514936", "0.694967", "0.6837569", "0.6828434", "0.6631887", "0.65557534", "0.65499055", "0.6476909", "0.6476909", "0.6472224", "0.6454781", "0.64367914", "0.6375717", "0.63712054", "0.63614947", "0.6313206", "0.62984866", "0.62675345", "0.6257352", "0.61799973", "0.61769533", "0.61723113", "0.61557215", "0.6144346", "0.61224353", "0.6117533", "0.6109059", "0.6073718", "0.6043532", "0.59945065", "0.59895307", "0.5947108", "0.59380984", "0.5929331", "0.59250754", "0.59123504", "0.58951586", "0.58915734", "0.58843285", "0.5856385", "0.5848233", "0.58373207", "0.5836289", "0.5830787", "0.5806097", "0.58018804", "0.5771511", "0.576591", "0.5762198", "0.57592523", "0.57497525", "0.5720177", "0.57112277", "0.5707434", "0.57040983", "0.5703966", "0.56997395", "0.5691317", "0.56896687", "0.5678532", "0.56762105", "0.5662277", "0.5659557", "0.56532395", "0.56532395", "0.56392354", "0.56282836", "0.56225675", "0.56174636", "0.5610887", "0.5602386", "0.5595136", "0.55904424", "0.5572916", "0.55724597", "0.55669886", "0.5562596", "0.5560181", "0.55600715", "0.5559276", "0.55577", "0.5556441", "0.5551554", "0.55441314", "0.552248", "0.55185646", "0.55149806", "0.5511347", "0.55058634", "0.5504545", "0.55012155" ]
0.78912127
2
Returns user which owns this notification
public function getUserId() { return $this->userId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOwner() {\n // no need to check whether exist because of database constrain\n return User::getUserById($this->owner_id);\n }", "public function getOwnerId()\n {\n return $this->user_id;\n }", "function getOwner() {\n $user =& Element_Factory::makeElement( 'Bm_Users' );\n $user->get( $this->author );\n\n return $user->login;\n }", "public function getOwner(): User\n {\n return $this->user;\n }", "public function getOwner()\n\t{\n\t\treturn $this->getObject('owner', null, 'user');\n\t}", "public function getOwner(): User\n {\n return $this->owner;\n }", "public function getUserId() {\n\t\treturn (string) $this->photo->owner['nsid'];\n\t}", "public function getOwner()\n {\n return $this->hasOne(User::className(), ['id' => 'owner_id']);\n }", "public function getToUser()\n {\n return $this->toUser;\n }", "public function getOwnerRequestedBy()\n {\n return $this->http->get('/users/%s/requested-by', 'self');\n }", "public function owner()\n\t{\n\t\treturn $this->oneToOne('Hubzero\\User\\User', 'id', 'owned_by_user');\n\t}", "public function payee()\n {\n return $this->getSubject()->user;\n }", "public function user()\n {\n if (!is_null($this->user)) {\n return $this->user;\n }\n $user = null;\n try {\n $resourceId = Authorizer::getResourceOwnerId();\n $resourceType = Authorizer::getResourceOwnerType();\n } catch (\\Exception $e) {\n $resourceId = null;\n $resourceType = null;\n // throw $e;\n }\n if ($resourceType !== $this->id) {\n return null;\n }\n if (!empty($resourceId)) {\n $user = $this->getProvider()->retrieveById($resourceId);\n }\n return $this->user = $user;\n\n }", "public function getOppoUserid()\n {\n return $this->get(self::_OPPO_USERID);\n }", "public function getOwner()\n {\n return $this->data['owner'];\n }", "public function owner()\n {\n return $this->hasOne(User::class);\n }", "public function getOwnerusername() {}", "public function getOwnerNameAttribute()\n {\n return $this->user->{config('forum.user.username')};\n }", "protected function getUserId()\n {\n return object_get($this->getUser(), 'profile_id', $this->getDefaultProfileId() );\n }", "public function get_user() {\n\t\treturn $this->user;\n\t}", "public function getCurrentUser()\n {\n return $this->remoteUser;\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getUserId()\r\n \t{\r\n \treturn $this->_client->getUser();\r\n \t}", "function getOwner() {\n \n return $this->principalInfo['uri'];\n \n }", "function get_user () {\n\t\treturn $this->user_id;\n\t}", "public function getCreatedBy() {\n\t\treturn $this->hasOne ( User::className (), [ \n\t\t\t\t'id' => 'created_by_id' \n\t\t] );\n\t}", "function getOwnerIdentifier()\n {\n return $this->ownerIdentifier;\n }", "public function invoiceuser()\n {\n return $this->bean->info()->user()->name();\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getUserId()\n {\n return $this->baseEvent->getUserId();\n }", "public function user()\n {\n return $this->user;\n }", "public function user()\n {\n return $this->user;\n }", "public function getOwnerId()\n {\n return $this->owner_id;\n }", "public function getOwnerId()\n {\n return $this->owner_id;\n }", "public function oOwner(){\n\t\tif(is_null($this->__oOwner)){\n $this->__oOwner = CUser::oGetUser($this->__iOwnerNo);\n }\n return $this->__oOwner;\n\t}", "public function getResponsibleUserAttribute()\n {\n $model = Config::get(\"auth.model\");\n return $model::find($this->user_id);\n }", "public function getFromUser()\n {\n return $this->fromUser;\n }", "public function user()\n {\n return $this->context-> getUser();\n }", "public function getOwnerID() {\n\t\treturn $this->owner_id;\n\t}", "public function getUserId()\n {\n return $this->id;\n }", "public function getUser ()\r\n\t{\r\n\t\treturn $this->user;\r\n\t}", "public function user() { return $this->user; }", "public function getUserId()\r\r\n {\r\r\n return $this->signedRequest ? $this->signedRequest->getUserId() : null;\r\r\n }", "public function owner()\n {\n return $this->belongsTo(Jetstream::userModel(), 'user_id');\n }", "public function getOwner()\n\t{\n\t\t$command='stat -c %U' . sprintf(' \"%s\"', $this->getFullPath());\n\t\t$user=$this->executeCommand($command);\n\t\treturn $user;\n }", "public function owner()\n {\n return $this->belongsTo(User::class, 'created_by');\n }", "public function getowner_id()\n {\n return $this->owner_id;\n }", "public function getOwner() {\n\t\treturn $this->owner;\n\t}", "public function get_user() {\r\n\t\treturn ($this->user);\r\n\t}", "public function getOwner()\n {\n return $this->get(self::_OWNER);\n }", "public function owner(){\n\n\t\treturn $this->belongsTo('App\\User', 'user_id');\n\n\t}", "public function getUser() {\n\t\treturn $this->user;\n\t}", "public function getUser() {\n\t\treturn $this->user;\n\t}", "private function getUser() {\n\t\t$account = $this->authenticationManager->getSecurityContext()->getAccount();\n\t\t$user = $account->getParty();\n\t\treturn $user;\n\t}", "public function getOwner() {\r\n return $this->owner;\r\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::class, ['id' => 'created_by']);\n }", "public function getUser()\n {\n return $this->_user;\n }", "public function getUserId(){\n return $this->u_id;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->_user;\n }", "public function getUser()\r\n {\r\n return $this->user;\r\n }", "public function getOwner()\n {\n return isset($this->owner) ? $this->owner : null;\n }", "public function get_user_specific()\r\n {\r\n return $this->m_user_specific;\r\n }", "public function owner()\n {\n return $this->belongsTo('App\\Models\\User', 'user_id');\n }", "public function getOwnerId()\n {\n return $this->_OwnerId;\n }", "public function get_id_user()\n\t{\n\t\treturn $this->id_user;\n\t}", "public function getOwner()\n {\n return $this->_owner;\n }", "public function get_user_id()\n {\n return self::getUser();\n }", "public function GetCurrentUser()\n {\n return $this->userManager->getCurrent();\n }", "public function getLoggedInUser() {\n\t\treturn elgg_get_logged_in_user_entity();\n\t}" ]
[ "0.749119", "0.7245172", "0.7202552", "0.7181934", "0.7142098", "0.71329516", "0.7061126", "0.6942792", "0.68789595", "0.6877059", "0.6854885", "0.68400234", "0.6805791", "0.6746872", "0.67325896", "0.67180353", "0.67101884", "0.6694337", "0.66776735", "0.66655445", "0.6664681", "0.6656217", "0.6656217", "0.6656217", "0.6656217", "0.6655965", "0.66475433", "0.66346246", "0.66323954", "0.6621608", "0.6617944", "0.66105515", "0.66105515", "0.66105515", "0.6607022", "0.66051686", "0.66051686", "0.6599638", "0.6599638", "0.65931934", "0.659016", "0.658453", "0.6562704", "0.6559384", "0.65511876", "0.65494436", "0.65468335", "0.6544208", "0.6544188", "0.6543278", "0.65367365", "0.65315324", "0.65304446", "0.6528745", "0.65216273", "0.65209085", "0.65191066", "0.65191066", "0.6511778", "0.6511539", "0.6503536", "0.64948505", "0.64945275", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6489188", "0.6485319", "0.64852947", "0.648322", "0.64808244", "0.6475657", "0.64668155", "0.6461686", "0.6460985", "0.64609283", "0.64589053", "0.6458676" ]
0.0
-1
Sets type of this notification.
public function setType($type) { $this->type = $type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "function setType($type) {\n $this->type = $type;\n }", "public function setType($type)\r\n {\r\n $this->type = $type;\r\n }", "public function SetType($type){\r\n\t\t$this->type = (string) $type;\r\n\t}", "public function SetType($type){\r\r\n\t\t$this->type = (string) $type;\r\r\n\t}", "public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}", "public function setType($type)\n {\n $this['type'] = $type;\n }", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "public function setType( $type ) {\n\n\t\t$this->type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "public function set_type($type)\n {\n $this->set_default_property(self::PROPERTY_TYPE, $type);\n }", "public function set_type($type) {\n $this->update([\n 'type' => $type\n ]);\n\n $this->type = $type;\n\n // finish configuring this OrderExchange\n $this->sync();\n }", "public function setType($type) {\n\t\t$this->data['type'] = $type;\n\t}", "public function setType(string $type)\n {\n $this->type = $type;\n }", "public function setType($type) {}", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType(string $type);", "public function set_type( $type ) {\n\t\t$this->report_type = $type;\n\t\tupdate_comment_meta( $this->id, APP_REPORTS_C_RECIPIENT_TYPE_KEY, $type );\n\t}", "public function setType( $type )\n {\n }", "public function setType(string $type): void\n {\n $this->type = $type;\n }", "public function setType(string $type): void\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n parent::setAttr(\"type\", $type);\n }", "function setType($type = \"\")\n\t\t{\n\t\t\t$this->type = $type;\n\t\t}", "public function set_type( $type ) {\n\t\t$this->set_prop( 'type', sanitize_title( $type ) ) ;\n\t}", "public function setType(?string $type): void\n {\n $this->type = $type;\n }", "public function setType(?string $type): void\n {\n $this->type = $type;\n }", "public function setType($type){ }", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setType(?string $type): void;", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setType(string $type): self;", "public function setType(string $type): self;", "public function setType(string $type) {\n $this->attributes()->set('type', $type);\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setTyp( $type );", "public function setType($type)\n {\n $this->data['type'] = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->values['Type'] = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->values['Type'] = $type;\n return $this;\n }", "public function setType(?string $type): void\n {\n }", "function setType($type=0){\n\t\t\tswitch ($type){\n\t\t\t\tcase 0:{$type = 0; break;}\n\t\t\t\tdefault:{$type = 0;}\n\t\t\t}\n\t\t\t$this->message_type = $type;\n\t\t}", "public function setType($type)\n {\n $this->_type = $type;\n return $this;\n }", "public function setType($type) {\n\t\tif($type == self::TYPE_TEXT){\n\t\t\t$this->type = self::TYPE_TEXT;\n\t\t} else {\n\t\t\t$this->type = self::TYPE_HTML;\n\t\t}\n\t}", "public function setType(string $type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n\t\t{\n\t\t\t$this->type = $type;\n\t\t\treturn $this;\n\t\t}", "public function setType(string $type) : self\n {\n $this->type = $type;\n return $this;\n }", "public function setType(string $type) : self\n {\n $this->type = $type;\n return $this;\n }", "function setType($type) {\n\t\treturn $this->type = $type;\n\t}", "public function type(string $type)\n {\n $this->data['type'] = $type;\n return $this;\n }", "public function setType($type) {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType($type)\n {\n $type = strtolower($type);\n if (in_array($type, self::$allowed_types)) {\n $this->type= $type;\n } else {\n throw new InvalidArgumentException(\"Invalid alert type provided!\");\n }\n\n return $this;\n }", "public function setType($t){\n $this->type = $t;\n }", "protected function setType(int $type):void {\r\n\t\t$this->type = $type;\r\n\t}", "public function setType($type)\n\n {\n\n $this->type = $type;\n\n\n\n return $this;\n\n }", "public function setType(Type $type = null)\n {\n $this->type = $type;\n }", "public function type(string $type): self\n {\n $this->data['type'] = $type;\n return $this;\n }", "public function setType($type) {\n $this->type = $type;\n\n return $this;\n }", "public function setType($type) {\n $this->type = $type;\n\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }" ]
[ "0.75659204", "0.75659204", "0.75659204", "0.7539872", "0.7539872", "0.7506071", "0.7483696", "0.7464401", "0.74403375", "0.73750854", "0.73750854", "0.73695564", "0.73648006", "0.73648006", "0.7362101", "0.73600954", "0.73600954", "0.7265226", "0.7259914", "0.72578824", "0.7227579", "0.7178067", "0.71181166", "0.71181166", "0.71181166", "0.71181166", "0.71181166", "0.71181166", "0.71181166", "0.71181166", "0.7072044", "0.70633835", "0.7015049", "0.70118606", "0.70118606", "0.69922686", "0.692788", "0.6917405", "0.69017345", "0.69017345", "0.6892968", "0.6830741", "0.68066156", "0.6789495", "0.6784861", "0.6784861", "0.6774188", "0.6773195", "0.6754697", "0.6736908", "0.6705243", "0.6705243", "0.6655743", "0.6641059", "0.6630384", "0.66262233", "0.66157615", "0.66057926", "0.66003186", "0.66003186", "0.6598494", "0.6587946", "0.65797544", "0.65738314", "0.65738314", "0.65738314", "0.65738314", "0.65738314", "0.65738314", "0.65738314", "0.65738314", "0.65738314", "0.65738314", "0.65738314", "0.65738314", "0.65738314", "0.65659595", "0.65640086", "0.65497464", "0.65482044", "0.6545026", "0.65428877", "0.6541243", "0.6541243", "0.6525298", "0.6525298", "0.6525298", "0.6525298", "0.6525298", "0.6525298", "0.6525298", "0.6525298" ]
0.7487875
13
Sets data for this notification. Which will be used when displaying notification info.
public function setData($data) { $this->data = $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setData($data) {}", "public function setData($data)\n {\n $this->_data = $data;\n }", "function setData($data)\n {\n $this->data = $data;\n }", "function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}", "function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}", "function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}", "public function setData($data) {\n $this->data = $data;\n }", "public function set_data($data)\n {\n $this->data = $data;\n }", "public function setData($data)\r\n\t{\r\n\t\t$this->data = $data;\r\n\t}", "public function setData( $data )\n {\n $this->data = $data;\n }", "final public function setData($data) {\n $this->data = $data;\n }", "public function setData($data) \n\t{\n $this->data = $data;\n }", "public function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}", "public function setData($data) { \n $this->data = $data; \n }", "public function setData($data)\r\n {\r\n }", "private function setData($data)\n {\n \t$this->data = $data;\n }", "public function setData($_data)\n {\n $this->_data = $_data;\n }", "public function set_data($data)\n {\n }", "public function set_data($data)\n {\n }", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData() \n {\n // Empty, to be overridden \n }", "public function setData($data){\n\t\t$this->_storage = $data;\n\t\t\n\t\t// set update flag\n\t\t$this->_isModified = true;\n\t\t\n\t\t// new data available\n\t\t$this->_dataAvailable = true;\n\t}", "protected function setData($data) {\n $this->data = collect($data);\n }", "public function setData( ) {\r\n\t\t\tself::callEvent('response.setData', $this, func_get_args());\r\n\t\t}", "protected function setData($data)\n {\n $this->sha1 = null;\n $this->data = $data;\n }", "public function setData($data): void\n {\n $this->data = $data;\n }", "protected function set_data($status_info, $data)\r\n {\r\n $this->status_information = $status_info;\r\n $this->return_data = $data;\r\n }", "public function setData($data) {\n $this->data = (string) $data;\n }", "function setData($data)\n {\n $this->date=$data;\n }", "public function setViewData($data)\n {\n $this->__viewData = $data;\n }", "public function set_all_data($data)\n\t{\n\t\t$this->_data = $data;\n\t}", "public function setData($Data) {\n\t\t$this->Data=$Data;\n\t}", "public function setData(array $data) {\n\t\t$this->_data = $data;\n\t}", "public function setData($data)\n\t{\n\t\t$this->_pageData['data'] = $data;\n\t}", "public function set($data);", "public function setData(array $data) \n\t{\n\t\t\n\t\t$this->setId((int)$data['nt_id']);\n\t\t$this->setUserId((int)$data['nt_usr_id']);\n\t\t$this->setTitle($data['nt_title']);\n\t\t$this->setDescription($data['nt_description']);\n//\t\t$this->setImage($data['nt_image']);\n\t\t$this->setLocationStreet($data['nt_location_street']);\n\t\t$this->setLocationZip($data['nt_location_zip']);\n\t\t$this->setLocationCity($data['nt_location_city']);\n\t\t$this->setUserName($data['user_name']);\n\t\t$this->setUserPhone($data['nt_user_phone']);\n\t\t$this->setUserEmail($data['nt_user_email']);\n\t\t$this->setPrice((float)$data['nt_price']);\n\t\t$this->setPriceType((int)$data['nt_price_type']);\n\t\t$this->setCreateDate((int)$data['nt_create_date']);\n\t\t$this->setModDate((int)$data['nt_mod_date']);\n\t\t$this->setDeleted((int)$data['nt_deleted']);\n\t\t$this->setHidden((int)$data['nt_hidden']);\n\t\t$this->setCategoryId((int)$data['nt_category_id']);#\n//\t\t$this->setValidity((int)$data['nt_validity']);\n\t\t$this->setUntilDate((int)$data['nt_until_date']);\n\t}", "public function setData($data = array())\n {\n $this->data = (string) $data;\n\n $this->update();\n }", "function initData() {\n\t\t$navigationMenuItemDao = DAORegistry::getDAO('NavigationMenuItemDAO');\n\t\t$navigationMenuItem = $navigationMenuItemDao->getById($this->navigationMenuItemId);\n\n\t\tif ($navigationMenuItem) {\n\t\t\t$this->_data = array(\n\t\t\t\t'path' => $navigationMenuItem->getPath(),\n\t\t\t\t'title' => $navigationMenuItem->getTitle(null),\n\t\t\t\t'url' => $navigationMenuItem->getUrl(),\n\t\t\t\t'menuItemType' => $navigationMenuItem->getType(),\n\t\t\t);\n\t\t\t$this->setData('content', $navigationMenuItem->getContent(null)); // Localized\n\t\t} \n\t}", "protected function setNotificationParam(Notifications $notification)\n {\n $this->notification = $notification;\n $this->content = $this->notificationService->getContentsForNotification($notification);\n }", "public static function setData(Data $data)\n {\n self::$data = $data;\n }", "public static function setData($data)\n {\n self::$rawData = $data;\n }", "private function __setMedicationTileData() {\n\t\tif ($this->_requestedUser['id'] === $this->Auth->user('id')) {\n\t\t\t$showMedicationTile = true;\n\t\t\t$this->__addMedicationSchedulerFormValidation();\n\t\t\t$timezone = $this->Auth->user('timezone');\n\t\t\t$date = Date::getCurrentDate($timezone);\n\t\t\t$data = $this->__getMedicationDataOnDate($date);\n\t\t\t$this->set($data);\n\t\t} else {\n\t\t\t$showMedicationTile = false;\n\t\t}\n\t\t$this->set(compact('showMedicationTile'));\n\t}", "public function setData (array $data) : void {\n\t\t$this->data = $data;\n\t}", "public function set_data($key, $data)\n\t{\n\t\t$this->_data[$key] = $data;\n\t}", "function set_data($name, $value) {\n $this->data[$name] = $value;\n }", "public function setConnectionData($data)\n {\n $this->metadata = $data;\n }", "public function setData() {\n\t\t$this->import($this->get());\n\t}", "public function __construct($data)\n {\n $this->data=$data;\n $this->ns=NotificationSetting::first();\n }", "public function setData()\n {\n }", "public function setData()\n {\n }", "public function setData()\n {\n }", "public function setValues($data)\n {\n $this->name = $data['name'];\n $this->author_name = $data['author_name'];\n $this->author_surname = $data['author_surname'];\n $this->release_year = $data['release_year'];\n $this->request_date = $data['request_date'];\n $this->reserve_day = $data['reserve_day'];\n $this->return_day = $data['return_day'];\n $this->picture = $data['picture'];\n }", "public function set_data($badge) {\n $default_values = array();\n parent::set_data($badge);\n\n if (!empty($badge->id)) {\n $default_values['currentimage'] = print_badge_image($badge, $badge->get_context(), 'large');\n }\n\n parent::set_data($default_values);\n }", "public function setData()\n {\n $this->data=new \\DateTime('now');\n\n }", "private function set_display_data( $data ) {\n\t\t$this->display_data = $data;\n\t}", "public function setMetaInfo($data = array()) {\n $this->metaInfo = array_merge($this->metaInfo, $data);\n }", "public function setData(array $data){\n $this->copyfrom($data, ['statusId', 'locked', 'rallyUpdated', 'position', 'description']);\n }", "protected function setData(string $data):void {\n $this->data = $data;\n }", "public function setData($data)\n {\n return $this->set('data', $data);\n }", "protected function setData(array $data)\n\t{\n\t\t$this->json_data = $data;\n\t}", "public function setData(array $data)\n {\n $this->data = $data;\n }", "public function setData(array $data)\n {\n $this->data = $data;\n }", "public function setData(array $data)\n {\n $this->data = $data;\n }", "public function setData(array $data)\n {\n $this->data = $data;\n }", "public function setData( $data ) {\n\t\t$this->data = $data;\n\t\t$this->addField( new ACHRecordField([4,83], $data) );\n\t}", "public function setDatas()\n\t{\n\t\t$this->data[\"skeleton\"] = $this->getSkeleton();\n\t\t$this->data[\"css\"] = $this->getCss();\n\t\t$this->data[\"javascript\"] = $this->getJavascript();\n\t\t$this->data[\"module\"] = $this->getModule();\n\t\t$this->data[\"site\"] = $this->getSite();\n\t\t\t\t\t\t\n\t\t$this->_nodeName = $this->getNodeName();\n\t\t$this->_value = $this->getNodeValue();\n\t}", "public function set()\n {\n $args = func_get_args();\n $num = func_num_args();\n if ($num == 2) {\n self::$data[$args[0]] = $args[1];\n } else {\n if (is_array($args[0])) {\n foreach ($args[0] as $k => $v) {\n self::$data[$k] = $v;\n }\n }\n }\n }", "public function setData($data)\n\t{\n\t\t$this->_data = unserialize($data);\n\t\t$this->_hashFunc = $this->_data['hashFunc'];\n\t}", "protected function setData()\n {\n $user = Auth::getUser();\n $cart = Cart::byUser($user);\n if ( ! $cart->payment_method_id) {\n $cart->setPaymentMethod(PaymentMethod::getDefault());\n }\n $this->setVar('cart', $cart);\n $this->setVar('paymentMethod', PaymentMethod::find($cart->payment_method_id) ?? PaymentMethod::getDefault());\n $this->setVar('step', $this->property('step'));\n $this->setVar('accountPage', GeneralSettings::get('account_page'));\n\n if ($orderId = request()->get('order')) {\n $orderId = $this->decode($orderId);\n $this->setVar('order', Order::byCustomer($user->customer)->find($orderId));\n }\n }", "public function setData($data) {\n \n if (!is_array($data)) {\n throw new InvalidArgumentException(\"No or invalid message data was sent\");\n }\n \n $this->data = $data;\n \n }", "protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function setData($data, $key = null);", "public function setData($data = null)\n {\n if ($data instanceof Model) {\n $data = [snake_case(class_basename($data)) => $this->convertObjectToArray($data)];\n } elseif (is_object($data)) {\n $data = $this->convertObjectToArray($data);\n } elseif (is_null($data)) {\n $data = [];\n } elseif (is_string($data)) {\n $data = [static::messageKey() => $data];\n }\n\n if (! is_array($data)) {\n $data = [static::messageKey() => json_encode($data)];\n }\n\n if (! array_key_exists(static::codeKey(), $data)) {\n $data[static::codeKey()] = $this->getCode();\n }\n\n if (! is_null($this->cleanKeys)) {\n $data = $this->cleanArray($data, $this->cleanKeys);\n }\n\n return parent::setData($data);\n }", "function setData ($data) {\n if ($data !== ($oldData = $this->data)) {\n $this->data = $data;\n if ($this->resetCacheOnDataChange($oldData, $data)) \n $this->resetCache();\n }\n }", "private function setValues($data) {\n \n // Should always be supplied\n $this->id = $data->id;\n $this->url = $data->url;\n $this->status = $data->status;\n\n // Optionally supplied\n if(property_exists($data, \"failure\")) {\n $this->failure = new \\Zamzar\\Failure($data->failure);\n }\n }", "function set(array $data) {\n\t\tforeach ($data as $key => $value) {\n\t\t\t$this->$key = $value;\n\t\t}\n\t}", "public function setInternalData($data): void\n {\n $this->internal_data = $data;\n }", "function setAllData(&$data) {\n\t\t$this->_data =& $data;\n\t}", "public function setShopifyData(stdClass $data) {\n if (isset($data->{static::getResourceSingularName()})) {\n /*\n * If we received data in the form:\n * {\n * \"product\": {\n * ...\n * }\n * }\n * we'll extract the resource object (in this example, product)\n */\n $this->shopifyData = $data->{static::getResourceSingularName()};\n } else {\n // otherwise let's assume we got the resource object directly\n $this->shopifyData = $data;\n }\n $this->populateChildren();\n }", "private function _setUserData($userData){\n $this->_userData = $userData;\n }", "protected function _setUniversalData()\n {\n $service = $this->getService();\n $object = $this->getObject();\n $entry = $this->getEntry();\n $attributeValues = $this->getAttributeValues();\n\n $this->_setAttribute('id', $object->getId() . '_' . $this->getStoreId(), 'text');\n\n if (isset($attributeValues['title']['value'])) {\n $titleText = $attributeValues['title']['value'];\n unset($attributeValues['title']); // to prevent \"Reason: Duplicate title\" error\n } elseif ($object->getName()) {\n $titleText = $object->getName();\n } else {\n $titleText = 'no title';\n }\n $entry->setTitle($service->newTitle()->setText($this->_cleanAtomAttribute($titleText)));\n\n if ($object->getUrl()) {\n $links = $entry->getLink();\n if (!is_array($links)) {\n $links = array();\n }\n $link = $service->newLink();\n $link->setHref($object->getUrl());\n $link->setRel('alternate');\n $link->setType('text/html');\n if ($object->getName()) {\n $link->setTitle($object->getName());\n }\n $links[0] = $link;\n $entry->setLink($links);\n }\n\n if (isset($attributeValues['description']['value'])) {\n $descrText = $attributeValues['description']['value'];\n unset($attributeValues['description']); // to prevent \"Reason: Duplicate description\" error\n } elseif ($object->getDescription()) {\n $descrText = $object->getDescription();\n } else {\n $descrText = 'no description';\n }\n $entry->setContent($service->newContent()->setText($this->_cleanAtomAttribute($descrText)));\n\n if (isset($attributeValues['price']['value']) && floatval($attributeValues['price']['value']) > 0) {\n $price = $attributeValues['price']['value'];\n } else {\n $price = $object->getPrice();\n }\n\n $this->_setAttributePrice(false, $price);\n\n if ($object->getQuantity()) {\n $quantity = $object->getQuantity() ? max(1, (int)$object->getQuantity()) : 1;\n $this->_setAttribute('quantity', $quantity, 'int');\n }\n\n $targetCountry = $this->getConfig()->getTargetCountry($this->getStoreId());\n\n if ($object->getData('image_url')) {\n $this->_setAttribute('image_link', $object->getData('image_url'), 'url');\n }\n\n $this->_setAttribute('condition', 'new', 'text');\n $this->_setAttribute('target_country', $targetCountry, 'text');\n $this->_setAttribute('item_language', $this->getConfig()->getCountryInfo($targetCountry, 'language'), 'text');\n // set new 'attribute_values' with removed 'title' and/or 'description' keys to avoid 'duplicate' errors\n $this->setAttributeValues($attributeValues);\n\n return $this;\n }", "private function setData($data){\n\t\n\t\t$this->setIdusuario($data['idusuario']);\n\t\t$this->setDeslogin($data['deslogin']);\n\t\t$this->setDessenha($data['dessenha']);\n\t\t$this->setDtcadastro(new DateTime($data['dtcadastro']));\t\t\n\t}", "function __data() {\n\t\tif ($data = $this->Session->read('data')) {\n\t\t\tforeach ($data as $k => $i) {\n\t\t\t\t$obj = ClassRegistry::init($k);\n\t\t\t\t$this->data[$k] = $i;\n\t\t\t}\n\t\t\t$this->Session->write('data', null);\n\t\t}\n\t\t// attempts to remember identity of commentor and prefill fields\n\t\tif (empty($this->data['Comment']) && $data = $this->Cookie->read('CommentUser')) {\n\t\t\t$this->data['Comment'] = $data;\n\t\t}\n\t}", "public function set_raw_data($data)\n {\n }", "public function fill(array $data) {\n if(isset($data['user_history_id'])) {\n $this->id = $data['user_history_id'];\n }\n\t\t\n $this->userId = $data['user_history_user_id'];\n\t\t$this->username = $data['user_history_username'];\n\t\t$this->type = $data['user_history_type'];\n\t\t$this->description = $data['user_history_description'];\n\t\t$this->time = $data['user_history_timestamp'];\n\t}", "function initData() {\n\t\tif (isset($this->journalId)) {\n\t\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\t\t\t$journal =& $journalDao->getById($this->journalId);\n\n\t\t\tif ($journal != null) {\n\t\t\t\t$this->_data = array(\n\t\t\t\t\t'title' => $journal->getSetting('title', null), // Localized\n\t\t\t\t\t'description' => $journal->getSetting('description', null), // Localized\n\t\t\t\t\t'journalPath' => $journal->getPath(),\n\t\t\t\t\t'enabled' => $journal->getEnabled()\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\t$this->journalId = null;\n\t\t\t}\n\t\t}\n\t\tif (!isset($this->journalId)) {\n\t\t\t$this->_data = array(\n\t\t\t\t'enabled' => 1\n\t\t\t);\n\t\t}\n\t}", "public function setData(array $data);", "public function setData(array $data);", "public function setData(array $data);", "public function data($msg_data)\n {\n }", "public function setInfo( $info )\n {\n $this->data['info'] = $info;\n }", "public function data(array $data)\n\t{\n\t\tself::$__data = array_merge(self::$__data, $data);\n\t}", "public function set_user_info($data){\n\t\t\treturn $result=$this->save($data);\n\t\t}", "public function __construct($data, $notifitable = null)\n\t{\n\t\t$this->data = $data;\n\t\t$this->notifitable = $notifitable;\n\t}", "public function setData(Array $data)\n {\n $this->data_view = array_merge_recursive($this->data_view, $data);\n }" ]
[ "0.66544855", "0.66422635", "0.66008276", "0.65828735", "0.65828735", "0.65828735", "0.65667105", "0.6550258", "0.65499145", "0.654096", "0.65374076", "0.6483927", "0.6476265", "0.6457619", "0.64489144", "0.64261603", "0.6391054", "0.6381752", "0.63815945", "0.6283336", "0.6283336", "0.6283336", "0.6283336", "0.6283336", "0.62773323", "0.6269213", "0.62690175", "0.6223907", "0.619985", "0.61829174", "0.61784226", "0.61707574", "0.6145952", "0.6090097", "0.6082693", "0.6066999", "0.6038302", "0.60206616", "0.60181934", "0.5976015", "0.59704614", "0.59603167", "0.595321", "0.5940952", "0.5940527", "0.59398437", "0.59243774", "0.59106845", "0.5909823", "0.5899222", "0.5895453", "0.5894327", "0.5884202", "0.5884202", "0.5884202", "0.58743334", "0.5855843", "0.58386874", "0.5823459", "0.5816894", "0.57954997", "0.5775315", "0.5771454", "0.5764058", "0.57544655", "0.57544655", "0.57544655", "0.57544655", "0.57509404", "0.5741879", "0.57343584", "0.57253414", "0.5717958", "0.57031935", "0.57023925", "0.56891036", "0.56849277", "0.56405", "0.56291604", "0.5623199", "0.5613738", "0.55996007", "0.5599093", "0.5595867", "0.55921936", "0.55807364", "0.55798846", "0.5577276", "0.5568519", "0.5567508", "0.5560875", "0.5560875", "0.5560875", "0.5560284", "0.5552814", "0.554574", "0.55436015", "0.5536294", "0.553004" ]
0.64867765
12
Sets timestamp of this notification
public function setTimestamp($timestamp) { $this->timestamp = $timestamp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTimestamp($timestamp) {\r\r\n\t\t$this->timestamp = $timestamp;\r\r\n\t}", "public function setTimestamp($timestamp);", "public function setTimestamp( $timestamp ) {\n\n $this->timestamp = $this->offsetTimestampForWordPressTimezone(\n $timestamp );\n }", "public function setTimeStamp()\n\t{\n\t\t$this->_current_timestamp = time();\n\t}", "public function setTimestamp($timestamp)\r\n {\r\n if (!is_null($timestamp))\r\n {\r\n $timestamp = (int) $timestamp;\r\n }\r\n $this->clearCachedValueIf($this->_timestamp != $timestamp);\r\n $this->_timestamp = $timestamp;\r\n }", "public function setTimestamp($timestamp)\n {\n if (null !== $timestamp) {\n $timestamp = (int) $timestamp;\n }\n $this->clearCachedValueIf($this->_timestamp != $timestamp);\n $this->_timestamp = $timestamp;\n }", "function setTimestamp($time_stamp) {\n $this->checkChange(TRUE);\n\n if (variable_get('userpoints_transaction_timestamp', 1)) {\n return $this;\n }\n $this->time_stamp = $time_stamp;\n return $this;\n }", "public function setTimestamp($v = null)\n { return $this->set('timestamp', $v ? $v : JSONMessage::timestamp()); }", "public function setTimestamp($var)\n {\n GPBUtil::checkInt64($var);\n $this->timestamp = $var;\n\n return $this;\n }", "public function setTimestamp($value)\n {\n return $this->set('Timestamp', $value);\n }", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function setCreatedTime($timestamp);", "public function timestamp($timestamp) {\n $this->data['attachment']['payload']['timestamp'] = $timestamp;\n\n return $this;\n }", "public function setTimestamp($timestamp, $reassign = false);", "public function setTimestamp( $timestamp )\n {\n if ( empty( $timestamp ) )\n {\n $timestamp = null;\n }\n else if ( is_string( $timestamp ) )\n {\n $timestamp = new DateTime( $timestamp );\n }\n else if ( is_numeric( $timestamp ) )\n {\n $timestamp = new DateTime( '@' . $timestamp );\n }\n else\n {\n $timestamp = null;\n }\n\n $this->proxyBase->timestamp = $timestamp;\n return $this;\n }", "public function SetFromTimestamp( $timestamp ){\r\n\t\t\tif( $timestamp !== null ){\r\n\t\t\t\t$this->year = date( 'Y', $timestamp );\r\n\t\t\t\t$this->month = date( 'm', $timestamp );\r\n\t\t\t\t$this->day = date( 'd', $timestamp );\r\n\t\t\t\t$this->hours = date( 'H', $timestamp );\r\n\t\t\t\t$this->minutes = date( 'i', $timestamp );\r\n\t\t\t\t$this->seconds = date( 's', $timestamp );\r\n\t\t\t}\r\n\t\t}", "public function setTime($timestamp)\r\n {\r\n $this->data['year'] = (int) date(\"Y\", $timestamp);\r\n $this->data['mon'] = (int) date(\"m\", $timestamp);\r\n $this->data['day'] = (int) date(\"d\", $timestamp);\r\n $this->data['hour'] = (int) date(\"G\", $timestamp);\r\n $this->data['min'] = (int) date(\"i\", $timestamp);\r\n }", "public function setTimestamp($timestamp = 0)\n\t\t\t{\n\t\t\t\t$this->timestamp = intval($timestamp);\n\n\t\t\t\treturn $this;\n\t\t\t}", "public function setStartDateTime($timestamp);", "function set_date_to_now()\n {\n $this->timestamp=time();\n }", "public function updateTopicModifiedDate()\n {\n $this->setAttribute( 'modified', time() );\n $this->store();\n }", "public function setUpdatedAt($timestamp);", "public function setTimestamp($var)\n {\n GPBUtil::checkInt64($var);\n $this->writeOneof(3, $var);\n\n return $this;\n }", "public function setTimestamp($timestamp)\n {\n $this->timestamp = $timestamp;\n return $this;\n }", "public function setTimestamp($timestamp) \n\t{\n\t\t$this->timestamp = $timestamp;\n\t\treturn $this;\n\t}", "public function setPubDate( $timestamp ) {\n\t\t$this->pubDate = date( 'r', $timestamp );\n\t}", "public function setTstamp($tstamp) {\n\t\t$this->tstamp = $tstamp;\n\t}", "public function setTs($timestamp)\n {\n if ($timestamp === null) {\n $this->ts = null;\n return $this;\n }\n\n if (is_string($timestamp)) {\n try {\n $timestamp = new DateTime($timestamp);\n } catch (Exception $e) {\n throw new InvalidArgumentException(\n sprintf('Invalid timestamp: %s', $e->getMessage())\n );\n }\n }\n\n if (!$timestamp instanceof DateTimeInterface) {\n throw new InvalidArgumentException(\n 'Invalid timestamp value. Must be a date/time string or a DateTime object.'\n );\n }\n\n $this->ts = $timestamp;\n\n return $this;\n }", "public static function setLastModified($timestamp) {}", "protected function setTimestamp(\\DateTime $timestamp)\n\t{\n\t\t$this->_timestamp = $timestamp;\n\t\treturn $this;\n\t}", "public function setTimestamp($timestamp)\n {\n $this->timestamp = $timestamp;\n\n return $this;\n }", "public function setTimestamp($timestamp)\n {\n $this->timestamp = $timestamp;\n\n return $this;\n }", "public function populateTimestamp()\n {\n $this->exists = true;\n $this->timestamp = 1;\n }", "private function _timestamp()\n \t{\n \t\t$this->updated_at = time();\n \t\tif (!$this->exists) $this->created_at = $this->updated_at;\n \t}", "function setTimeOffset($value)\n {\n $this->_props['TimeOffset'] = $value;\n }", "public function setModificationTime( $timestamp )\n {\n $this->mtime = $timestamp;\n list( $this->properties[\"lastModFileTime\"], $this->properties[\"lastModFileDate\"] ) = self::timestampToDosFormat( $timestamp );\n }", "public function setDueDateTime($timestamp);", "function save_timestamp() {\n\t\t$this->timestamp = date('Y-m-d', time());\n\t}", "public function setTimestamp(?int $timestamp): self\n {\n $this->timestamp = $timestamp;\n\n return $this;\n }", "public function timestamp() {\n\t\t$this->updated_at = new \\DateTime;\n\n\t\tif ( ! $this->exists) $this->created_at = $this->updated_at;\n\t}", "public function setDateTime($value)\n {\n $this->createdAt=$value;\n }", "public function setCommentTimestamp($newCommentTimestamp = null): void {\n\t\t// base case: if the date is null, use the current date and time\n\t\tif($newCommentTimestamp === null) {\n\t\t\t$this->commentTimestamp = new \\DateTime();\n\t\t\treturn;\n\t\t}\n\t\t// store the comment timestamp using the ValidateDate trait\n\t\ttry {\n\t\t\t$newCommentTimestamp = self::validateDateTime($newCommentTimestamp);\n\t\t} catch(\\InvalidArgumentException | \\RangeException $exception) {\n\t\t\t$exceptionType = get_class($exception);\n\t\t\tthrow(new $exceptionType($exception->getMessage(), 0, $exception));\n\t\t}\n\t\t$this->commentTimestamp = $newCommentTimestamp;\n\t}", "#[ReturnTypeWillChange]\n public function setTimestamp($timestamp)\n {\n $time = date('Y-m-d H:i:s', $timestamp);\n\n return self::parse($time, $this->timezone, $this->locale);\n }", "public function setCreationTimestamp(?DateTime $value): void {\n $this->getBackingStore()->set('creationTimestamp', $value);\n }", "function setAuthTimestamp($AuthTimestamp)\n {\n \t$this->_authTimestamp =$AuthTimestamp;\n }", "public function refreshTimestamp();", "private function actionAlterTablePaymentSetTimestamp() {\n $this->changeTableColumnToTimestamp(TB_VPS_PAYMENT, array(\"payment_date\"), \"payment_id\");\n echo TB_VPS_PAYMENT . \" DONE <br/>\";\n }", "public function setTimestampValues($event)\r\n\t{\r\n\t\tif($this->owner instanceof ActiveRecord)\r\n\t\t{\r\n\t\t\t$now = $this->getValue($event);\r\n\t\t\tif($this->owner->getIsNewRecord())\r\n\t\t\t{\r\n\t\t\t\tif($this->owner->hasAttribute($this->createdAtAttribute)) $this->owner->setAttribute($this->createdAtAttribute, $now);\r\n\t\t\t}\r\n\t\t\tif($this->owner->hasAttribute($this->updatedAtAttribute)) $this->owner->setAttribute($this->updatedAtAttribute, $now);\r\n\t\t}\r\n\t}", "public function setTimeStamp($value)\n\t{\n\t\tif($value===null || (is_string($value) && trim($value)===''))\n\t\t\t$this->setText('');\n\t\telse\n\t\t{\n\t\t\t$date = TPropertyValue::ensureFloat($value);\n\t\t\t$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat());\n\t\t\t$this->setText($formatter->format($date));\n\t\t}\n\t}", "function setStatusModified( $timestamp )\n {\n $this->StatusModified = $timestamp;\n }", "public function setDebugTimestamp($timestamp)\n {\n $this->debugTimestamp = $timestamp;\n }", "public function setDateTime($value) {\n\t\t$this->datetime = $value;\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "private function _setTimestamp($column)\n {\n $this->_record->$column = date(self::DATE_FORMAT);\n }", "protected static function setSyncLastTime()\n {\n DB::update(\"UPDATE `sync_last_time` SET timestamp = ? WHERE id=?\", [time(), 1]);\n }", "function setTimeStamp( $value )\r\n {\r\n $formattedTime =& date('His', $value );\r\n\r\n if ( preg_match( \"/([0-9]{2})([0-9]{2})([0-9]{2})/\", $formattedTime, $valueArray ) )\r\n {\r\n $this->setHour( min( $valueArray[1], 23 ) );\r\n $this->setMinute( min( $valueArray[2], 59 ) );\r\n $this->setSecond( min( $valueArray[3], 59 ) );\r\n }\r\n else\r\n {\r\n print( \"<b>Error:</b> eZTime::setTimeStamp() received wrong time format.\" );\r\n }\r\n\r\n }", "public function timestamp()\n {\n $this->replaceTextNode('/p:package/p:date', date('Y-m-d'));\n $this->replaceTextNode('/p:package/p:time', date('H:i:s'));\n\n $release = $this->_requireCurrentRelease();\n\n $this->replaceTextNodeRelativeTo('./p:date', $release, date('Y-m-d'));\n }", "public function setUpdatedAt($timestamp){\n return $this->setData(self::UPDATED_AT, $timestamp);\n }", "public function Date($timestamp = \"\") {\n\t\tif ($timestamp) {\n\t\t\t$this->setTimestamp($timestamp);\n\t\t} \n\t\telse {\n\t\t\t$this->setTimestamp(time());\n\t\t}\n\t}", "public function setTime(?DateTime $value): void {\n $this->getBackingStore()->set('time', $value);\n }", "public function __construct($timestamp)\n {\n $this->timestamp = $timestamp;\n }", "public function setModifiedAt()\n {\n $this->modifiedAt = new \\DateTime();\n }", "public function setTimestamp(string $timestamp) : Result\n {\n $this->timestamp = new DateTime($timestamp);\n return $this;\n }", "public function setDate()\n\t{\n\t\tif ($this->getIsNewRecord())\n\t\t\t$this->create_time = time();\n\t}", "public function setTimeAttribute($time)\n {\n $this->attributes['broadcasted_at'] = Carbon::make($time);\n }", "public function setTimestamp(float $timestamp) : self\n {\n $this->timestamp = $timestamp;\n return $this;\n }", "function set_event_date_time() {\r\n\t\t\t$dateobj = date_create($this->date . \" \" . $this->time);\r\n\t\t\t\r\n\t\t\t//we can format the date object string to exactly what we want. Leading zeros, etc.\r\n\t\t\t$this->event_date_time = date_format($dateobj, \"Y-m-d H:i:s\");\r\n\t\t}", "public function setAsSent()\n {\n $this->sentAt = new \\DateTime();\n }", "public function timestamp(Carbon $timestamp = null);", "public function set_times($timestamp_type=false)\n\t{\n\t\tif ($timestamp_type !== false) $this->timestamp_type = $timestamp_type;\n\n\t\t// set current time\n\t\tswitch($this->timestamp_type)\n\t\t{\n\t\t\tcase 'object':\n\t\t\t\t$this->now = new egw_time('now');\n\t\t\t\tbreak;\n\t\t\tcase 'string':\n\t\t\t\t$this->now = egw_time::to('now',egw_time::DATABASE);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->now = egw_time::to('now','ts');\n\t\t}\n\t\t$this->tz_offset_s = egw_time::tz_offset_s();\n\t}", "public function setTime($value)\n {\n if (!array_key_exists('time', $this->fieldsModified)) {\n $this->fieldsModified['time'] = $this->data['fields']['time'];\n } elseif ($value === $this->fieldsModified['time']) {\n unset($this->fieldsModified['time']);\n }\n\n $this->data['fields']['time'] = $value;\n }", "public function setTime($time);", "public function putDate(int $timestamp = null): self\n {\n if (null === $timestamp) {\n $date = gmdate('D, d M Y H:i:s');\n } else {\n $date = gmdate('D, d M Y H:i:s', $timestamp);\n }\n\n $this->put('Date', $date . ' GMT');\n return $this;\n }", "protected function changeModifiedTime($file, $timestamp)\n {\n touch($file, $timestamp);\n }", "public function setTime($time=0){\n\t\t\t$this->_time = $time;\n\t\t}", "function __construct(){\r\n $this->timestamp = time();\r\n }", "public function setTimeOverride( $time ) {\n\t\t$this->time = $time;\n\t}", "function setPasswordUpdatedTime(){\n\t\t$this->setPasswordUpdated(time());\n\t}", "public function setTime(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->time = $var;\n }" ]
[ "0.7692352", "0.760684", "0.751946", "0.72841686", "0.7180668", "0.7110282", "0.68556523", "0.67837626", "0.66360265", "0.6632361", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6589783", "0.6583187", "0.65616155", "0.65450704", "0.6517823", "0.6505026", "0.6494145", "0.6355123", "0.6348853", "0.63130796", "0.6311888", "0.6291402", "0.6286662", "0.6264696", "0.6259399", "0.62387097", "0.6203798", "0.6203373", "0.6183821", "0.61646485", "0.61646485", "0.61626273", "0.61395925", "0.6113176", "0.6112784", "0.61117375", "0.6100982", "0.6086808", "0.6085016", "0.6084131", "0.60278636", "0.6025279", "0.59945303", "0.598176", "0.59665996", "0.5963665", "0.59628165", "0.5962702", "0.5952537", "0.5936696", "0.59033334", "0.58948326", "0.58948326", "0.589362", "0.58928174", "0.5889976", "0.5845507", "0.58405524", "0.5837351", "0.5834476", "0.5822936", "0.5780498", "0.57588845", "0.57497287", "0.5741285", "0.57190746", "0.57174635", "0.5704218", "0.5694183", "0.5664036", "0.56208974", "0.56196076", "0.5617106", "0.56084657", "0.55990785", "0.55712557", "0.5558241", "0.5554851", "0.555463" ]
0.7470387
4
Sets if this notification is read.
public function setRead($isRead) { $this->isRead = $isRead; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRead() {\n\t\t$statement = Registry::get(\"database\") -> query(\"UPDATE messages SET is_read=1 WHERE id=?\");\n\t\t$statement -> bindParam(1, \t$this -> getId());\n\t\t$statement -> execute();\n\t}", "public function markNotificationAsRead()\n\t{\n\t\t//get current login user\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$this->MeetingUser->updateAll(\n\t\t\t\tarray('MeetingUser.is_read' => 1),\n\t\t\t\tarray('MeetingUser.to_user' => $user)\n\t\t);\n\t\techo \"true\";\n\t\texit;\n\t}", "public function setAsRead()\n {\n $this->readAt = new \\DateTime();\n }", "public function isRead()\n {\n return $this->isRead;\n }", "public function getIsRead()\n {\n return $this->isRead;\n }", "public function markAsRead()\n {\n if ($this->auth->alerts_unread) {\n $this->alert->where('user_id', $this->userId)->whereNull('read_at')->update([\n 'read_at' => Carbon\\Carbon::now()\n ]);\n }\n\n $this->alert->where('user_id', $this->userId)->update(['is_marked' => true]);\n }", "public function markAsRead()\n {\n if (is_null($this->read_at)) {\n $this->forceFill(array(\n 'read_at' => $this->freshTimestamp()\n ));\n\n $this->save();\n }\n }", "public function changeRead(Request $request) {\n $id = $request['id'];\n $isRead = $request['isRead'];\n $notification = \\App\\UserNotification::query()\n ->where('user_id', Auth::user()->id)\n ->where('notification_id',$id)->first();\n $notification->update(array('is_read' => true));\n \n }", "public function isRead() {\n\t\treturn $this -> data['is_read'] == 1;\n\t}", "public function markAsRead($notification)\n\t{\n\t\t$notification = NotificationsModel::model()->find(\"id=\".$notification);\n\t\tif($notification)\n\t\t{\n\t\t\t$notification->seen = \"1\";\n\t\t\t$notification->save();\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 hasRead()\n {\n return ($this->status == NOTIFICATION_VIEWED);\n }", "public function markRead ()\n\t{\n\t\tif (isset($_COOKIE[\"read\"]) && $_COOKIE[\"read\"] == 1)\n\t\t{\n\t\t\t$Statement = $this->Database->prepare(\"UPDATE messages SET unread = 0 WHERE reciever = ?\");\n\t\t\t$Statement->execute(array($this->id));\n\t\t\tsetcookie('read', 0, time()-3600);\n\t\t}\n\t}", "function setRead($conv_id, $is_read=true){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('UPDATE msg_conversation SET is_read=:is_read WHERE conv_id=:conv_id');\n\t\t$statement->execute(array(':is_read'=>$is_read, ':conv_id'=>$conv_id));\n\t}", "public function isRead()\n {\n return $this->object->isRead();\n }", "public function isRead()\n {\n return (bool) $this->readAt;\n }", "public function setIsRead($isRead)\n {\n $this->isRead = $isRead;\n\n return $this;\n }", "public function setRead($id) {\n Auth::user()->notif_id = intval($id);\n Auth::user()->save();\n }", "public function markAsRead($notifications);", "public function markAsRead(Message $message): bool;", "public function setRead()\n {\n $this->read_at = new \\DateTime();\n $this->save();\n\n return $this;\n }", "public function setNotificationsAsRead() {\n \tif (Auth::check()) {\n \t\tforeach (Auth::user()->unreadNotifications as $notification) {\n \t\t\t$notification->markAsRead();\n \t\t}\n \t\treturn response(null,200);\n \t} else {\n \t\treturn response(null, 403);\n \t}\n }", "public function markRead($user)\n {\n $this->getNotification($user)->markAsRead();\n }", "public function read() {\n\n $id = Input::get('data_id');\n\n DB::table('user_notifications')\n ->where('user_id', Auth::user()->id)\n ->where('notification_id', $id)\n ->update(array('read' => 1));\n }", "public function markAsRead($notification)\n {\n if ( $this->hasError() ) return false;\n \n try {\n $this->notification = $this->user->unreadNotifications()->findOrFail($notification);\n $this->notification->markAsRead(); \n } catch ( \\Exception $e ) {\n $this->setError('Could not mark the notification as read.', 500);\n return false;\n }\n\n $this->setSuccess('Successfully marked the notification as read.', 200);\n \n return true;\n }", "function isReadable() { return $this->flagAccessRead; }", "public function read()\n {\n return $this->read_at !== null;\n }", "function markUserNotificationAsRead( $userID, $notificationID ) {\n\tglobal $ftsdb;\n\n\t$result = $ftsdb->update( DBTABLEPREFIX . 'notifications',\n\t\tarray( 'read' => 1 ),\n\t\t\"id = :id AND user_id = :user_id\",\n\t\tarray(\n\t\t\t\":user_id\" => $userID,\n\t\t\t\":id\" => $notificationID,\n\t\t) );\n\n\treturn $result;\n}", "public function markAllAsRead()\n {\n Auth::user()->unreadNotifications()->update(['read_at' => now()]);\n }", "public function marcarlida()\n {\n auth()->user()->unreadNotifications->markAsRead();\n }", "public function markNotificationAsRead($notificationId);", "public function readOrUnread()\n {\n $state = 0;\n\n if($this->state == 0){\n $state = 1;\n }\n\n $this->update(['state' => $state]);\n\n return $state;\n }", "protected function maybe_read() {\n\t\tparent::maybe_read() ;\n\n\t\t// Reset transition variable.\n\t\t$this->amount_transition_status = false ;\n\t}", "public function getWasRead()\n {\n if (!is_null($this->time_read)){\n return true;\n }\n return false;\n }", "public function markAsRead()\n {\n if (! $this->read()) {\n $this->forceFill(['read_at' => now()])->save();\n }\n\n return $this;\n }", "public function set_message_read() {\n $token = $this->input->get_post('token');\n $message_id = $this->input->get_post('message_id');\n $message_type = $this->input->get_post('message_type');\n $user = $this->userlib->getUserProfile($token);\n \n $table = \"\";\n if ($message_type == \"0\") $table = \"\"; // To be updated\n if ($message_type == \"1\") $table = TABLE_USERS_NEW_JOBS;\n if ($message_type == \"2\") $table = TABLE_USERS_NEW_CANDIDATES;\n \n // Set the status of the message to 0 (read)\n $query = \"\n UPDATE \".$table.\"\n SET status = 0\n WHERE\n user_id = ?\n AND id = ?\n \";\n $data = array($user['id'], $message_id);\n $this->db->query($query, $data);\n \n $this->outputlib->output(STATUS_OK, '', array());\n }", "public function markAllAsRead()\n {\n if ( $this->hasError() ) return false;\n \n try {\n $this->user->unreadNotifications->markAsRead(); \n } catch ( \\Exception $e ) {\n $this->setError('Could not mark the users notifications as read.', 500);\n return false;\n }\n\n $this->setSuccess('Successfully marked the users notifications as read.', 200);\n \n return true;\n }", "protected function read()\n {\n return true;\n }", "public function read()\n {\n return ! ! $this->read_at;\n }", "public function mark_read($args)\n {\n // Security check\n if (!SecurityUtil::checkPermission('InterCom::', '::', ACCESS_READ)) {\n return LogUtil::registerPermissionError();;\n }\n\n if (!isset($args['msg_id']) || !is_numeric($args['msg_id'])) {\n return LogUtil::registerArgsError;\n }\n\n $args['msg_read'] = 1;\n DBUtil::updateObject($args, 'intercom', '', 'msg_id');\n return true;\n }", "public function read(): bool\n {\n return $this->isAllowed(self::READ);\n }", "public function markMessageReadByID($id) {\n $result = $this->sdb->query(\n 'update messages set read = TRUE where id = $1',\n array($id));\n }", "public function markAsRead($id) {\n $email = $this->find($id);\n if ($email) {\n $email->is_read = 1;\n return $email->save();\n }\n return false;\n }", "public function unread()\n {\n return $this->read_at === null;\n }", "public function setReadDataOnly($pValue = false) {\n\t\t$this->_readDataOnly = $pValue;\n\t}", "public function markAsRead(Request $request)\n {\n if($request->filled('notifId')){\n $notification = DatabaseNotification::find($request->notifId);\n if($notification){\n $notification->markAsRead();\n return response()->json('success', 200);\n }else{\n return response()->json('error', 200);\n }\n }else{\n return response()->json('error', 200);\n }\n }", "public function markAsRead(Request $request)\n {\n if($request->filled('notifId')){\n $notification = DatabaseNotification::find($request->notifId);\n if($notification){\n $notification->markAsRead();\n return response()->json('success', 200);\n }else{\n return response()->json('error', 200);\n }\n }else{\n return response()->json('error', 200);\n }\n }", "public function markAsReadByNotificationType($id)\n\t{\n\t}", "public function has_unread_restriction() {\n return false;\n }", "public function isReadProtected() {\n\t\treturn $this->getReadProtected();\n\t}", "function GST_setRead()\n\t{\n $this->GST_setClassDB();\n \n\t\t$query = $this->DB->query(\"UPDATE guestbook SET condition='READ' WHERE condition!='REPLIED' AND user_GUID='\".$this->user_GUID.\"'\");\n $query->run();\n \n\t\treturn $query->affected_rows;\n\t}", "protected function markRead($id, $userId, $isRead)\n {\n $this->db->createCommand()\n ->update($this->notificationsTable, [\n 'is_read' => $isRead,\n 'updated_at' => time()\n ], [\n 'user_id' => $userId,\n 'id' => $id\n ])\n ->execute();\n }", "public function markRead($messageId) {\n return $this->_post(\n $this->_serverPath['mark'],\n array(\n 'messages' => $messageId,\n 'read' => '1'\n )\n );\n\t}", "public function setUnread()\n {\n $this->read_at = NULL;\n $this->save();\n\n return $this;\n }", "public function read()\n {\n $this->seen();\n }", "public function mark_as_read($read_id){\n\n\t\t$this->query(\"UPDATE `messege` SET `view` = 1 WHERE `id` = '$read_id'\");\n\t}", "public function markAllRead($userId)\n {\n $this->db->createCommand()\n ->update($this->notificationsTable, [\n 'is_read' => 1\n ], [\n 'user_id' => $userId,\n 'is_read' => 0\n ])\n ->execute();\n }", "public function setUnread($toggle = true);", "public function hasReadReference(): bool\n {\n return $this->getPhanFlagsHasState(Flags::WAS_PROPERTY_READ);\n }", "public function read()\n {\n $ids = request()->get('ids');\n Auth::user()->notifications()->whereIn('id', $ids)->update(['is_seen' => true]);\n\n return $this->empty();\n }", "public function isUnread();", "function mark_read()\n {\n /* BENCHMARK */ $this->benchmark->mark('func_mark_read_start');\n\n $read=$this->get_input_vals();\n\n $this->message_model->save_read($read['uid'],$read['mid'],1);\n\n /* BENCHMARK */ $this->benchmark->mark('func_mark_read_end');\n\n // success\n exit();\n }", "function setDateRead($notificationId) {\n\t\t$returner = $this->update(\n\t\t\tsprintf('UPDATE notifications\n\t\t\t\tSET date_read = %s\n\t\t\t\tWHERE notification_id = ?',\n\t\t\t\t$this->datetimeToDB(date('Y-m-d H:i:s'))),\n\t\t\t(int) $notificationId\n\t\t);\n\n\t\treturn $returner;\n\t}", "public function markAsRead(Request $request)\n {\n $notification = DatabaseNotification::find($request->notificationID);\n $notification->markAsRead();\n return back()->with('toast_success' , 'Marked As Read');\n }", "public function markRead()\n\t{\n\t\tif(Request::ajax())\n\t\t{\n\t\t\t$ids = Input::get('_ids');\n\t\t\t$user = UserController::getUser(Auth::user());\n\n\t\t\tforeach ($ids as $value)\n\t\t\t{\n\t\t\t\t$message = $user->messages()->find($value);\n\t\t\t\t\n\t\t\t\tif($message->read === false)\n\t\t\t\t{\n\t\t\t\t\t$message->read = true;\n\t\t\t\t\t$message->save();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} \n\t\t\t\n\t\t\treturn Response::json(\"00\");\n\t\t}\n\t}", "function markAllUserNotificationsAsRead( $userID ) {\n\tglobal $ftsdb;\n\n\t$result = $ftsdb->update( DBTABLEPREFIX . 'notifications',\n\t\tarray( 'read' => 1 ),\n\t\t\"user_id = :user_id\",\n\t\tarray(\n\t\t\t\":user_id\" => $userID,\n\t\t) );\n\n\treturn $result;\n}", "function read_set()\n\t{\n\t\tglobal $REQUEST;\n\t\tif (!$this->writeable)\n\t\t{\n\t\t\tpage_error('Read only attribute ' . $this->name);\n\t\t}\n\t\t$this->value = $REQUEST->read($this->id, $this->mandatory);\n\t\t\n\t\tUtilLogging::getInstance()->debug(\"read_set - Attribute: \". $this->id . \" - value set: \" . $this->value);\n\t}", "public function setReadOnly ()\n {\n $this->resetNeedsSaving();\n $this->readOnly = true;\n }", "public function isRead(){\n $read = VolumeRead::where('user_id', Auth()->user()->id)->where('volume_id', $this->id)->first();\n if($read){\n return true;\n }\n return false;\n }", "public function setReadPreference($read_preference, $tags = array());", "public function markAsRead() {\r\n $this->type = PRIVMSGS_READ_MAIL;\r\n $this->commit(); \r\n \r\n return $this;\r\n }", "function mark_unread()\n\t{\n\t\tif (!isset($this->get['m'])) {\n\t\t\theader('HTTP/1.0 404 Not Found');\n\t\t\treturn $this->message($this->lang->pm_personal_msging, $this->lang->pm_no_number);\n\t\t}\n\n\t\t$this->get['m'] = intval($this->get['m']);\n\n\t\t$this->db->query( 'UPDATE %ppmsystem SET pm_read=0 WHERE pm_id=%d AND pm_to=%d', $this->get['m'], $this->user['user_id'] );\n\n\t\treturn $this->message($this->lang->pm_personal_msging, $this->lang->pm_mark_unread);\n\t}", "public function markAsRead($notificationId)\n {\n $notification = $this->_notificationFactory->create();\n $notification->load($notificationId);\n if (!$notification->getId()) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__('Wrong notification ID specified.'));\n }\n $notification->setIsRead(1);\n $notification->save();\n }", "public function action_mark_as_read() {\n\t\tif($this->request->param('id')) {\n\t\t\t$id = $this->request->param('id');\n\t\t\t$message = ORM::factory('Message', $id);\n\t\t\t$message->read = 1;\n\t\t\ttry {\n\t\t\t\t$message->save();\n\t\t\t\t$this->_set_msg('Marked as Read', 'success', $message->as_array());\n\t\t\t} catch(Exception $e) {\n\t\t\t\t$this->_set_msg('Oops something went wrong failed to mark as read', 'error', TRUE);\n\t\t\t}\n\t\t\t//$this->redirect($this->request->referrer());\n\t\t} else if ($this->request->post() && $this->request->post('id')) {\n\t\t\t$id = $this->request->post('id');\n\t\t\t$message = ORM::factory('Message', $id);\n\t\t\t$message->read = 1;\n\t\t\ttry {\n\t\t\t\t$message->save();\n\t\t\t\t$this->_set_msg('Marked as Read', 'success', $message->as_array());\n\t\t\t} catch(Exception $e) {\n\t\t\t\t$this->_set_msg('Failed to mark as read', 'error', TRUE);\n\t\t\t}\n\t\t}\n\t}", "public function markMessageAsRead($mid) {\n\t\t$result=mysql_query(\"SELECT * FROM messages WHERE mid='$mid'\");\n\t\tif (mysql_num_rows($result) == 0)\n\t\t\treturn \"no such msg\";\n\t\t$result=mysql_query(\"UPDATE messages SET msgread=1 WHERE mid='$mid'\");\n\t\treturn $result;\n\t}", "public function setReadOnlyFlag($readOnly = true) {}", "function read_notifications($userID, $id){\n\t\t\t$query = \"update notifications set read_message = 'yes' where content = '$id' and user_id = '$userID'\";\n\t\t\t$this->db->query($query);\n\t\t}", "public function setConversationAsRead($user)\r\n {\r\n $queryBuilder = $this->entityManager->createQueryBuilder();\r\n $queryBuilder->update(\"YilinkerCoreBundle:Message\", \"m\")\r\n ->set(\"m.isSeen\", \":isSeen\")\r\n ->set(\"m.timeSeen\", \":timeSeen\")\r\n ->where(\"m.sender = :sender\")\r\n ->andWhere(\"m.recipient = :recipient\")\r\n ->andWhere(\"NOT m.isSeen = :isSeen\")\r\n ->setParameter(\":isSeen\", true)\r\n ->setParameter(\":timeSeen\", Carbon::now())\r\n ->setParameter(\":sender\", $user->getUserId())\r\n ->setParameter(\":recipient\", $this->authenticatedUser)\r\n ->getQuery()\r\n ->execute();\r\n\r\n $gcmData = array(\r\n \"isSuccessful\" => true,\r\n \"responseType\" => \"CONVERSATION_SEEN\",\r\n \"message\" => \"The messages is set to seen.\",\r\n \"data\" => array(\r\n \"userId\" => $user->getUserId(),\r\n \"recipientName\" => $this->authenticatedUser->getFullName(),\r\n )\r\n );\r\n\r\n $registrationIds = $this->entityManager\r\n ->getRepository(\"YilinkerCoreBundle:Device\")\r\n ->loadConversationRegistrationIds($this->authenticatedUser->getUserId(), $user->getUserId());\r\n\r\n $this->sendToGCM($gcmData, $registrationIds);\r\n\r\n try{\r\n $this->predisService->publishSeen($user, $this->authenticatedUser);\r\n }\r\n catch(Exception $e){\r\n }\r\n }", "public function markAsRead(Request $request, $conversation_id) {\n \t\\Chat::conversationRead($conversation_id, Auth::id());\n }", "public function markAsRead($userID)\n {\n if (!$this->old)\n {\n if (is_null($this->reader))\n {\n $this->readers()->attach($userID);\n }\n elseif ($this->updatedSince($this->reader))\n {\n $this->reader->touch();\n }\n }\n }", "public function readAll() {\n\n $id = Input::get('data_id');\n \n DB::table('user_notifications')\n ->where('user_id', Auth::user()->id)\n ->update(array('read' => 1));\n }", "public function markasread()\n { \n if(Session::has('prac_id'))\n {\n $viewer = Practitioner::find(Session::get('prac_id'));\n }\n elseif(Auth::check())\n {\n $viewer = User::find(Auth::user()->id);\n }\n\n $messages = Message::GetMessageById(Input::get('conv_id'))->get();\n\n foreach($messages as $message)\n {\n if($message->receiver_email === $viewer->email)\n {\n if($message->status === 'unread')\n {\n $message->status = 'read';\n $message->save();\n }\n\n } \n }\n\n return $messages;\n }", "public function allowsRead()\n {\n if ($this->plus) {\n return true;\n }\n\n return $this->base == 'r';\n }", "public function action_mark_all_as_read() {\n\t\tif($this->request->param('id')) {\n\t\t\t$sender = ORM::factory(\"User\", $this->request->param('id'));\n\t\t\t$messages = ORM::factory('Message')->where(\"sender\", '=', $sender->id)->find_all();\n\t\t\tforeach ($messages as $message) {\n\t\t\t\t$model = ORM::factory('Message', $message->message_id);\n\t\t\t\ttry {\n\t\t\t\t\t$model->read = 1;\n\t\t\t\t\t$model->save();\n\t\t\t\t} catch(Exception $e) {\n\t\t\t\t\t$this->_set_msg('Failed to mark as read', 'error');\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_set_msg(\"All conversations with \" . $sender->personnel_info->personnel_name . ' were marked as Read',\n\t\t\t'success');\n\t\t\t$this->redirect($this->request->referrer());\n\t\t}\n\t}", "public function togglepmreadAction()\n\t{\n\t\t$messageId = $this->_request->getParam('messageId');\n\t\tif(empty($messageId)){\n\t\t\treturn null;\n\t\t}\n\n\t\t$messageTable = new PrivateMessage();\n\t\t$message = $messageTable->find($messageId)->current();\n\t\tif(empty($message)){\n\t\t\treturn null;\n\t\t}\n\n\t\tif(!$message->isReadableBy($this->_user, $this->_acl)){\n\t\t\treturn null;\n\t\t}\n\n\t\t$message->read = 1 - $message->read;\n\t\t$message->save(true);\n\n\t\tdie($message->read);\n\n\t}", "public function setAsRead($conv_ids)\n\t{\n\t\tMem::userDel(fsId(), 'msg-update');\n\n\t\treturn $this->update('UPDATE '.PREFIX.'foodsaver_has_conversation SET unread = 0 WHERE foodsaver_id = '.(int)fsId().' AND conversation_id IN('.implode(',', $conv_ids).')');\n\t}", "function updateTicketIsRead($readValue,$id)\n {\n $arrFields['is_read']=$readValue;\n DB::Update(CFG::$tblPrefix.\"ticket\",Stringd::processString($arrFields),\" id = %d \",$id);\n }", "public function isReadRelationship();", "public function setReadOnly($flag = true)\n {\n $this->readOnly = (boolean)$flag;\n }", "public function unread()\n {\n return $this->unseen();\n }", "public function onReading(){\n $read = VolumeRead::where('volume_id', Auth()->user()->last_volume)->where('user_id', Auth()->user()->id)->first();\n if(!$read){\n if(Auth()->user()->last_volume == $this->id){\n return true;\n }\n }\n return false;\n }", "public function unread()\n {\n return $this->state(fn (array $attributes) => [\n 'read_at' => null,\n ]);\n }", "public function Read()\n\t{\n\t\treturn $this->OnRead();\n\t}", "protected function assign($read, $write = null)\n {\n // Ensure there's data\n if (empty($read))\n {\n return false;\n }\n \n $_write = ($write == null) ? new Notification() : $write;\n $_write->id = $read['id'];\n $_write->image = ($read['image_id'] > 0) ? new Image($read['image_id']) : new Image();\n $_write->userTo = ($read['user_to_id'] > 0) ? new User($read['user_to_id']) : new User();\n $_write->userFrom = new User($read['user_from_id']);\n $_write->comment = $read['comment'];\n $_write->date = $read['date'];\n $_write->time = $read['time'];\n $_write->type = $read['type'];\n $_write->status = $read['status'];\n $_write->deleted = $read['deleted'];\n \n return $_write;\n }", "public function isReadOnly ()\n {\n return $this->readOnly;\n }", "public function setReadOnly($readOnly)\n {\n $this->readOnly = (boolean) $readOnly;\n }", "public function setCanRead($canRead)\n {\n $this->canRead = $canRead;\n return $this;\n }", "public function setReadOnly($readOnly) {\n\t\t\tif (is_bool($readOnly)) {\n\t\t\t\t$this->_readOnly = $readOnly;\n\t\t\t}\n\t\t}", "public function setReadOnly($flag)\n\t{\n\t\t$this->_readOnly = (bool) $flag;\n\t}", "public function setReadOnly($flag);", "public function mark_read_by_user($userid)\n\t{\n\t\t$query = $this->db\n\t\t\t\t\t\t->set('is_read', 1)\n\t\t\t\t\t\t->where('user_id', $userid)\n\t\t\t\t\t\t->update('notif_rcpts');\n\n\t\tif($query)\n\t\t{\n\t\t\t$result['status'] = true;\n\t\t\t$result['data'] = \"Marked as read.\";\n\n\t\t\treturn $result;\n\t\t}\n\t\telse return $this->get_db_error();\n\t}" ]
[ "0.74566734", "0.7343013", "0.7148123", "0.69664603", "0.6889458", "0.6863738", "0.68222976", "0.6744735", "0.6719493", "0.66722655", "0.6579511", "0.65353376", "0.64625823", "0.6426486", "0.6418967", "0.6410899", "0.63930506", "0.6361774", "0.63539225", "0.6335364", "0.63115615", "0.62843716", "0.6257449", "0.6200539", "0.61975545", "0.618132", "0.6162263", "0.6160316", "0.61487633", "0.6143876", "0.60813534", "0.6070944", "0.6067341", "0.60639685", "0.6037263", "0.60288787", "0.6022765", "0.6020995", "0.6015153", "0.599383", "0.5982522", "0.59672743", "0.5962955", "0.5943434", "0.5942241", "0.5942241", "0.5897438", "0.5857697", "0.5839324", "0.5823194", "0.57594764", "0.5754016", "0.5741677", "0.57281846", "0.5723654", "0.57207924", "0.5714163", "0.5703666", "0.5699308", "0.56807804", "0.5675609", "0.56669587", "0.56603295", "0.5648388", "0.56164175", "0.5612269", "0.5610543", "0.55957633", "0.5580393", "0.5565341", "0.5563295", "0.5562605", "0.5527688", "0.55268365", "0.5504614", "0.54811186", "0.54737884", "0.5463157", "0.5445982", "0.5440079", "0.543821", "0.5422121", "0.5415586", "0.5409832", "0.5405001", "0.54031235", "0.5399115", "0.537968", "0.53785276", "0.53784186", "0.53778666", "0.5375109", "0.53707165", "0.53618187", "0.5358417", "0.5353735", "0.53366876", "0.5331106", "0.53199786", "0.5308537" ]
0.73228997
2
check if this table is already being processed, and if not, lock it
public function start($exit_when_running = true, $stuck_threshold = 20) { echo $this->_nl, "checking lock on $this->_dbtype $this->_object. at " . date('Y/m/d H:i:s', time()), $this->_nl; try { $q = $this->_conn->prepare("select in_process, case when start_time > finish_time and datediff(minute, start_time, getdate()) > {$stuck_threshold} then 1 else 0 end as is_stuck from sandbox.dbo.daemon where object = :object and dbtype = :dbtype"); $q->bindParam(':object', $this->_object); $q->bindParam(':dbtype', $this->_dbtype); $q->execute(); $rs = $q->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { echo 'ERROR: ' , $e->getMessage(), $this->_nl; if ($exit_when_running) die(); else return false; } // if no daemon entry for this queue, create one $currently_running = $is_stuck = false; if (empty($rs)) $this->create(); else $currently_running = (bool) $rs[0]['in_process']; $is_stuck = $rs[0]['is_stuck']; if ($is_stuck) { echo "$this->_dbtype $this->_object is stuck.", $this->_nl, $this->_nl; @mail('[email protected]', "$this->_dbtype $this->_object is stuck", ''); } if ($currently_running) { // do I want to just exit here? or is there something a script would have to do regardless of whether the queue is locked echo "$this->_dbtype $this->_object is currently running: locked.", $this->_nl, $this->_nl; if ($exit_when_running) die(); else return false; } $this->set_process_state(true); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function lock()\n {\n $sql = \"LOCK TABLE $this->_table_name WRITE\";\n try {\n $this->_db->exec($sql);\n } catch ( PDOException $e ) {\n if ( !strpos($e->getMessage(), 'syntax error') )\n throw $e;\n // no lock support, continue\n }\n }", "public function lockTable($table)\n {\n try{\n $this->stmt = $this->db->prepare(\"LOCK TABLES `{$table}`\");\n $this->stmt->execute();\n return true;\n } \n \n catch (PDOException $e)\n {\n $this->error = $e->getMessage(); \n return false;\n }\n }", "protected function lockRecord()\n\t{\n\t\t//\tignore locking\n\t\treturn true;\n\t}", "public static function lockTable(){\n\t\t$statement = App::getDBO()->prepare('LOCK TABLES USERS WRITE');\n\t\t App::getDBO()->query();\n\t}", "protected function updateLock() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n $my_process = $this->getProcessInfo();\n $my_pid = $my_process['pid'];\n\n if (!is_numeric($my_pid)) {\n $my_pid = 'null';\n }\n\n $db->beginTransaction();\n\n $stmt = \"SELECT \".$this->_dblp.\"value, \".$this->_dblp.\"pid FROM \".$this->_dbtp.\"locks \".\n \"WHERE \".$this->_dblp.\"name=?\";\n \n try {\n $res = $db->fetchRow($stmt, $this->_lock, Zend_Db::FETCH_ASSOC);\n \n $pid = $res[$this->_dblp.'pid'];\n $lock_value = $res[$this->_dblp.'value'];\n $acquire_lock = true;\n $log->debug(\n \"Queue got lockValue=\".$lock_value.\", pid=\".$pid.\" with \".$stmt.\" and \".print_r($res, true)\n );\n \n if ($lock_value != -1 && (!empty($pid)) && is_numeric($pid)) {\n // check if process is still running or if this is an invalid lock\n $psinfo = $this->getProcessInfo($pid);\n $log->debug(\"checking for lock on lock \".$pid);\n $log->debug(array(\"psinfo\",$psinfo));\n if (!empty($psinfo)) {\n // override existing lock\n $acquire_lock = false;\n $log->debug(\"overriding existing lock \".$psinfo);\n }\n }\n \n // worst case: a background process is started, but the queue already\n // empty at this point\n if ($acquire_lock) {\n $sql = \"UPDATE \".$this->_dbtp.\"locks SET \".$this->_dblp.\"pid=? \".\n \"WHERE \".$this->_dblp.\"name=?\"; \n $db->query($sql, array($my_pid, $this->_lock));\n $db->commit();\n } else {\n return false;\n }\n }\n catch(Exception $ex) {\n $db->rollBack(); \n $log->err($ex);\n return false;\n }\n return true;\n }", "function _lock_tree_table()\n\t{\n\t\tee()->db->query(\"LOCK TABLE \" .$this->tree_table . \" WRITE\");\n\t}", "private function is_locked(){\n\t\t//return $batch_txt_file_object->exists();\n\t\treturn \"no\";\n\t\t\n\t}", "public function isLocked()\n {\n return $this->conn->exists('lock:' . $this->name);\n }", "function lock($table, $mode=\"write\")\n\t{\n\t\t/* connect first */\n\t\tif ($this->connect('w')==DB_SUCCESS)\n\t\t{\n\t\t\t/* lock */\n\t\t\t$query = \"LOCK TABLES $table $mode\";\n\n\t\t\tif (atkconfig(\"debug\")>=0)\n\t\t\t{\n\t\t\t\tatkimport(\"atk.utils.atkdebugger\");\n\t\t\t\tatkDebugger::addQuery($query);\n\t\t\t}\n\n\t\t\t$result = $this->_query($query, true);\n\t\t\tif (!$result) $this->halt(\"$mode lock on $table failed.\");\n\n\t\t\t/* return result */\n\t\t\treturn $result;\n\t\t}\n\t\treturn 0;\n\t}", "public function isLocked() {}", "public function lockJob() {\n \t\t//structure id,jobId,serverId (job id is unique entry)\n\n \t}", "function lock($table, $mode=\"write\") {\r\n\t\t$query=new query($this, \"lock tables $table $mode\");\r\n\t\t$result=$query->result;\r\n\t\treturn $result;\r\n\t}", "public function transaction_start() {\r\n if (!isset($this->handle)) {\r\n $this->handle = $this->_open();\r\n return flock($this->handle, LOCK_EX); // exclusive lock\r\n }\r\n return false;\r\n }", "public function trylock() {}", "public function lock() {}", "public function is_locked(): bool {\n\t\t// TODO: Implement this.\n\t\treturn true;\n\t}", "public function stream_lock($operation) {\n return FALSE;\n }", "public function lock()\n {\n $this->locked = true;\n }", "function lock($table, $mode=\"write\") \n \t{\n \t\t$res = @mysql_query(\"lock tables $table $mode\", $this->Link_ID);\n \t\t\n \t\tif (!$res)\n \t\t\tnew CException(sprintf(\"lock('%s', '%s') zawi�d�\", $table, $mode), __FILE__, __LINE__);\n \t\t\n \t\treturn $res;\n \t}", "public function isLocked();", "public function isLocked();", "public function isLocked();", "protected function lockingEnabled()\n {\n return $this->lock === null ? true : $this->lock;\n }", "function lock() {\n global $_Query_lock_depth;\n if ($_Query_lock_depth < 0) {\n Fatal::internalError('Negative lock depth');\n }\n if ($_Query_lock_depth == 0) {\n $row = $this->select1($this->mkSQL('select get_lock(%Q, %N) as locked',\n OBIB_LOCK_NAME, OBIB_LOCK_TIMEOUT));\n if (!isset($row['locked']) or $row['locked'] != 1) {\n Fatal::cantLock();\n }\n }\n $_Query_lock_depth++;\n }", "public function lock()\n {\n $this->isLocked = true;\n }", "function cacheObjectLocked ()\n {\n return is_file($this->cacheObjectId.'.lock');\n }", "public function get_lock($table_name, $record_id);", "public function lock()\n {\n $this->lock = true;\n }", "private function lockConcurrentExecution()\n\t{\n\t\t$tag = $this->getLockTag();\n\t\t$app = \\Bitrix\\Main\\Application::getInstance();\n\t\t$managedCache = $app->getManagedCache();\n\t\t$managedCache->clean($tag);\n\t\t$managedCache->read(self::LOCK_TTL, $tag);\n\t\t$managedCache->setImmediate($tag, true);\n\t}", "function lock_table($table_name, $alias = null) {\r\n\t\treturn;\r\n\r\n\t\t$sql = \"LOCK TABLES $table_name\";\r\n\r\n\t\tif (isset($alias)) {\r\n\t\t\t$sql .= \" AS $alias\";\r\n\t\t}\r\n\r\n\t\t$sql .= \" WRITE\";\r\n\r\n\t\treturn $this->query($sql);\r\n\r\n\t}", "static public function lockTable( $table )\n\t{\n\t\t$lock = \"LOCK TABLES \".Utilities::sqlBackquotes( $table ).\" WRITE\\n\";\n\t\t\n\t\treturn $lock;\n\t}", "public function lock()\n {\n if ( !($this->_state & self::LOADED) ) {\n $this->_memManager->load($this, $this->_id);\n $this->_state |= self::LOADED;\n }\n\n $this->_state |= self::LOCKED;\n\n /**\n * @todo\n * It's possible to set \"value\" container attribute to avoid modification tracing, while it's locked\n * Check, if it's more effective\n */\n }", "protected function hashLockClause() {}", "public function triggerUpdate() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n if (!$this->_use_locking) {\n $log->debug(\"not using locking - starting background process directly\");\n $this->process();\n return;\n }\n \n /**\n * CHECK PROCESS MUTEX\n * 1. Check lock state\n * 2. If locked, check if process is running\n * 3. If process if running: commit/end transaction\n * 4. If process is not running: clean lock\n * 5. Acquire lock\n * 6. Run process\n */\n // Start a transaction explicitly.\n $db->beginTransaction();\n\n $sql = \"SELECT \".$this->_dblp.\"value, \".$this->_dblp.\"pid FROM \".$this->_dbtp.\"locks \".\n \"WHERE \".$this->_dblp.\"name=?\";\n \n try {\n $res = $db->fetchRow($sql, $this->_lock, Zend_Db::FETCH_ASSOC);\n \n $pid = $res[$this->_dblp.'pid'];\n $lock_value = $res[$this->_dblp.'value'];\n $acquire_lock = true;\n $log->debug(\n \"Queue::triggerUpdate got lockValue=\".$lock_value.\", pid=\".$pid.\n \" with \".$sql.\" and \".print_r($res, true)\n );\n\n if ($lock_value > 0 && !empty($pid) && is_numeric($pid)) { \n // check if process is still running or if this is an invalid lock\n $psinfo = $this->getProcessInfo($pid);\n $log->debug(array(\"psinfo\",$psinfo));\n\n if (!empty($psinfo)) {\n // override existing lock\n $acquire_lock = false;\n $log->debug(\"overriding existing lock \".$psinfo);\n }\n }\n \n // worst case: a background process is started, but the queue already\n // empty at this point (very fast indexer)\n if ($acquire_lock) {\n // acquired lock \n $sql = \"DELETE FROM \".$this->_dbtp.\"locks WHERE \".$this->_dblp.\"name=?\";\n $db->query($sql, $this->_lock);\n \n $invalid_pid = -2;\n $sql = \"INSERT INTO \".$this->_dbtp.\"locks (\".$this->_dblp.\"name,\".$this->_dblp.\"value,\".$this->_dblp.\"pid) \".\n \"VALUES (?,?,?)\";\n $db->query($sql, array($this->_lock, 1, $invalid_pid));\n // If all succeed, commit the transaction and all changes\n // are committed at once.\n $db->commit();\n $ok = true; \n } else {\n $db->rollBack();\n $ok = false;\n }\n } catch(Exception $ex) {\n $db->rollBack();\n $log->err($ex);\n $ok = false;\n }\n \n if (! $ok) {\n // setting lock failed because another process was faster\n $log->debug(\"Queue::triggerUpdate - lock value has been taken\");\n \n } else {\n // create new background update process\n $log->debug(\"Queue::triggerUpdate - created new background process!\");\n $this->process();\n }\n }", "public function lock(): void {}", "public function lock(): void {}", "public function lock(): void {}", "public function lock(): void {}", "public function lock(): void {}", "public function acquireSharedLock() {}", "public function lock(): void;", "function action_lock($dsn, $action, $stamp) {\n\t$db =& MDB2::factory($dsn);\n\t\n\tif (DB::isError($db)) {\n\t\tdie ($db->getMessage());\n\t}\n\n\t$sql = \"SELECT COUNT(*) FROM action_lock WHERE action='\".addslashes($action).\"' AND stamp='\".$stamp.\"' ;\";\n\tsyslog( LOG_INFO, $sql );\n\t$action_lock = $db->queryOne($sql);\n\tif ( $action_lock > 0 ) {\n\t\t\treturn false;\n\t} else {\n\t // Otherwise, insert.\n\t $sql = \"INSERT INTO action_lock ( action, stamp ) VALUES ( '\".addslashes($action).\"', '\".addslashes($stamp).\"' ); \";\n\t syslog( LOG_INFO, $sql );\n\t $result = $db->query($sql);\n\n\t return true;\n }\n\n}", "private function lock() {\n\t\tif (file_exists($this -> lockfile)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn file_put_contents($this -> lockfile, 'I am locked!') !== false;\n\t}", "public function isLocked()\n {\n if (0 === $this->getIndexerId()) {\n Mage::throwException('FastIndexer: IndexerId cannot be 0');\n }\n\n if (null !== $this->_isLocked) {\n return $this->_isLocked;\n }\n $shmId = @shmop_open($this->getIndexerId(), 'a', self::PERM, self::LEN);\n if (false === $shmId) {\n $this->_isLocked = false;\n return $this->_isLocked;\n }\n $size = shmop_size($shmId);\n $startTime = shmop_read($shmId, 0, $size);\n shmop_close($shmId);\n\n $this->_isLocked = $this->_isLockedByTtl((double)$startTime);\n return $this->_isLocked;\n }", "private function _acquireLock()\n {\n // set the correct path to the lock resource based on dir and file name.\n $lockResource = $this->_lockPath . \"/\" . self::PID_FILE_NAME;\n echo \"Acquiring exclusive lock $lockResource\\n\";\n\n // Check to see if lock file exists.\n if (file_exists($lockResource)) {\n // If the lock file exists and is not stale, the process is running,\n // leave the process and don't release current lock.\n if (!((filectime($lockResource) + self::PID_FILE_MAX_TIME) <= time())) {\n $this->leave(\n \"Error: database manager is either already running or it did \" .\n \"not exit cleanly during the previous run.\\nPID: $lockResource\\n\",\n false);\n }\n }\n\n // Touches the pid file in order to create it if it does not exist.\n return touch($lockResource);\n }", "public function set_lock($table_name, $record_id, $user_id);", "public static function checkLock()\n {\n $_lastExecutionTime = Mage::app()->loadCache(self::LOCK_CACHE_INDEX);\n if (self::HDU_LOCK_TIMEOUT > (time() - $_lastExecutionTime)) {\n return false;\n }\n Mage::app()->saveCache(time(), self::LOCK_CACHE_INDEX, array(), self::HDU_LOCK_TIMEOUT);\n return true;\n }", "public function run()\n {\n $config = $this->config;\n try {\n $this->getFluent()->getPdo()->beginTransaction();\n $this->tree->getFluent()->getPdo()->exec(\"LOCK TABLES $config[table] WRITE;\");\n $return = $this->doRun();\n $this->getFluent()->getPdo()->commit();\n $this->tree->getFluent()->getPdo()->query(\"UNLOCK TABLES;\");\n return $return;\n } catch (Exception $ex) {\n $this->getFluent()->getPdo()->rollBack();\n $this->tree->getFluent()->getPdo()->query(\"UNLOCK TABLES;\");\n throw $ex;\n }\n }", "public function isLocked($key)\n\t{\n\t\treturn $this->dbHandler->isLocked($key);\n\t}", "public function isLocked()\n {\n if ($this->_isLocked !== null) {\n return $this->_isLocked;\n }\n\n $fp = $this->_getLockFile();\n if (flock($fp, LOCK_EX | LOCK_NB)) {\n flock($fp, LOCK_UN);\n return false;\n }\n\n //if the lock exists and exists for longer then 5minutes then remove lock & return false\n if($this->_lockIsExpired()){\n $varDir = Mage::getConfig()->getVarDir('locks');\n $lockFile = $varDir . DS . 'buckaroo_process_' . $this->getId() . '.lock';\n unlink($lockFile);\n\n $this->_getLockFile();//create new lock file\n return false;\n }\n\n return true;\n }", "public function acquireExclusiveLock() {}", "abstract protected function lock(): void;", "public function wasLockTimeout() {\n\t\treturn false;\n\t}", "public function wasDeadlock() {\n\t\treturn false;\n\t}", "public function tree_lock() {\n global $db, $uid;\n\n if (($this->lock_user != false) && ($this->lock_user != $uid)) {\n // Baum ist bereits von einem anderen Benutzer gesperrt\n $lock_stamp = false;\n $this->error = \"ERR_ALREADY_LOCKED\";\n return false;\n } else if (($this->lock_user != false) && ($this->lock_user == $uid)) {\n // Eigene Sperre bereits aktiv\n $this->lock_stamp = time();\n $this->lock_expire = time() + 300;\n $result = $db->querynow(\"UPDATE `lock` SET STAMP_UPDATE='\".date('Y-m-d H:i:s', $this->lock_stamp).\"',\n STAMP_EXPIRE='\".date('Y-m-d H:i:s', $this->lock_expire).\"'\n WHERE FK_USER=\".$uid.\" AND IDENT='\".$this->table.$this->root.\"'\");\n if (!$result['str_error']) {\n $this->lock_user = $uid;\n return true;\n } else {\n $this->error = \"ERR_LOCK_FAILED\";\n $this->lock_stamp = 0;\n $this->lock_expire = 0;\n $this->lock_user = false;\n return false;\n }\n } else {\n // Baum nicht gesperrt, Sperre hinzu\n $this->lock_stamp = time();\n $this->lock_expire = time() + 300;\n $result = $db->querynow(\"INSERT INTO `lock` (FK_USER, IDENT, STAMP_UPDATE, STAMP_EXPIRE) VALUES\n (\".$uid.\",'\".$this->table.$this->root.\"', '\".date('Y-m-d H:i:s', $this->lock_stamp).\"', '\".\n date('Y-m-d H:i:s', $this->lock_expire).\"')\");\n if (!$result['str_error']) {\n $this->lock_user = $uid;\n return true;\n } else {\n $this->error = \"ERR_LOCK_FAILED\";\n $this->lock_user = false;\n return false;\n }\n }\n }", "public function isLocked() {\n return $this->lock->get('enable', false);\n }", "protected function lock()\n {\n $this->isStateLocked = true;\n }", "public function _transaction_status_check()\n {\n if (!$this->_transaction_in_progress) {\n return;\n }\n $this->rollback();\n }", "public function lock()\n {\n $shmId = shmop_open($this->getIndexerId(), 'c', self::PERM, self::LEN);\n shmop_write($shmId, $this->_getMicrotimeString(), 0);\n shmop_close($shmId);\n $this->_isLocked = true;\n }", "public function sharedLock($sql){\n\t\treturn $sql;\n\t}", "public function isLocked()\n {\n return $this->lockFile->exists();\n }", "public function hasQuotaLock(){\n return $this->_has(11);\n }", "public function transaction_held() {\n\n\t\treturn false;\n\t}", "function getLock ($tablename)\n\t{\n\t\tignore_user_abort(true);\n\t\t$fp = fopen($this->datadir . $tablename.'.lock','w');\n\t\tif (!flock($fp, LOCK_EX)) {\n\t\t // log error?\n\t\t}\n\t\t$this->loadTable($tablename);\n\t\treturn $fp;\n\t}", "protected function _lock($key) {\n\t\treturn apc_add($key, 1);\n\t}", "public function lock()\n {\n if ($this->isLocked()) {\n throw new RuntimeException('Cannot lock: already locked');\n }\n\n $this->conn->set('lock:' . $this->name, $this->id);\n }", "public function lock($name) {\n\t\t\n\t\t/*$b = mysql_query('show tables');\n\t\t$d = '';\n\t\t$d .= 'LOCK TABLES';\n\t\twhile( $c = mysql_fetch_array($b) ) {\n\t\t\t$d .= '\n\t\t`'.$c[0].'` WRITE , ';\n\t\t}\n\t\t\n\t\t$d = rtrim($d,' , ').';';\n\t\t//if( $this->info['id'] == 12345 ) {\n\t\t\tif( $name == 'reflesh.useitems' || $name == 'reflesh-heal' ) {\n\t\t\t\tmysql_query($d);\n\t\t\t}\n\t\t//}*/\n\t}", "private function _isLocked(): bool {\n\t\t// Each server is responsible for keeping locks clean.\n\t\t// Allow a hook to enable inter-server connection, later\n\t\tif (!$this->isMyServer()) {\n\t\t\treturn $this->application->hooks->callArguments(__CLASS__ . '::server_is_locked', [\n\t\t\t\t$this->memberInteger('server'), $this->pid,\n\t\t\t], true);\n\t\t}\n\t\tif ($this->isMyPID()) {\n\t\t\t// My process, so it's not locked\n\t\t\treturn false;\n\t\t}\n\t\t// Is the process running?\n\t\tif ($this->application->process->alive($this->pid)) {\n\t\t\treturn true;\n\t\t}\n\t\t$this->application->logger->warning('Releasing lock from {server}:{pid} as process is dead', $this->members());\n\t\t$this->release();\n\t\treturn false;\n\t}", "private function isLocked() {\n return true === $this->status->is_locked;\n }", "public function lockToNormal() {}", "public function waitWithSingleTable($table)\n {\n $function = sprintf(\"queue_wait(%s)\", $this->getPDO()->quote($table));\n try {\n $this->executeFunction($function);\n } catch (Exception $e) {\n throw new Q4MException(sprintf(\"Failed to wait with single table. function=[%s]\", $function), 0, $e);\n }\n\n return $this->wait($table);\n }", "function lock()\n{\n}", "private function alreadyHaveLock($lockName){\n return array_search($lockName, $this->locks);\n }", "protected function ipLockClause() {}", "public function isLocked()\r\n {\r\n return $this->locked;\r\n }", "function lock( $table, $mode = \"write\" )\n {\n $query = \"lock tables \";\n if ( is_array( $table ) )\n {\n while ( list( $key, $value ) = each( $table ) )\n {\n // text keys are \"read\", \"read local\", \"write\", \"low priority write\"\n if ( is_int( $key ) ) $key = $mode;\n if ( strpos( $value, \",\" ) )\n {\n $query .= str_replace( \",\", \" $key, \", $value ) . \" $key, \";\n } else\n {\n $query .= \"$value $key, \";\n }\n }\n $query = substr( $query, 0, -2 );\n } elseif ( strpos( $table, \",\" ) )\n {\n $query .= str_replace( \",\", \" $mode, \", $table ) . \" $mode\";\n } else\n {\n $query .= \"$table $mode\";\n }\n if ( !$this->query( $query ) )\n {\n $this->halt( \"lock() failed.\" );\n return false;\n }\n $this->locked = true;\n return true;\n }", "public function getLockStatus() {\n\t\treturn $this->getDriver()->isAcquired();\n\t}", "public function hasLocktype(){\n return $this->_has(31);\n }", "public function isLock($string)\n {\n\t\treturn $this->db->fireFastSqlQuery(\"SELECT IS_FREE_LOCK('$string') 'LOCK'\",'isLock')->fetchObject()->LOCK;\n\t}", "public function isLocked()\n {\n return $this->locked;\n }", "public function lock()\n\t{\n\t\t$this->immutable = true;\n\t}", "public function trylock_read() {}", "public function lockShared($lock_waiting_option = null) {}", "public function getLockStatus() {}", "function lock($db, $id, $table='activity') {\n if ($id<0) return -1; # ignore 'new' entries.\n $q='UPDATE '.$table.' set editlock=datetime(\\'now\\',\\'+5 minutes\\') WHERE editlock < datetime(\\'now\\') AND id='.$id.';';\n if ($db->exec($q) == 1) return -1;\n\n $q='SELECT editlock from '.$table.' WHERE id='.$id.';';\n $res=$db->query($q);\n if (!$res) return 0; # XXX error\n $r=$res->fetch(PDO::FETCH_ASSOC);\n return $r['editlock'];\n }", "protected function get__locked()\n\t{\n\t\treturn NULL;\n\t}", "public function _lock_tables($tables) {\n // Must be overridden.\n }", "public function enableLocked()\n\t{\n\t\t$this->_locked = true;\n\t}", "public function isLocked() {\n return $this->getStatus() === Status::LOCKED;\n }", "public function ownsLock()\n {\n return $this->owner() === $this->id;\n }", "function _acquireLock ()\n {\n $this->_enterSection('_acquireLock');\n \n $a = strcspn ($this->_options['dsn'], ':');\n $proto = substr ($this->_options['dsn'], 0, $a);\n $path = substr ($this->_options['dsn'], $a + 3);\n\n if ($proto == 'file') {\n $f = sprintf($path, $this->_indexName);\n $this->_indexFileRes = fopen ($f,'w');\n flock ($this->_indexFileRes, LOCK_EX);\n }\n \n $this->_leaveSection('_acquireLock');\n }", "public function beginTransaction()\n{\n\treturn db2_autocommit($this->dbh, DB2_AUTOCOMMIT_OFF) && ($this->transaction = TRUE);\n}", "public function lockAndBlock()\n {\n $this->lock();\n }", "public function isLocked()\n\t{\n\t\treturn $this->blnLocked;\n\t}", "public function lockproc($key, $value)\n {\n if ($this->lockexp($key)) {\n return true;\n }\n\n $this->setlock($key, $value);\n\n return false;\n }", "function cera_grimlock_single() {\n\t\tdo_action( 'grimlock_single' );\n\t}", "public function isLocked()\n {\n return $this->_state & self::LOCKED;\n }", "private function check()\n {\n foreach ($this->scheduler->getQueuedJobs() as $job) {\n if ($job->isDue(new DateTime()) === true) {\n\n $this->executeIfNotOverlapped($job);\n }\n }\n }", "public function beginTaskUpdateAdTable() {\n\t\t$logAdTable = $this->getScrapeLog(JOB_AD_TABLE);\n\t\tif($this->updateDisabled($logAdTable) === true) {\n\t\t\tthrow new \\Exception(ERROR_UPDATE_IN_PROGRESS);\n\t\t}\n\t\texec(PHP_EXECUTE_FILE_PATH . \" \" . BASE_ABSOLUTE_PATH . FILE_PATH_TASK_UPDATE_ADS . \" > /dev/null &\");\n\t\tusleep(50000); // Minor MVC violation. Script is paused shortly to allow for tasks to begin so that when the page is reloaded we will be able to detect that the task is running.\n\t}", "public function in_transaction() {\r\n return isset($this->sem_id) && $this->sem_id;\r\n }", "protected function locking()\n {\n foreach ($this->all() as $name => $element) {\n $element->lock();\n }\n }" ]
[ "0.6794703", "0.66241926", "0.64189416", "0.63366914", "0.63359565", "0.6323825", "0.6266688", "0.6252063", "0.6148174", "0.6106333", "0.60411584", "0.59715223", "0.5956528", "0.5924201", "0.5917103", "0.5858529", "0.5838356", "0.5824012", "0.5810789", "0.58081585", "0.58081585", "0.58081585", "0.57541424", "0.5753376", "0.5752104", "0.5750719", "0.57433623", "0.5737526", "0.5726126", "0.5701835", "0.5690898", "0.5620398", "0.56125104", "0.5610085", "0.56003845", "0.56003845", "0.56003845", "0.56003845", "0.56003845", "0.55998296", "0.5599826", "0.55651045", "0.5556856", "0.55414426", "0.55369014", "0.5535617", "0.5535274", "0.55306685", "0.55218863", "0.5520887", "0.5518445", "0.5505415", "0.54777294", "0.54748267", "0.54565114", "0.54073447", "0.5400059", "0.5384143", "0.5381812", "0.53811085", "0.53660154", "0.53644246", "0.53480756", "0.5339312", "0.5324627", "0.53189474", "0.5312026", "0.53034097", "0.5298359", "0.52943903", "0.5293721", "0.5283384", "0.52808917", "0.52776474", "0.52672166", "0.52655566", "0.5262407", "0.5253475", "0.52421325", "0.5236356", "0.52360445", "0.5228829", "0.52286524", "0.5226661", "0.52210283", "0.52080965", "0.5196301", "0.51920027", "0.518147", "0.5162794", "0.5160676", "0.51474404", "0.51415503", "0.5136839", "0.5133735", "0.5128985", "0.5121091", "0.5104007", "0.509351", "0.5083475", "0.5083111" ]
0.0
-1
unlock table, processing is done
public function end() { $this->set_process_state(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function unlock()\n {\n $sql = \"UNLOCK TABLES\";\n try {\n $this->_db->exec($sql);\n } catch ( PDOException $e ) {\n if ( !strpos($e->getMessage(), 'syntax error') )\n throw $e;\n // no lock support, continue\n }\n }", "function unlock() {\r\n\t\t$query=new query($this, \"unlock tables\");\r\n\t\t$result=$query->result;\r\n\t\treturn $result;\r\n\t}", "function _unlock_tree_table()\n\t{\n\t\t$q = \"UNLOCK TABLES\";\n\t\tee()->db->query($q);\n\t}", "public static function unlockTables(){\n\t $statement = App::getDBO()->prepare('UNLOCK TABLES');\n\t\tApp::getDBO()->query();\n\t}", "function unlock()\n\t{\n\t\t/* connect first */\n\t\tif ($this->connect('w')==DB_SUCCESS)\n\t\t{\n\t\t\t/* unlock */\n\t\t\tatkdebug(\"unlock tables\");\n\t\t\t$result = $this->_query(\"UNLOCK TABLES\", true);\n\t\t\tif (!$result) $this->halt(\"unlock tables failed.\");\n\n\t\t\t/* return result */\n\t\t\treturn $result;\n\t\t}\n\t\treturn 0;\n\t}", "public function unlockTables(): void\n {\n $sql = 'unlock tables';\n\n $this->executeNone($sql);\n }", "public function writeunlock() {}", "public function unlock(): void;", "public function unlock(): void {}", "public function unlock(): void {}", "public function unlock(): void {}", "public function unlock(): void {}", "public function unlock(): void {}", "public function unlockTable($table)\n {\n try{\n $this->stmt = $this->db->prepare(\"UNLOCK TABLES `{$table}`\");\n $this->stmt->execute();\n return true;\n } \n \n catch (PDOException $e)\n {\n $this->error = $e->getMessage(); \n return false;\n }\n }", "function unlocktables(){\n // unlock previously locked tables in database\n $tquery = \"UNLOCK TABLES\";\n $mres = mysqli_query($this->dcon,$tquery);\n if (!$mres){\n $this->showerror(\"Could not unlock the tables in the database\");\n }\n \n return true;\n }", "public static function lockTable(){\n\t\t$statement = App::getDBO()->prepare('LOCK TABLES USERS WRITE');\n\t\t App::getDBO()->query();\n\t}", "public function _unlock_tables($tables) {\n // Must be overridden.\n }", "public function unlock() {\n }", "function _lock_tree_table()\n\t{\n\t\tee()->db->query(\"LOCK TABLE \" .$this->tree_table . \" WRITE\");\n\t}", "protected function unlockNewRecord()\n\t{\n\t\tif( $this->lockingObj )\n\t\t\t$this->lockingObj->UnlockRecord($this->tName, $this->keys , \"\");\n\t}", "protected function unlockOldRecord()\n\t{\n\t\tif( $this->lockingObj && $this->keysChanged )\n\t\t\t$this->lockingObj->UnlockRecord($this->tName, $this->oldKeys , \"\");\n\t}", "public function unlock()\r\n {\r\n frameEbbs::_()->getModule('backup')->unlock();\r\n }", "public function unlock_tables($settings) {\n if ($settings->filters['utils_lock_tables']) {\n $this->_unlock_tables();\n }\n }", "public function readunlock() {}", "public function unlock_tree()\n\t{\n\t\t$sql = \"UNLOCK TABLES\";\n\t\treturn $this->db->query($sql);\n\t}", "private function unlock() {\n\t\tif (file_exists($this -> lockfile)) {\n\t\t\tunlink($this -> lockfile);\n\t\t}\n\t}", "protected function releaseLock() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n $sql = \"DELETE FROM \".$this->_dbtp.\"locks WHERE \".$this->_dblp.\"name=?\";\n try {\n $db->query($sql, $this->_lock);\n }\n catch(Exception $ex) {\n $log->err($ex);\n $log->err(array(\"Queue releaseLock failed\", $res));\n } \n }", "protected function lock()\n {\n $sql = \"LOCK TABLE $this->_table_name WRITE\";\n try {\n $this->_db->exec($sql);\n } catch ( PDOException $e ) {\n if ( !strpos($e->getMessage(), 'syntax error') )\n throw $e;\n // no lock support, continue\n }\n }", "function unlock_sqlite3_access() {\n\tglobal $DB;\n\n\tsem_release($DB['SEM_ID']);\n}", "public function unlockTeam()\n\t\t{\n\t\t\t$lockedteam = array();\n\t\t\t$lockedteam['id'] = $this->team->id;\n\t\t\t$lockedteam['teamvalue'] = ($this->players[0]->playervalue)+($this->team->RR)*($this->team->RRcost)+($this->team->FF)*10000+($this->team->A_Coach)*10000+($this->team->CheerLeader)*10000+($this->team->Apoth)*50000;\n\t\t\t$lockedteam['locked'] = 0;\n\t\t\t$table = $this->getTable('Teams','BloodBowlTable');\n\t\t\treturn $table->updTeam($lockedteam);\n\t\t\t//return true;\n\t\t}", "private function unlockByIdUser($data)\n {\n $sql = \"DELETE FROM {$this->config->dbTablePrefix}keyword_lock\n WHERE `by_id_user`={$data['id_user']}\";\n\n $this->model->dba->query($sql); \n }", "public function release() {\n $this->locked = 0;\n $this->save();\n }", "public function release() {\n $this->locked = 0;\n $this->save();\n }", "protected function _unlock($key) {\n\t\treturn apc_delete($key);\n\t}", "abstract protected function releaseLock($name);", "public function unlock($key=null,$value=null){\n return $this->methodsData(\"unlock\",$key,$value);\n }", "function lock_release($name) {\n global $locks;\n\n unset($locks[$name]);\n db_delete('semaphore')\n ->condition('name', $name)\n ->condition('value', _lock_id())\n ->execute();\n}", "function lock($table, $mode=\"write\") \n \t{\n \t\t$res = @mysql_query(\"lock tables $table $mode\", $this->Link_ID);\n \t\t\n \t\tif (!$res)\n \t\t\tnew CException(sprintf(\"lock('%s', '%s') zawi�d�\", $table, $mode), __FILE__, __LINE__);\n \t\t\n \t\treturn $res;\n \t}", "public function tree_unlock() {\n global $db, $uid;\n\n if (($this->lock_user != false) && ($this->lock_user != $uid)) {\n // Ein anderer User hat den Baum gesperrt\n $this->error = \"ERR_ALREADY_LOCKED\";\n $this->reload = true;\n return false;\n } else if ($this->lock_user == $uid) {\n // Eigene Sperre, entfernen\n $this->lock_user = false;\n $db->querynow(\"DELETE FROM `lock` WHERE FK_USER=\".$uid.\" AND IDENT='\".$this->table.$this->root.\"'\");\n return true;\n }\n // Baum ist nicht gesperrt\n return true;\n }", "public function unlockTables()\n\t{\n\t\treturn $this;\n\t}", "public function unlockTables()\n\t{\n\t\treturn $this;\n\t}", "public function unlock(&$prevcount = 0) {}", "function lock($table, $mode=\"write\") {\r\n\t\t$query=new query($this, \"lock tables $table $mode\");\r\n\t\t$result=$query->result;\r\n\t\treturn $result;\r\n\t}", "function lock_table($table_name, $alias = null) {\r\n\t\treturn;\r\n\r\n\t\t$sql = \"LOCK TABLES $table_name\";\r\n\r\n\t\tif (isset($alias)) {\r\n\t\t\t$sql .= \" AS $alias\";\r\n\t\t}\r\n\r\n\t\t$sql .= \" WRITE\";\r\n\r\n\t\treturn $this->query($sql);\r\n\r\n\t}", "public function unlockAction()\r\n {\r\n $timesheet = $this->byId();\r\n $this->projectService->unlockTimesheet($timesheet);\r\n $this->redirect('timesheet', 'edit', array('clientid'=>$timesheet->clientid, 'projectid'=>$timesheet->projectid, 'id'=>$timesheet->id));\r\n }", "public function unlock(string $name): void;", "function lock_release_all($lock_id = NULL) {\n global $locks;\n\n $locks = array();\n if (empty($lock_id)) {\n $lock_id = _lock_id();\n }\n db_delete('semaphore')\n ->condition('value', $lock_id)\n ->execute();\n}", "private function unlockConcurrentExecution()\n\t{\n\t\t$app = \\Bitrix\\Main\\Application::getInstance();\n\t\t$managedCache = $app->getManagedCache();\n\t\t$managedCache->clean($this->getLockTag());\n\t}", "protected function RemoveLock()\n {\n if (false === isset($_SERVER['HTTP_REFERER']) || empty($_SERVER['HTTP_REFERER'])) {\n return;\n }\n $sReferer = $_SERVER['HTTP_REFERER'];\n if (false === stristr($sReferer, 'pagedef=tableeditor')) {\n return;\n }\n $aURLParts = parse_url($sReferer);\n if (false === isset($aURLParts['query']) || empty($aURLParts['query'])) {\n return;\n }\n $sLastOpenRecordID = null;\n $sLastOpenTableID = null;\n\n $aParams = explode('&', $aURLParts['query']);\n foreach ($aParams as $sParam) {\n if ('id=' === substr($sParam, 0, 3)) {\n $sLastOpenRecordID = substr($sParam, 3);\n } elseif ('tableid=' === substr($sParam, 0, 8)) {\n $sLastOpenTableID = substr($sParam, 8);\n }\n }\n\n if (null === $sLastOpenRecordID || null === $sLastOpenTableID) {\n return;\n }\n $oTableEditor = new TCMSTableEditorManager();\n if ($oTableEditor->Init($sLastOpenTableID, $sLastOpenRecordID)) {\n $oTableEditor->RemoveLock();\n }\n }", "public function releaseAll($lockId = NULL);", "protected function hashLockClause() {}", "function recursiveLockUnlock($lock_id,$action) {\n\t\t$query=\"SELECT vers_id, vers_comp_id, vers_type FROM (SELECT *, MAX(vers_repo_vers) FROM(SELECT * FROM versions WHERE vers_parent=\".$lock_id.\" ORDER BY vers_repo_vers DESC) AS c GROUP BY c.vers_comp_id ORDER BY vers_type, vers_name) AS a WHERE a.vers_type='file' OR a.vers_type='dir'\";\n\t\t$result=mysql_query($query) or die(mysql_error());\n\t\t$temp=lock_convert($result);\n\t\t$len=sizeof($temp);\n\t\tfor($i=0; $i<$len; $i++) {\n\t\t\tif($temp[$i][\"vers_type\"]==\"file\") {\n\t\t\t\t$query=\"SELECT vers_id FROM versions WHERE vers_comp_id=\".$temp[$i][\"vers_comp_id\"].\" AND vers_type='file'\";\n\t\t\t\t$result=mysql_query($query) or die(mysql_error());\n\t\t\t\t$arr=lock_convert($result);\n\t\t\t\t$len2=sizeof($arr);\n\t\t\t\tfor($j=0; $j<$len2; $j++) {\n\t\t\t\t\tif(!$j) {\n\t\t\t\t\t\tlockUnlock($arr[$j][\"vers_id\"],$action,true);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tlockUnlock($arr[$j][\"vers_id\"],$action,false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlockUnlockDir($temp[$i][\"vers_id\"],$action);\n\t\t\t\trecursiveLockUnlock($temp[$i][\"vers_id\"],$action);\n\t\t\t}\n\t\t}\n\t}", "public function unlock($all = false) {}", "function __destruct() {\n\t\tif (count($this->locks) > 0) {\n\t\t\tif (DEBUG > 0) {\n\t\t\t\tforeach ($this->locks as $id=>$fp) {\n\t\t\t\t\t$this->unlock($id);\n\t\t\t\t}\n\t\t\t\twriteLog(\"these locks have not been unlocked:\".print_r($this->locks, true),KATA_ERROR);\n\t\t\t}\n\t\t}\n\t}", "static function unlock_account() {\n $model = \\Auth::$model;\n\n # hash GET param exists\n if ($hash = data('hash')) {\n\n # verificando se ha algum usuário com a hash.\n $user = $model::first(array(\n 'fields' => 'id, hash_unlock_account',\n 'where' => \"hash_unlock_account = '$hash'\"\n ));\n\n if (!empty($user)) {\n $user->hash_unlock_account = '';\n $user->login_attempts = 0;\n\n $user->edit() ?\n flash('Sua conta foi desbloqueada.') :\n flash('Algo ocorreu errado. Tente novamente mais tarte.', 'error');\n }\n }\n\n go('/');\n }", "public function releaseLocks()\n {\n foreach ($this->lockedKeys as $key => $value) {\n self::appRelease($key);\n }\n }", "public function testLockReleaseFailsNotLockedAnymore() {\n\n\t\t\t$lockName = uniqid();\n\n\t\t\tSharedLock::lock($lockName, 0, 10);\n\n\t\t\t// simulate that the database lock was not hold\n\t\t\tif ($this->sqlExecute('DELETE FROM ' . SharedLock::getTable() . ' WHERE name = :name', [':name' => $lockName])->rowCount() != 1) {\n\t\t\t\t$this->fail('Test-Scenario-Error: Simulating lock deleted failed');\n\t\t\t}\n\n\t\t\t$this->setExpectedException(SharedLockReleaseException::class);\n\n\t\t\tSharedLock::unlock($lockName);\n\t\t}", "function Unlock($UserID)\n\t{\n\t\tj::SQL(\"UPDATE jfp_xuser SET LockTimeout=? , FailedLoginAttempts=0 WHERE ID=? LIMIT 1\",time(),$UserID);\n\t}", "function lock($table, $mode=\"write\")\n\t{\n\t\t/* connect first */\n\t\tif ($this->connect('w')==DB_SUCCESS)\n\t\t{\n\t\t\t/* lock */\n\t\t\t$query = \"LOCK TABLES $table $mode\";\n\n\t\t\tif (atkconfig(\"debug\")>=0)\n\t\t\t{\n\t\t\t\tatkimport(\"atk.utils.atkdebugger\");\n\t\t\t\tatkDebugger::addQuery($query);\n\t\t\t}\n\n\t\t\t$result = $this->_query($query, true);\n\t\t\tif (!$result) $this->halt(\"$mode lock on $table failed.\");\n\n\t\t\t/* return result */\n\t\t\treturn $result;\n\t\t}\n\t\treturn 0;\n\t}", "function _update_locked () {\n\t\t\n\t\t// How old do locks have to be to get unlocked?\n\t\t$minutes = 10;\n\t\t\n\t\t$time = gmdate(\"Y-m-d H:i:s\", (time() - ($minutes * 60)));\n\t\t\n\t\t$q = $this->db->query(\"UPDATE commentreports\n\t\t\t\t\t\tSET \tlocked = NULL,\n\t\t\t\t\t\t\t\tlockedby = 0\n\t\t\t\t\t\tWHERE\tlocked < '$time'\n\t\t\t\t\t\t\");\n\t\n\t}", "public function unlockCommand() {\n\t\tif (@is_file((PATH_typo3conf . 'LOCK_BACKEND'))) {\n\t\t\tunlink(PATH_typo3conf . 'LOCK_BACKEND');\n\t\t\tif (@is_file((PATH_typo3conf . 'LOCK_BACKEND'))) {\n\t\t\t\t$message = 'ERROR: Could not remove lock file \\'typo3conf/LOCK_BACKEND\\'!';\n\t\t\t\t$this->outputLine($message);\n\t\t\t\t$this->logger->error($message);\n\t\t\t\t$this->quit(1);\n\t\t\t} else {\n\t\t\t\t$message = 'Removed lock file \\'typo3conf/LOCK_BACKEND\\'';\n\t\t\t\t$this->outputLine($message);\n\t\t\t\t$this->logger->info($message);\n\t\t\t}\n\t\t} else {\n\t\t\t$message = 'No lock file \\'typo3conf/LOCK_BACKEND\\' was found, hence no lock could be removed.';\n\t\t\t$this->outputLine($message);\n\t\t\t$this->logger->info($message);\n\t\t\t$this->quit(1);\n\t\t}\n\t}", "function unlockCacheObject ()\n {\n return unlink($this->cacheObjectId.'.lock');\n }", "public function testParallelUnlock(): void\n {\n $identifier1 = \\uniqid('lock_name_1_', true);\n $identifier2 = \\uniqid('lock_name_2_', true);\n\n $this->assertTrue($this->cacheInstance1->lock($identifier1, 30));\n $this->assertTrue($this->cacheInstance2->lock($identifier2, 30));\n\n $this->assertFalse($this->cacheInstance2->unlock($identifier1));\n $this->assertTrue($this->cacheInstance2->unlock($identifier2));\n\n $this->assertTrue($this->cacheInstance2->isLocked($identifier1));\n $this->assertFalse($this->cacheInstance2->isLocked($identifier2));\n }", "function fud_unlock($dir)\n{\n\t$dirs = array(realpath($dir));\n\n\twhile (list(,$v) = each($dirs)) {\n\t\tif (!($files = glob($v.'/{.b*,.h*,.p*,.n*,.m*,*}', GLOB_BRACE|GLOB_NOSORT))) {\n\t\t\tcontinue;\n\t\t}\n\t\tforeach ($files as $file) {\n\t\t\tif (is_dir($file) && !is_link($file)) {\n\t\t\t\t$perm = 0777;\n\t\t\t\t$dirs[] = $file;\n\t\t\t} else {\n\t\t\t\t$perm = 0666;\n\t\t\t}\n\t\t\tif (!chmod($file, $perm)) {\n\t\t\t\techo '<b>Could not unlock path \"'. $file .'\"<br />';\n\t\t\t}\n\t\t}\n\t}\n}", "private function deleteExpiredLocks()\n {\n $sql = \"DELETE FROM {$this->config->dbTablePrefix}keyword_lock\n WHERE\n `lock_time` < NOW()-3600\";\n\n $this->model->dba->query($sql); \n }", "public function __destruct()\n {\n if ($this->isLocked()) {\n $this->unlock();\n }\n }", "function revert_table() {\r\n $this->_table = $this->_table_org;\r\n $this->_table_org = NULL;\r\n }", "public function set_lock($table_name, $record_id, $user_id);", "public function lockUnspent(array $lock);", "public static function email_unlock_account() {\n\n if ($u = static::check_record_existence()) {\n\n # definindo conta como não confirmada.\n $u->hash_unlock_account = \\Security::random(32);\n if (!$u->edit())\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n\n $m = auth_model();\n if ($m::first(array('where' => 'id = \\'' . $u->id . '\\''))->emailUnlockAccount())\n flash('Email com as instruções para Desbloqueamento de conta enviado para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }", "public static function release_lock($lock_name)\n {\n }", "private function waitForUnlocking()\n\t{\n\t\t$times = self::LOCK_TTL;\n\t\t$i = 0;\n\t\twhile ($this->isExecutionLocked() && $i < $times)\n\t\t{\n\t\t\tsleep(1);\n\t\t\t$i++;\n\t\t}\n\t}", "function free_lock(string $key): void\n{\n $logger = \\Logger::getLogger(\"files.lock\");\n $lockfn = get_lock_filename($key);\n $logger->debug(\"Free lock '$key'\");\n if (!unlink($lockfn)) {\n $logger->error(\"Error unlocking $key\");\n }\n}", "public function _lock_tables($tables) {\n // Must be overridden.\n }", "private function rotate_log_table() {\n\t\t\tif( $this->calls > 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$random_val = rand(0,1000);\n\t\t\tif($random_val == 500){\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$lock = rand();\n\t\t\t\t$sql = $wpdb->prepare(\"INSERT IGNORE INTO {$wpdb->prefix}options SET `option_name` = 'error_log_delete_lock', `option_value` = '$lock', `autoload` = 'no'\");\n\t\t\t\tif($wpdb->query($sql)){\n\t\t\t\t\t$sql = $wpdb->prepare(\"SELECT option_value FROM {$wpdb->prefix}options where option_name='error_log_delete_lock'\");\n\t\t\t\t\t$results = $wpdb->$results($sql);\n\t\t\t\t\tif ($results['key'] == $lock) {\n \t\t\t\t\t\t$sql = $wpdb->prepare( \"DELETE FROM {$this->table_name} WHERE time_stamp < (CURDATE() - INTERVAL %d DAY)\", Error_Logging::KEEP_DAYS );\n\t\t\t\t\t\t$return = $wpdb->query( $sql );\n\t\t\t\t\t\t$sql = $wpdb->prepare(\"DELETE FROM {$wpdb->prefix}options WHERE option_name='error_log_delete_lock'\");\t\n\t\t\t\t\t\t$return = $wpdb->query( $sql );\n\t\t\t\t\t}else {\n\t\t\t \t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\treturn $return;\n\t\t\t\t}else{\n\t\t\t \t\treturn 0;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t \treturn 0;\n\t\t\t}\n\t\t}", "private function lock_cleanup() {\n\t\tif (\n\t\t\t$this->lock !== NULL\n\t\t\t&& $this->lock->is_expired()\n\t\t) {\n\t\t\t$this->lock = NULL;\n\t\t}\n\t\t$this->write();\n\t}", "function unlockAccount($userid){\n $query = \"UPDATE users_account SET status ='Active' WHERE userid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $userid\n );\n $this->db_handle->update($query, $paramType, $paramValue);\n }", "function lockout($username = \"\") {\n\t\tglobal $wpdb;\n\n\t\t$ip = $this->get_user_ip();;\n\n\t\t$username = sanitize_user($username);\n\n\t\t$user = get_user_by( 'login', $username );\n\n\t\tif ( !$user ) { \n\t\t\t$user = new stdClass();\n\t\t\t$user->ID = 0;\n\t\t}\n\n\t\t$sql = \"insert into \" . $this->lock_table . \" (user_id, lockdown_date, release_date, lockdown_IP) \" .\n\t\t\t \"values ('\" . $user->ID . \"', NOW(), date_add( NOW(), interval \" .\n\t\t\t $this->ll_options['lockout_length'] . \" MINUTE), '\" . $wpdb->escape($ip) . \"')\";\n\n\t\t$wpdb->query($sql);\n\n\t\tif ( 'yes' == $this->ll_options['notify_admins'] )\n\t\t\t$this->ll_notify_admins( $ip, $username );\n\n\t}", "public function unlockgroupAction()\n {\n \t//Don't display a new view\n \t$this->_helper->viewRenderer->setNoRender();\n \t//Don't use the default layout since this isn't a view call\n \t$this->_helper->layout->disableLayout();\n \n \t$group = GroupNamespace::getCurrentGroup();\n \t$date = $this->getRequest()->getParam('unlockuntildateinput');\n \t$zenddate = new Zend_Date($date, ACORNConstants::$ZEND_DATE_FORMAT);\n \t$date = $zenddate->toString(ACORNConstants::$ZEND_INTERNAL_DATE_FORMAT);\n \n \t$items = $group->getRecords();\n \t$success = UnlockedItemsDAO::getUnlockedItemsDAO()->unlockItems($items, $date);\n \t\n \tif ($success)\n \t{\n \t\t$group = GroupDAO::getGroupDAO()->getGroup($group->getPrimaryKey());\n \t\tGroupNamespace::setCurrentGroup($group);\n \t}\n \n \t$jsonstring = Zend_Json::encode(array('UnlockSuccessful' => $success));\n \t$this->getResponse()->setHeader('Content-Type', 'application/json')\n \t->setBody($jsonstring);\n }", "public function lockTable(string $schemaName, string $tableName): void\n {\n $sql = sprintf('lock tables `%s`.`%s` write', $schemaName, $tableName);\n\n $this->executeNone($sql);\n }", "public function run()\n {\n $config = $this->config;\n try {\n $this->getFluent()->getPdo()->beginTransaction();\n $this->tree->getFluent()->getPdo()->exec(\"LOCK TABLES $config[table] WRITE;\");\n $return = $this->doRun();\n $this->getFluent()->getPdo()->commit();\n $this->tree->getFluent()->getPdo()->query(\"UNLOCK TABLES;\");\n return $return;\n } catch (Exception $ex) {\n $this->getFluent()->getPdo()->rollBack();\n $this->tree->getFluent()->getPdo()->query(\"UNLOCK TABLES;\");\n throw $ex;\n }\n }", "public function lockTable($table)\n {\n try{\n $this->stmt = $this->db->prepare(\"LOCK TABLES `{$table}`\");\n $this->stmt->execute();\n return true;\n } \n \n catch (PDOException $e)\n {\n $this->error = $e->getMessage(); \n return false;\n }\n }", "function close() {\n if($this->locked) {\n foreach($this->users as $user => $pass) {\n if($this->cvs[$user]) {\n fputs($this->fplock, \"$user:$pass:\" . $this->cvs[$user] . \"\\n\");\n } else {\n fputs($this->fplock, \"$user:$pass\\n\");\n }\n }\n rename($this->lockfile, $this->filename);\n flock($this->fplock, LOCK_UN);\n $this->locked = false;\n fclose($this->fplock);\n }\n }", "protected function unlock_session() {\n \\core\\session\\manager::write_close();\n ignore_user_abort(true);\n }", "public function lock($name) {\n\t\t\n\t\t/*$b = mysql_query('show tables');\n\t\t$d = '';\n\t\t$d .= 'LOCK TABLES';\n\t\twhile( $c = mysql_fetch_array($b) ) {\n\t\t\t$d .= '\n\t\t`'.$c[0].'` WRITE , ';\n\t\t}\n\t\t\n\t\t$d = rtrim($d,' , ').';';\n\t\t//if( $this->info['id'] == 12345 ) {\n\t\t\tif( $name == 'reflesh.useitems' || $name == 'reflesh-heal' ) {\n\t\t\t\tmysql_query($d);\n\t\t\t}\n\t\t//}*/\n\t}", "public function clear_all_locks();", "public function lockToNormal() {}", "public function down()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{user_block}}\")){\n\t\t\t$this->dropTable(\"{{user_block}}\");\n\t\t}\n\n\t}", "private function releaseLockScript(): string\n {\n return <<<'LUA'\nif redis.call(\"get\",KEYS[1]) == ARGV[1] then\n return redis.call(\"del\",KEYS[1])\nelse\n return 0\nend\nLUA;\n }", "public function testParallelUnlockNoExpiration(): void\n {\n $identifier1 = \\uniqid('lock_name_1_', true);\n $identifier2 = \\uniqid('lock_name_2_', true);\n\n $this->assertTrue($this->cacheInstance1->lock($identifier1, -1));\n $this->assertTrue($this->cacheInstance2->lock($identifier2, -1));\n\n $this->assertFalse($this->cacheInstance2->unlock($identifier1));\n $this->assertTrue($this->cacheInstance2->unlock($identifier2));\n\n $this->assertTrue($this->cacheInstance2->isLocked($identifier1));\n $this->assertFalse($this->cacheInstance2->isLocked($identifier2));\n }", "protected function do_unlock($obj) {\n\t\t$this->debug(\"-- do_unlock($obj)\");\n\n\t\t$this->send(self::REQ_REL_LOCK, $obj);\n\n\t\tlist($op, $p) = $this->receive();\n\n\t\tif ($op != self::REP_LOCK_RELEASED) {\n\t\t\tthrow new LockException($this->decode_reply($op) . \": \" . $p);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function releaseLock($string)\n {\n\t\treturn $this->db->fireFastSqlQuery(\"SELECT RELEASE_LOCK('$string') 'LOCK'\",'releaseLock');\n\t}", "public function safeDown()\n {\n $this->dropTable($this->tableName);\n }", "protected function releaseLock($name)\n {\n return $this->db->useMaster(function ($db) use ($name) {\n /** @var \\yii\\db\\Connection $db */\n return (bool) $db->createCommand(\n 'SELECT RELEASE_LOCK(:name)',\n [':name' => $this->hashLockName($name)]\n )->queryScalar();\n });\n }", "protected function _unlock($lockFile = null)\n {\n if (!$lockFile) {\n $lockFile = $this->_getLockFile();\n }\n if (file_exists($lockFile)) {\n unlink($lockFile);\n }\n }", "public function unlock($id)\n {\n unlock($id);\n }", "private function _alter() {\n\t\t$queries = array();\n\t\t\n\t\t$queries[] = ('BEGIN TRANSACTION');\n\t\t$q = \"SELECT * FROM _ssm_backup\";\n\t\t$r = @sqlite_query($q, $this->_connection);\n\t\t\n\t\tif(!sqlite_last_error($this->_connection)) {\n\t\t\tsqlite_query(\"DROP TABLE _ssm_backup\", $this->_connection);\n\t\t}\n\t\t\n\t\t$export = new export('sql');\n\t\t\n\t\t@sqlite_query(\"CREATE TABLE _ssm_backup AS SELECT * FROM {$this->_name}\", $this->_connection);\n\t\t$t = new table(\"{$this->_db}:_ssm_backup\");\n\t\t\n\t\t$queries[] = \"DROP TABLE {$this->_name}\";\n\n\t\t$sql = $export->structTable($this);\n\t\t$queries[] = $sql;\n\t\t$insertQuery = $this->_alterBuildInsertQuery($t);\n\t\t$queries[] = $insertQuery;\n\t\t$queries[] = \"COMMIT TRANSACTION\";\n\t\t\n\t\t$ret = true;\n\n\t\tforeach($queries as $query) {\n\t\t\t@sqlite_query($query, $this->_connection);\n\t\t\tif(@sqlite_last_error($this->_connection)) {\n\t\t\t\t$ret = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t@sqlite_query(\"DROP TABLE _ssm_backup\", $this->_connection);\n\t\treturn $ret;\n\t}", "static public function lockTable( $table )\n\t{\n\t\t$lock = \"LOCK TABLES \".Utilities::sqlBackquotes( $table ).\" WRITE\\n\";\n\t\t\n\t\treturn $lock;\n\t}", "public function testLockReleaseFailsConnectionLoss() {\n\n\t\t\t$lockName = uniqid();\n\n\t\t\tSharedLock::lock($lockName, 0, 10);\n\n\t\t\t// simulate that the database lock was not hold\n\t\t\ttry {\n\t\t\t\t$this->sqlExecute('KILL connection_id()');\n\t\t\t}\n\t\t\tcatch (\\PDOException $ex) {\n\t\t\t\tif ($ex->getCode() != 70100)\n\t\t\t\t\tthrow $ex;\n\t\t\t}\n\n\t\t\t$this->setExpectedException(SharedLockReleaseException::class);\n\n\t\t\tSharedLock::unlock($lockName);\n\t\t}", "private function maintain()\n {\n $stmt = $this->db->prepare(\"DELETE FROM \".$this->dbname.\".users WHERE NOW() > (registratoinDate + INTERVAL \".$this->timeToVerify.\" MINUTE) and isVerified=FALSE\");\n $stmt->execute(); \n }", "public function walletlock()\n\t{\n\t\treturn $this->_get_error($this->connect('walletlock'));\n\t}" ]
[ "0.7918392", "0.7655057", "0.7612727", "0.7552042", "0.7232896", "0.7217439", "0.7050222", "0.69996095", "0.6981731", "0.6981731", "0.6981731", "0.6981731", "0.6981731", "0.6979487", "0.6890818", "0.6828629", "0.680204", "0.67444825", "0.6566899", "0.65466195", "0.6506707", "0.6498182", "0.6485646", "0.6442488", "0.64257675", "0.62677246", "0.625292", "0.61329466", "0.60986143", "0.6094151", "0.6029943", "0.5949992", "0.5949992", "0.58623534", "0.585928", "0.582704", "0.58247817", "0.5811517", "0.5804873", "0.5801749", "0.5801749", "0.5777307", "0.5741445", "0.57334524", "0.5717786", "0.5700565", "0.5689336", "0.568358", "0.5634111", "0.5628234", "0.5611084", "0.5610164", "0.55717623", "0.556521", "0.5543437", "0.5540264", "0.5533411", "0.5529304", "0.55129606", "0.550029", "0.5493371", "0.5481641", "0.5476692", "0.54392", "0.54233354", "0.54194576", "0.5405197", "0.53975934", "0.5394875", "0.5390852", "0.53627056", "0.5358204", "0.53469497", "0.5337969", "0.53354317", "0.5318516", "0.5311912", "0.5306699", "0.5300361", "0.5297226", "0.5279787", "0.5252429", "0.5230401", "0.5224869", "0.5222746", "0.5222145", "0.5220775", "0.5211454", "0.5203283", "0.5201989", "0.51935816", "0.5192543", "0.51886016", "0.51851463", "0.51821595", "0.5170661", "0.5164821", "0.51637954", "0.51597136", "0.5157641", "0.5145407" ]
0.0
-1
lock or unlock table $object
private function set_process_state($state) { $action = $state === true ? 'lock' : 'unlock'; echo $this->_nl, "{$action}ing $this->_dbtype $this->_object.", $this->_nl; try { $q_string = "update sandbox.dbo.daemon set in_process = :state"; if ($state === true) $q_string .= ", start_time = getdate()"; else $q_string .= ", finish_time = getdate()"; $q_string .= " where object = :object and dbtype = :dbtype"; $q = $this->_conn->prepare($q_string); $q->bindParam(':object', $this->_object); $q->bindParam(':dbtype', $this->_dbtype); $q->bindParam(':state', $state); $success = $q->execute(); } catch (PDOException $e) { echo 'ERROR: ' , $e->getMessage() . $this->_nl, $this->_nl; exit(); } // unable to update lock status if ($success === false) { echo "ERROR: unable to {$action} $this->_dbtype $this->_object.", $this->_nl, $this->_nl; exit(); } echo "$this->_dbtype $this->_object {$action}ed at " . date('Y/m/d H:i:s', time()), $this->_nl, $this->_nl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _lock_tree_table()\n\t{\n\t\tee()->db->query(\"LOCK TABLE \" .$this->tree_table . \" WRITE\");\n\t}", "protected function lock()\n {\n $sql = \"LOCK TABLE $this->_table_name WRITE\";\n try {\n $this->_db->exec($sql);\n } catch ( PDOException $e ) {\n if ( !strpos($e->getMessage(), 'syntax error') )\n throw $e;\n // no lock support, continue\n }\n }", "public function set_lock($table_name, $record_id, $user_id);", "public static function lockTable(){\n\t\t$statement = App::getDBO()->prepare('LOCK TABLES USERS WRITE');\n\t\t App::getDBO()->query();\n\t}", "function lock($table, $mode=\"write\") {\r\n\t\t$query=new query($this, \"lock tables $table $mode\");\r\n\t\t$result=$query->result;\r\n\t\treturn $result;\r\n\t}", "protected function do_unlock($obj) {\n\t\t$this->debug(\"-- do_unlock($obj)\");\n\n\t\t$this->send(self::REQ_REL_LOCK, $obj);\n\n\t\tlist($op, $p) = $this->receive();\n\n\t\tif ($op != self::REP_LOCK_RELEASED) {\n\t\t\tthrow new LockException($this->decode_reply($op) . \": \" . $p);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function lock($table, $mode=\"write\") \n \t{\n \t\t$res = @mysql_query(\"lock tables $table $mode\", $this->Link_ID);\n \t\t\n \t\tif (!$res)\n \t\t\tnew CException(sprintf(\"lock('%s', '%s') zawi�d�\", $table, $mode), __FILE__, __LINE__);\n \t\t\n \t\treturn $res;\n \t}", "function lock($table, $mode=\"write\")\n\t{\n\t\t/* connect first */\n\t\tif ($this->connect('w')==DB_SUCCESS)\n\t\t{\n\t\t\t/* lock */\n\t\t\t$query = \"LOCK TABLES $table $mode\";\n\n\t\t\tif (atkconfig(\"debug\")>=0)\n\t\t\t{\n\t\t\t\tatkimport(\"atk.utils.atkdebugger\");\n\t\t\t\tatkDebugger::addQuery($query);\n\t\t\t}\n\n\t\t\t$result = $this->_query($query, true);\n\t\t\tif (!$result) $this->halt(\"$mode lock on $table failed.\");\n\n\t\t\t/* return result */\n\t\t\treturn $result;\n\t\t}\n\t\treturn 0;\n\t}", "function lock() {\n global $_Query_lock_depth;\n if ($_Query_lock_depth < 0) {\n Fatal::internalError('Negative lock depth');\n }\n if ($_Query_lock_depth == 0) {\n $row = $this->select1($this->mkSQL('select get_lock(%Q, %N) as locked',\n OBIB_LOCK_NAME, OBIB_LOCK_TIMEOUT));\n if (!isset($row['locked']) or $row['locked'] != 1) {\n Fatal::cantLock();\n }\n }\n $_Query_lock_depth++;\n }", "protected function unlock()\n {\n $sql = \"UNLOCK TABLES\";\n try {\n $this->_db->exec($sql);\n } catch ( PDOException $e ) {\n if ( !strpos($e->getMessage(), 'syntax error') )\n throw $e;\n // no lock support, continue\n }\n }", "public function lock()\n {\n $this->isLocked = true;\n }", "public function unlock(): void;", "public function lock(): void;", "function lock_table($table_name, $alias = null) {\r\n\t\treturn;\r\n\r\n\t\t$sql = \"LOCK TABLES $table_name\";\r\n\r\n\t\tif (isset($alias)) {\r\n\t\t\t$sql .= \" AS $alias\";\r\n\t\t}\r\n\r\n\t\t$sql .= \" WRITE\";\r\n\r\n\t\treturn $this->query($sql);\r\n\r\n\t}", "abstract protected function lock(): void;", "public function lock() {}", "public function writeunlock() {}", "public function lockToNormal() {}", "public function lock()\n {\n $this->locked = true;\n }", "protected function unlockNewRecord()\n\t{\n\t\tif( $this->lockingObj )\n\t\t\t$this->lockingObj->UnlockRecord($this->tName, $this->keys , \"\");\n\t}", "public function get_lock($table_name, $record_id);", "function lock(Sabre_DAV_Locks_LockInfo $lockInfo);", "public function unlock(): void {}", "public function unlock(): void {}", "public function unlock(): void {}", "public function unlock(): void {}", "public function unlock(): void {}", "public function lock(): void {}", "public function lock(): void {}", "public function lock(): void {}", "public function lock(): void {}", "public function lock(): void {}", "public function lock()\n {\n if ($this->isLocked()) {\n throw new RuntimeException('Cannot lock: already locked');\n }\n\n $this->conn->set('lock:' . $this->name, $this->id);\n }", "public function lock()\n {\n if ( !($this->_state & self::LOADED) ) {\n $this->_memManager->load($this, $this->_id);\n $this->_state |= self::LOADED;\n }\n\n $this->_state |= self::LOCKED;\n\n /**\n * @todo\n * It's possible to set \"value\" container attribute to avoid modification tracing, while it's locked\n * Check, if it's more effective\n */\n }", "protected function do_lock($obj) {\n\t\t$this->debug(\"-- do_lock($obj))\";\n\n\t\t$this->send(self::REQ_ACQ_LOCK, $obj);\n\n\t\tlist($op, $p) = $this->receive();\n\n\t\tif ($op == self::REP_ACK) {\n\t\t\t// wait for a definitive answer\n\t\t\tlist($op, $p) = $this->receive();\n\t\t}\n\t\tif ($op != self::REP_LOCK_ACQUIRED) {\n\t\t\treturn false;\n\t\t\tthrow new LockException($this->decode_reply($op) . \": \" . $p);\n\t\t}\n\t\treturn true;\n\t}", "public function release() {\n $this->locked = 0;\n $this->save();\n }", "public function release() {\n $this->locked = 0;\n $this->save();\n }", "function lock()\n{\n}", "public function unlock() {\n }", "public function lock()\n {\n $this->lock = true;\n }", "function unlock() {\r\n\t\t$query=new query($this, \"unlock tables\");\r\n\t\t$result=$query->result;\r\n\t\treturn $result;\r\n\t}", "abstract protected function manage(LockableInterface $resource);", "public function lock()\n\t{\n\t\t$this->immutable = true;\n\t}", "public function lock()\r\n {\r\n frameEbbs::_()->getModule('backup')->lock();\r\n }", "protected function unlockOldRecord()\n\t{\n\t\tif( $this->lockingObj && $this->keysChanged )\n\t\t\t$this->lockingObj->UnlockRecord($this->tName, $this->oldKeys , \"\");\n\t}", "public function lock($name) {\n\t\t\n\t\t/*$b = mysql_query('show tables');\n\t\t$d = '';\n\t\t$d .= 'LOCK TABLES';\n\t\twhile( $c = mysql_fetch_array($b) ) {\n\t\t\t$d .= '\n\t\t`'.$c[0].'` WRITE , ';\n\t\t}\n\t\t\n\t\t$d = rtrim($d,' , ').';';\n\t\t//if( $this->info['id'] == 12345 ) {\n\t\t\tif( $name == 'reflesh.useitems' || $name == 'reflesh-heal' ) {\n\t\t\t\tmysql_query($d);\n\t\t\t}\n\t\t//}*/\n\t}", "function _unlock_tree_table()\n\t{\n\t\t$q = \"UNLOCK TABLES\";\n\t\tee()->db->query($q);\n\t}", "function lock( $table, $mode = \"write\" )\n {\n $query = \"lock tables \";\n if ( is_array( $table ) )\n {\n while ( list( $key, $value ) = each( $table ) )\n {\n // text keys are \"read\", \"read local\", \"write\", \"low priority write\"\n if ( is_int( $key ) ) $key = $mode;\n if ( strpos( $value, \",\" ) )\n {\n $query .= str_replace( \",\", \" $key, \", $value ) . \" $key, \";\n } else\n {\n $query .= \"$value $key, \";\n }\n }\n $query = substr( $query, 0, -2 );\n } elseif ( strpos( $table, \",\" ) )\n {\n $query .= str_replace( \",\", \" $mode, \", $table ) . \" $mode\";\n } else\n {\n $query .= \"$table $mode\";\n }\n if ( !$this->query( $query ) )\n {\n $this->halt( \"lock() failed.\" );\n return false;\n }\n $this->locked = true;\n return true;\n }", "protected function hashLockClause() {}", "function trylock($obj) {\n\n\t\t$this->send(self::REQ_TRY_LOCK, $obj);\n\n\t\tlist($op, $p) = $this->receive();\n\n\t\tswitch ($op) {\n\t\t\tcase self::REP_LOCK_ACQUIRED:\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase self::REP_LOCK_WBLOCK:\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new LockException($this->decode_reply($op) . \": \" . $p);\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\t}", "private function setLock($status) {\n $this->status->is_locked = $status;\n $this->status->save();\n }", "public function lockJob() {\n \t\t//structure id,jobId,serverId (job id is unique entry)\n\n \t}", "function lockCacheObject ()\n {\n return copy($this->cacheObjectId, $this->cacheObjectId.'.lock');\n }", "function lock($db, $id, $table='activity') {\n if ($id<0) return -1; # ignore 'new' entries.\n $q='UPDATE '.$table.' set editlock=datetime(\\'now\\',\\'+5 minutes\\') WHERE editlock < datetime(\\'now\\') AND id='.$id.';';\n if ($db->exec($q) == 1) return -1;\n\n $q='SELECT editlock from '.$table.' WHERE id='.$id.';';\n $res=$db->query($q);\n if (!$res) return 0; # XXX error\n $r=$res->fetch(PDO::FETCH_ASSOC);\n return $r['editlock'];\n }", "public function lockAndBlock()\n {\n $this->lock();\n }", "function unlock()\n\t{\n\t\t/* connect first */\n\t\tif ($this->connect('w')==DB_SUCCESS)\n\t\t{\n\t\t\t/* unlock */\n\t\t\tatkdebug(\"unlock tables\");\n\t\t\t$result = $this->_query(\"UNLOCK TABLES\", true);\n\t\t\tif (!$result) $this->halt(\"unlock tables failed.\");\n\n\t\t\t/* return result */\n\t\t\treturn $result;\n\t\t}\n\t\treturn 0;\n\t}", "public function readunlock() {}", "public function lock_get()\n\t{\n\t\ttry{\n\n\t\t\t$this->checkCanCandidateId();\n\t\t\t$id = $this->getParameterId();\n\t\t\t$code = 0;\n \n $filters = array(\n \"id\" => $id,\n \"{$this->_candidateIdFkKey}\" =>$this->getCanCandidateId()\n );\n \n\t\t\t// if Lock flag is ON\n\t\t\t// Get object by normal way\n\t\t\t// and check is that the object locked by their-self or another\n\t\t\tif ($this->_model->getLockFlag() == LOCK_FLAG_ON){\n\t\t\t\t\n $objects = $this->_model->getBy($filters);\n if (count($objects)==0){\n throw new Exception ('対象が存在していません。', REST_ER_PAGE_NOTFOUND);\n }\n \n\t\t\t\t//if the current object locked equal this id then this object locked by their self s\n\t\t\t\tif ($id != $this->getCurrentObjectId()){\n\t\t\t\t\t// The object locked by another\n\t\t\t\t\t$code = REST_RESPOND_CANNOT_LOCK;\n\t\t\t\t}\n\t\t\t\t$data = array();\n\t\t\t\tif (count($objects)>0)\n\t\t\t\t\t$data = $objects[0];\n\t\t\t}else {\n $objects = $this->_model->getBy($filters);\n if (count($objects)==0){\n throw new Exception ('対象が存在していません。', REST_ER_PAGE_NOTFOUND);\n }\n \n\t\t\t\t// if the lock flag is off\n\t\t\t\t// get and lock this object\n\t\t\t\t$result = $this->_model->getByIdAndLock($id);\n\t\t\t\tif ($result['transStatus']){\n\t\t\t\t\t// set the current locked object id\n\t\t\t\t\t$this->setCurrentObjectId($id);\n\t\t\t\t}else {\n\t\t\t\t\tthrow new Exception('ロック処理に失敗しました。', REST_ER_TRANSACTION_ERROR);\n\t\t\t\t}\n\t\t\t\t$data = $result['data'];\n\n\t\t\t}\n\t\t\t$respond = array(\n\t\t\t\t'code' => $code,\n\t\t\t\t'datetime'=> date('Y-m-d H:i:s', time()),\n\t\t\t\t'data' => $data\n\t\t\t);\n\t\t\t$this->response($respond);\n\t\t}catch( Exception $e ){\n\t\t\t$message = $e->getMessage();\n\t\t\t$code = $e->getCode();\n\t\t\t$this->error_response($message,$code);\n\t\t}\n\n\t}", "protected function lock()\n {\n $this->isStateLocked = true;\n }", "public function lockTable($table)\n {\n try{\n $this->stmt = $this->db->prepare(\"LOCK TABLES `{$table}`\");\n $this->stmt->execute();\n return true;\n } \n \n catch (PDOException $e)\n {\n $this->error = $e->getMessage(); \n return false;\n }\n }", "public function lock()\n {\n $shmId = shmop_open($this->getIndexerId(), 'c', self::PERM, self::LEN);\n shmop_write($shmId, $this->_getMicrotimeString(), 0);\n shmop_close($shmId);\n $this->_isLocked = true;\n }", "protected function releaseLock() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n $sql = \"DELETE FROM \".$this->_dbtp.\"locks WHERE \".$this->_dblp.\"name=?\";\n try {\n $db->query($sql, $this->_lock);\n }\n catch(Exception $ex) {\n $log->err($ex);\n $log->err(array(\"Queue releaseLock failed\", $res));\n } \n }", "public function lock($name=NULL, $mode='WRITE', $quot='`'){\r\n\t\tif($name){\r\n\t\t\t$this->check_table_name($name);\r\n\t\t\t$mode = $this->escstr(strtoupper(trim($mode)));\r\n\t\t\t$this->parent->add_sql(' LOCK TABLE '.$quot.$name.$quot.' '.$mode);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->parent->add_sql(' FLUSH TABLES WITH READ LOCK ');\r\n\t\t$this->sql_query_class->lock = true;\r\n\t\treturn new object_sql_query(NULL, $this->parent);\r\n\t}", "static public function lockTable( $table )\n\t{\n\t\t$lock = \"LOCK TABLES \".Utilities::sqlBackquotes( $table ).\" WRITE\\n\";\n\t\t\n\t\treturn $lock;\n\t}", "abstract protected function releaseLock($name);", "public static function unlockTables(){\n\t $statement = App::getDBO()->prepare('UNLOCK TABLES');\n\t\tApp::getDBO()->query();\n\t}", "public function trylock() {}", "public function lockPayments()\n {\n $this -> lock_payments = true;\n $this -> save();\n }", "function unlockCacheObject ()\n {\n return unlink($this->cacheObjectId.'.lock');\n }", "function Spinlock( $query, $id = -1, $set = FALSE, $spin = FALSE, $name = \"\" )\n\t{\n\t\t$log = new Logger( PAYPAL_IPN_LOG, \"Utils::Spinlock\", FALSE, $name );\n\t\t$log->debug( \"Attempting to lock tables...\" );\n\t\t$myResponse = \"\";\n\t\t$result = mysql_query( \"LOCK TABLES session WRITE, $query\" );\n\t\t\n\t\t// Table access locked?\n\t\tif ( $result == FALSE )\n\t\t{\n\t\t\t$myResponse = 'Lock_wait' . mysql_error();\n\t\t\t$log->error( $myResponse );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Table locked by another guestID?\n\t\t\t$result = mysql_query( \"SELECT locked, timeout FROM session\" );\n\t\t\t$row = mysql_fetch_row( $result );\n\t\t\t$timeLeft = $row[1] - time();\n\t\t\tif ( $row[0] != -1 && $row[0] != $id && $timeLeft > 0 )\n\t\t\t{\n\t\t\t\t// locked by someone else, still within timeout\n\t\t\t\t$myResponse = \"Locked by guest #{$row[0]} for $timeLeft more seconds. You are #$id\";\n\t\t\t\t$log->error( $myResponse );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// not locked or lock timed out\n\t\t\t\t$newID = $set ? $id : -1;\n\t\t\t\t$timeout = (time() + LOCK_TIMEOUT);\n\t\t\t\t$result = mysql_query( \"UPDATE session SET locked='$newID', timeout='$timeout'\" );\n\t\t\t\tif ( $result == FALSE )\n\t\t\t\t{\n\t\t\t\t\t$qerr = \"Error setting/clearing lock to $newID: \" . mysql_error();\n\t\t\t\t\t$log->error( $qerr );\n\t\t\t\t\treturn $qerr;\n\t\t\t\t}\n\t\t\t\t$log->debug( \"Lock set for $newID with timeout of $timeout\" );\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t\t// if we get here then there's an existing lock, so spin, if requested, at 5-second intervals\n\t\tif ( $spin )\n\t\t{\n\t\t\t$log->debug( \"Spinning for 5 seconds...\" );\n\t\t\tsleep(5);\n\t\t\treturn Utils::Spinlock( $query, $id, $set, $spin, $name, FALSE );\n\t\t}\n\t\treturn $myResponse;\n\t}", "function _update_locked () {\n\t\t\n\t\t// How old do locks have to be to get unlocked?\n\t\t$minutes = 10;\n\t\t\n\t\t$time = gmdate(\"Y-m-d H:i:s\", (time() - ($minutes * 60)));\n\t\t\n\t\t$q = $this->db->query(\"UPDATE commentreports\n\t\t\t\t\t\tSET \tlocked = NULL,\n\t\t\t\t\t\t\t\tlockedby = 0\n\t\t\t\t\t\tWHERE\tlocked < '$time'\n\t\t\t\t\t\t\");\n\t\n\t}", "function loadLockedObject()\n {\n return $this->cacheObjectContents($this->cacheObjectId.'.lock');\n }", "public function acquireExclusiveLock() {}", "public function enableLocked()\n\t{\n\t\t$this->_locked = true;\n\t}", "public function release($lockHandle);", "public function setLocked($locked = true) {}", "function freeze() {\n ## we will need this to lock the table\n $db_connection = new DB_Sql();\n $str=\"\";\n\n $this->serialize(\"this->in\",$str);\n $this->serialize(\"this->registered_objects\",$str);\n\n reset($this->registered_objects);\n while ( list($thing) = each($this->registered_objects) ) {\n $thing=trim($thing);\n if ( $thing ) {\n $this->serialize(\"GLOBALS['\".$thing.\"']\",$str);\n }\n }\n \n ## her we start to store the table\n $db_connection->lock(ACTIVE_SESSIONS);\n \n $r = $this->that->store($this->id, $this->name, $str);\n $db_connection->unlock();\n if(!$r) $this->that->halt(\"Session: freeze() failed.\");\n }", "protected function locking()\n {\n foreach ($this->all() as $name => $element) {\n $element->lock();\n }\n }", "public function unlockTable($table)\n {\n try{\n $this->stmt = $this->db->prepare(\"UNLOCK TABLES `{$table}`\");\n $this->stmt->execute();\n return true;\n } \n \n catch (PDOException $e)\n {\n $this->error = $e->getMessage(); \n return false;\n }\n }", "public function _lock_tables($tables) {\n // Must be overridden.\n }", "public function tree_lock() {\n global $db, $uid;\n\n if (($this->lock_user != false) && ($this->lock_user != $uid)) {\n // Baum ist bereits von einem anderen Benutzer gesperrt\n $lock_stamp = false;\n $this->error = \"ERR_ALREADY_LOCKED\";\n return false;\n } else if (($this->lock_user != false) && ($this->lock_user == $uid)) {\n // Eigene Sperre bereits aktiv\n $this->lock_stamp = time();\n $this->lock_expire = time() + 300;\n $result = $db->querynow(\"UPDATE `lock` SET STAMP_UPDATE='\".date('Y-m-d H:i:s', $this->lock_stamp).\"',\n STAMP_EXPIRE='\".date('Y-m-d H:i:s', $this->lock_expire).\"'\n WHERE FK_USER=\".$uid.\" AND IDENT='\".$this->table.$this->root.\"'\");\n if (!$result['str_error']) {\n $this->lock_user = $uid;\n return true;\n } else {\n $this->error = \"ERR_LOCK_FAILED\";\n $this->lock_stamp = 0;\n $this->lock_expire = 0;\n $this->lock_user = false;\n return false;\n }\n } else {\n // Baum nicht gesperrt, Sperre hinzu\n $this->lock_stamp = time();\n $this->lock_expire = time() + 300;\n $result = $db->querynow(\"INSERT INTO `lock` (FK_USER, IDENT, STAMP_UPDATE, STAMP_EXPIRE) VALUES\n (\".$uid.\",'\".$this->table.$this->root.\"', '\".date('Y-m-d H:i:s', $this->lock_stamp).\"', '\".\n date('Y-m-d H:i:s', $this->lock_expire).\"')\");\n if (!$result['str_error']) {\n $this->lock_user = $uid;\n return true;\n } else {\n $this->error = \"ERR_LOCK_FAILED\";\n $this->lock_user = false;\n return false;\n }\n }\n }", "public function adopt($obj) {\n\n\t\t$this->send(self::REQ_ADOPT, $obj);\n\n\t\tlist($op, $p) = $this->receive();\n\n\t\tif ($op == self::REP_ACK) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\tthrow new LockException($this->decode_reply($op) . \": \" . $p);\n\t\t\treturn false;\n\t\t}\n\t}", "public function update() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with id of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"UPDATE $this->sqlTable SET \";\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$sql .= \"lp_userid = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$sql .= \"lp_random = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$sql .= \"lp_deadline = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\r\n\t\t\t$sql = preg_replace ( '/, $/', '', $sql);\r\n\t\t\t$sql .= \" WHERE lp_id = ?\";\r\n\t\t\t$arrBindings[] = $this->id;\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function toggleLock($thread)\n {\n $thread->locked = !$thread->locked;\n $thread->save();\n\n return $thread;\n }", "function setLocked($l) {\n\t\t$this->set(\"locked\",$l);\n\t}", "function lock_release($name) {\n global $locks;\n\n unset($locks[$name]);\n db_delete('semaphore')\n ->condition('name', $name)\n ->condition('value', _lock_id())\n ->execute();\n}", "function cmd_lock($db, $params, $computer) {\n global $glo_dirname;\n\t\tif (!isset($params['lock'])) {\n throw new NuboException(ERROR_MISSING_PARAMETER);\n }\n $mutex = fopen(\"./$glo_dirname/lock\", \"w+\");\n if (!$mutex) {\n throw new NuboException(ERROR_INTERNAL);\n }\n try {\n flock($mutex, LOCK_EX);\n if ($params['lock']) {\n $result = $db->select('SELECT computer_id FROM tbl_computer WHERE lock IS NOT NULL');\n if (reset($result) !== false) {\n $status = 'busy';\n } else {\n $db->execute('UPDATE tbl_computer SET lock=:ltime WHERE computer_id=:id', ['id/int' => $computer, 'ltime/int' => time()]);\n $status = 'locked';\n }\n } else {\n $db->execute('UPDATE tbl_computer SET lock=NULL WHERE computer_id=:id', ['id/int' => $computer]);\n $status = 'unlocked';\n }\n } finally {\n flock($mutex, LOCK_UN);\n fclose($mutex);\n }\n\t\treturn ['status' => $status];\n\t}", "public function lock($key=null,$value=null){\n return $this->methodsData(\"lock\",$key,$value);\n }", "function lock_sqlite3_access() {\n\tglobal $DB;\n\n\tsem_acquire($DB['SEM_ID']);\n}", "private function unlock() {\n\t\tif (file_exists($this -> lockfile)) {\n\t\t\tunlink($this -> lockfile);\n\t\t}\n\t}", "public function run()\n {\n $config = $this->config;\n try {\n $this->getFluent()->getPdo()->beginTransaction();\n $this->tree->getFluent()->getPdo()->exec(\"LOCK TABLES $config[table] WRITE;\");\n $return = $this->doRun();\n $this->getFluent()->getPdo()->commit();\n $this->tree->getFluent()->getPdo()->query(\"UNLOCK TABLES;\");\n return $return;\n } catch (Exception $ex) {\n $this->getFluent()->getPdo()->rollBack();\n $this->tree->getFluent()->getPdo()->query(\"UNLOCK TABLES;\");\n throw $ex;\n }\n }", "public function testLockedMethod() {\n $lockedOperation = new LockedOperation(self::$lockHandler);\n $lockable = new MyLockable();\n $foo = new Foo();\n\n $result = FALSE;\n\n try {\n $result = $lockedOperation->execute(array($foo, 'bar'), $lockable);\n }\n catch (Exception $ex) {\n // this shouldn't happen.\n }\n\n $this->assertTrue($result);\n $this->assertFalse(isset($ex));\n }", "public function unlock()\r\n {\r\n frameEbbs::_()->getModule('backup')->unlock();\r\n }", "function lock_release_all($lock_id = NULL) {\n global $locks;\n\n $locks = array();\n if (empty($lock_id)) {\n $lock_id = _lock_id();\n }\n db_delete('semaphore')\n ->condition('value', $lock_id)\n ->execute();\n}", "private function lockConcurrentExecution()\n\t{\n\t\t$tag = $this->getLockTag();\n\t\t$app = \\Bitrix\\Main\\Application::getInstance();\n\t\t$managedCache = $app->getManagedCache();\n\t\t$managedCache->clean($tag);\n\t\t$managedCache->read(self::LOCK_TTL, $tag);\n\t\t$managedCache->setImmediate($tag, true);\n\t}", "public static function setLocked()\n {\n self::$locked = true;\n }", "public function testParallelUnlock(): void\n {\n $identifier1 = \\uniqid('lock_name_1_', true);\n $identifier2 = \\uniqid('lock_name_2_', true);\n\n $this->assertTrue($this->cacheInstance1->lock($identifier1, 30));\n $this->assertTrue($this->cacheInstance2->lock($identifier2, 30));\n\n $this->assertFalse($this->cacheInstance2->unlock($identifier1));\n $this->assertTrue($this->cacheInstance2->unlock($identifier2));\n\n $this->assertTrue($this->cacheInstance2->isLocked($identifier1));\n $this->assertFalse($this->cacheInstance2->isLocked($identifier2));\n }", "public function isLocked() {}", "public function isLocked();", "public function isLocked();", "public function isLocked();" ]
[ "0.6816337", "0.6728325", "0.66627455", "0.6658425", "0.6599877", "0.6592038", "0.65149903", "0.6461936", "0.64562607", "0.6401575", "0.6302777", "0.6302484", "0.6267757", "0.6264725", "0.6231645", "0.61779577", "0.6174427", "0.6158007", "0.6148799", "0.6142662", "0.6105473", "0.6095622", "0.6089862", "0.6089862", "0.6089862", "0.6089862", "0.6089862", "0.6089818", "0.6089818", "0.6089818", "0.6089818", "0.6089818", "0.6085938", "0.6067748", "0.6060885", "0.60521907", "0.60521907", "0.6009959", "0.5989381", "0.5989023", "0.5957707", "0.59325874", "0.58946973", "0.588451", "0.58789754", "0.5874213", "0.5869344", "0.5849195", "0.5846724", "0.582037", "0.5811606", "0.5801103", "0.57879555", "0.5785987", "0.5779905", "0.57695997", "0.57666314", "0.57610226", "0.575724", "0.57419825", "0.57413983", "0.5693753", "0.56850183", "0.56533223", "0.5649245", "0.5635913", "0.56332743", "0.5590344", "0.5588751", "0.5581926", "0.5574028", "0.556305", "0.55314666", "0.55086803", "0.55060357", "0.55037075", "0.54946434", "0.54867345", "0.5475931", "0.54734874", "0.5449122", "0.5442909", "0.54376745", "0.5428183", "0.5425463", "0.5424555", "0.5412446", "0.5411527", "0.5408064", "0.5379105", "0.5377348", "0.53706056", "0.53676283", "0.5356956", "0.5351736", "0.535043", "0.5338416", "0.5337134", "0.53316146", "0.53316146", "0.53316146" ]
0.0
-1
first time this is run for a given queue, create a new entry
private function create() { try { $q_string = "insert into sandbox.dbo.daemon (object, dbtype) values (:object, :dbtype)"; $q = $this->_conn->prepare($q_string); $q->bindParam(':object', $this->_object); $q->bindParam(':dbtype', $this->_dbtype); $success = $q->execute(); } catch (PDOException $e) { echo 'ERROR: ', $e->getMessage(), $this->_nl; exit(); } // unable to insert new entry if ($success !== true) { echo "ERROR: unable to create new lock entry for $this->_dbtype $this->_object.", $this->_nl, $this->_nl; exit(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTask( $queue ) {\n\t\t$query = \"SELECT cd.`ticket_id` FROM `\".BIT_DB_PREFIX.\"task_ticket` cd\n\t\t\t\t\t\t WHERE ti.`ticket_ref` BETWEEN TODAY AND TOMORROW AND cd.`room` = $queue + 80\n\t\t\t\t\t\t AND cd.`office` = 1\n\t\t\t\t \t\t ORDER BY cd.`ticket_ref`\";\n\t\t$next = $this->mDb->getOne( $query );\n// Add switch of user state to serving!\n\t\tif ( $next ) return true;\n\t\telse return false;\n\t}", "function addNewMyQueue($myqueueName)\r\n {\r\n $time = time(); \r\n $q = \"INSERT INTO \".TBL_MYQUEUE.\" VALUES (NULL, '$myqueueName', $time )\";\r\n return mysql_query($q, $this->connection);\r\n }", "public function createQueue() {\n // Drupal is first installed) so there is nothing we need to do to create\n // a new queue.\n }", "public function createQueue();", "public function createItem($data) {\n // the queue table yet, so we cannot rely on drupal_write_record().\n $query = db_insert('queue')\n ->fields(array(\n 'name' => $this->name,\n 'data' => serialize($data),\n // We cannot rely on REQUEST_TIME because many items might be created\n // by a single request which takes longer than 1 second.\n 'created' => time(),\n ));\n return (bool) $query->execute();\n }", "public function testAddToQueue()\n {\n $this->setUpDB(['email']);\n \n $Email = new \\EmailTemplate('test');\n \n // Add the message to queue\n $r = $Email->queue('[email protected]', 'test', 'test');\n \n // get data from DB\n $EmailQueue = new \\EmailQueue();\n $filter = ['too' => '[email protected]'];\n $Collection = $EmailQueue->Get($filter, []);\n \n // asserts\n $this->assertEquals(1, $r);\n $this->assertInstanceOf(\\Collection::class, $Collection);\n $this->assertCount(1, $Collection);\n $Item = $Collection->getItem();\n $this->assertInstanceOf(\\SetterGetter::class, $Item);\n $this->assertEquals('test', $Item->getSubject());\n $this->assertEquals('test', $Item->getBody());\n }", "function enqueue ($entry) {\n\n}", "public function testQueueBuilding()\n {\n\n $contract = $this->getScenarioContract();\n $collection = $this->getScenarioCollection();\n\n $probFactory = new \\CsCannon\\MetadataProbeFactory();\n\n $probFactory->populateLocal();\n $probe = $probFactory->getOrCreate($collection,$contract,'null');\n\n\n $this->assertInstanceOf(\\CsCannon\\MetadataProbe::class,$probe,'Could not laod prob');\n\n\n $erc721_3 = \\CsCannon\\Blockchains\\Ethereum\\Interfaces\\ERC721::init(3);\n $erc721_4 = \\CsCannon\\Blockchains\\Ethereum\\Interfaces\\ERC721::init(4);\n $erc721_1 = \\CsCannon\\Blockchains\\Ethereum\\Interfaces\\ERC721::init(1); //this should exist already\n\n $probe->queue($erc721_3);\n\n // $probe->queue($erc721_3,$erc721_4,$erc721_1);\n while($probe->executeQueue()) {\n\n sleep(1);\n\n\n }\n\n\n }", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "function createAtomEntry() {\n\t\t$this->create();\n\t}", "public function testOne()\n {\n $this->queue->add('first item');\n\n $this->assertEquals('first item', $this->queue->next());\n $this->assertNull($this->queue->next());\n }", "public function add($id) \n {\n $log = FezLog::get();\n if (!array_key_exists($id,$this->_ids) || !$this->_ids[$id]) {\n $this->_ids[$id] = self::ACTION_ADD;\n $log->debug(\"Added $id to queue\");\n }\n }", "private function performQueueOperations()\n\t{\n\t\t//$this->queue_manager = high_risk\n\t\t$application_id = $this->application->getModel()->application_id;\n\t\t$qi = $this->queue_manager->getQueue(\"high_risk\")->getNewQueueItem($application_id);\n\t\t$this->queue_manager->moveToQueue($qi, \"high_risk\");\t\t\n\t}", "public function submit_new_entry_start()\n\t{\n\t\t// -------------------------------------\n\t\t// This is really obnoxious, but EE makes us do this for Quick Save/Preview to work\n\t\t// -------------------------------------\n\n\t\tif ($this->data->channel_is_calendars_channel(ee()->input->post('weblog_id')) === TRUE OR\n\t\t\t$this->data->channel_is_events_channel(ee()->input->post('weblog_id')) === TRUE)\n\t\t{\n\t\t\t$this->cache['quicksave']\t= TRUE;\n\t\t}\n\t}", "function queue_enqueue(&$queue, $value) { \n // We are just adding a value to the end of the array, so can use the \n // [] PHP Shortcut for this. It's faster than using array_push \n $queue[] = $value; \n}", "function enqueue(){\n\t\t}", "function appendNetflixQueue($queueId){\t\t\n\t\t$userId = $this->getUserId();\n\n\t\tif (!$userId) {\n\t\t\t$this->Session->setFlash(__('You must log in.', true));\n\t\t\t$this->redirect(array('controller' => 'queues', 'action' => 'login'));\n\t\t}\n\n\t\t$queue = $this->Queue->find('first', \n\t\t\tarray('conditions' => \n\t\t\t\t\"Queue.id = $queueId AND (Queue.account_number = '$userId' OR Queue.privacy = 'public')\"\n\t\t\t)\n\t\t);\n\t\t\n\t\t$this->log(\"Appending queue with id $queueId and owner {$queue['Queue']['account_number']} to netflix queue for user $userId\", LOG_DEBUG);\n\t\t\n\t\t$this->Queue->id = $queueId;\n\t\t$this->Queue->read(null, $queueId);\n\t\t$etag = $this->Queue->field('etag');\n\n\t\tif(!$queue){\n\t\t\t$this->flash(\"The queue does not exist or does not belong to the user.\");\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\texit;\n\t\t}\n\n\t\t$queueMovies = $this->Queue->QueueMovie->find('all', \n\t\t\tarray('conditions' => \"queue_id = $queueId\", \n\t\t\t\t 'order' => 'QueueMovie.position ASC'));\n\t\t$this->set('queueMovies', $queueMovies);\n\n\t\t$netflix = $this->NetflixAccount->getNetflixAPIConsumerForAccountNumber($userId);\n\n\t\t$errors = array();\n\t\t\n\t\tforeach($queueMovies as $movieToAdd){\n\t\t\t$titleURL = $movieToAdd['QueueMovie']['netflix_key'];\n\t\t\t$position = $movieToAdd['QueueMovie']['position'];\n\t\t\t$title = $movieToAdd['QueueMovie']['title'];\n\t\t\t\n\t\t\t$this->log(\"Adding $title at position $position for $userId\", LOG_DEBUG);\n\t\t\t\n\t\t\tif($position == 0){\n\t\t\t\t//Handle movies in the 'saved' queue. They have position 0.\n\t\t\t\t$position = count($queueMovies);\n\t\t\t}\n\n\t\t\ttry{\n\t\t\t\t$etag = $netflix->addTitle($titleURL, $position);\n\t\t\t\t$this->Queue->saveField('etag', $etag);\n\t\t\t}\n\t\t\tcatch(Exception $e){\n\t\t\t\t$errors[] = $e->getMessage();\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t$this->set('errors', $errors);\n\t}", "public function pushOn($queue, $job, $data = '');", "public function __construct($queue);", "function saveQueue($request) {\n\n if(isset($request['Statistic_type']) && $request['Statistic_type'] !='') {\n if($request['Statistic_type'] == 'all') {\n $this->insertQueue($request,'Avalue');\n $this->insertQueue($request,'Pvalue');\n $this->insertQueue($request,'Ritvalue');\n } else {\n $this->insertQueue($request);\n }\n }\n return true;\n }", "public static function enqueue();", "public function add() {\n $this->out('CakePHP Queue Example task.');\n $this->hr();\n $this->out('This is a very simple example of a QueueTask.');\n $this->out('I will now add an example Job into the Queue.');\n $this->out('This job will only produce some console output on the worker that it runs on.');\n $this->out(' ');\n $this->out('To run a Worker use:');\n $this->out('\tbin/cake queue runworker');\n $this->out(' ');\n $this->out('You can find the sourcecode of this task in: ');\n $this->out(__FILE__);\n $this->out(' ');\n\n //$options = getopt('',['id:']);\n /*\n * Adding a task of type 'example' with no additionally passed data\n */\n //if ($this->QueuedJobs->createJob('RemittanceApi', ['id'=>4033, 'batch_id'=>'58e44de0f33a7'])) {\n if ($this->QueuedJobs->createJob('RemittanceApi', null)) {\n $this->out('OK, job created, now run the worker');\n } else {\n $this->err('Could not create Job');\n }\n }", "Public Function CreatejobId()\n {\n \t$DatabaseObj = Zend_Registry::get('Instance/DatabaseObj');\n \t\n\t\t\t$Salt = \"abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ1234567890_\";\n\t\t\tsrand((double)microtime()*1000000);\n\t\t\t$ConfirmationKey = \"\";\n\t\t\tfor ($i=0;$i<8;$i++)\n\t\t\t{\n\t\t\t\t$ConfirmationKey = $ConfirmationKey . substr ($Salt, rand() % strlen($Salt), 1);\n\t\t\t}\n\t\t\t\n\t\t\t$InsertArray = array(\n \t\t\t'jobId' => $ConfirmationKey,\n \t\t);\n \t\t\n \t\t$Sql = \"SELECT id FROM bevomedia_queue WHERE jobId = '$ConfirmationKey'\";\n \t\t$Rows = $DatabaseObj->fetchAll($Sql);\n \t\tif(sizeof($Rows) > 0)\n \t\t{\n \t\t\t$ConfirmationKey = $this->CreatejobId();\n \t\t\treturn $ConfirmationKey;\n \t\t}\n \t\t\n \t\t$DatabaseObj->insert('bevomedia_queue', $InsertArray);\n \t\t\n \t\t$this->jobId = $ConfirmationKey;\n \t\t\n\t\t\treturn $ConfirmationKey;\n \t\n }", "function queue() {\n\n\t\t$date = false;\n\t\t$queue = new Queued_Event();\n\t\t$queue->set_workflow_id( $this->get_id() );\n\n\t\tswitch( $this->get_timing_type() ) {\n\n\t\t\tcase 'delayed':\n\t\t\t\t$date = new DateTime();\n\t\t\t\t$date->setTimestamp( time() + $this->get_timing_delay() );\n\t\t\t\tbreak;\n\n\t\t\tcase 'scheduled':\n\t\t\t\t$date = $this->calculate_scheduled_datetime();\n\t\t\t\tbreak;\n\n\t\t\tcase 'fixed':\n\t\t\t\t$date = $this->get_fixed_time();\n\t\t\t\tbreak;\n\n\t\t\tcase 'datetime':\n\t\t\t\t$date = $this->get_variable_time();\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$date = apply_filters( 'automatewoo/workflow/queue_date', $date, $this );\n\n\t\tif ( ! $date ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$queue->set_date_due( $date );\n\t\t$queue->save();\n\n\t\t$queue->store_data_layer( $this->data_layer() ); // add meta data after saved\n\n\t\treturn $queue;\n\t}", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "function insertLogDigestQueue($digest_insert)\n{\n\t$db = database();\n\n\t$db->insert('',\n\t\t'{db_prefix}log_digest',\n\t\t[\n\t\t\t'id_topic' => 'int', 'id_msg' => 'int', 'note_type' => 'string', 'exclude' => 'int',\n\t\t],\n\t\t$digest_insert,\n\t\t[]\n\t);\n}", "public function push(Token $t)\n {\n if (!isset ($this->queue))\n return;\n \n array_push($this->queue, $t);\n }", "public function run()\n {\n foreach ($this->topics as $topic){\n Topic::query()->firstOrCreate($topic);\n }\n }", "public function enqueue() {\n\t}", "private function insert_entry_qual()\n {\n global $DB;\n $params = $this->get_params();\n $this->id = $DB->insert_record('subject', $params);\n }", "abstract public function push($job, $queue = null);", "public static function push()\n {\n return <<<'LUA'\n-- Push the job onto the queue...\nredis.call('zadd', KEYS[1], 'NX', ARGV[1], ARGV[2])\n-- Push a notification onto the \"notify\" queue...\nredis.call('rpush', KEYS[2], 1)\nLUA;\n }", "private function prepForNewEntry()\n {\n $this->id = Helper::makeUuid();\n $locale = $this->request->input('locale');\n\n $this->content = Entry::create($this->slug)\n ->collection($this->collection)\n ->get();\n\n if ($locale !== default_locale()) {\n $this->content->set('title', $this->slug);\n $this->content->published(false);\n $this->content = $this->content->in($locale)->get();\n }\n\n $this->content->published($this->getSubmittedStatus());\n\n $this->content->order(\n $this->getSubmittedOrderKey() ?: $this->getNewEntryOrderKey()\n );\n }", "private function registerTask($entry)\n\t{\n\t\ttry {\n\n\t\t\t$entryArray = $entry->toArray();\n\n\n\t\t\tif(!QuickBooks::setCompanyScope($entry->realm_id)) {\n\n\t\t\t\tLog::info('QuickBook AddTask: unable to set company scope.', $entryArray);\n\n\t\t\t\treturn false;\n }\n\n\t\t\t$token =QuickBooks::getToken();\n\n\t\t\tif(!$token){\n\t\t\t\treturn $entry->abandon(\"Quickbooks token not found\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// $this->directTempTriggers($entry);\n\n\t\t\t$taskName = $this->getQuickBookTaskName($entry);\n\n\n\t\t\tif(!$this->checkCompanySubscription()){\n\t\t\t\treturn $entry->abandon(\"Company is inactive\");\n\t\t\t}\n\n\t\t\t$this->registerQBODumpTask($entry);\n\n\t\t\t$settings = Quickbooks::getQuickBookSettings();\n \n\t\t\tif($this->isTwoWayDisabled($settings)) {\n\t\t\t\treturn $entry->abandon(\"two way synch disabled\");\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @todo We'll break up validateEntry\n\t\t\t */\n\t\t\t$errors = $this->validateEntry($entryArray);\n\t\t\tif(!empty($errors)) {\n\t\t\t\treturn $entry->abandon(\"validate entry failed: \".$errors[0]);\n\t\t\t}\n\n\t\t\tif($this->isAlreadyRegistered($entry)){\n\t\t\t\treturn $entry->abandon(\"this entity was already registered\");\n\n\t\t\t}\n\n\t\t\t// Prevent loop \n\t\t\tif($this->isTaksOriginatedFromJP($entry)){\n\t\t\t\treturn $entry->abandon(\"This entity in jp was created from JP originally\");\n\n\t\t\t}\n\t\t\t\n\n\t\t\t$task = QBOQueue::addTask($taskName, $entryArray, [\n\t\t\t\t'object' => $entryArray['object_type'],\n\t\t\t\t'object_id' => $entryArray['object_id'],\n\t\t\t\t'origin' => QuickBookTask::ORIGIN_QB,\n\t\t\t\t'action' => $entryArray['operation'],\n\t\t\t\t'status' => QuickBookTask::STATUS_PENDING,\n\t\t\t\t'created_source' => $this->getSource($entryArray),\n\t\t\t\t'quickbook_webhook_id' => ($entryArray['quickbook_webhook_id']) ? $entryArray['quickbook_webhook_id']: null,\n\t\t\t\t'quickbook_webhook_entry_id' => $entryArray['id']\n\t\t\t]);\n\n\t\t\tif(!$task){\n\t\t\t\t$entry->markFailed();\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t} catch(Exception $e) {\n\t\t\t$entry->markFailed();\n\t\t\tLog::error('QuickBook AddTask: Error', [(string) $e]);\n\t\t}\t\t\n }", "public function testAddToQueueNoEmailAddress()\n {\n $Email = new \\EmailTemplate('test');\n \n // Add the message to queue\n $r1 = $Email->queue([], '');\n $r2 = $Email->queue([], 'abc');\n \n // assert false was returned, which means error\n $this->assertFalse($r1);\n $this->assertFalse($r2);\n }", "public function queueContact($email) \n {\n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n $query = $db->prepare('INSERT INTO ctct_email_cache VALUES(:email);');\n $query->execute(array('email' => $email));\n }", "public function creating(EntryInterface $entry)\n {\n $this->dispatchNow(new SetStrId($entry));\n\n parent::creating($entry);\n }", "public function creating(EntryInterface $entry)\n {\n $this->dispatchNow(new SetStrId($entry));\n\n parent::creating($entry);\n }", "public function creating(EntryInterface $entry)\n {\n $this->dispatchNow(new SetStrId($entry));\n\n parent::creating($entry);\n }", "Public Function ProcessNextInbevomedia_queue()\n {\n \t//First lets make sure there isn't already a item started\n \t$DatabaseObj = Zend_Registry::get('Instance/DatabaseObj');\n\t\t\t\n \t//Lets get all entries that have envelopes and have not been started\n \t$Query = \"\n \t\tSELECT\n \t\t\tjobId\n \t\tFROM\n \t\t\tbevomedia_queue\n \t\tWHERE\n \t\t\tstarted != '0000-00-00 00:00:00'\t\n \t\tAND\n \t\t\tcompleted = '0000-00-00 00:00:00'\n \t\t\n \t\";\n \t\n \t$Results = $DatabaseObj->fetchAll($Query);\n \tif(count($Results)>0)\n \t{\n \t\t//There is, lets return right now\n \t\treturn false;\n \t}\n \telse\n \t{\n \t\t//There isn't, lets get the next in bevomedia_queue and process it\n \t\t$Query = \"\n\t \t\tSELECT\n\t \t\t\tjobId, envelope\n\t \t\tFROM\n\t \t\t\tbevomedia_queue\n\t \t\tWHERE\n\t \t\t\tstarted = '0000-00-00 00:00:00'\t\n\t \t\tAND\n\t \t\t\tcompleted = '0000-00-00 00:00:00'\n\t \t\t\n\t \t\";\n\t \t\n\t \t$Results = $DatabaseObj->fetchAll($Query);\n\t \tif(count($Results)>0)\n\t \t{\n\t \t\t//We got an item for bevomedia_queue\n\t \t\t//Lets create the file in the sandbox directory and execute it\n\t \t\t$UpdateArray = array(\n\t\t \t\t\t'started' => date(\"Y-m-d H:i:s\")\t\t\t\t\t\t \t\t\t\n\t\t \t\t);\n\t\t \t\t\n\t\t \t\t$DatabaseObj->update('bevomedia_queue', $UpdateArray, \"jobId = '{$Results[0]->jobId}'\");\n\t\t \t\t\n\t \t\tfile_put_contents($this->SandboxDirectory.DIRECTORY_SEPARATOR.$Results[0]->jobId.'.php', $Results[0]->envelope);\n\t \t\tob_start();\n\t \t\tinclude($this->SandboxDirectory.DIRECTORY_SEPARATOR.$Results[0]->jobId.'.php');\n\t \t\t$output = ob_get_clean();\n\t \t\t\n\t \t\t$UpdateArray = array(\n\t\t \t\t\t'completed' => date(\"Y-m-d H:i:s\"),\n\t \t\t\t'output'=>$output\n\t\t \t\t);\n\t\t \t\t\n\t\t \t\t$DatabaseObj->update('bevomedia_queue', $UpdateArray, \"jobId = '{$Results[0]->jobId}'\");\n\t \t\treturn true;\n\t \t}\n\t \telse \n\t \t{\n\t \t\t//There are no items in bevomedia_queue\n\t \t\treturn false;\n\t \t}\n \t}\n \t\n }", "public function runQueue();", "public function addQueue(QueueInterface $queue);", "function getNextTask( $queue ) {\n\t\t$query = \"SELECT cd.`ticket_id` FROM `\".BIT_DB_PREFIX.\"task_ticket` cd\n\t\t\t\t\t\t WHERE cd.`ticket_ref` BETWEEN 'TODAY' AND 'TOMORROW' AND cd.`room` = $queue + 80\n\t\t\t\t\t\t AND cd.`office` = 1\n\t\t\t\t \t\t ORDER BY cd.`ticket_ref`\";\n\t\t$next = $this->mDb->getOne( $query );\n// Add switch of user state to serving!\n\t\tif ( $next ) return true;\n\t\telse return false;\n\t}", "public function Queues();", "public function declareSimpleQueue($queueName = '', $type = self::QUEUE_DURABLE);", "public function QueueAdd($queue, $interface, $penalty);", "function queue_initialize() { \n // In this case, just return a new array \n $new = array(); \n return $new; \n}", "public function enqueue($element) {\n $this->queue[] = $element;\n }", "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 push($string) {\n\t\tif (!empty($string)) {\n\t\t\tif(!$this->duplicates && $this->objectExists($string)) return false;\n\t\t\tarray_unshift($this->objects, $string . \"\\n\"); \n\t\t\t\n\t\t\tif (count($this->objects) > $this->queueLimit && $this->queueLimit > 0) {\n\t\t\t\t$this->dequeue();\n\t\t\t}\n\t\t\tif($this->autosave) $this->save();\n\t\t}\n\t}", "public function postCreate() {\n if ($this->enabled) {\n $this->queueItems();\n }\n $server = $this->server();\n if ($server) {\n // Tell the server about the new index.\n if ($server->enabled) {\n $server->addIndex($this);\n }\n else {\n $tasks = variable_get('search_api_tasks', array());\n // When we add or remove an index, we can ignore all other tasks.\n $tasks[$server->machine_name][$this->machine_name] = array('add');\n variable_set('search_api_tasks', $tasks);\n }\n }\n }", "function check(){\n\techo \"Looking for jobs and adding to queue\\n\";\n\t\n\t$times = date('d-M-Y');\n\tif(DEBUG) $qlog = new snowytech\\stphplogger\\logWriter('../logs/check-queue-' . $times . '.txt');\n\t$check = new snowytech\\stphpschedule\\schedule();\n\t//Goes through whole Jobs table and checks interval!\t\n\t$db = db::getInstance();\n\t$sql = \"SELECT * FROM JOBS\";\n\t$stmt = $db->getData($sql);\n\n\t//Count the rows and send console message there are no jobs configured.\n\tif ( count($stmt) > 0) {\n\t\tforeach($stmt as $row){\n\t\t\t$id = $row['id'];\n\t\t\t$job_name = $row['name'];\n\t\t\t$path = $row['path'];\n\t\t\t$in_queue = $row['status_int'];\n\t\t\t$lastrun = $row['last_run'];\n\t\t\t$interval = $row['interval'];\n\t\t\t$global_hold = $row['global_hold'];\n\t\t\t\n\t\t\t$r = $check->interval($lastrun, $interval);\n\t\t\t\n\t\t\t//Dont run if global hold is set to 1\n\t\t\tif($global_hold !=1){\n\t\t\t\t//Dont run if $in_queue = 0 ( already in queue )\n\t\t\t\tif($in_queue != 0){\n\t\t\t\t\tif( $r ) {\n\t\t\t\t\t\techo \"Job hit the queue: \" . $job_name . \"\\n\";\n\t\t\t\t\t\t$count = time();\n\t\t\t\t\t\techo $count . \"\\n\";\n\t\t\t\t\t\tif(DEBUG) $qlog->info('Job hit the queue: ' . $job_name . \" : time: \" . $count);\n\t\t\t\t\t\t \n\t\t\t\t\t\t//Now last update is updating in table. Need to add an entry to the QUE and update last run from there.\t\t\t\t\n\t\t\t\t\t\t$data = array(':jid' => $id, ':path' => $path, ':hold' => '1', ':time' => $count);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add into QUEUE\n\t\t\t\t\t\t$sql= 'INSERT INTO QUEUE (job_id, path, hold, in_que_time) VALUES (:jid,:path,:hold,:time)';\n\t\t\t\t\t\t$db->execQuery($sql, $data);\n\n\t\t\t\t\t\t//update status_int, prevents multiple entries into queue\n\t\t\t\t\t\t$sql= \"UPDATE JOBS SET status_int = 0 WHERE id = '$id'\";\n\t\t\t\t\t\t$db->updateData($sql);\n\t\t\t\t\t}else{ \n\t\t\t\t\t\techo \"NOT ready to run - \" . $job_name . \"\\n\"; \n\t\t\t\t\t\t//Log that its intervnal is not ready\n\t\t\t\t\t\tif(DEBUG) $qlog->info('NOT RUN - interval is ' . $interval . \" minutes on JOB: \" . $job_name . \"\\n\");\n\t\t\t\t\t}\n\t\t\t\t} else { \n\t\t\t\t\techo \"JOB \" . $job_name . \" - already in QUEUE!\\n\"; \n\t\t\t\t\tif(DEBUG) $qlog->info('JOB ' . $job_name . \" - already in QUEUE!\");\n\t\t\t\t}\n\t\t\t} else { \n\t\t\t\techo \"JOB \" . $job_name . \" is HELD globally!\\n\";\n\t\t\t\tif(DEBUG) $qlog->info(\"JOB \" . $job_name . \" is HELD globally!\\n\");\n\t\t\t}\n\t\t}\n\t} else { echo \"There are no JOBS configured!\"; }\n\t$db->closeDB();\n}", "public static function queue($queue, $key, $data = array()) {\n static::$queued[$queue][$key] = $data;\n }", "public static function enqueueAt($at, $queue, $class, $args = array())\n\t{\n\t\tself::validateJob($class, $queue);\n\n\t\t$job = self::jobToHash($queue, $class, $args);\n\t\tself::delayedPush($at, $job);\n\t\t\n\t\tResque_Event::trigger('afterRepeatSchedule', array(\n\t\t\t'at' => $at,\n\t\t\t'queue' => $queue,\n\t\t\t'class' => $class,\n\t\t\t'args' => $args,\n\t\t));\n\t}", "public function testReserveQueueJob()\n {\n $queueJobTest1 = new TestQueueJob('price', 'ShopwarePriceImport');\n\n $this->queue->enqueue($queueJobTest1);\n $result = $this->queue->reserve();\n\n $this->assertInstanceOf(Job::class, $result);\n $this->assertTrue($result->isReserved(Queue::EXPIRATION_TIME));\n $this->assertCount(1, $this->queueStorage->queue);\n }", "function addSongsToQueue($accountId, $soundtrackId, $startSong, $startingSequence = 1)\n{\n \n $sql = \"SELECT * FROM soundtrack_playlist WHERE soundtrack_id = $soundtrackId\";\n \n $rows = mysql_query($sql);\n $songs = array();\n $songIds = array();\n\n if ($startSong)\n {\n $startSongId = intval($startSong['song_id']);\n $songIds[] = $startSongId;\n }\n\n while ($row = mysql_fetch_array($rows, MYSQL_ASSOC))\n {\n $playlistId = $row['playlist_id'];\n $weight = $row['weight'];\n\n // TODO: What if there aren't enough songs from this playlist?\n \n $sql = \"SELECT * FROM playlist_song JOIN song ON playlist_song.song_id = song.song_id WHERE playlist_id = $playlistId \" .\n \"AND (playlist_song.song_id NOT IN (SELECT song_id FROM account_queue WHERE account_id = $accountId)) \" .\n \"AND (playlist_song.song_id NOT IN (SELECT song_id FROM account_song WHERE account_id = $accountId AND action = (-2))) \" .\n \"AND (playlist_song.song_id NOT IN (SELECT song_id FROM account_song WHERE account_id = $accountId AND `timestamp` >= DATE_SUB(NOW(), INTERVAL 1 DAY))) \" .\n \"AND (playlist_song.song_id NOT IN (SELECT song_id FROM soundtrack_exclude_song WHERE soundtrack_id = $soundtrackId)) \";\n\n if (count($songIds) > 0)\n {\n $sql .= \"AND (playlist_song.song_id NOT IN (\" . implode(',', $songIds) . \")) \";\n } \n \n $sql .= \"AND playlist_song.status = 0 AND song.status = 0 ORDER BY RAND() LIMIT $weight\";\n \n //echo $sql;\n \n $songRows = mysql_query($sql);\n $songCount = 0;\n\n while ($row = mysql_fetch_array($songRows, MYSQL_ASSOC))\n {\n $songId = intval($row['song_id']);\n $songIds[] = $songId;\n\n $songs[] = $row;\n $songCount++;\n }\n }\n \n // Randomize the songs\n\n shuffle($songs);\n \n // Prepend the start song\n \n if ($startSong)\n {\n array_unshift($songs, $startSong);\n }\n \n // Try to make sure the same artist isn't too close to themselves\n // Some soundtracks don't want this\n\n $separateArtists = true; \n $sql = \"SELECT shuffle FROM soundtrack WHERE soundtrack_id = $soundtrackId\";\n $rows = mysql_query($sql);\n\n if ($row = mysql_fetch_array($rows, MYSQL_ASSOC))\n {\n $separateArtists = intval($row['shuffle']);\n }\n \n if ($separateArtists)\n {\n $songCount = count($songs);\n \n for ($i = 1; $i < ($songCount - 1); $i++)\n {\n $artistA = $songs[$i-1]['artist'];\n $artistB = $songs[$i]['artist'];\n \n if (strcmp(strtolower($artistA), strtolower($artistB)) == 0)\n {\n // Found a match\n // Just swap B with C\n \n $save = $songs[$i];\n $songs[$i] = $songs[$i+1];\n $songs[$i+1] = $save;\n }\n }\n }\n \n // Append to the queue\n \n $sequence = $startingSequence;\n \n foreach ($songs as $song)\n {\n $songId = $song['song_id'];\n $playlistId = $song['playlist_id'];\n \n mysql_query(\"INSERT INTO account_queue (account_id, soundtrack_id, playlist_id, song_id, sequence) VALUES ($accountId, $soundtrackId, $playlistId, $songId, $sequence)\");\n $sequence++;\n }\n \n \n}", "public function testReservingReservedQueueJob()\n {\n $queueJobTest1 = new TestQueueJob('price', 'ShopwarePriceImport');\n $queueJobTest2 = new TestQueueJob('product', 'ShopwareProductExport');\n\n $this->queue->enqueue($queueJobTest1);\n $this->queue->enqueue($queueJobTest2);\n $this->queue->reserve();\n $result = $this->queue->reserve();\n\n $this->assertNull($result);\n $this->assertCount(2, $this->queueStorage->queue);\n }", "public function queueOn($queue, $numbers = null, $message = null, $type = null);", "function queueAssignment($name, $email, $phone) {\n\t$detailsArray = array('name' => $name, 'email' => $email, 'phone' => $phone);\n\t$detailsStr = json_encode($detailsArray);\n\twriteFile($detailsArray);\n\t// client code\n\t$client = new GearmanClient();\n\t$client->addServer();\n\t$store = $client->do(\"saveRecord\", $detailsStr);\n}", "function create_mailbox($db_array,$form_array,$path) {\n\techo \"<div align='center'>\";\n\tif (preg_match(\"/^([a-z0-9]{1}[a-z0-9\\.+_-]{1,18}[a-z0-9]{1})$/i\",$form_array[\"Boxname\"])) {\n\t\t$dbhandler=\"\";\n\t\topen_db($dbhandler,$db_array);\n\t\t$boxname = $form_array[\"Boxname\"];\n\t\t$creationdate = time();\n\t\t$query = $dbhandler->query(\"SELECT * FROM `mailboxlist` WHERE boxname='\".$boxname.\"'\");\t\n\t\tif (mysqli_num_rows($query)==0){\n\t\t\tmysqli_query($dbhandler,\"INSERT INTO `mailboxlist`(`boxname`, `destination`, `duration`, `comment`) VALUES ('\".$form_array['Boxname'].\"','\".$form_array['Destination'].\"','\".$_POST['ttl'].\"','\".$form_array['Comment'].\"')\");\n\t\t\t$boxname = str_replace(\".\",\":\",$boxname); # replace all dots with colons for qmail handling\n\t\t\techo $GLOBALS[\"text_create_file\"].\": \".$path.\".qmail-\".$boxname.\"<br />\";\n\t\t\t$filehandler = fopen($path.\".qmail-\".$boxname, \"w+\");\n\t\t\t# Create a new Mailbox-File\n\t\t\tfwrite($filehandler, $form_array['Destination']); # Writes the destination-address into the file\n\t\t\techo $GLOBALS[\"text_box_created\"];\n\t\t}\n\t\telse { echo $GLOBALS[\"text_box_exists\"]; }\n\t\tmysqli_close ($dbhandler);\n\t}\n\telse { echo $GLOBALS[\"text_invalid_boxname\"].\": \".$form_array[\"Boxname\"];}\n\techo \"</div>\";\n}", "public function autoPostOpenQueueItems()\n\t{\n\t\t$helper = Mage::helper('fw_queue');\n\t\tif($helper->isQueueEnabled())\n\t\t{\n\t\t\t$start = -microtime(true);\n\t\t\t$collection = Mage::getModel('fw_queue/queue')->getCollection();\n\t\t\t$collection->addFieldToSelect('*');\n\t\t\t$collection->addFieldToFilter('status', array(array('eq' => '1'),array('eq' => '4')));\n\t\t\tforeach($collection as $queue_item){\n\t\t\t\t$queue = Mage::getModel('fw_queue/queue')->load($queue_item->getId());\n\t\t\t\t$queue->process();\n\t\t\t}\n\t\t\t//CLEAN-UP AND STOP ERROR QUEUE ITEMS\n\t\t\t$expired = Mage::getModel('fw_queue/queue')->getCollection();\n\t\t\t$expired->addFieldToSelect('*');\n\t\t\t$expired->addFieldToFilter('status', array(array('eq' => '4')));\n\t\t\t$expired->addFieldToFilter('number_attempts', array(array('gteq' => '75')));\n\t\t\tforeach($expired as $expire_item){\n\t\t\t\t$queue = Mage::getModel('fw_queue/queue')->load($queue_item->getId());\n\t\t\t\t//STATUS_ABORTED_NOTIFIED = 5\n\t\t\t\t$queue->changeStatus('5');\n\t\t\t}\n\n\t\t\t//CLEAN-UP OLD ITEMS\n\t\t\t$date = date('Y-m-d H:i:s', time());\n\t\t\t$queueLastAttemptDate = strtotime ( '-90 day' , strtotime ( $date ) ) ;\n\t\t\t$queueLastAttemptDate = date ( 'Y-m-d H:i:s' , $queueLastAttemptDate );\n\n\t\t\ttry {\n\t\t\t\t$queueItems = Mage::getModel('fw_queue/queue')\n\t\t\t\t->getCollection()\n\t\t\t\t->addFieldToSelect('*')\n\t\t\t\t->addFieldToFilter('last_attempt', array('to' => $queueLastAttemptDate));\n\n\t\t\t\t$queueItems->getSelect()->limit(10000);\n\n\t\t\t\tforeach ($queueItems as $queueItem)\n\t\t\t\t{\n\t\t\t\t\t$queueItem->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception $e){\n\t\t\t\tMage::logException($e->getMessage());\n\t\t\t}\n\t\t\t$totalTime = microtime(true) + $start;\n\t\t\t$span = gmdate(\"H:i:s\",$totalTime);\n\t\t\t$micro = substr($totalTime - floor($totalTime),2);\n\t\t\t$logLine = \"Queue executed in {$span}.{$micro}\\r\\n\";\n\t\t\tMage::Log($logLine,null,'fw_queue.log');\n\n\t\t\t//Dispatch Event to let fw_orderpublish know when queue is done running\n\t\t\t$eventData = array('queue_complete' => 'true');\n\t\t\tMage::dispatchEvent('fw_queue_run_complete');\n\t\t}\n\n\t}", "public function getNextQueueItem() {\n $select = db_select($this->og_controller->queue_table, 'queue');\n $select->condition('queue.processed', 0);\n $select->fields('queue', array('entity_type', 'entity_id'));\n $select->range(0, 1);\n\n if ($item = $select->execute()->fetchObject()) {\n return new Dumper_Data_QueueItem($this->og_controller->og_node->nid, $item->entity_type, $item->entity_id);\n }\n\n return FALSE;\n }", "abstract public function queue($ts = null);", "function startQueue(){\n\n // Maintain the array checkLogQ as a FIFO buffer with length 4.\n // When a new entry is added, remove oldest entry and shuffle.\n function addCheckLog($message){\n global $checkLogQ;\n $length = 4;\n // If checkLogQ size is smaller than 4 add the message\n if(count($checkLogQ)<$length){\n $checkLogQ[] = $message;\n }\n // If checkLogQ size is bigger than 4 - Remove the oldest message and add the new one\n else{\n array_shift($checkLogQ);\n $checkLogQ[] = $message;\n }\n }\n // Prints all checkLogQ messages to the console \n function printCheckLogQ(){\n global $checkLogQ;\n foreach($checkLogQ as $message){\n print($message);\n }\n $checkLogQ = array(); // reset a variable to an empty array\n }\n \n try{\n while(true){\n addCheckLog(date('Y/m/d H:i:s').\" Awaiting a message...\\n\");\n\n // Receive messages from queue, maximum waits for 20 seconds for message\n // receive_request - contain all the queue messages\n global $sqs;\n $receive_request = $sqs->receiveMessage(array(\n 'QueueUrl' => ds_config(\"QUEUE_URL\"),\n 'WaitTimeSeconds' => 20,\n 'MaxNumberOfMessages' => 10\n ));\n // Count the amount of messages received\n $msgCount = 0;\n if($receive_request->getPath('Messages') !== NULL){\n $msgCount = count($receive_request->getPath('Messages'));\n }\n addCheckLog(date('Y/m/d H:i:s').\" found $msgCount message(s)\\n\");\n // If at least one message has been received\n if ($msgCount!=0) {\n printCheckLogQ();\n foreach ($receive_request->getPath('Messages') as $msg) {\n messageHandle($msg, $receive_request);\n }\n }\n }\n }\n catch (Exception $e) {\n printCheckLogQ();\n print(date('Y/m/d H:i:s').\" Queue receive error: $e\");\n sleep(5);\n global $restart;\n $restart = true;\n }\n }", "public function test_createQueue() {\n\n }", "public function push();", "public function push();", "public function pushRecord()\r\n {\r\n\r\n }", "public function execute() {\n $this->getQueue()->push($this->getJob(), $this->getJobOptions());\n }", "protected function getNotification_Type_PostInQueueService()\n {\n $instance = new \\phpbb\\notification\\type\\post_in_queue(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['language']) ? $this->services['language'] : $this->getLanguageService()) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['auth']) ? $this->services['auth'] : ($this->services['auth'] = new \\phpbb\\auth\\auth())) && false ?: '_'}, './../', 'php', 'phpbb_user_notifications');\n\n $instance->set_user_loader(${($_ = isset($this->services['user_loader']) ? $this->services['user_loader'] : $this->getUserLoaderService()) && false ?: '_'});\n $instance->set_config(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'});\n\n return $instance;\n }", "protected function _write_to_queue()\r\n {\r\n if (!is_array($this->_id_list) OR empty($this->_id_list))\r\n {\r\n return false;\r\n }\r\n\r\n $indexes = vBSphinxSearch_Core::get_sphinx_index_map($this->_content_type_id);\r\n if (empty($indexes))\r\n {\r\n return false;\r\n }\r\n\r\n $db = vB::$vbulletin->db;\r\n $values = array();\r\n foreach ($this->_id_list as $id)\r\n {\r\n $values[] = '(' . $this->_content_type_id . ', ' . $id . ')';\r\n }\r\n\r\n $sql = 'INSERT INTO ' . TABLE_PREFIX . 'vbsphinxsearch_queue (`contenttypeid`, `primaryid`)\r\n VALUES ' . implode(', ', $values) . '\r\n ON DUPLICATE KEY UPDATE\r\n `contenttypeid` = VALUES(`contenttypeid`), `primaryid` = VALUES(`primaryid`), `done` = 0';\r\n return $db->query_write($sql);\r\n }", "static function newChannel($exchange, $queue)\n\t{\n\t\tif (!empty(self::$channel))\n\t\t{\n\t\t\tself::$channel->close();\n\t\t}\n\t\tself::init($exchange, $queue);\n\t}", "protected function initializeQueue() {\n\t\t$className = $this->getConfiguredQueueClassName();\n\t\t$objectFactory = new ObjectFactory();\n\t\t$queueFactory = new QueueFactory();\n\t\tself::$instance = new $className();\n\t\tif (TRUE === self::$instance instanceof QueueCachableInterface) {\n\t\t\t$cacheFactory = new CacheFactory();\n\t\t\t$queueCache = $cacheFactory->fetchCache($className::CACHE_IDENTITY);\n\t\t\tself::$instance->setCache($queueCache);\n\t\t\tself::$instance->load();\n\t\t}\n\t\treturn self::$instance;\n\t}", "function mrbsCreateSingleEntry($starttime, $endtime, $entry_type, $repeat_id, $room_id,\n $owner, $name, $type, $description)\n{\n\tglobal $tbl_entry;\n\n\t$name = slashes($name);\n\t$description = slashes($description);\n\t\n\t# make sure that any entry is of a positive duration\n\t# this is to trap potential negative duration created when DST comes\n\t# into effect\n\tif( $endtime > $starttime )\n\t$sql = \"INSERT INTO $tbl_entry ( start_time, end_time, entry_type, repeat_id, room_id,\n\t create_by, name, type, description)\n\t VALUES ($starttime, $endtime, $entry_type, $repeat_id, $room_id,\n\t '$owner', '$name', '$type', '$description')\";\n\t\n\tif (sql_command($sql) < 0) return 0;\n\t\n\treturn sql_insert_id(\"$tbl_entry\", \"id\");\n}", "function it_exchange_abandoned_carts_update_qualified_shoppers_queue( $new_queue=array() ) {\n\t$plugin_options = it_exchange_get_option( 'addon_abandoned_carts' );\n\t$new_queue = (array) $new_queue;\n\t$new_queue = apply_filters( 'it_exchange_abandoned_carts_update_qualified_shoppers_queue', $new_queue );\n\n\t$plugin_options['qualified_shoppers'] = $new_queue;\n\tit_exchange_save_option( 'addon_abandoned_carts', $plugin_options );\n}", "public function QueueMsg(array $queue_entry)\n {\n $queue_entry[\"MSG_TIME\"] = date(\"r\");\n array_push ($this->messages, $queue_entry);\n if ( $queue_entry[\"MSG_SEVERITY\"] <= $this->error_condition_trigger_thresh )\n {\n $this->in_error_condition = true;\n $this->FlushQueue();\n $this->in_error_condition = false;\n return;\n }\n $queue_has_messages = true;\n while ( ( ( sizeof ( $this->messages ) > $this->max_queue_size ) | ( !$this->queue_mode ) ) & ( $queue_has_messages ) )\n {\n $queue_has_messages = $this->FlushMsg();\n }\n return;\n }", "public function testGetQueueUrlQueueCreated()\n {\n $queueUrl = 'my-invoice-queue-message-url';\n $results = [\n new Result(['QueueUrl' => $queueUrl])\n ];\n $sqsQueue = $this->getSqsQueueInstance($results);\n $this->assertEquals($queueUrl, $sqsQueue->getQueueUrl());\n $this->assertEquals(0, $this->getAwsMockHandlerStackCount());\n }", "function collections_new($parameters) \n\t{\n\t\t\n\t\t$qi = new ECash_Queues_BasicQueueItem($parameters->application_id);\n\t\t$qm = ECash::getFactory()->getQueueManager();\n\t\t$qm->removeFromAllQueues($qi);\n\n\t\t$holidays = Fetch_Holiday_List();\n\t\t$pdc = new Pay_Date_Calc_3($holidays);\n\n\t\t$today = date(\"Y-m-d\");\n\t\t$application_id = $parameters->application_id;\n\n\t\tRemove_Standby($application_id);\n\n\t\t// Send Return Letter 1 - 'Specific Reason Letter' 6.1.1.3\n\t\t//ECash_Documents_AutoEmail::Queue_For_Send($parameters->application_id, 'RETURN_LETTER_1_SPECIFIC_REASON', $parameters->status->fail_set[0]->transaction_register_id);\n\t\tECash_Documents_AutoEmail::Queue_For_Send($parameters->application_id, 'PAYMENT_FAILED', $parameters->status->fail_set[0]->transaction_register_id);\n\n\t\t// 6.1.1.2 - Assess late fee\n\t\t$assess_fee = FALSE;\n\t\t\n\t\tforeach ($parameters->status->fail_set as $f)\n\t\t{\n\t\t\tif (in_array($f->clearing_type, array('ach','card')))\n\t\t\t{\n\t\t\t\t$assess_fee = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tforeach ($parameters->schedule as $e)\n\t\t{\n\t\t\tif (in_array($e->type, array('assess_fee_ach_fail','assess_fee_card_fail')))\n\t\t\t{\n\t\t\t\t$assess_fee = FALSE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($assess_fee)\n\t\t{\n\t\t\tif (isCardSchedule($parameters->application_id))\n\t\t\t{\n\t\t\t\t$payment1 = 'assess_fee_card_fail';\n\t\t\t\t$description1 = 'Card Fee Assessed';\n\t\t\t\t$payment2 = 'payment_fee_card_fail';\n\t\t\t\t$description2 = 'Card Fee Payment';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$payment1 = 'assess_fee_ach_fail';\n\t\t\t\t$description1 = 'ACH Fee Assessed';\n\t\t\t\t$payment2 = 'payment_fee_ach_fail';\n\t\t\t\t$description2 = 'ACH Fee Payment';\n\t\t\t}\n\n\t\t\t$late_fee = $parameters->rules['return_transaction_fee'];\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('fee' => $parameters->rules['return_transaction_fee']));\n\t\t\t$event = Schedule_Event::MakeEvent($today, $today, $amounts, $payment1,$description1);\n\n\t\t\tPost_Event($parameters->application_id, $event);\n\n\t\t\t// Generate a late fee payment\n\t\t\t$next_payday = Get_Next_Payday(date(\"Y-m-d\"), $parameters->info, $parameters->rules);\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('fee' => -$parameters->rules['return_transaction_fee']));\n\t\t\t$event = Schedule_Event::MakeEvent($next_payday['event'], $next_payday['effective'], $amounts, $payment2,$description2);\n\n\t\t\tRecord_Event($parameters->application_id, $event);\n\t\t}\n\n\t\t// 6.1.1.1 - Change status to Collections New\n\t\tUpdate_Status(null, $application_id, array('new','collections','customer','*root'), NULL, NULL, FALSE);\n\n\t\t// part of 6.1.2 and 6.1.3 - Add to Collections New Queue\n\t\t$qm = ECash::getFactory()->getQueueManager();\n\t\t$queue_item = $qm->getQueue('collections_new')->getNewQueueItem($parameters->application_id);\n\t\t//\t\t$queue_item->Priority = 200; Not in spec\n\t\t$qm->moveToQueue($queue_item, 'collections_new');\n\n\t\tComplete_Schedule($parameters->application_id);\n\n\t\t$this->Log(__METHOD__.\": Processed application {$application_id} as Collections New.\");\n\n\t\treturn 0;\n\t}", "public function getNextQueuedJob() {\n \t}", "public function add($item)\n {\n $this->queueItems[] = $item;\n }", "function setupNewItem()\n {\n $item = array(\n 'id' => null,\n 'pending_id' => null,\n 'content_id' => null,\n 'created' => date( 'Y-m-d H:i:s'),\n 'createdBy' => $_SESSION['isLoggedUID'],\n 'updated' => null,\n 'updatedBy' => null,\n 'status' => 'create',\n 'topic' => null,\n 'subtopic' => null,\n 'heading' => null,\n 'date' => date( 'Y-m-d H:i:s'),\n 'caption' => null,\n 'text' => null,\n 'download_src' => null,\n 'download_name' => null,\n 'images' => array(),\n 'tags' => array(),\n 'terms' => array());\n $_SESSION['cropId'] = null;\n\n return($item);\n }", "public function action() {\n\t\tself::$_queue = new \\Flux\\LeadSplit();\n\n\t\t// If this is the primary thread, then run some cleanup/statistics\n\t\tif ($this->getPrimaryThread()) {\n\t\t\t$this->calculatePendingRecordCount();\n\t\t\t// Only return if there are other threads to handle the processes\n\t\t\tif ($this->getDaemon()->getThreads() > 1) { return true; }\n\t\t}\n\n\t\t$queue_items = $this->getNextItems();\n\t\tif (count($queue_items) > 0) {\n\t\t\ttry {\n\t\t\t\t/* @var $lead_split_item \\Flux\\LeadSplit */\n\t\t\t\tforeach ($queue_items as $lead_split_item) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Process the queue item\n\t\t\t\t\t\t\tif (!$lead_split_item->getSplit()->getSplit()->getScheduling()->isValid()) {\n\t\t\t\t\t\t\t\t$this->log('Cannot Fulfill Queue item ' . $lead_split_item->getId() . ' because the split schedule is not valid', array($this->pid, $lead_split_item->getId()));\n\t\t\t\t\t\t\t\t$lead_split_item->setErrorMessage('Fulfillment Schedule is closed');\n\t\t\t\t\t\t\t\tfor ($i = 0; $i < 168; $i++) {\n\t\t\t\t\t\t\t\t\tif ($lead_split_item->getSplit()->getSplit()->getScheduling()->isValid(strtotime('now + ' . $i . ' hours'))) {\n\t\t\t\t\t\t\t\t\t\t$next_attempt_time = new \\MongoDate(strtotime('now + ' . $i . ' hours'));\n\t\t\t\t\t\t\t\t\t\t$lead_split_item->setNextAttemptTime($next_attempt_time);\n\t\t\t\t\t\t\t\t\t\tbreak;\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$lead_split_item->setLastAttemptTime(new \\MongoDate());\n\t\t\t\t\t\t\t\t$lead_split_item->setIsProcessing(false);\n\t\t\t\t\t\t\t\t$lead_split_item->update();\n\t\t\t\t\t\t\t\tthrow new \\Exception('Cannot Fulfill Queue item ' . $lead_split_item->getId() . ' because the split schedule is not valid');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!$lead_split_item->getSplit()->getSplit()->getFulfillImmediately()) {\n\t\t\t\t\t\t\t\tthrow new \\Exception('Cannot Fulfill Queue item ' . $lead_split_item->getId() . ' because the split is not setup for immediate fulfillment');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ($lead_split_item->getSplit()->getSplit()->getFulfillImmediately() && \\MongoId::isValid($lead_split_item->getSplit()->getSplit()->getFulfillDelay())) {\n\t\t\t\t\t\t\t\tif ((strtotime('now') - $lead_split_item->getLead()->getLead()->getModified->sec) > ($lead_split_item->getSplit()->getSplit()->getFulfillDelay() * 60)) {\n\t\t\t\t\t\t\t\t\tthrow new \\Exception('Cannot Fulfill Queue item ' . $lead_split_item->getId() . ' because the delay has not been reached yet');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ($lead_split_item->getIsFulfilled()) {\n\t\t\t\t\t\t\t\t// Create the fulfillment handler\n\t\t\t\t\t\t\t\t/* @var $fulfillment \\Flux\\Fulfillment */\n\t\t\t\t\t\t\t\t$fulfillment = $lead_split_item->getSplit()->getSplit()->getFulfillment()->getFulfillment();\n\n\t\t\t\t\t\t\t\t/* @var $lead_split_attempt \\Flux\\LeadSplitAttempt */\n\t\t\t\t\t\t\t\t$lead_split_attempt = new \\Flux\\LeadSplitAttempt();\n\t\t\t\t\t\t\t\t$lead_split_attempt->setLeadSplit($lead_split_item->getId());\n\t\t\t\t\t\t\t\t$lead_split_attempt->setFulfillment($fulfillment->getId());\n\t\t\t\t\t\t\t\t$lead_split_attempt->setAttemptTime(new \\MongoDate());\n\n\t\t\t\t\t\t\t\t// The lead has already been fulfilled, so don't allow it to be fulfilled again\n\t\t\t\t\t\t\t\t/* @var $lead_split_attempt \\Flux\\LeadSplitAttempt */\n\t\t\t\t\t\t\t\t$lead_split_attempt = new \\Flux\\LeadSplitAttempt();\n\t\t\t\t\t\t\t\t$lead_split_attempt->setLeadSplit($lead_split_item->getId());\n\t\t\t\t\t\t\t\t$lead_split_attempt->setFulfillment($fulfillment->getId());\n\t\t\t\t\t\t\t\t$lead_split_attempt->setAttemptTime(new \\MongoDate());\n\t\t\t\t\t\t\t\t$lead_split_attempt->setIsError(false);\n\t\t\t\t\t\t\t\t$lead_split_attempt->setResponse('Already Fulfilled');\n\t\t\t\t\t\t\t\t$lead_split_item->addAttempt($lead_split_attempt);\n\t\t\t\t\t\t\t\t$lead_split_item->setDisposition(\\Flux\\LeadSplit::DISPOSITION_ALREADY_FULFILLED);\n\t\t\t\t\t\t\t\t$lead_split_item->setErrorMessage('Already Fulfilled');\n\t\t\t\t\t\t\t\t$lead_split_item->update();\n\t\t\t\t\t\t\t\tthrow new \\Exception('Cannot Fulfill Queue item ' . $lead_split_item->getId() . ' because it is already fulfilled');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (\\Exception $e) {\n\t\t\t\t\t\t\t$this->log($e->getMessage(), array($this->pid, $lead_split_item->getId()));\n\t\t\t\t\t\t\t// we failed basic validation, so continue to the next entry\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// We made it past the validations, so attempt to fulfill the lead\n\t\t\t\t\t\t//\n\n\t\t\t\t\t\t$this->log('Fulfilling [' . $lead_split_item->getSplit()->getName() . ']: ' . $lead_split_item->getId(), array($this->pid, $lead_split_item->getId()));\n\n\t\t\t\t\t\t// Create the fulfillment handler\n\t\t\t\t\t\t/* @var $fulfillment \\Flux\\Fulfillment */\n\t\t\t\t\t\t$fulfillment = $lead_split_item->getSplit()->getSplit()->getFulfillment()->getFulfillment();\n\n\t\t\t\t\t\t/* @var $lead_split_attempt \\Flux\\LeadSplitAttempt */\n\t\t\t\t\t\t$lead_split_attempt = new \\Flux\\LeadSplitAttempt();\n\t\t\t\t\t\t$lead_split_attempt->setLeadSplit($lead_split_item->getId());\n\t\t\t\t\t\t$lead_split_attempt->setFulfillment($fulfillment->getId());\n\t\t\t\t\t\t$lead_split_attempt->setAttemptTime(new \\MongoDate());\n\n\t\t\t\t\t\t$results = $fulfillment->queueLead($lead_split_attempt);\n\n\t\t\t\t\t\t/* @var $result \\Flux\\LeadSplitAttempt */\n\t\t\t\t\t\tif (count($results) > 0) {\n\t\t\t\t\t\t\tforeach ($results as $key => $result) {\n\t\t\t\t\t\t\t\t// Save the split queue attempts back to the split queue item\n\t\t\t\t\t\t\t\t$lead_split_item->addAttempt($result);\n\n\t\t\t\t\t\t\t\t$lead_split_item->setDebug($result->getRequest());\n\t\t\t\t\t\t\t\t$lead_split_item->setLastAttemptTime(new \\MongoDate());\n\t\t\t\t\t\t\t\t$lead_split_item->setIsProcessing(false);\n\n\t\t\t\t\t\t\t\tif ($result->getIsDuplicate()) {\n\t\t\t\t\t\t\t\t\t$lead_split_item->setIsError(true);\n\t\t\t\t\t\t\t\t\t$lead_split_item->setErrorMessage($result->getResponse());\n\t\t\t\t\t\t\t\t\t$lead_split_item->setIsFulfilled(true);\n\t\t\t\t\t\t\t\t\t$lead_split_item->setDisposition(\\Flux\\LeadSplit::DISPOSITION_ALREADY_FULFILLED);\n\t\t\t\t\t\t\t\t\t$lead_split_item->update();\n\n\t\t\t\t\t\t\t\t\t/* @var $report_lead \\Flux\\ReportLead */\n\t\t\t\t\t\t\t\t\t$report_lead = new \\Flux\\ReportLead();\n\t\t\t\t\t\t\t\t\t$lead = $lead_split_item->getLead()->getLead();\n\t\t\t\t\t\t\t\t\t$report_lead->setLead($lead->getId());\n\t\t\t\t\t\t\t\t\t$report_lead->setClient($lead->getTracking()->getClient()->getId());\n\t\t\t\t\t\t\t\t\t$report_lead->setDisposition(\\Flux\\ReportLead::LEAD_DISPOSITION_DUPLICATE);\n\t\t\t\t\t\t\t\t\t$report_lead->setRevenue(0.00);\n\t\t\t\t\t\t\t\t\t$report_lead->setPayout(0.00);\n\t\t\t\t\t\t\t\t\t$report_lead->setReportDate(new \\MongoDate());\n\t\t\t\t\t\t\t\t\t$report_lead->insert();\n\t\t\t\t\t\t\t\t\t$this->log('DUPLICATE [' . $lead_split_item->getSplit()->getName() . ']: ' . $lead_split_item->getId(), array($this->pid, $lead_split_item->getId()));\n\t\t\t\t\t\t\t\t} else if ($result->getIsError()) {\n\t\t\t\t\t\t\t\t\t$lead_split_item->setIsError(true);\n\t\t\t\t\t\t\t\t\t$lead_split_item->setErrorMessage($result->getResponse());\n\t\t\t\t\t\t\t\t\t$lead_split_item->setIsFulfilled(false);\n\t\t\t\t\t\t\t\t\t$lead_split_item->setAttemptCount($lead_split_item->getAttemptCount() + 1);\n\t\t\t\t\t\t\t\t\t$lead_split_item->setNextAttemptTime(new \\MongoDate(strtotime('now + 1 hour')));\n\t\t\t\t\t\t\t\t\t$lead_split_item->setDisposition(\\Flux\\LeadSplit::DISPOSITION_PENDING);\n\t\t\t\t\t\t\t\t\t$lead_split_item->update();\n\n\t\t\t\t\t\t\t\t\t/* @var $report_lead \\Flux\\ReportLead */\n\t\t\t\t\t\t\t\t\t$report_lead = new \\Flux\\ReportLead();\n\t\t\t\t\t\t\t\t\t$lead = $lead_split_item->getLead()->getLead();\n\t\t\t\t\t\t\t\t\t$report_lead->setLead($lead->getId());\n\t\t\t\t\t\t\t\t\t$report_lead->setClient($lead->getTracking()->getClient()->getId());\n\t\t\t\t\t\t\t\t\t$report_lead->setDisposition(\\Flux\\ReportLead::LEAD_DISPOSITION_DISQUALIFIED);\n\t\t\t\t\t\t\t\t\t$report_lead->setRevenue(0.00);\n\t\t\t\t\t\t\t\t\t$report_lead->setPayout(0.00);\n\t\t\t\t\t\t\t\t\t$report_lead->setReportDate(new \\MongoDate());\n\t\t\t\t\t\t\t\t\t$report_lead->insert();\n\t\t\t\t\t\t\t\t\t$this->log('ERROR [' . $lead_split_item->getSplit()->getName() . ']: ' . $lead_split_item->getId() . ', ERROR: ' . $result->getResponse(), array($this->pid, $lead_split_item->getId()));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$lead_split_item->setIsFulfilled(true);\n\t\t\t\t\t\t\t\t\t$lead_split_item->setIsError(false);\n\t\t\t\t\t\t\t\t\t$lead_split_item->setErrorMessage('');\n\t\t\t\t\t\t\t\t\t$lead_split_item->setDisposition(\\Flux\\LeadSplit::DISPOSITION_FULFILLED);\n\t\t\t\t\t\t\t\t\t$lead_split_item->update();\n\n\t\t\t\t\t\t\t\t\t/* @var $lead \\Flux\\Lead */\n\t\t\t\t\t\t\t\t\t$lead = $lead_split_item->getLead()->getLead();\n\n\t\t\t\t\t\t\t\t\t// Add a fulfilled event to the lead\n\t\t\t\t\t\t\t\t\tif ($fulfillment->getTriggerFulfillmentFlag()) {\n\t\t\t\t\t\t\t\t\t\t$lead->setValue(\\Flux\\DataField::DATA_FIELD_EVENT_FULFILLED_NAME, 1);\n\t\t\t\t\t\t\t\t\t\t$lead->update();\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Add/Update the lead reporting\n\t\t\t\t\t\t\t\t\t/* @var $report_lead \\Flux\\ReportLead */\n\t\t\t\t\t\t\t\t\t$report_lead = new \\Flux\\ReportLead();\n\t\t\t\t\t\t\t\t\t$report_lead->setLead($lead->getId());\n\t\t\t\t\t\t\t\t\t$report_lead->setClient($lead->getTracking()->getClient()->getId());\n\t\t\t\t\t\t\t\t\t$report_lead->setDisposition(\\Flux\\ReportLead::LEAD_DISPOSITION_ACCEPTED);\n\t\t\t\t\t\t\t\t\t$report_lead->setRevenue($lead_split_attempt->getBounty());\n\t\t\t\t\t\t\t\t\tif ($lead->getTracking()->getCampaign()->getCampaign()->getPayout() > 0) {\n\t\t\t\t\t\t\t\t\t\t$report_lead->setPayout($lead->getTracking()->getCampaign()->getCampaign()->getPayout());\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$report_lead->setPayout($lead->getTracking()->getOffer()->getOffer()->getPayout());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$report_lead->setReportDate(new \\MongoDate());\n\t\t\t\t\t\t\t\t\t$report_lead->setAccepted(true);\n\t\t\t\t\t\t\t\t\t$report_lead->insert();\n\t\t\t\t\t\t\t\t\t$this->log('FULFILLED [' . $lead_split_item->getSplit()->getName() . ']: ' . $lead_split_item->getId(), array($this->pid, $lead_split_item->getId()));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new \\Exception('No results returned from fulfillment, check for fulfillment errors or network errors');\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (\\Exception $e) {\n\t\t\t\t\t\t$this->log($e->getMessage(), array($this->pid));\n\t\t\t\t\t\t$lead_split_item->setIsError(true);\n\t\t\t\t\t\t$lead_split_item->setErrorMessage($e->getMessage());\n\t\t\t\t\t\t$lead_split_item->setIsFulfilled(false);\n\t\t\t\t\t\t$lead_split_item->setAttemptCount($lead_split_item->getAttemptCount() + 1);\n\t\t\t\t\t\t$lead_split_item->setNextAttemptTime(new \\MongoDate(strtotime('now + 1 hour')));\n\t\t\t\t\t\t$lead_split_item->update();\n\t\t\t\t\t}\n\n\t\t\t\t\t// Unset the queue item and flag it as processed\n\t\t\t\t\tself::$_queue->updateMultiple(\n\t\t\t\t\t\tarray('_id' => $lead_split_attempt->getId()),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'$unset' => array(\n\t\t\t\t\t\t\t\t'__pid_fulfill' => 1\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray('multiple' => false, 'upsert' => false)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$this->log('Unhandled exception threw us out of the fulfillment loop');\n\t\t\t\t$this->log($e->getMessage(), array($this->pid));\n\t\t\t\t$this->log($e->getTraceAsString(), array($this->pid));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->log('No more items to process', array($this->pid));\n\t\t\tsleep(5);\n\t\t}\n\t\treturn true;\n\t}", "public function pushToFareye() {\r\n Mage::getModel('marketplace/fareyedataqueue')->pushToFareye();\r\n }", "function enQueue($value) {\n if ($this->isFull()){\n return FALSE;\n }\n $this->data[$this->rear]=$value;\n $this->rear=($this->rear+1)%$this->size;\n return TRUE;\n }", "private function respawn()\n {\n // create new event at the end of the queue\n Mage::getModel('marketingsoftware/queue')\n ->setObject($this->currentStatus)\n ->setAction('file_sync')\n ->save();\n }", "function target_add_topic($topic)\n{\n\t// if ($GLOBALS['VERBOSE']) pf('...'. $topic['id']);\n\n\tif (!isset($topic['orderexpiry'])) {\n\t\t$topic['orderexpiry'] = 0;\n\t}\n\n\t// Set orderexpiry for announcement and sticky topics.\n\tif (($topic['thread_opt'] & 2) || ($topic['thread_opt'] & 4)) {\n\t\t$topic['orderexpiry'] = 1000000000;\n\t}\n\n\t// Skip topics that doesn't belong to a forum.\n\tif (!isset($GLOBALS['forum_map'][ (int)$topic['forum_id'] ])) {\n\t\tpf('WARNING: Skip topic #'. $topic['id'] .'. Probably an announcement or orphaned message!');\n\t\treturn;\n\t}\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread (\n\t\tid, forum_id, root_msg_id, views, replies, thread_opt, orderexpiry\n\t\t) VALUES(\n\t\t\t'. (int)$topic['id'] .',\n\t\t\t'. $GLOBALS['forum_map'][ (int)$topic['forum_id'] ] .',\n\t\t\t'. (int)$topic['root_msg_id'] .',\n\t\t\t'. (int)$topic['views'] .',\n\t\t\t'. (int)$topic['replies'] .',\n\t\t\t'. (int)$topic['thread_opt'] .',\n\t\t\t'. (int)$topic['orderexpiry'] .')\n\t');\n}", "public function add_entry($entry);", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n $name = $db->escapeString( $this->Name );\r\n if ( !isSet( $this->ID ) )\r\n {\r\n $db->lock( \"eZBug_Priority\", \"ID\" );\r\n $this->ID = $db->nextID( \"eZBug_Priority\", \"ID\" );\r\n $res = $db->query( \"INSERT INTO eZBug_Priority (ID, Name)\r\n VALUES ('$this->ID', '$name')\" );\r\n $db->unlock();\r\n }\r\n else\r\n {\r\n $res = $db->query( \"UPDATE eZBug_Priority SET\r\n\t\t Name='$name' WHERE ID='$this->ID'\" );\r\n }\r\n if ( $res == false )\r\n $db->rollback();\r\n else\r\n $db->commit();\r\n \r\n return true;\r\n }", "public function merge(self $queue): void\n {\n $data = $queue->toArray();\n\n foreach ($data as $item) {\n $this->insert($item['data'], $item['priority']);\n }\n }", "private function prepForExistingEntry()\n {\n $this->id = $this->request->input('uuid');\n\n $this->content = Entry::find($this->id)->in($this->locale)->get();\n\n $this->content->published($this->getSubmittedStatus());\n\n // Only the default locale can have its order modified\n if (! $this->isLocalized()) {\n // If no order was submitted (in the case of numeric\n // entries), we want to get the existing order key.\n if (! $order = $this->getSubmittedOrderKey()) {\n $order = $this->content->order();\n }\n\n $this->content->order($order);\n }\n }", "function addqueueAction() {\n\n // Translate Object ..\n $translate = Zend_Registry::get('Zend_Translate');\n $em = Zend_Registry::get('em');\n\n $queueForm = $this->getQueueForm();\n $conn = $this->dbConnection();\n\n // fetch First 10 tests from DB..\n $res1 = $em->createQueryBuilder()->select('t.TestId,t.TST_Name')->from('Testcreator_Model_Tests', 't')->setMaxResults(10)->getQuery();\n $testResArr = $res1->getResult();\n\n $testArr = array();\n $testArr[0] = 'Select All';\n $testIdStr = '';\n\n foreach($testResArr as $val) {\n $testArr[$val['TestId']] = $val['TST_Name'];\n $testIdStr .= $val['TestId'] . \", \";\n }\n\n $user = new TUsers();\n $importTargets = new TImporttargets();\n\n $this->view->QueueForm = $queueForm;\n\n $logger = Zend_Registry::get('Zend_Log');\n\n $clientObj = $em->getRepository('TClient')->findAll();\n\n $this->view->clientObj =$clientObj;\n\n if ($this->getRequest()->getMethod() == 'POST') {\n $request = $this->getRequest();\n if (!$queueForm->isValid($request->getPost())) {\n\n // Invalid entries\n $this->view->QueueForm = $queueForm;\n return $this->render('addqueue'); // re-render webservice form\n } else {\n $result=$this->saveQueue($request->getPost());\n\n if($result) {\n $this->_redirect('testitemanalysis/index/addqueue');\n } else {\n\n }\n }\n }\n }", "private function createEntry(){\n\t\t\t$con = Connection();\n\t\n\t\t\tif(!$con)\n\t\t\t{\n\t\t\t\t$arr_res = array();\n\t\t\t\t$arr_res['error'] = array(\"msg\" => \"no DB Connection\");\n\t\t\t\t$arr_res['result'] = array('status' => \"Failed\");\n\t\t\t\t$this->response($this->json($arr_res), 503);\n\t\t \t}\n\t\t \t$entityBody = file_get_contents('php://input');\n\t\t \t$myfile = fopen(\"newfile.txt\", \"w\") or die(\"Unable to open file!\");\n\t\t\t$txt = $entityBody;\n\t\t\tfwrite($myfile, $txt);\n\t\t\tfclose($myfile);\n\n \t\t\t$data = $this->convert_json_to_array($entityBody);\n \t\t\t\n \t\t\t$myfile2 = fopen(\"newfile2.txt\", \"w\") or die(\"Unable to open file!\");\n\t\t\t$txt2 = $data;\n\t\t\tfwrite($myfile2, $txt2);\n\t\t\tfclose($myfile2);\n\t\t\t$timeStamp= date(\"Y-m-d H:i:s\");\n\t\t\t$uid = $data['clientID'];\n\t\t\t$base64Image= $data['base64Image'];\n \t\t\t$query = \"INSERT INTO ringings (timeStamp, base64Image, uid) VALUES ('$timeStamp','$base64Image', '$uid')\"; \n \n\t\t\tif(!mysqli_query($con,$query))\n\t\t\t{\n\t\t\t\t\t$arr_res = array();\n\t\t\t\t\t$arr_res['error'] = array(\"msg\" => \"failed Adding Entry\");\n\t\t\t\t\t$arr_res['result'] = array('status' => \"Failed\");\n\t\t\t\t\t$this->response($this->json($arr_res), 417);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$last_id = $con->insert_id;\n\t\t\t\t$str_array = array('status' => \"Success\" ,'id' => $last_id, 'reply' => Null, 'base64Image' => $base64Image, 'uid' => $uid);\n\t\t\t\t\n\t\t\t\t$arr_res = array();\n\t\t\t\t$arr_res['error'] = $error;\n\t\t\t\t$arr_res['result'] = $str_array;\n\t\t\t\t$this->response($this->json($arr_res), 200);\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$con->close();\n\t\t}", "public function insert()\n {\n $this->_checkItem();\n $service = $this->getService();\n $entry = $service->newItemEntry();\n $this->setEntry($entry);\n $this->_prepareEnrtyForSave();\n $this->getEntry()->setItemType($this->_getItemType());\n $entry = $service->insertGbaseItem($this->getEntry());\n $this->setEntry($entry);\n $entryId = $this->getEntry()->getId();\n $published = $this->gBaseDate2DateTime($this->getEntry()->getPublished()->getText());\n $this->getItem()\n ->setGbaseItemId($entryId)\n ->setPublished($published);\n\n if ($expires = $this->_getAttributeValue('expiration_date')) {\n $expires = $this->gBaseDate2DateTime($expires);\n $this->getItem()->setExpires($expires);\n }\n }", "function addBatchToQueue() {\n if(count($this->_importQueueBatch) == 0) {\n return;\n }\n $queueParams = array(\n 'entity' => $this->_entity,\n 'params' => $this->_importQueueBatch,\n 'errorFileName' => $this->_errorFileName,\n );\n $task = new CRM_Queue_Task(\n array('CRM_Csvimport_Task_Import', 'ImportEntity'),\n $queueParams,\n ts('Importing entity') . ': ' . $this->_lineCount\n );\n $this->_importQueue->createItem($task);\n $this->_importQueueBatch = array();\n }", "public function getQueue();" ]
[ "0.6319045", "0.6304691", "0.6264562", "0.6219788", "0.6116542", "0.6064413", "0.5987302", "0.58326536", "0.5769485", "0.5599387", "0.55540645", "0.5482267", "0.5481303", "0.5464393", "0.54541105", "0.54472107", "0.5427705", "0.5403099", "0.5390099", "0.53792065", "0.5342842", "0.53318816", "0.53087956", "0.5307275", "0.52788514", "0.52788514", "0.52788514", "0.52788514", "0.52788514", "0.52788514", "0.52370507", "0.52368057", "0.52357024", "0.5230684", "0.5206754", "0.51960367", "0.5189537", "0.51788926", "0.51691604", "0.5158672", "0.5153253", "0.5152923", "0.5152923", "0.5152923", "0.515125", "0.5150901", "0.5140254", "0.51347077", "0.51281416", "0.508887", "0.50871694", "0.5075152", "0.5074565", "0.50713396", "0.5070971", "0.5067536", "0.5044383", "0.5036941", "0.50198424", "0.50146496", "0.5013838", "0.50075984", "0.50020826", "0.49963906", "0.49591634", "0.49548528", "0.4954088", "0.49487782", "0.49460405", "0.4940673", "0.49405462", "0.49405462", "0.49359262", "0.4931493", "0.49293098", "0.4927268", "0.49253422", "0.49241087", "0.49218848", "0.49123764", "0.4908651", "0.4903069", "0.48970002", "0.48913157", "0.4886526", "0.4885599", "0.48537034", "0.4853292", "0.48376888", "0.48368788", "0.48339254", "0.48320022", "0.48305878", "0.48261544", "0.48260963", "0.48229307", "0.48216558", "0.48200494", "0.48092002", "0.48040578" ]
0.5151505
44
get the status of all entries
public function get_status() { try { $q = $this->_conn->prepare("select * from sandbox.dbo.daemon where dbtype = :dbtype order by object asc"); $dbtype = 'live'; $q->bindParam(':dbtype', $dbtype); $q->execute(); $rs = $q->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { return 'ERRORdd: ' . $e->getMessage(); } return $rs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStatuses() {\n\t}", "abstract public static function getStatuses();", "public static function getStatuses(): array;", "public function getStatusesList(){\n return $this->_get(1);\n }", "abstract protected function getStatusesInfos();", "function monitor_list_statuses() {\n $query = \"select distinct(`wf_status`) from `\".GALAXIA_TABLE_PREFIX.\"instances`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_status'];\n }\n return $ret;\n }", "function statuses() {\n //return parent::statusesWithCount( self::tableName(), self::arrayStatuses() );\n\n global $wpdb;\n\n $table_name = self::tableName();\n $statuses = self::arrayStatuses();\n $field_name = 'status';\n /*\n * @ToDo Decommentare qui se non vogliamo i conteggi dinamici in base al filtro\n * @ToDo La query è molto onerosa\n *\n *\n */\n $table_orders = BNMExtendsOrders::tableName();\n $sql = <<< SQL\n SELECT DISTINCT( {$table_orders}.{$field_name} ),\n COUNT(*) AS count\n FROM `{$table_name}`\n LEFT JOIN `{$table_orders}`\n ON {$table_orders}.id = {$table_name}.id_order\n GROUP BY {$table_orders}.{$field_name}\nSQL;\n\n\n\n $result = $wpdb->get_results( $sql, ARRAY_A );\n\n foreach ( $result as $status ) {\n if ( !empty( $status['status'] ) ) {\n $statuses[$status['status']]['count'] = $status['count'];\n }\n }\n\n $statuses['all']['count'] = self::count( $table_name );\n\n return $statuses;\n }", "public function getAll()\n {\n return $this->db->get_where($this->_table, [\"status\" => 1])->result();\n }", "public static function all()\n {\n $sql = new Sql();\n\n $results = $sql->select(\"SELECT * FROM tbl_status\");\n\n return $results;\n }", "public static function getStatuses()\n {\n $sql = 'SELECT * FROM location_status';\n $command = Yii::app()->db->createCommand($sql);\n return $command->queryAll(true);\n }", "public function getAllStatus()\n {\n return OrderStatus::all();\n }", "public function status()\n {\n return $this->status->get($this->entity->status);\n }", "public function getStatusHistories();", "public function getAllStatus()\n {\n $sql = \"SELECT s.id, s.status_name , s.color FROM status AS s ORDER BY s.id ASC\";\n $query = $this->db->prepare($sql);\n $query->execute();\n\n // fetchAll() is the PDO method that gets all result rows, here in object-style because we defined this in\n // core/controller.php! If you prefer to get an associative array as the result, then do\n // $query->fetchAll(PDO::FETCH_ASSOC); or change core/controller.php's PDO options to\n // $options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC ...\n return $query->fetchAll();\n }", "public static function statuses()\n {\n return Lastus::statuses(static::class);\n }", "public function getStatuses()\n {\n return $this->statuses;\n }", "function &getStatus(){\n\t\treturn array();\n\t}", "public function status()\n {\n return array_map(\n function (array $status) {\n return Status::fromArray($status);\n },\n $this->client->get('status')\n );\n }", "public function hasStatuses(){\n return $this->_has(1);\n }", "public function getStatuses()\n {\n $endpoint = $this->endpoints['getStatuses'];\n return $this->sendRequest($endpoint['method'], $endpoint['uri']);\n }", "public function get_status()\n {\n }", "public function get_status()\n {\n }", "public static function getStatusesList()\n {\n $sql = 'SELECT id AS value, display_name AS text '\n . 'FROM location_status '\n . 'WHERE active = 1';\n $command = Yii::app()->db->createCommand($sql);\n return $command->queryAll(true);\n }", "function get_status()\n {\n foreach ($this->data as $row => $value)\n {\n $data['completed'][$value] = $this->recruitment_model->check_filled($this->user_id,$value);\n }\n return $data['completed'];\n }", "function getStatus() {\n \t\n \t$status = array();\n \n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'a_contacter'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"to_contact\"] = $result['num_contact'];\n\n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'contacte'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"contacted\"] = $result['num_contact'];\n \n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'a_rappeler'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"call_back\"] = $result['num_contact'];\n \n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'termine'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"deleted\"] = $result['num_contact'];\n \n $sql = \"SELECT COUNT(*) as num_motif FROM mp_activation_motifs\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n\n $status[\"number_motif\"] = $result['num_motif'];\n \n \n return $status;\n }", "public function getEveryStatus()\n {\n static $status;\n\n if ($status) {\n return $status;\n }\n\n $status = array(\n 'U' => $this->_('Valid from date unknown'),\n 'W' => $this->_('Valid from date in the future'),\n 'O' => $this->_('Open - can be answered now'),\n 'A' => $this->_('Answered'),\n 'M' => $this->_('Missed deadline'),\n 'D' => $this->_('Token does not exist'),\n );\n\n return $status;\n }", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getHealthStatusList() {\n return $this->_get(8);\n }", "public function get_all_status()\n {\n $this->db->order_by('idstatus', 'asc');\n return $this->db->get('cat_status')->result_array();\n }", "public static function get_all_statuses() {\n\t\tglobal $wpdb;\n\n\t\t$cache_key = 'orders-all-statuses';\n\t\t$statuses = Cache::get( $cache_key );\n\n\t\tif ( false === $statuses ) {\n\t\t\t$table_name = self::get_db_table_name();\n\t\t\t$statuses = $wpdb->get_col(\n\t\t\t\t\"SELECT DISTINCT status FROM {$table_name}\"\n\t\t\t); // WPCS: cache ok, DB call ok, unprepared SQL ok.\n\n\t\t\tCache::set( $cache_key, $statuses );\n\t\t}\n\n\t\treturn $statuses;\n\t}", "public function GetStatus()\n\t{\n\t\t// Demnach ist der Status in IPS der einzige der vorliegt.\t\t\n\t}", "function getStatus() {\n\t\treturn $this->getData('status');\n\t}", "function getDetailedStatus() ;", "public function status() {\n\t\treturn self::STATUS_DESCRIPTIONS[$this->oehhstat];\n\t}", "public function get_statuses() {\n return $this->statuses;\n }", "public function ajax_get_entry_status()\n {\n $type = ee()->input->get('type', TRUE);\n $id = ee()->input->get('id', TRUE);\n\n $status = FALSE;\n\n switch ($type)\n {\n case 'phrase':\n // $status = ee()->publisher_phrase->is_translated($id);\n break;\n case 'category':\n // $status = ee()->publisher_category->is_translated($id);\n break;\n case 'entry':\n if (strstr($id, ','))\n {\n $id = explode(',', $id);\n }\n\n if (is_array($id))\n {\n $status = FALSE;\n $draft_entries = array();\n\n foreach ($id as $entry_id)\n {\n if (ee()->publisher_entry->has_draft($entry_id))\n {\n $draft_entries[$entry_id] = 'y';\n }\n else\n {\n $draft_entries[$entry_id] = 'n';\n }\n }\n\n return ee()->publisher_helper->send_ajax_response(json_encode($draft_entries));\n }\n else\n {\n $status = ee()->publisher_entry->has_draft($id);\n }\n break;\n }\n\n $return = $status ? TRUE : FALSE;\n\n ee()->publisher_helper->send_ajax_response($return);\n }", "public function getStatus()\n {\n \n return $this->_em->createQuery('SELECT s,u FROM TechCorpFrontBundle:Status s \n JOIN s.user u ORDER BY s.createdAt DESC');\n }", "public function index()\n {\n return TaskStatus::all();\n }", "function getStatusList() {\n $statusList = array();\n foreach (Constants::$statusNames as $id => $name) {\n $statusList[$id] = \"$id - $name\";\n }\n return $statusList;\n}", "public function lists()\n {\n return $this->statuses;\n }", "function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}", "function getStatus() ;", "function getStatus() ;", "function getStatus() ;", "function getStatus() \n {\n return $this->instance->getStatus();\n }", "public function getStatusesForAdding()\n {\n return $this->statusesForAdding;\n }", "function get_status() {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->getData('status');\n }", "public function admin_getList()\n {\n $sql = 'select * from '.$this->table.' where status >= 0';\n return $this->query($sql);\n }", "public function getStatus()\n\t\t{\n\t\t\t$status_id = $this->getStatusId();\n\t\t\t$asf = ECash::getFactory()->getReferenceList('ApplicationStatusFlat');\n\t\t\treturn $asf[$status_id];\n\t\t}", "public function status() {\n\t\treturn self::STATUS_DESCRIPTIONS[$this->status];\n\t}", "public function getStatus()\n {\n return $this->query('mnsync status');\n }", "public function getAll(): array {\n $query = $this->db\n ->select('*')\n ->where('status <>', 0)\n ->get($this->tblName);\n return $query->result_array();\n }", "public function Get_Status() {\n $flags = array(\n 'complete' => array(\n 'code' => 'complete',\n 'name' => 'Complete',\n //'_update' => array($this,'_Status_Make_Complete'),\n ),\n 'cool' => array(\n 'code' => 'cool',\n 'name' => 'Cool',\n //'_update' => array($this,'_Status_Make_Complete'),\n )\n );\n // Apply any filter for adding to the flag list\n $status = apply_filters('vcff_reports_status',$status,$this);\n // Return the flag list\n return $flags;\n }", "public static function getStatusList()\n {\n return array(\n self::STATUS_TRASH => 'trash',\n self::STATUS_DRAFT => 'draft',\n self::STATUS_PUBLISHED => 'published',\n );\n }", "public function statuses() {\n return $this->hasMany('Larabook\\Statuses\\Status')->latest();\n }", "public function getStatus()\n {\n return $this->get(self::_STATUS);\n }", "public function getStatus()\n {\n return $this->get(self::_STATUS);\n }", "public function getStatus()\n {\n return $this->get(self::_STATUS);\n }", "public function getStatus()\n {\n return $this->get(self::_STATUS);\n }", "public function get_status(){\n return $this->status;\n }", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getItemStatus() {\r\n\t\t$status = array();\r\n\t\t\t$status[0] = array('id' => 0,\r\n\t\t\t\t\t\t\t'name' => 'Sold',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'sold'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[1] = array('id' => 1,\r\n\t\t\t\t\t\t\t'name' => 'Available',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'available'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[2] = array('id' => 2,\r\n\t\t\t\t\t\t\t'name' => 'Out on Job',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'out_on_job'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[3] = array('id' => 3,\r\n\t\t\t\t\t\t\t'name' => 'Pending Sale',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'pending_sale'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[4] = array('id' => 4,\r\n\t\t\t\t\t\t\t'name' => 'Out on Memo',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'out_on_memo'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[5] = array('id' => 5,\r\n\t\t\t\t\t\t\t'name' => 'Burgled',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'burgled'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[6] = array('id' => 6,\r\n\t\t\t\t\t\t\t'name' => 'Assembled',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'assembled'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[7] = array('id' => 7,\r\n\t\t\t\t\t\t\t'name' => 'Returned To Consignee',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'return_to_consignee'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[8] = array(\r\n\t\t\t\t\t\t\t'id' => 8,\r\n\t\t\t\t\t\t\t'name' => 'Pending Repair Queue',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'pending_repair'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[91] = array('id' => 91,\r\n\t\t\t\t\t\t\t'name' => 'Francesklein Import',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'francesklein_import'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[98] = array('id' => 98,\r\n\t\t\t\t\t\t\t'name' => 'Never Going Online',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'never_going_online'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[99] = array('id' => 99,\r\n\t\t\t\t\t\t\t'name' => 'Unavailable',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'unavailable'\r\n\t\t\t\t\t);\r\n\t\treturn $status;\r\n\t}", "public function getJobStatus()\n {\n }", "public function getStatus()\n {\n return $this->get(self::STATUS);\n }", "protected static function getStatuses()\n {\n return [\n CrudController::STATUS_SUCCESS => 'successfully',\n CrudController::STATUS_FAILURE => 'unsuccessfully',\n ];\n }", "abstract public function GetStatus();", "public function index()\n {\n $attstatuses = AttStatus::getAllAttStatus();\n return AttStatusResource::collection($attstatuses);\n }", "public static function listAll()\n\t{\n\t\t$sql = new Sql();\n\t\treturn $sql->select(\"SELECT * FROM tb_ordersstatus ORDER BY desstatus\");\n\t}", "function getTermStatuses(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getTermStatuses();\r\n }", "public function getAllActive() {}", "public function getStatus(){\n\t\treturn $this->status;\n\t}" ]
[ "0.74738586", "0.74416417", "0.71846503", "0.71634465", "0.7060505", "0.7030485", "0.69539213", "0.67999345", "0.67969286", "0.67573196", "0.67398584", "0.6739112", "0.6656269", "0.6650233", "0.66439974", "0.6626768", "0.66034687", "0.6602739", "0.6578752", "0.65700704", "0.65392196", "0.65392196", "0.65129864", "0.65107006", "0.65001786", "0.64973086", "0.644835", "0.644835", "0.644835", "0.644835", "0.644835", "0.644835", "0.644835", "0.644835", "0.644835", "0.644835", "0.6419721", "0.63965374", "0.6396095", "0.6391424", "0.6373533", "0.63691884", "0.6340489", "0.632537", "0.6318445", "0.6316473", "0.63101166", "0.6277521", "0.62744814", "0.6255198", "0.62516725", "0.62516725", "0.6249967", "0.6248492", "0.62483966", "0.6247841", "0.6228912", "0.6228187", "0.6227237", "0.62140715", "0.6208361", "0.62053126", "0.6186661", "0.6173279", "0.616646", "0.61645645", "0.61645645", "0.61645645", "0.61645645", "0.61639833", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61551386", "0.61537635", "0.61537635", "0.61537635", "0.61537635", "0.61504084", "0.6139927", "0.613764", "0.6132276", "0.61299247", "0.61298764", "0.6129514", "0.6122339", "0.6118792", "0.61176276" ]
0.0
-1
/ ___ _ _ _____ / _ \| \ | | ____| | | | | \| | _| | |_| | |\ | |___ \___/|_| \_|_____| One file site generator.
function page_content($filename = false) { static $cache = array(); $key = crc32($filename); if (isset($cache[$key])) { return $cache[$key]; } if ($filename == false) { $filename = locate_page_file(); if ($filename == false) { $cache[$key] = false; return false; } } if (!is_file($filename)) { $filename = locate_page_file($filename); } $item = str_replace('..', '', $filename); if (is_file($item)) { ob_start(); include ($item); $content = ob_get_clean(); $cache[$key] = $content; return $content; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate($path)\n {\n $this->newPage();\n $this->makeLetterhead();\n $this->makeTitle();\n $this->makeBeforeInfo();\n $this->makeEntries();\n $this->makeAfterInfo();\n $this->output('F', $path, true);\n }", "private function generateSiteMapMain()\n {\n $this->load->model('extension/module/siteMapGenerate');\n $output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $output .= '<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">';\n\n foreach ($this->includedFiles as $file) {\n $removeFromUrl = mb_substr($file, 0, mb_strrpos($file, '/'));;\n $clearFileUrl = str_replace($removeFromUrl . '/', '', $file);\n $output .= '<sitemap>';\n $output .= '<loc>' . $this->siteUrl . $clearFileUrl . '</loc>';\n $output .= '</sitemap>';\n }\n\n $output \t.= '</sitemapindex>';\n $this->response->addHeader('Content-Type: application/xml');\n\n $siteMapXmlUrl = DIR_MAIN . 'sitemap_custom.xml';\n $openedFile = fopen($siteMapXmlUrl, 'w');\n chmod($siteMapXmlUrl, 0775);\n file_put_contents($siteMapXmlUrl, $output);\n fclose($openedFile);\n }", "function homepage(){\n\t\trequire(TEMPLATES_PATH.\"/homepage.php\");\n\t}", "public function generate()\n {\n if (!file_exists(SSG_OUTPUT_DIR)) {\n if (!mkdir($concurrentDirectory = SSG_OUTPUT_DIR) && !is_dir($concurrentDirectory)) {\n throw new \\RuntimeException(sprintf('Directory \"%s\" was not created', $concurrentDirectory));\n }\n }\n\n //Empty output dir\n $this->emptyBuildFolder();\n\n //Create needed directories in build folder\n if (!mkdir($concurrentDirectory = SSG_OUTPUT_DIR . TEMPLATE_URI) && !is_dir($concurrentDirectory)) {\n throw new \\RuntimeException(sprintf('Directory \"%s\" was not created', $concurrentDirectory));\n }\n\n //If we are running on Netlify and Mix wasn't triggered we get the Mix assets from the live site, meaning the last build\n if (getenv('NETLIFY') && USE_MIX && !defined('NETLIFY_MIX_TRIGGERED')) {\n $rootUrl = getenv('URL');\n $manifest = @file_get_contents($rootUrl . TEMPLATE_URI . '/dist/mix-manifest.json');\n if($manifest) {\n if (!mkdir($concurrentDirectory = APP_ROOT . TEMPLATE_DIR . '/dist') && !is_dir($concurrentDirectory)) {\n throw new \\RuntimeException(sprintf('Directory \"%s\" was not created', $concurrentDirectory));\n }\n file_put_contents(APP_ROOT . TEMPLATE_DIR . '/dist/mix-manifest.json', $manifest);\n foreach (json_decode($manifest) ?? [] as $filename => $hash) {\n $file = file_get_contents($rootUrl . TEMPLATE_URI . '/dist' . $filename);\n file_put_contents(APP_ROOT . TEMPLATE_DIR . '/dist' . $filename, $file);\n }\n }\n\n }\n\n $sitemapCreated = (new Sitemap)->createSitemap();\n if ($sitemapCreated) {\n copy(APP_ROOT . PUBLIC_DIR . '/sitemap.xml', SSG_OUTPUT_DIR . '/sitemap.xml');\n }\n\n //Create blog home\n if (file_exists(POSTS_DIR)) {\n $this->renderBlogHome();\n }\n\n //TODO: Support for CPT here\n //Scan trough content types and render HTML\n $collections = $this->router->getKnownCollections();\n foreach ($collections as $collection) {\n $pages = $this->getDirContents(APP_ROOT . CONTENT_DIR . '/' . $collection);\n foreach ($pages as $page) {\n $this->renderContentJsonToHtml($page, $collection);\n }\n }\n\n //Copy theme images to build directory\n $this->syncDirectoryToBuild('uploads');\n $this->syncDirectoryToBuild('theme/img');\n $this->syncDirectoryToBuild('theme/dist');\n $this->syncDirectoryToBuild('theme/fonts');\n\n //If redirect file exists, move it over\n if(file_exists(APP_ROOT . '/_redirects')) {\n copy(APP_ROOT . '/_redirects', SSG_OUTPUT_DIR . '/_redirects');\n }\n\n //Create Netlify CMS admin index file from dynamic json config\n $this->createNetlifyCmsAdminFolder();\n }", "public function generate()\n\t{\n\t\t$extractor = $this->createExtractor($this->extractor);\n\t\t$factory = $this->createGeneratorFactory();\n\t\t$generator = $factory->createGenerator($this->directoryToSaveSitemap);\n\n\t\treturn $generator->generate($this->fileName, $extractor);\n\t}", "public function web_common(){\n\t\t//get_num(4) because: 0 = CLASS_KEY, 1=CLASS, 2=TASK_KEY, 3=TASK, 4=remainder\n\t\t$file = str_replace('|', DIRECTORY_SEPARATOR, lc('uri')->get('f', ''));\n\t\tif($file == ''){\n\t\t\t$tmps = lc('uri')->get_num();\n\t\t\tforeach($tmps as $k => $tmp){\n\t\t\t\tif($k >= 3 && $tmp != ''){\n\t\t\t\t\t$file .= $tmp.DIRECTORY_SEPARATOR;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(substr($file, -1) == DIRECTORY_SEPARATOR){\n\t\t\t$file = substr($file, 0, -1);\n\t\t}\n\t\t$file\t\t = str_replace(array('..', '|'), array('', DIRECTORY_SEPARATOR), $file);\n\t\t$template\t = ll('client')->get('template', 'default');\n\t\t$allowedExt\t = array('jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'ico');\n\t\t$file_cache\t = TPLPATH.$template.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.$file;\n\t\tforeach($allowedExt as $ext){\n\t\t\tif(ll('files')->exists($file_cache.'.'.$ext)){\n\t\t\t\t$file_cache .= '.'.$ext;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(!ll('files')->exists($file_cache)){\n\t\t\t$file_cache = TPLPATH.'default'.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.$file;\n\t\t\tforeach($allowedExt as $ext){\n\t\t\t\tif(ll('files')->exists($file_cache.'.'.$ext)){\n\t\t\t\t\t$file_cache .= '.'.$ext;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!ll('files')->exists($file_cache)){\n\t\t\t$file_cache = TPLPATH.'img'.DIRECTORY_SEPARATOR.$file;\n\t\t\tforeach($allowedExt as $ext){\n\t\t\t\tif(ll('files')->exists($file_cache.'.'.$ext)){\n\t\t\t\t\t$file_cache .= '.'.$ext;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!ll('files')->exists($file_cache)){\n\t\t\tlc('error')->show_error(404, 'Page not Found');\n\t\t}else{\n\t\t\t$this->send_image($file_cache, $ext);\n\t\t}\n\t}", "function website_sitemap() {\n\n\t$websites = website_themes();\n\n\tforeach ( $websites as $site ) {\n?>\n\t<li><a href=\"<?php echo path( 'theme-showcase/' . $site . '/' ); ?>\"><?php echo ucwords( $site ); ?></a></li>\n<?php\n\t}\n\n}", "function generate_sitemap()\n\t{\n\t\t$result = '';\n\n\t\t$site_url = \\lib\\router::get_storage('url_site');\n\t\t$result .= \"<pre>\";\n\t\t$result .= $site_url.'<br/>';\n\t\t$sitemap = new \\lib\\utility\\sitemap($site_url , root.'public_html/', 'sitemap' );\n\t\t$counter =\n\t\t[\n\t\t\t'pages' => 0,\n\t\t\t'polls' => 0,\n\t\t\t'posts' => 0,\n\t\t\t'helps' => 0,\n\t\t\t'attachments' => 0,\n\t\t\t'otherTypes' => 0,\n\t\t\t'terms' => 0,\n\t\t\t// 'cats' => 0,\n\t\t\t// 'otherTerms' => 0,\n\t\t];\n\n\t\t// --------------------------------------------- Static pages\n\n\t\t// add list of static pages\n\t\t$sitemap->addItem('', '1', 'daily');\n\n\n\t\t$sitemap->addItem('about', '0.6', 'weekly');\n\t\t$sitemap->addItem('social-responsibility', '0.6', 'weekly');\n\t\t$sitemap->addItem('help', '0.4', 'daily');\n\t\t$sitemap->addItem('help/faq', '0.6', 'daily');\n\n\t\t$sitemap->addItem('benefits', '0.6', 'weekly');\n\t\t$sitemap->addItem('pricing', '0.6', 'weekly');\n\t\t$sitemap->addItem('terms', '0.4', 'weekly');\n\t\t$sitemap->addItem('privacy', '0.4', 'weekly');\n\t\t$sitemap->addItem('changelog', '0.5', 'daily');\n\t\t$sitemap->addItem('contact', '0.6', 'weekly');\n\t\t$sitemap->addItem('logo', '0.8', 'monthly');\n\t\t$sitemap->addItem('for/school', '0.8', 'monthly');\n\n\n\n\n\t\t// PERSIAN\n\t\t// add all language static page automatically\n\t\t// we must detect pages automatically and list static pages here\n\t\t$lang_data = \\lib\\option::$language;\n\t\tif(isset($lang_data['list']))\n\t\t{\n\t\t\tforeach ($lang_data['list'] as $key => $myLang)\n\t\t\t{\n\t\t\t\tif(isset($lang_data['default']) && $myLang === $lang_data['default'])\n\t\t\t\t{\n\t\t\t\t\t// do nothing\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sitemap->addItem( $myLang, '1', 'daily');\n\t\t\t\t\t// add static pages of persian\n\t\t\t\t\t$sitemap->addItem( $myLang. '/about', '0.8', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/social-responsibility', '0.8', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/help', '0.6', 'daily');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/help/faq', '0.8', 'daily');\n\n\t\t\t\t\t$sitemap->addItem( $myLang. '/benefits', '0.8', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/pricing', '0.8', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/terms', '0.6', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/privacy', '0.6', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/changelog', '0.7', 'daily');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/contact', '0.8', 'weekly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/logo', '0.8', 'monthly');\n\t\t\t\t\t$sitemap->addItem( $myLang. '/for/school', '0.8', 'monthly');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// add posts\n\t\tforeach ($this->model()->sitemap('posts', 'post') as $row)\n\t\t{\n\t\t\t$myUrl = $row['url'];\n\t\t\tif($row['language'] && $row['language'] !== 'en')\n\t\t\t{\n\t\t\t\t$myUrl = $row['language'].'/'. $myUrl;\n\t\t\t}\n\n\t\t\t$sitemap->addItem($myUrl, '0.8', 'daily', $row['publishdate']);\n\t\t\t$counter['posts'] += 1;\n\t\t}\n\n\t\t// // add poll\n\t\t// foreach ($this->model()->sitemap('posts', 'poll') as $row)\n\t\t// {\n\t\t// \t$myUrl = $row['url'];\n\t\t// \tif($row['language'] && $row['language'] !== 'en')\n\t\t// \t{\n\t\t// \t\t$myUrl = $row['language'].'/'. $myUrl;\n\t\t// \t}\n\n\t\t// \tif(isset($row['privacy']) && $row['privacy'] === 'public')\n\t\t// \t{\n\t\t// \t\t$sitemap->addItem($myUrl, '0.8', 'daily', $row['publishdate']);\n\t\t// \t\t$counter['polls'] += 1;\n\t\t// \t}\n\t\t// }\n\n\t\t// add pages\n\t\tforeach ($this->model()->sitemap('posts', 'page') as $row)\n\t\t{\n\t\t\t$myUrl = $row['url'];\n\t\t\tif($row['language'] && $row['language'] !== 'en')\n\t\t\t{\n\t\t\t\t$myUrl = $row['language'].'/'. $myUrl;\n\t\t\t}\n\n\t\t\t$sitemap->addItem($myUrl, '0.6', 'weekly', $row['publishdate']);\n\t\t\t$counter['pages'] += 1;\n\t\t}\n\n\t\t// add helps\n\t\tforeach ($this->model()->sitemap('posts', 'helps') as $row)\n\t\t{\n\t\t\t$myUrl = $row['url'];\n\t\t\tif($row['language'] && $row['language'] !== 'en')\n\t\t\t{\n\t\t\t\t$myUrl = $row['language'].'/'. $myUrl;\n\t\t\t}\n\n\t\t\t$sitemap->addItem($myUrl, '0.3', 'monthly', $row['publishdate']);\n\t\t\t$counter['helps'] += 1;\n\t\t}\n\n\t\t// // add attachments\n\t\t// foreach ($this->model()->sitemap('posts', 'attachment') as $row)\n\t\t// {\n\t\t// \t$myUrl = $row['url'];\n\t\t// \tif($row['language'] && $row['language'] !== 'en')\n\t\t// \t{\n\t\t// \t\t$myUrl = $row['language'].'/'. $myUrl;\n\t\t// \t}\n\n\t\t// \t$sitemap->addItem($myUrl, '0.2', 'weekly', $row['publishdate']);\n\t\t// \t$counter['attachments'] += 1;\n\t\t// }\n\n\t\t// add other type of post\n\t\tforeach ($this->model()->sitemap('posts', false) as $row)\n\t\t{\n\t\t\t$myUrl = $row['url'];\n\t\t\tif($row['language'] && $row['language'] !== 'en')\n\t\t\t{\n\t\t\t\t$myUrl = $row['language'].'/'. $myUrl;\n\t\t\t}\n\n\t\t\t$sitemap->addItem($myUrl, '0.5', 'weekly', $row['publishdate']);\n\t\t\t$counter['otherTypes'] += 1;\n\t\t}\n\n\t\t// add cats and tags\n\t\t// foreach ($this->model()->sitemap('terms') as $row)\n\t\t// {\n\t\t// \t$myUrl = $row['term_url'];\n\t\t// \tif($row['term_language'])\n\t\t// \t{\n\t\t// \t\t$myUrl = $row['term_language'].'/'. $myUrl;\n\t\t// \t}\n\n\n\t\t// \t$sitemap->addItem($myUrl, '0.4', 'weekly', $row['datemodified']);\n\t\t// \t$counter['terms'] += 1;\n\t\t// }\n\n\t\t$sitemap->createSitemapIndex();\n\t\t$result .= \"</pre>\";\n\t\t$result .= \"<p class='alert alert-success'>\". T_('Create sitemap Successfully!').\"</p>\";\n\n\t\tforeach ($counter as $key => $value)\n\t\t{\n\t\t\t$result .= \"<br/>\";\n\t\t\t$result .= T_($key). \" <b>\". $value.\"</b>\";\n\t\t}\n\n\t\treturn $result;\n\t}", "public function generate()\n{\n$user_code=\"{% extends 'resource.twig.c' %}\\n\".$this->user_code;\n\n$buf=$this->gen->renderer->render_string($this->filename,$user_code\n\t,array('resource' =>$this, 'global' => $this->gen));\n$this->gen->file_write($this->dest_filename,$buf);\n}", "public static function generate(): string\n {\n //Adds the homepage\n $url[] = self::parse('/');\n\n foreach (Plugin::all() as $plugin) {\n //Gets all methods from `Sitemap` class of the plugin\n $methods = self::getMethods($plugin);\n\n //Calls each method\n foreach ($methods as $method) {\n $url = array_merge($url, (array)call_user_func([$method['class'], $method['name']]));\n }\n }\n\n $xml = Xml::fromArray(['urlset' => [\n 'xmlns:' => 'http://www.sitemaps.org/schemas/sitemap/0.9',\n 'url' => $url,\n ]], ['pretty' => true]);\n\n return trim($xml->asXML());\n }", "static function gen($file) {\n\n\t\t$compile = BP_Parser::compile($file);\n\n\t\t$root = BlogPad::get_templates_dir();\n\n\t\t$theme = BlogPad::get_theme_name();\n\n\t\t$template_name = 'compiled_'.basename($file).'.php';\n\n\t\tif( !is_dir($root) ) {\n\t\t\tmkdir($root);\n\t\t}\n\n\t\t// Organise each template by its theme directory.\n\t\tif( !is_dir(\"$root/$theme\") ) {\n\t\t\tmkdir(\"$root/$theme\");\n\t\t}\n\n\t\tif( !empty($compile) ) {\n\t\t\tif( !file_put_contents(\"$root/$theme/$template_name\", $compile) ) {\n\t\t\t\ttrigger_error(\"Couldn't generate template for $file.\", E_USER_NOTICE);\n\t\t\t\texit;\n\t\t\t}\n\n\t\t}\n\n\t\t// Return the path of the compiled template so that it can be used as a pointer.\n\t\treturn \"$root/$theme/$template_name\";\n\t}", "function create_blank_template_file() {\n\t$sourse = 'http://adepttechsolutions.com/lms_test/wp-content/plugins/tscore/admin/blank_tempp.php';\n\t\n\t$destination = get_template_directory_uri().'/blank_tempp.php';\n\tcopy($sourse, $destination);\t\n}", "public static function generate()\n\t{\n\t\t//get the Name of the SourceFolder\n\t\t\techo \"First you need to give the name of the SourceFolder you want to generate.\\n\";\n\t\t\techo \"The SourceFolder name: \";\n\t\t\t$line = trim(fgets(STDIN));\n\t\t\t$dir = 'src/'.$line;\n\t\t//controll when the Folder already exist\n\t\t\twhile(is_dir($dir)){\n\t\t\t\techo \"This SourceFolder already exist! Do you want to overwrite this File?\\npress y for yes and another for no:\";\n\t\t\t\t$answer = trim(fgets(STDIN));\n\t\t\t\tif($answer === 'y'){\n\t\t\t\t\tFolder::delete($dir);\n\t\t\t\t\tbreak;\n\t\t\t\t}else{\n\t\t\t\t\techo \"The SourceFolder name: \";\n\t\t\t\t\t$line = trim(fgets(STDIN));\n\t\t\t\t\t$dir = 'src/'.$line;\n\t\t\t\t}\n\t\t\t}\t\n\t\t//create dirs\n\t\t\tmkdir($dir);\n\t\t\tmkdir($dir.'/Controller');\n\t\t\tmkdir($dir.'/Entity');\n\t\t\tmkdir($dir.'/Resources');\n\t\t\tmkdir($dir.'/Resources/views');\n\t\t//set controllerValue\n\t\t\t$controllerValue = \"<?php \\n\\n\";\n\t\t\t$controllerValue .='namespace '.$line.\"\\\\Controller;\\n\\n\";\n\t\t\t$controllerValue .='use Kernel\\Controller;'.\"\\n\\n\";\t\t\t\t\t\t\n\t\t\t$controllerValue .='class '.$line.\"Controller extends Controller\\n{\\n\";\n\t\t\t$controllerValue .='\tpublic function '.$line.'()'.\"\\n\";\n\t\t\t$controllerValue .=\"\t{\\n\";\n\t\t\t$controllerValue .='\t\treturn $this->render(\"'.$line.':default.html\");'.\"\\n\";\n\t\t\t$controllerValue .=\"\t}\\n\";\n\t\t\t$controllerValue .=\"}\\n\";\n\t\t//generate Controller\n\t\t\t$controller = fopen($dir.'/Controller/'.$line.'Controller.php', \"w\") or die(\"Unable to open file!\\n\");\n\t\t\tfwrite($controller, '');\n\t\t\tfwrite($controller, trim($controllerValue));\n\t\t\tfclose($controller);\n\t\t//generate template\n\t\t\t$templateValue = \"<div>hello</div>\";\n\t\t\t$template = fopen($dir.'/Resources/views/default.html', \"w\") or die(\"Unable to open file!\\n\");\n\t\t\tfwrite($template, '');\n\t\t\tfwrite($template, trim($templateValue));\n\t\t\tfclose($template);\n\t\t//amend srcInit\n\t\t\tif(!array_key_exists($line, Config::srcInit())){\n\t\t\t\t$content = $line.': '.$line;\n\t\t\t\tfile_put_contents('Config/SrcInit.yml', \"\\n\".$content, FILE_APPEND);\n\t\t\t}\n\t}", "public function generateStandalone();", "protected function defineSitePath() {}", "function indexSite () {\n\t/* get a list of the various content-types from the folders in the site (blog | photo | quote &c.)\n\t -------------------------------------------------------------------------------------------------------------- */\n\t$types = array_fill_keys (array_filter (\n\t\t//include only directories, but ignore directories starting with ‘.’\n\t\tpreg_grep ('/^(\\.|_)/', scandir ('.'), PREG_GREP_INVERT), 'is_dir'\n\t), 0);\n\t\n\t/* generate an index of the articles on the site\n\t -------------------------------------------------------------------------------------------------------------- */\n\t$list = $tags = array ();\n\t$xml = '';\n\t\n\t//get each entry in each content-type folder\n\tforeach ($types as $type => &$count) foreach (preg_grep ('/\\.rem$/', scandir ($type)) as $file_name) {\n\t\t$name = pathinfo ($file_name, PATHINFO_FILENAME);\n\t\t\n\t\t//get the article’s header and content. if it doesn’t have a header, skip it\n\t\tif (!list ($meta, $title, $content) = getArticle (\"$type/$name\")) continue;\n\t\t\n\t\t//if the article is a draft, do not index it. it will be visible only at its permalink\n\t\tif (@$meta['draft']) continue;\n\t\t\n\t\t//update information:\n\t\t$modified = false;\n\t\t//if the file has no date: it’s new. give it a date\n\t\tif (!isset ($meta['date'])) {$meta['date'] = date ('YmdHi'); $modified = true;}\n\t\t//if the file has no updated meta, add it. the entry will be pushed to the top of the RSS feed\n\t\tif (!isset ($meta['updated'])) {$meta['updated'] = date ('YmdHi'); $modified = true;}\n\t\t//save the file if the date/updated fields have been changed:\n\t\t//(of course, I could have just used `json_encode` here, but then it wouldn’t be tidy)\n\t\tif ($modified) {\n\t\t\t//what if we can’t save to disk?\n\t\t\tif (!is_writable (\"$type/$file_name\")) @chmod (\"$type/$file_name\", 0777) or errorPage (\n\t\t\t\t'denied_article.rem', 'Error: Permission Denied', array ('PATH' => \"$type/$file_name\")\n\t\t\t);\n\t\t\tfile_put_contents (\"$type/$file_name\",\n\t\t\t\t\"{\\t\\\"date\\\"\\t\\t:\\t${meta['date']},\\n\"\n\t\t\t\t.\"\\t\\\"updated\\\"\\t:\\t${meta['updated']}\"\n\t\t\t\t//optional stuff\n\t\t\t\t.(@$meta['title'] ? \",\\n\\t\\\"title\\\"\\t:\\t\\\"\".str_replace ('\"', '\\\"', $meta['title'])\n\t\t\t\t\t\t\t.\"\\\"\" : '')\n\t\t\t\t.(@$meta['licence'] ? \",\\n\\t\\\"licence\\\"\\t:\\t\\\"${meta['licence']}\\\"\" : '')\n\t\t\t\t.(@$meta['tags'] ? \",\\n\\t\\\"tags\\\"\\t\\t:\\t[\\\"\".implode ('\", \"',$meta['tags']).\"\\\"]\" : '')\n\t\t\t\t.(@$meta['enclosure'] ? \",\\n\\t\\\"enclosure\\\"\\t\\t:\\t[\\\"\"\n\t\t\t\t\t\t\t.implode ('\", \"',$meta['enclosure']).\"\\\"]\" : '')\n\t\t\t\t.(@$meta['url'] ? \",\\n\\t\\\"url\\\"\\t\\t:\\t\\\"${meta['url']}\\\"\" : '')\n\t\t\t\t.(@$meta['draft'] ? \",\\n\\t\\\"draft\\\"\\t\\t:\\t${meta['draft']}\\n\" : \"\\n\")\n\t\t\t\t//the entry’s content\n\t\t\t\t.\"}\\n\\n\".$content\n\t\t\t);\n\t\t}\n\t\t\n\t\t//add each entry to the XML sitemap\n\t\t$xml .= template_tags (template_load ('url.xml'), array (\n\t\t\t'DOMAIN' => APP_HOST,\n\t\t\t'URL' => \"$type/$name\",\n\t\t\t'DATE' => date ('c', filemtime (APP_ROOT.\"$type/$file_name\"))\n\t\t));\n\t\t\n\t\t//add this entry to the index\n\t\tarray_push ($list,\n\t\t\t$meta['updated'].\"|$type|\".@implode ('|', $meta['tags']).(@$meta['tags'] ? '|' : '').$name\n\t\t);\n\t\t\n\t\t//add to the count for each of the tags\n\t\tif (isset ($meta['tags'])) foreach ($meta['tags'] as $tag) @$tags[$tag]++;\n\t\t\n\t\t//add to the count for this content-type\n\t\t$count++;\n\t}\n\tarsort ($types);\t//sort content-types by count, descending (for tag-cloud)\n\tarsort ($tags);\t\t//sort tags by count, descending (also for tag-cloud)\n\trsort ($list);\t\t//sort index, the updated-date is used for order\n\t\n\t/* save list to cache\n\t -------------------------------------------------------------------------------------------------------------- */\n\tif (!is_writable (APP_CACHE)) @chmod (APP_CACHE, 0777) or errorPage (\n\t\t'denied_cache.rem', 'Error: Permission Denied', array ('PATH' => APP_CACHE)\n\t);\n\tfile_put_contents (APP_CACHE.'index.types', serialize ($types));\n\tfile_put_contents (APP_CACHE.'index.tags', serialize ($tags));\n\tfile_put_contents (APP_CACHE.'index.list', serialize ($list));\n\t\n\t/* rebuild sitemap?\n\t -------------------------------------------------------------------------------------------------------------- */\n\tclearstatcache (); $date = reset (@explode ('|', $list[0]));\n\tif (!file_exists (APP_SYSTEM.'sitemap.xml') || filemtime (APP_SYSTEM.'sitemap.xml') < mktime (\n\t\t(integer) substr ($date, 8, 2),\n\t\t(integer) substr ($date, 10, 2), 0,\n\t\t(integer) substr ($date, 4, 2),\n\t\t(integer) substr ($date, 6, 2),\n\t\t(integer) substr ($date, 0, 4)\n\t)) {\n\t\t//save the cache\n\t\tfile_put_contents (APP_SYSTEM.'sitemap.xml',\n\t\t\ttemplate_tag (template_load ('base.xml'), 'URLS', $xml), LOCK_EX\n\t\t) or errorPage (\n\t\t\t'denied_cache.rem', 'Error: Permission Denied', array ('PATH' => APP_CACHE)\n\t\t);\n\t\t//ping Google with the update\n\t\tif ($_SERVER['SERVER_ADDR'] != '127.0.0.1') get_headers (\n\t\t\t\"http://www.google.com/webmasters/tools/ping?sitemap=\".\n\t\t\turlencode ('http://'.APP_HOST.'/sitemap.xml')\n\t\t);\n\t};\n}", "function renederPage( $url )\n{\n $sitePath = $_SERVER['SERVER_NAME'];\n global $link;\n global $msg;\n include $_SERVER['DOCUMENT_ROOT'].\"/views/_head.html\";\n include $_SERVER['DOCUMENT_ROOT'].\"/views/$url.html\";\n include $_SERVER['DOCUMENT_ROOT'].\"/views/_end.html\";\n}", "protected function generate()\n {\n $oServer = Input::singleton('server');\n $this->hData['method'] = isset($oServer['http_x_http_method_override']) ? strtolower($oServer['http_x_http_method_override']) : strtolower($oServer['request_method']);\n\n $oGet = Input::singleton('get');\n $this->processGet($oGet->getRaw());\n\n $this->hData['baseurl'] = rtrim(dirname($oServer['php_self']), '/') . '/';\n $this->hData['rawpath'] = rtrim(preg_replace(\"#\\?.*#\", '', preg_replace(\"#^\" . $this->hData['baseurl'] . \"#\", '', $oServer['request_uri'])), '/');\n $this->processRawPath();\n }", "function Template()\r\n\t{\t\t\r\n\t\tglobal $_REQUEST;\t\t\r\n\t\t$theme = $this->theme;\r\n\t\t/*** Get Template By Page Id ***/\r\n\t\t$file = $this->get_template();\r\n\t\t\r\n\t\tif($_SETTINGS['debug'] == 1){\r\n\t\t\techo \"TEMPLATE: \".$file.\" <Br>\";\r\n\t\t}\r\n\t\t\r\n\t\t$websitepath = $this->website_path;\r\n\t\t//die(\"FILE: $file\");\r\n\t\t//exit();\r\n\t\tinclude''.$_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file.'';\r\n\t}", "function createPage($name) {\n //Keep track of the new page's location.\n $location = $_SERVER['DOCUMENT_ROOT'] . \"/pages/\" . $name . \".php\";\n //Check to make sure the file doesn't already exist.\n if(file_exists($location)) {\n //If it does exist, just load into that page.\n header('Refresh: 0; URL = /pages/' . $name . '.php');\n }\n //Create a new php page in the pages folder.\n $newPage = fopen($location, \"w\");\n //Ensure that the user can write, and that anyone can read it.\n //If need be, put this in an \"if\" statement in case it throws an error.\n chmod($location, 0644);\n //Add the default stuff like header.php\n $defaultText = '<?php\n include ($_SERVER[\\'DOCUMENT_ROOT\\'] . \"/php/header.php\");\n?>\n<head>\n</head>\n<body id=\"body\" class=\"nested\">\n</body>';\n //Write the default text into the new page.\n fwrite($newPage, $defaultText);\n //Close editing\n fclose($newPage);\n //Load the new page\n header('Refresh: 0; URL = /pages/' . $name . '.php');\n }", "public function generate()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$this->Template = new \\BackendTemplate('be_wildcard');\n\t\t\t$this->Template->wildcard = '### ONE-PAGE-WEBSITE :: NAVIGATION ###' . \"<br>\" . $GLOBALS['TL_LANG']['FMD'][$this->type][0];\n\t\t\t$this->Template->title = $this->headline;\n\n\t\t\treturn $this->Template->parse();\n\t\t}\n\t\t\n\t\t\n\t\t// if no id is given, generate one\n\t\t$arrCssID = deserialize($this->cssID);\n\t\tif(strlen($arrCssID[0]) < 1)\n\t\t{\n\t\t\t$arrCssID[0] = 'onepagewebsitenavigation_'.$this->id;\n\t\t\t$this->cssID = $arrCssID;\n\t\t}\n\t\t\n\t\treturn parent::generate();\n\t}", "public function output()\n\t{\n\t\t$template_path = THEMES_DIR.PAGE_PATH.'.html';\n\t\tif(!file_exists($template_path)) {\n\t\t\t// or the first file in the first existing path\n\t\t\t$existing_path = $this->first_realpath(THEMES_DIR, PAGE_PATH);\n\t\t\t$tpl_list = $this->list_files(THEMES_DIR . $existing_path, '*.html');\n\t\t\t$template_path = reset($tpl_list);\n\t\t}\n\t\t$content = file_get_contents($template_path);\n\t\t$content = $this->parse($content, false, true, 'template \"'.$template_path.'\"');\n\t\treturn $content;\n\t}", "public function generate()\r\n {\r\n $loader = new ContentLoader($this->_viewVariables);\r\n $loader->initContent($this->_contentViewPath);\r\n $this->_layout = $loader->initLayout($this->_layoutPath);\r\n echo $this->_layout;\r\n }", "public function generateContent()\n {\n $this->initDepth();\n $url = Url::getCurrentURL();\n $folders = $url->getFolders();\n $filename = $url->getFilename();\n $folder_count = count($folders);\n if ($folder_count == $this->depth) {\n $extension = \\Sledgehammer\\file_extension($filename, $file);\n if ($extension === null && $this->handle_filenames_without_extension == false) { // Ongeldige bestandsnaam? (geen extentie)\n error_log('filename without extension, redirecting to \"'.$filename.'/\"', E_NOTICE);\n\n return new Redirect($filename.'/'); // Redirect naar dezelfde url, maar dan als mapnaam\n }\n if ($this->publicMethods === null) {\n notice('Check if the parent::__construct() is called in '.get_class($this).'__construct()');\n }\n $function = str_replace('-', '_', $file);\n if (substr($function, -7) != '_folder' && in_array($function, $this->publicMethods)) {\n return $this->$function($extension); // Roept bijvoorbeeld de $this->index('html') functie aan.\n }\n\n return $this->file($filename);\n }\n if ($folder_count > $this->depth) {\n if ($folder_count != ($this->depth + 1)) {\n $filename = false; // Deze submap heeft nog 1 of meer submappen.\n }\n $folder = $folders[$this->depth];\n $function = str_replace('-', '_', $folder).'_folder';\n if (in_array($function, $this->publicMethods)) {\n return $this->$function($filename); // Roept bijvoorbeeld de $this->fotos_folder('index.html') functie aan.\n }\n\n return $this->folder($folder, $filename);\n }\n warning('Not enough (virtual) subfolders in URI', 'VirtualFolder depth('.$this->depth.') exceeds maximum('.count($folders).')');\n\n return $this->onFolderNotFound(); // @todo eigen event?\n }", "public function index() {\n\t\t$map_content['title_page'] = 'Карта сайта';\n\t\t$this->html_map = '';\n\t\t$this->map_generation();\n\t\t\n\n\t\t$map_content['text'] = $this->html_map;\n\t\t$this->layout='pages';\n\t\t$this->sitemap=\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n\t\t$this->sitemap.=\"<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\";\n\t\t$this->map_generation_xml();\n\t\t$this->sitemap.=\"</urlset>\";\n\n\t\t$file=\"sitemap.xml\";\n\t\t\n\t\t$fp = fopen($file, \"w\"); \n\t\t\n\t\tfwrite($fp,$this->sitemap);\n\t\t\n\t\tfclose($fp);\n\t\t$this->html->render('pages/pages.html', $map_content, 'container');\n\t}", "public function index()\r\n {\r\n\r\n $template_file = DX_ROOT_DIR . $this->views_dir . 'index.php';\r\n\r\n // include_once DX_ROOT_DIR . '/views/layouts/' . $this->layout;\r\n }", "public function generate() {\n\t\t$data = [\n\t\t\t'@type' => $this->determine_page_type(),\n\t\t\t'@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH,\n\t\t\t'url' => $this->context->canonical,\n\t\t\t'name' => $this->context->title,\n\t\t\t'isPartOf' => [\n\t\t\t\t'@id' => $this->context->site_url . WPSEO_Schema_IDs::WEBSITE_HASH,\n\t\t\t],\n\t\t];\n\n\t\t$data = WPSEO_Schema_Utils::add_piece_language( $data );\n\n\t\tif ( is_front_page() ) {\n\t\t\tif ( $this->context->site_represents_reference ) {\n\t\t\t\t$data['about'] = $this->context->site_represents_reference;\n\t\t\t}\n\t\t}\n\n\t\tif ( is_singular() ) {\n\t\t\t$this->add_image( $data );\n\n\t\t\t$post = get_post( $this->context->id );\n\t\t\t$data['datePublished'] = $this->date->format( $post->post_date_gmt );\n\t\t\t$data['dateModified'] = $this->date->format( $post->post_modified_gmt );\n\n\t\t\tif ( get_post_type( $post ) === 'post' ) {\n\t\t\t\t$data = $this->add_author( $data, $post );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $this->context->description ) ) {\n\t\t\t$data['description'] = strip_tags( $this->context->description, '<h1><h2><h3><h4><h5><h6><br><ol><ul><li><a><p><b><strong><i><em>' );\n\t\t}\n\n\t\tif ( $this->add_breadcrumbs() ) {\n\t\t\t$data['breadcrumb'] = [\n\t\t\t\t'@id' => $this->context->canonical . WPSEO_Schema_IDs::BREADCRUMB_HASH,\n\t\t\t];\n\t\t}\n\n\t\t$data = $this->add_potential_action( $data );\n\n\t\treturn $data;\n\t}", "public function plantilla()\n\t\t{\n\t\t\trequire(\"views/template.php\");\n\t\t}", "function fsnat_create_page() {\n\trequire_once( get_template_directory() . '/inc/templates/fsnat-admin.php');\n}", "function path_info_to_content() {\n\n if (! isset($_SERVER['PATH_INFO'])) {\n return '_content.index.php';\n }\n\n $path_info = $_SERVER['PATH_INFO'];\n $path_info = preg_replace('/^\\/|\\/$/', '', $path_info);\n\n // species/* is handled by the species page\n if (preg_match('/^species\\/[^\\/]+$/', $path_info)) {\n $path_info = 'species';\n }\n\n // species/overview/* is handled by the species_overview page\n if (preg_match('/^species\\/overview\\/[^\\/]+$/', $path_info)) {\n $path_info = 'species_overview';\n }\n\n $path_info = preg_replace('/\\//', '_', $path_info);\n \n return \"_content.$path_info.php\";\n}", "function buildBase($Environment)\n\t{\n\t\t$page = new pageTemplate(CMS_DIR_THEME . \"/core.thtml\");\n\n\t\t// Insert the Head information\n\t\t$pageHead = new pageTemplate(CMS_DIR_THEME . \"/head.thtml\");\n\t\t$page -> add(\"HEADER_INFO\", $pageHead -> parse());\n\n\t\t// Insert the Header of the page\n\t\t$pageHead = new pageTemplate(CMS_DIR_THEME . \"/header.thtml\");\n\t\t$page -> add(\"HEADER\", $pageHead -> parse());\n\t\t\n\t\t$page -> add($Environment[\"config\"]);\n\t\t\n\t\treturn $page;\n\t}", "private static function _createIndexPages()\n {\n // For each system and its templates create its glossary index page.\n // For each system create its index page and then for each of its templates.\n foreach (self::$_docsInfo as $systemName => $docsInfo) {\n // Create the glossary index for this system.\n self::_createGlossaryIndexPage($docsInfo['glossary'], $systemName);\n\n // Create the index page for this system which has its description and\n // link to its screens.\n self::_createSystemIndexPage($docsInfo, $systemName);\n foreach ($docsInfo['template'] as $templateName => $tplDocsInfo) {\n // Create the glossary index for this template.\n self::_createGlossaryIndexPage($tplDocsInfo['glossary'], $systemName, $templateName);\n\n // Create the index page for the template which shows main article of\n // the template on top and rest of the articles of the template and\n // the mode.\n self::_createTemplateIndexPage($tplDocsInfo['article'], $docsInfo['article'], $systemName, $templateName);\n }\n }//end foreach\n\n }", "public function generate()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$objTemplate = new \\BackendTemplate('be_wildcard');\n\n\t\t\t$objTemplate->wildcard = '### PAGE PEEL ###';\n\t\t\t$objTemplate->title = $this->name;\n\t\t\t\n\t\t\t// TODO: Vorschaubild der Kampagne einbinden\n\t\t\t\n\t\t\t$objTemplate->id = $this->id;\n\t\t\t$objTemplate->link = $this->title;\n\t\t\t$objTemplate->href = 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id=' . $this->id;\n\n\t\t\treturn $objTemplate->parse();\n\t\t}\n\n\t\t$objFile = \\FilesModel::findByPk($this->cp_pagepeel_imgsmall); \n\t\t$this->cp_pagepeel_imgsmall = $objFile->path; \n\n\t\t$objFile = \\FilesModel::findByPk($this->cp_pagepeel_imgbig); \n\t\t$this->cp_pagepeel_imgbig = $objFile->path; \n\t\t\n\t\treturn parent::generate();\n\t}", "function Yield() \n\t{\n\t\t$ci= & get_instance();\n\t\tif (!$ci->layout) {\t\t\t\n\t\t\t$ci->layout = 'default';\n\t\t}\n\t\t$layout = APPPATH .\"views/themes/\".config_item('theme').\"/layouts/\" . $ci->layout . \".php\";\n\t\t//echo ($layout);\n\t\t$current_output = $ci->output->get_output();\n\t\t//echo $current_output;\n\t\t//exit;\n\t\t$controller = $ci->uri->segment(1);\n\t\tif (file_exists($layout)){\n\t\t\t//echo \".\";\n\t\t\t$output = $ci->load->file($layout, true);\n\t\t\t//echo $output;\n\t\t\t$output = str_replace(\"{yield}\", $current_output,$output);\n\t\t\techo $output;\n\t\t} else {\n\t\t\t//echo \"no layout\";\n\t\t\t$output = $current_output;\n\t\t\techo $output;\n\t\t}\n\t}", "public function index()\n {\n\n\t $template = storage_path('app/public/temp1.docx');\n\n \tif(file_exists($template)){\n \t\t$templateProcessor = new TemplateProcessor($template);\n\n $testData = array(\n array('List'=>'list 1'),\n array('List'=>'list 2'),\n array('List'=>'List 3')\n );\n\n\n\n // \t\t$testData = array(\n\t\t\t// array('Name'=>'Test Name 1', 'Value'=>123.45),\n\t\t\t// array('Name'=>'Test Name 2', 'Value'=>223.45),\n\t\t\t// array('Name'=>'Test Name 3', 'Value'=>323.45),\n\t\t\t// array('Name'=>'Test Name End', 'Value'=>423.45),\n\t\t\t// );\n\n // \t\t$t=$templateProcessor->cloneBlock('CLONEME', 3,true,true,$testData);\n\n // $t=$templateProcessor->cloneBlock('LI', 3,true,true,$testData);\n // $php = new PhpWord();\n \t\t// dd($t);\n \n $templateProcessor->setValue('Name','John Doe');\n \t\t$file=$templateProcessor->saveAs(public_path('w/h.docx'));\n dd($file);\n\n \t}\n \n\n \t\n }", "protected function generatePagesSitemap() {\n\t\tt3lib_div::requireOnce(t3lib_extMgm::extPath('dd_googlesitemap', 'class.tx_ddgooglesitemap_pages.php'));\n\t\t$generator = t3lib_div::makeInstance('tx_ddgooglesitemap_pages');\n\t\t/* @var $generator tx_ddgooglesitemap_pages */\n\t\t$generator->main();\n\t}", "function generate_page_head ( $titre, $description, $tags, $res_segments ){\n\t\t$html = \"<html lang='fr'>\n\t<head>\n\t\t<title>\".$titre.\"</title>\n\t\t<link rel='shortcut icon' type='image/png' href='img/favicon.png'>\n\t\t<link rel='stylesheet' type='text/css' href='lib/site.css'>\n\t\t<link href='http://fonts.googleapis.com/css?family=Oleo+Script' rel='stylesheet' type='text/css'>\n\t\t<meta charset='utf-8'>\n\t\t<meta name='description' content='\".$description.\"'>\n\t\t<meta name='keywords' content='\".$tags.\"'>\";\n\t\t\n\t\t// If page has segments\n\t\t//$html .= sizeof($res_segments);\n\t\tif ( $res_segments != \"\" ){\n\t\t\t\n\t\t\t// List all elements involved in page\n\t\t\twhile ( $row = getLine ( $res_segments ) )\t$tab_elm[$row['element']] = 1;\n\t\t\t\n\t\t\t// Include each element css file in html head\n\t\t\tforeach ( $tab_elm as $elm=>$v )\t$html .= \"\n\t\t\t<link rel='stylesheet' type='text/css' href='lib/$elm/$elm.css'>\";\n\t\t}\n\t\t\t\n\t\t// Generate site's structure : header & nav sections\n\t\t$html .= \"\n\t</head><body>\n\t\t<div id='back'>\n\t\t\t<center><div id='wrapper'>\";\n\t\t$html .= \"\n\t\t\t\t\".generate_site_header();\n\t\treturn $html;\n\t}", "public function run ()\n\t{\n\t\t$dump = template::dump ();\n\n\t\t$head = '';\n\t\tforeach ( $dump ['css'] as $file )\n\t\t{\n\t\t\t$head .= $this->twig->render ( 'system/html/web/snippets/css.twig', [ 'file' => $file, 'defer' => substr ( $file, 0, 2 ) == '//' ] );\n\t\t}\n\n\t\tforeach ( $dump ['js'] as $file )\n\t\t{\n\t\t\t$head .= $this->twig->render ( 'system/html/web/snippets/js.twig', [ 'file' => $file, 'defer' => substr ( $file, 0, 2 ) == '//' ] );\n\t\t}\n\n\t\t$body = '';\n\t\tforeach ( $dump ['templates'] as $template )\n\t\t{\n\t\t\t$body .= $this->twig->render ( $template ['path'], $template ['environment'] );\n\t\t}\n\n\t\t// We do not use die incase some modules need to run after the layout have been generated\n\t\techo $this->twig->render ('system/html/web/base.twig', [\n\t\t\t'head' => $head,\n\t\t\t'body' => $body\n\t\t] );\n\t}", "function page_generateScaffold($pageInfo,$offset=0,$extravars=array()) {\n\tglobal $Auth,$input_language;\n\t\t\t\n\t## multiclient\n\t$client_id = $Auth->auth[\"client_id\"];\n\n\t$output = '';\n\t\n\t$page_id \t\t= intval($pageInfo[\"page_id\"]);\n\t$menu_id \t\t= isset($pageInfo[\"id\"]) ? $pageInfo[\"id\"] : 0;\n\t$menu_text \t\t= isset($pageInfo[\"text\"]) ? $pageInfo[\"text\"] : '';\t\t\n\t$template_id\t= $pageInfo[\"template_id\"];\n\t$page_type\t\t= $pageInfo[\"type\"];\t\n\t$modified\t\t= $pageInfo[\"modified\"];\n\t\t\t\n\t$dbConnection = new DB_Sql();\n\t\t\t\n\tif($page_type == 'folder') {\n\t\t## we need to output the folder by calling\n\t\t## the folder output functions\n\t\tfolder_outputFolder($page_id);\n\t\texit();\t\n\t}\n\t\n\t## grab the information for this page\n\t$select_query = \"SELECT basename FROM \".PAGE_TEMPLATE.\" WHERE template_id='$template_id' AND client_id='$client_id'\";\n\t$result_pointer = $dbConnection->query($select_query);\n\t\n\t$dbConnection->next_record();\n\t$filename = $dbConnection->Record[\"basename\"];\n\t$xmlFile = $filename.\".xml\";\n\t$filename = $filename.\".tpl\";\n\n\tif ($filename == \".tpl\") {\n\t\t## maybe we can come with some good default behavior\n\t\texit();\n\t}\n\t\t\t\n\t## prepare the template file\n\t$layout_template = new Template(HTML_DIR);\n\t$layout_template->set_templatefile(array(\"pager\"=>$filename,\"head\" => $filename,\"body\" => $filename,\"foot\" => $filename)); \n\t\n\t## here we set the global vars- the user can set them within the templates:\n\t$layout_template->set_var(\"matrix:TITLE\",$menu_text);\n\t$layout_template->set_var(\"matrix:PAGEID\",$page_id);\n\t$layout_template->set_var(\"matrix:TARGETPAGE\",getTargetURL($page_id));\n\t$layout_template->set_var(\"matrix:MODDATE\",utility_prepareDate(strtotime($modified),DEFAULT_DATE));\n\t\n\t## finally set the others values passed to the script\n\t$layout_template->set_vars($extravars);\n\n\t##$output .= $layout_template->fill_block(\"head\");\n\n\t## for the body we need to examine the xml file- to find out \n\t## what type of form elements we need to position\n\t$wt = new xmlparser(HTML_DIR.$xmlFile);\n\t$wt->parse();\n\t\n\t## okay we scanned in the xml file- so we now loop through all the elements\n\t$elements = $wt->getNormalElements();\t\n\t$objects = $wt->getNormalObjects();\t\n\t\n\t## we should get the page content\n\t$page_record = page_getPage($page_id,$objects);\n\n\t$counter =0;\n\t$num_elements = count($elements);\n\twhile($counter < $num_elements) {\n\t\t## store the output\n\t\t$storage = ' ';\t\n\t\n\t\t## okay first we try to find out what type we have\n\t\t## we wrap this up in a switch statemnt- this way we can extend it more easily\n\t\t$element_type = $elements[$counter]['TYPE'];\n\t\t$element_name = $elements[$counter]['NAME'];\n\n\t\tswitch($element_type) {\n\t\t\tcase 'TEXT':\n\t\t\tcase 'COPYTEXT':\n\t\t\tcase 'DATE': \n\t\t\tcase 'LINK' :\n\t\t\tcase 'FILE':\n\t\t\tcase 'BOX':\n\t\t\tcase 'LINKLIST':\n\t\t\tcase 'IMAGE': {\n\t\t\t\t## get the data and set the var in the template\n\t\t\t\t$target = strtolower($element_type); \n\t\t\t\tif(isset($page_record[$element_name])) {\n\t\t\t\t\t$function = \"output_\".$target;\n\t\t\t\t\t$element = $function($page_record[$element_name],$elements[$counter],$menu_id,$page_id);\n\n\t\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t\t$layout_template->set_vars($element);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$layout_template->set_var($element_name,$element);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'INCLUDE' : {\n\t\t\t\t## basically we need to call the function output_\"element_type\"\n\t\t\t\t## and the output the results to the template\n\t\t\t\t$target = strtolower($element_type); \n\t\t\t\t$function = \"output_\".$target;\n\t\t\t\t$element = $function('',$elements[$counter],$menu_id,$page_id);\t\t\t\t\n\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t$layout_template->set_vars($element);\n\t\t\t\t} else {\n\t\t\t\t\t$layout_template->set_var($element_name,$element);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\tcase 'LISTVIEW': {\n\t\t\t\t$element = \"\";\n\t\t\t\t\n\t\t\t\t$element = output_listview($page_record,$elements[$counter],$layout_template,$menu_id,$page_id); \n\t\t\t\t$layout_template->set_var($element_name,$element);\t\n\t\t\t\tbreak;\t\n\t\t\t}\t\n\t\t\n\t\t\tcase 'SEARCH': {\n\t\t\t\t## now it's time to check the previous data entered:\n\t\t\t\t$layout_template->set_var($element_name.'.action',\"content.php?name=\".$elements[$counter]['PAGE']);\n\t\t\t\t$layout_template->set_var($element_name.'.name',\"query\");\n\t\t\t\t\n\t\t\t\t## prepare the hidden fields\n\t\t\t\t$hidden ='<input type=\"hidden\" name=\"PAGE\" value=\"'.$elements[$counter]['PAGE'].'\">';\n\t\t\t\t$hidden .='<input type=\"hidden\" name=\"LIMIT\" value=\"'.$elements[$counter]['LIMIT'].'\">';\n\t\t\t\t\n\t\t\t\t$layout_template->set_var($element_name.'.hidden',$hidden);\n\t\t\t\tbreak;\n\t\t\t}\t\n\t\t\tcase 'SEARCHRESULTS': {\n\t\t\t\t## if we hit a searchresult tag, does means we should display\n\t\t\t\t## the results for the current search- we need to check\n\t\t\t\t## if we have a $query.\n\t\t\t\t$query = \"\";\n\t\t\t\tif($_POST[\"query\"]!=\"\" && isset($_POST[\"query\"])) {\n\t\t\t\t\t## we have a query so let's perform the search\n\t\t\t\t\t## we need to process the umlauts\n\t\t\t\t\t$query = convert_general($_POST[\"query\"]);\n\t\t\t\t\t$results = search($query);\n\t\t\t\t}\n\t\t\t\t$db = new DB_Sql();\n\t\t\t\t\n\t\t\t\t$found_pages = array();\t\t\t## used to store the found pages\n\t\t\t\t$box_pages = array();\n\t\t\t\t## we've got the results, but they are in a raw format\n\t\t\t\tfor($i=0; $i < count($results); $i++) {\n\t\t\t\t\t## now loop through the results, and check the type\n\t\t\t\t\tif($results[$i]['type']=='page') {\n\t\t\t\t\t\t## this means everything is fine, we need to check if this page\n\t\t\t\t\t\t## is currently visible (+current version)\n\t\t\t\t\t\t\n\t\t\t\t\t\t## at least we check if it is visible\n\t\t\t\t\t\t$pageInfo = structure_getStructureID($results[$i]['page_id']);\n\t\t\t\t\t\tif (!checkFlag($pageInfo[\"flags\"],PAGE_INVISIBLE) && checkFlag($pageInfo[\"flags\"],PAGE_ACTIVE)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t## first we check if the content element that was found belongs to the latest version of the page\n\t\t\t\t\t\t\t$s_query = \"SELECT content_id FROM \".PAGE_CONTENT.\" WHERE identifier='\".$results[$i]['identifier'].\"' AND page_id='\".$results[$i]['page_id'].\"' AND client_id='$client_id' LIMIT 1\";\n\t\t\t\t\t\t\t$result = $db->query($s_query);\t\n\t\t\t\t\t\t\tif($db->next_record()) {\n\t\t\t\t\t\t\t\tif($db->Record['content_id'] == $results[$i]['content_id']) {\n\t\t\t\t\t\t\t\t\t## this means we can savely output the result\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t## first check if the page_id id is aleady within the found pages\n\t\t\t\t\t\t\t\t\tif(!in_array($results[$i]['page_id'],$found_pages)) {\n\t\t\t\t\t\t\t\t\t\t$found_pages[] = $results[$i]['page_id'];\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\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t## if it is a container, we need to check if it is active and if the page it belongs to\n\t\t\t\t\t\t## is current and active\n\t\t\t\t\t\t\n\t\t\t\t\t\t## using this query we get: the page id that hosts the content element. We don't know if the content element of the active version of this page\n\t\t\t\t\t\t## contains the search parameter but we know it has at somepoint- leave it for now\n\t\t\t\t\t\t$s_query = \"SELECT page_id FROM \".DB_PREFIX.\"box_item AS A INNER JOIN \".DB_PREFIX.\"box AS B ON A.box_id=B.box_id WHERE target='\".$results[$i]['page_id'].\"' AND A.client_id='$client_id' ORDER BY B.modified DESC\";\n\t\t\t\t\t\t$result = $db->query($s_query);\n\t\t\t\t\t\twhile($db->next_record()) {\n\t\t\t\t\t\t\t## check if the page is active\n\t\t\t\t\t\t\t$pageInfo = structure_getStructureID($db->Record['page_id']);\n\t\t\t\t\t\t\tif (!checkFlag($pageInfo[\"flags\"],PAGE_INVISIBLE) && checkFlag($pageInfo[\"flags\"],PAGE_ACTIVE)) {\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t## first check if the page_id id is aleady within the found pages\n\t\t\t\t\t\t\t\tif(!in_array($db->Record['page_id'],$found_pages)) {\n\t\t\t\t\t\t\t\t\t$found_pages[] = $db->Record['page_id'];\n\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t## set the found page id to the returned page id- otherwise we only have the box\n\t\t\t\t\t\t\t\t$box_pages[] =\t$results[$i]['page_id']; \n\t\t\t\t\t\t\t\t$results[$i]['page_id'] = $db->Record['page_id'];\t\n\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t## now that we have the results, we will set them in the template\n\t\t\t\t$basename = $elements[$counter]['TEMPLATE'];\n\t\t\t\t$filename = $basename.'.tpl';\n\t\t\t\t$xmlFile = $basename.'.xml';\t\n\t\t\t\t\n\t\t\t\t$xmlStructure = new xmlparser(HTML_DIR.$xmlFile);\n\t\t\t\t$xmlStructure->parse();\n\t\t\t\t## parse the template file\n\t\t\t\t$objects \t\t= $xmlStructure->getObjects();\n\t\t\t\t$xmlStructure \t= $xmlStructure->getElements();\t\n\t\t\t\t\t\t\n\t\t\t\t$searchresult_template = new Template(HTML_DIR);\n\t\t\t\t$searchresult_template->set_templatefile(array(\"body\" => $filename)); \n\n\t\t\t\t$displayed_pages = array();\n\t\t\t\t$results_counter = 1;\n\t\t\t\tfor($i=0;$i<count($results); $i++) {\n\t\t\t\t\tif(!in_array($results[$i][\"page_id\"],$displayed_pages)) {\n\t\t\t\t\t\tif(in_array($results[$i][\"page_id\"],$found_pages)) {\n\t\t\t\t\t\t\t$displayed_pages[] = $results[$i][\"page_id\"];\n\t\t\t\t\t\t\t$page_data = array();\n\t\t\t\t\t\t\t## get the page \n\t\t\t\t\t\t\t$page_data = page_getPage($results[$i][\"page_id\"],$objects);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t## output the page\n\t\t\t\t\t\t\t$search_results_counter =0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t## reset the template\n\t\t\t\t\t\t\t$searchresult_template->varkeys = array(); \n\t\t\t\t\t\t\t$searchresult_template->varvals = array(); \t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twhile($search_results_counter < count($xmlStructure)-1) {\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t## okay first we try to find out what type we have\n\t\t\t\t\t\t\t\t## we wrap this up in a switch statemnt- this way we can\n\t\t\t\t\t\t\t\t## extend it more easily\n\t\t\t\t\t\t\t\t$s_element_type = $xmlStructure[$search_results_counter]['TYPE'];\n\t\t\t\t\t\t\t\t$s_element_name = $xmlStructure[$search_results_counter]['NAME'];\n\n\t\t\t\t\t\t\t\tswitch($s_element_type) {\n\t\t\t\t\t\t\t\t\tcase 'TEXT':\n\t\t\t\t\t\t\t\t\tcase 'COPYTEXT':\n\t\t\t\t\t\t\t\t\tcase 'DATE': \n\t\t\t\t\t\t\t\t\tcase 'LINK' :\n\t\t\t\t\t\t\t\t\tcase 'FILE':\n\t\t\t\t\t\t\t\t\t//case 'BOX':\n\t\t\t\t\t\t\t\t\tcase 'LINKLIST':\n\t\t\t\t\t\t\t\t\tcase 'IMAGE': {\n\t\t\t\t\t\t\t\t\t\t## basically we need to call the function output_\"element_type\"\n\t\t\t\t\t\t\t\t\t\t## and the output the results to the template\n\t\t\t\t\t\t\t\t\t\t$s_target = strtolower($s_element_type); \n\t\t\t\t\t\t\t\t\t\tif(isset($page_data[$s_element_name])) {\n\t\t\t\t\t\t\t\t\t\t\teval(\"\\$s_element = output_\".$s_target.\"(\\$page_data[\\$s_element_name],\\$xmlStructure[\\$search_results_counter],0);\");\t\n\t\t\t\t\t\t\t\t\t\t\tif(is_array($s_element)) {\n\t\t\t\t\t\t\t\t\t\t\t\t$searchresult_template->set_vars($s_element);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$searchresult_template->set_var($s_element_name,$s_element);\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\tbreak;\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\tcase 'BOX': {\n\t\t\t\t\t\t\t\t\t\tif($page_data[$s_element_name]['length'] > 0) {\n\t\t\t\t\t\t\t\t\t\t\tfor($bb=0;$bb<$page_data[$s_element_name][\"length\"]; $bb++) {\n\t\t\t\t\t\t\t\t\t\t\t\t$b_target_page = $page_data[$s_element_name][$bb]['target'];\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t## now check if the target_page was wihtin the search_result\n\t\t\t\t\t\t\t\t\t\t\t\tif(in_array($b_target_page,$box_pages)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t## okay we need to get this page then\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## get the text elements for the page\n\t\t\t\t\t\t\t\t\t\t\t\t\t$b_data = array();\n\t\t\t\t\t\t\t\t\t\t\t\t\ttext_getData($b_target_page,$b_data);\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\tforeach($b_data as $b_current_data) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t## prepare the text element\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$b_current_data['text'] = '<p>'.strip_tags($b_current_data['text']).'</p>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$b_current_data['text']= str_colapse($b_current_data['text'],280,\"center\",'...');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$searchresult_template->set_var($b_current_data['identifier'],$b_current_data['text']);\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\tbreak;\n\t\t\t\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$search_results_counter++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t## finally we ouptut the link\n\t\t\t\t\t\t$page_id = $results[$i][\"page_id\"];\n\t\t\t\t\t\t$targetURL = getTargetURL($page_id);\t\n\t\t\t\t\t\t$searchresult_template->set_var('matrix:TARGETPAGE',$targetURL);\n\t\t\t\t\t\t$searchresult_template->set_var('matrix:RESULTINDEX',$results_counter);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$results_counter++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$searchresult_output.=$searchresult_template->fill_block(\"body\");\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}\n\t\t\t\t\n\t\t\t\t## finally set the general vars\n\t\t\t\t$layout_template->set_var(\"SEARCHRESULT.query\",$query);\n\t\t\t\t$layout_template->set_var(\"SEARCHRESULT.hits\",count($found_pages));\n\t\t\t\t## finally output the whole thing\t\t\t\t\n\t\t\t\t\n\t\t\t\t$layout_template->set_var($element_name,$searchresult_output);\n\t\t\t\tbreak;\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tcase 'DIVIDER': {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\t## we need to check if we have a module for this datatype\n\t\t\t\t$target = strtolower($element_type);\n\t\t\t\t\n\t\t\t\t## first we try to include the apropriate file \n\t\t\t\t@include_once(\"datatypes/extra_\".$target.\"/\".$target.\".php\");\n\t\t\t\t## now we check if the function exists\n\t\t\t\t\n\t\t\t\tif(function_exists($target.\"_output\")) {\n\t\t\t\t\t## no we call the function\n\t\t\t\t\t## check if the page_record entry is defined\n\t\t\t\t\t## if not we need to pass the whole record\n\t\t\t\t\t$function = $target.\"_output\";\n\t\t\t\t\tif(isset($page_record[$element_name])) {\n\t\t\t\t\t\t$element = $function($page_record[$element_name],$elements[$counter],$menu_id,$page_id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$element = $function($page_record,$elements[$counter],$layout_template,$menu_id,$page_id);\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t\t$layout_template->set_vars($element);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$layout_template->set_var($element_name,$element);\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$counter++;\n\t}\n\n\t## this is it- so we will flush the template here\t\t\n\t$output .= $layout_template->fill_block(\"body\");\n\t##$output .= $layout_template->fill_block(\"foot\");\n\t##$output = $layout_template->finish($output);\n\tpagecache_createCacheFile($page_id,$output);\n\treturn $output;\n}", "function generate($title=\"\"){\n\t\t// Page generate benchmark\n\t\t$this->CI->benchmark->mark('benchmark_start');\n\n\t\t// Turn on profiler if necessary\n\t\tif ($this->profiler) {\n\t\t\t$this->CI->output->enable_profiler($this->profiler);\n\t\t}\n\t\t\n\t\tif ($this->js_utils) {\n\t\t\t// Passes site_url, base_url and php_vars to JS. Very useful for javascript frameworks.\n\t\t\t$this->code(\"// Javascript utils\\n\\t\\tvar site_url = '\".site_url().\"';\\n\\t\\tvar base_url = '\".base_url().\"';\\n\\t\\tvar phpvars = \".json_encode($this->php_vars).\";\");\n\t\t}\n\n\t\t// Template header\n\t\t$this->CI->load->view(\n\t\t\"../templates/{$this->template}/header\",\n\t\tarray(\n\t\t\t'head_info'\t\t\t=> $this->head_info,\n\t\t\t'title'\t\t\t\t=> $title,\n\t\t\t'metas'\t\t\t\t=> $this->_compile_metas(),\n\t\t\t'css'\t\t\t\t=> $this->_compile_css(PAGE_HEAD),\n\t\t\t'js'\t\t\t\t=> $this->_compile_js(PAGE_HEAD),\n\t\t));\n\t\t\n\t\t// Foreach saved view in the view_list array load it\n\t\tforeach($this->view_list as $view){\n\t\t\t$this->CI->load->view($view['name'], $view['data']);\n\t\t}\n\n\t\t// Footer\n\t\t$this->CI->load->view(\n\t\t\t\"../templates/{$this->template}/footer\",\n\t\t\tarray(\n\t\t\t\t'js'\t\t\t=> $this->_compile_js(PAGE_BODY)\n\t\t\t)\n\t\t);\n\n\t\t// Okay dood!\n\t\t$this->CI->benchmark->mark('benchmark_end');\n\t}", "function aman_create_page() {\n\trequire_once(get_template_directory() . '/inc/templates/aman-admin.php');\n}", "protected function generateNewsSitemap() {\n\t\tt3lib_div::requireOnce(t3lib_extMgm::extPath('dd_googlesitemap', 'class.tx_ddgooglesitemap_ttnews.php'));\n\t\t$generator = t3lib_div::makeInstance('tx_ddgooglesitemap_ttnews');\n\t\t/* @var $generator tx_ddgooglesitemap_ttnews */\n\t\t$generator->main();\n\t}", "public function runSitemap() {\n $this->genSitemapXML();\n $this->genSitemapHTML();\n $this->genSitemapROR();\n $this->genSitemapTXT();\n $this->genRobotTXT();\n }", "function homepage_action()\n{\n\n require_once __DIR__ . '/../templates/home.php';\n}", "public function readme()\n {\n return 'Generate a link to an external page or an internal page. \nIn order to call an internal URL use the `//` prefix like `link[//contact](Go to contact)`, now the `//` are replace by the url of the webserver. \nIf a single `/` is used its a relative url and therfore won\\'t be changed.\nIn order to generate an external url use `link[luya.io](Go to Luya.io)`.';\n }", "public function displayDoc()\n {\n include __DIR__ . '/templates/doc.php';\n }", "public function main() {\n\t\tswitch ($this->getSitemapType()) {\n\t\t\tcase self::SITEMAP_TYPE_PAGES:\n\t\t\t\t$this->generatePagesSitemap();\n\t\t\t\tbreak;\n\t\t\tcase self::SITEMAP_TYPE_NEWS:\n\t\t\t\t$this->generateNewsSitemap();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->generateError();\n\t\t}\n\t}", "function lb_show_make_page() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'make_page',\n\t\t\t'pages' => lb_get_all_pages_from_pages(),\n\t\t)\n\t);\n}", "public function generate(): bool\n {\n foreach (glob(__DIR__.'/Resources/skeleton/*/*.tpl.php') as $file)\n {\n if (!empty($file))\n {\n $this->setFile($file);\n }\n }\n\n foreach ($this->files as $file)\n {\n if (!file_exists($file['file']))\n {\n // TODO: Throw error\n return false;\n }\n\n if (!file_put_contents($this->getAppDirectory().'/src/'.$file['type'].'/'.$file['newName'] ,file_get_contents($file['file'])))\n {\n return false;\n }\n }\n\n return true;\n }", "public function index()\n\t{\n\t\t$this->load->view('generator');\n\t}", "function display_template_skeleton()\n{\n\tif ( !isset($_GET['_escaped_fragment_']) )\n\t{\n\t\techo '<div id=\"nav\">';\n\t\techo '<ul id=\"pages\" class=\"clearfix\"></ul>';\n\t\techo '</div>';\n\t\techo '<div id=\"wrap\">';\n\t\techo '<div id=\"title\"></div>';\n\t\techo '<div id=\"content_wrap\" class=\"clearfix\">';\n\t\techo '<div id=\"content\">';\n\t\techo '<div id=\"posts\"></div>';\n\t\techo '<div id=\"pagination\" class=\"clearfix\"></div>';\n\t\techo '<div id=\"comments\"></div>';\n\t\techo '<div id=\"commentform_wrap\"></div>';\n\t\techo '</div>';\n\t\techo '<div id=\"sidebar\">';\n\t\tif ( get_option('bb_opts_twitter_name') != '' )\n\t\t{\n\t\t\techo '<ul id=\"twitter_widget\"></ul>';\n\t\t}\n\t\techo '<ul id=\"categories\"></ul>';\n\t\techo '<ul id=\"archives\"></ul>';\n\t\techo '<ul id=\"bookmarks\"></ul>';\n\t\techo '</div>';\n\t\techo '</div>';\n\t\techo '</div>';\n\t\techo '<div id=\"footer_outer\"><div id=\"footer\" class=\"clearfix\"></div></div>';\n\t}\n}", "function createBasepathXML() {\n\t\n $file_modified_time = date('Y-m-d',mktime());\n\t\n\t$xml = \"<url>\";\n $xml .= \" <loc>\".SITE_PATH.\"</loc>\";\n $xml .= \" <lastmod>$file_modified_time</lastmod>\";\n $xml .= \" <changefreq>monthly</changefreq>\";\n $xml .= \" <priority>1.0</priority>\";\n\t$xml .= \"</url>\";\n\t\n\treturn $xml;\n\t\n }", "public function generate()\n {\n \n if (TL_MODE == 'BE') {\n $template = new \\BackendTemplate('be_wildcard');\n \n $template->wildcard = 'pdfbo';\n //$template->title = $this->headline;\n $template->title = \"\";\n $template->id = $this->id;\n $template->link = $this->name;\n $template->href = 'contao?do=themes&amp;table=tl_module&amp;act=edit&amp;id='.$this->id;\n \n return $template->parse();\n }\n \n return parent::generate();\n }", "public static function Index(){\n Output::SetNamespace(\"helloworld\");\n Output::UseSmarty();\n Output::SetTemplate(Storage::Join(\"app.helloworld.shell.tpl\", \"index.tpl\"));\n Output::AppendCSS(Storage::Join(\"app.helloworld.shell.css\", \"index.css\"));\n Output::Send();\n }", "private function auto_create(){\n\n if ( $this->firebug ) \\FB::info(get_called_class().\": auto creating file\");\n\n $root = $this->use_codeza_root ? (string)new Code_Alchemy_Root_Path() : '';\n\n $filename = $root . $this->template_file;\n\n if ( file_exists($filename) && ! file_exists($this->file_path)) {\n\n $copier = new Smart_File_Copier($filename,$this->file_path,$this->string_replacements,false);\n\n $copier->copy();\n\n }\n\n\n\n }", "function main($args){\n\t\t\t//var_dump($args);\n\n\t\t\tif(count($args)>1){\n\t\t\t\t//there is at least one cmd line argument.\n\t\t\t\t//echo(\"Args Exist\\n\");\n\n\t\t\t\t$i=0;\n\t\t\t\tforeach($args as $arg){\n\t\t\t\t\tif($arg===\"-s\"){\n\n\t\t\t\t\t\t// The SITE command.\n\t\t\t\t\t\t// If no directory is given as an argument after the -s switch, \n\t\t\t\t\t\t// the present working diretory will be used.\n\n\t\t\t\t\t\techo(\"Deprecated. Please clone from git (https://github.com/lofilabo/balsa.git)\\n\");\n\t\t\t\t\t\tdie;\n\n\t\t\t\t\t\t$cwd = getcwd();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(sizeof($args) >($i+1)){\n\t\t\t\t\t\t\t$newsitelocation = $args[$i+1];\t\n\t\t\t\t\t\t\techo(\"new site location is supplied path \" . $newsitelocation . \"\\n\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo(\"new site location is assumed to be PWD.\\n\");\n\t\t\t\t\t\t\t$newsitelocation = $cwd;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t$src = \"C:\\\\ProjectSource\\\\j4\";\n\t\t\t\t\t\t//$des = opendir (getcwd());\t\n\t\t\t\t\t\t$des = \"/\" . $newsitelocation;\n\t\t\t\t\t\t//echo(\"site location: \" . $newsitelocation . \"\\n\");\n\t\t\t\t\t\t//echo (\"cwd: \" . $cwd . \"\\n\");\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t$this->recurse_copy($src, $des);\t\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif($arg===\"-p\"){\n\t\t\t\t\t\t\techo(\"Making new logic, control and template classes.\\n\");\n\t\t\t\t\t\t\techo(\"Page name: \" . $args[$i+1] . \"\\n\");\n\t\t\t\t\t\t\t//the page command expects to be executed from the \n\t\t\t\t\t\t\t// ./all directory of the NEW SITE. \n\t\t\t\t\t\t\t$cwd = realpath(dirname(__FILE__) . '/..');\n\t\t\t\t\t\t\t$des = opendir ($cwd);\t\n\t\t\t\t\t\t\t$pClassname = $args[$i+1];\n\t\t\t\t\t\t\t$mnp = new MakeNewPageClass();\n\t\t\t\t\t\t\t$mnp->doMakeClassMgr($pClassname);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\n\n\t\t\t}else{\n\t\t\t\t//no arguments. Go to interactive.\n\t\t\t\t$this->mainmenu();\n\t\t\t}\n\n\t\t}", "function tpl_page($help = '', $title = '')\n{\n tpl_language();\n tpl_header($help, $title);\n tpl_footer();\n}", "public function plantilla(){\n\n include \"views/template.php\";#include(): Se utiliza para invocar el archivo que contiene el código html (es decir, incluye el template que está en la carpeta views)\n }", "public function index()\n {\n $this->load->model('extension/module/siteMapGenerate');\n $this->includedFiles = [];\n $this->deleteSiteMap();\n $this->generateSiteMapCategories();\n $this->generateSiteMapProducts();\n $this->generateSiteMapMain();\n }", "function oneviewer_page_template( $template ) {\n if ( is_page('viewer') ) {\n $newtemplate = dirname( __FILE__ ) . '/templates/page-one-viewer.php';\n return $newtemplate ;\n }\n return $template;\n\n}", "function page_generatePage($page_id=0,$offset=0,$extravars=array()) {\n\tglobal $Auth,$input_language,$previewMode;\n\n\t## prepare the multiclient support\n\t$client_id = $Auth->auth[\"client_id\"];\t\n\n\t## get the page info- and the homepage if we don't have a page\n\t$pageInfo = frontend_getPageInfo($page_id,$client_id);\n\t$page_id \t\t= intval($pageInfo[\"page_id\"]);\n\t$menu_id \t\t= isset($pageInfo[\"id\"]) ? $pageInfo[\"id\"] : 0;\t\t\n\t$template_id\t= $pageInfo[\"template_id\"];\n\n\t## try to fetch the cached scaffold page\n\t$cached_scaffold = pagecache_getCacheFile($page_id);\n\n\t## check if we have a scaffold\n\tif($cached_scaffold === false) {\n\t\t## we need to create a new scaffold file\n\t\t$cached_scaffold = page_generateScaffold($pageInfo,$offset,$extravars);\n\t}\n\t\t\t\n\t$dbConnection = new DB_Sql();\n\t\t\t\t\n\t## grab the information for this page\n\t$select_query = \"SELECT basename FROM \".PAGE_TEMPLATE.\" WHERE template_id='$template_id' AND client_id='$client_id'\";\n\t$result_pointer = $dbConnection->query($select_query);\n\t\n\tif($dbConnection->next_record()) {\n\t\t$filename = $dbConnection->Record[\"basename\"];\n\t\t$xmlFile = $filename.\".xml\";\n\t\t$filename = $filename.\".tpl\";\n\t} else {\n\t\t## maybe we can come with some good default behavior\n\t\texit();\n\t}\n\n\t## for the body we need to examine the xml file- to find out \n\t## what type of form elements we need to position\n\t$wt = new xmlparser(HTML_DIR.$xmlFile);\n\t$wt->parse();\n\t\n\t## okay we scanned in the xml file- so we now loop through all the elements\n\t$elements = $wt->getCacheElements();\t\n\t$objects = $wt->getCacheObjects();\t\n\t\n\t## we should get the page content\n\t$page_record = page_getPage($page_id,$objects);\n\t\n\t$counter = 0;\n\t$num_elements = count($elements);\n\t\n\twhile($counter < $num_elements) {\n\t\t## okay first we try to find out what type we have\n\t\t## we wrap this up in a switch statemnt- this way we can extend it more easily\n\t\t$element_type = $elements[$counter]['TYPE'];\n\t\t$element_name = $elements[$counter]['NAME'];\t\n\t\tswitch($element_type) {\n\t\t\tcase 'TEXT':\n\t\t\tcase 'COPYTEXT':\n\t\t\tcase 'DATE': \n\t\t\tcase 'LINK' :\n\t\t\tcase 'FILE':\n\t\t\tcase 'IMAGE': \n\t\t\tcase 'LINKLIST': \n\t\t\tcase 'BOX':\n\t\t\t\t## get the data and set the var in the template\n\t\t\t\t$target = strtolower($element_type); \n\t\t\t\tif(isset($page_record[$element_name])) {\n\t\t\t\t\teval(\"\\$element = output_\".$target.\"(\\$page_record[\\$element_name],\\$elements[\\$counter],$menu_id,$page_id);\");\t\n\n\t\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t\t$varkeys = array();\n\t\t\t\t\t\t$varvals = array();\n\t\t\t\t\t\n\t\t\t\t\t\tforeach ($element as $varname => $value) {\t\t\n\t\t\t\t\t\t\t$varkeys[$varname] = \"{\".$varname.\"}\";\n\t\t\t\t\t\t\t$varvals[$varname] = $value; \n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$varkeys[$element_name] = \"{\".$element_name.\"}\";\n\t\t\t\t\t\t$varvals[$element_name] = $element; \t\t\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\n\t\t\tcase 'INCLUDE' : {\n\t\t\t\t## basically we need to call the function output_\"element_type\"\n\t\t\t\t## and the output the results to the template\n\t\t\t\t$target = strtolower($element_type); \n\t\t\t\t\n\t\t\t\teval(\"\\$element = output_\".$target.\"('',\\$elements[\\$counter],$menu_id,$page_id);\");\n\t\t\t\t\n\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t$varkeys = array();\n\t\t\t\t\t$varvals = array();\n\t\t\t\t\n\t\t\t\t\tforeach ($element as $varname => $value) {\t\t\n\t\t\t\t\t\t$varkeys[$varname] = \"{\".$varname.\"}\";\n\t\t\t\t\t\t$varvals[$varname] = $value; \n\t\t\t\t\t}\t\t\t\t\n\n\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t} else {\n\t\t\t\t\t$varkeys[$element_name] = \"{\".$element_name.\"}\";\n\t\t\t\t\t$varvals[$element_name] = $element; \t\t\t\t\n\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\t\t\t\n\t\t\tdefault: {\n\t\t\t\t## we need to check if we have a module for this datatype\n\t\t\t\t$target = strtolower($element_type);\n\t\t\t\t\n\t\t\t\t## first we try to include the apropriate file \n\t\t\t\t@include_once(\"datatypes/extra_\".$target.\"/\".$target.\".php\");\n\t\t\t\t## now we check if the function exists\n\t\t\t\t\n\t\t\t\tif(function_exists($target.\"_output\")) {\n\t\t\t\t\t## no we call the function\n\t\t\t\t\t## check if the page_record entry is defined\n\t\t\t\t\t## if not we need to pass the whole record\n\t\t\t\t\tif(isset($page_record[$element_name])) {\n\t\t\t\t\t\teval(\"\\$element = \".$target.\"_output(\\$page_record[\\$element_name],\\$elements[\\$counter],$menu_id,\\$page_id);\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t##var_dump(eval();\n\t\t\t\t\t\teval(\"\\$element = \".$target.\"_output(\\$page_record,\\$elements[\\$counter],\\$layout_template,\\$menu_id,\\$page_id);\");\n\t\t\t\t\t}\t\n\t\t\t\n\t\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t\t$varkeys = array();\n\t\t\t\t\t\t$varvals = array();\n\t\t\t\t\t\n\t\t\t\t\t\tforeach ($element as $varname => $value) {\t\t\n\t\t\t\t\t\t\t$varkeys[$varname] = \"{\".$varname.\"}\";\n\t\t\t\t\t\t\t$varvals[$varname] = $value; \n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$varkeys[$element_name] = \"{\".$element_name.\"}\";\n\t\t\t\t\t\t$varvals[$element_name] = $element; \t\n\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$counter++;\n\t}\n\n\t## finally strip all empty tags\n\t$cached_scaffold = preg_replace('/{[^ \\t\\r\\n}]+}/', \"\", $cached_scaffold); \n\n\t## this is it- so we will flush the template here\t\t\n\treturn $cached_scaffold;\n}", "function pantomime_sitename(){\n\tif (is_home()){\n\t\t$heading_tag = 'h1';\n\t\t$copy = get_bloginfo( \"name\" );\t\n\t} else {\n\t\t$heading_tag = 'h2';\n\t\t$copy = '<a href=\"'. get_bloginfo( \"url\" ) .'\" class=\"emboss-dark\">'. get_bloginfo( \"name\" ) .'</a>';\n\t}\n\n\techo '\n\t\t<div id=\"sitename-wrap\" class=\"emboss-dark\">\n\t\t\t<'. $heading_tag .' id=\"sitename\">'. $copy .'</'. $heading_tag .'>\n\t\t\t<p>'. get_bloginfo( \"description\" ) .'</p>\n\t\t</div>\n\t';\n}", "function sunrise_theme_create_page()\n {\n require_once(get_template_directory().'/inc/templates/sunrise-admin.php');\n }", "function export(& $site) {\n\t\t$this->_document =& new DOMIT_Document();\n\t\t$this->_document->xmlDeclaration = '<?xml version=\"1.0\" encoding=\"UTF-8\" '.'?'.'>';\n\t\t$doctype = \"<!DOCTYPE site [\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT site (title,history,(activation?),(permissions?),header,footer,(theme?),(media?),(section|navlink)*)>\";\n\t\t$doctype .= \"\\n\\t<!ATTLIST site id CDATA #REQUIRED owner CDATA #REQUIRED type (system|class|personal|other) #REQUIRED>\";\t\t\n \t\t$doctype .= \"\\n\\t<!ELEMENT section (title,history,(activation?),(permissions?),(page|navlink|heading|divider)*)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT page (title,history,(activation?),(permissions?),(story|link|image|file)*)>\";\n\t\t$doctype .= \"\\n\\t<!ATTLIST page story_order (custom|addeddesc|addedasc|editeddesc|editedasc|author|editor|category|titleasc|titledesc) #REQUIRED horizontal_rule (TRUE|FALSE) #REQUIRED show_creator (TRUE|FALSE) #REQUIRED show_date (TRUE|FALSE) #REQUIRED archiving CDATA #REQUIRED>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT story (title,history,(activation?),(permissions?),shorttext,(longtext?),(category?),(discussion?))>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT navlink (title,history,(activation?),(permissions?),url)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT heading (title,history,(activation?),(permissions?))>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT divider (history,(activation?),(permissions?))>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT link (title,history,(activation?),(permissions?),description,url,(category?),(discussion?))>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT image (title,history,(activation?),(permissions?),description,(filename|url),(category?),(discussion?))>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT file (title,history,(activation?),(permissions?),description,(filename|url),(category?),(discussion?))>\";\n\t\t\n\t\t$doctype .= \"\\n\\t<!ELEMENT discussion (discussion_node*)>\";\n\t\t$doctype .= \"\\n\\t<!ATTLIST discussion email_owner (TRUE|FALSE) #REQUIRED show_authors (TRUE|FALSE) #REQUIRED show_others_posts (TRUE|FALSE) #REQUIRED>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT discussion_node (creator,created_time,title,text,rating?,filename?,(discussion_node*))>\";\n\t\t\n\t\t$doctype .= \"\\n\\t<!ELEMENT media (media_file*)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT media_file (creator,last_editor,last_edited_time,filename,type)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT type (#PCDATA)>\";\n\t\t\n\t\t$doctype .= \"\\n\\t<!ELEMENT theme (name,color_scheme?,background_color?,border_style?,border_color?,text_color?,link_color?,navigation_arrangement?,navigation_width?,section_nav_size?,page_nav_size?)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT name (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT color_scheme (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT background_color (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT border_style (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT border_color (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT text_color (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT link_color (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT navigation_arrangement (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT navigation_width (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT section_nav_size (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT page_nav_size (#PCDATA)>\";\n\t\t\n\t\t$doctype .= \"\\n\\t<!ELEMENT history (creator,created_time,last_editor,last_edited_time)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT created_time (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT last_edited_time (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT creator (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT last_editor (#PCDATA)>\";\n\t\t\n\t\t$doctype .= \"\\n\\t<!ELEMENT activation ((manual_activiation)?,(activate_date)?,(deactivate_date)?)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT manual_activiation (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT activate_date (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT deactivate_date (#PCDATA)>\";\n\t\t\n\t\t$doctype .= \"\\n\\t<!ELEMENT permissions ((locked?),(view_permission?),(add_permission?),(edit_permission?),(delete_permission?),(discuss_permission?))>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT locked EMPTY>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT view_permission (agent*)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT add_permission (agent*)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT edit_permission (agent*)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT delete_permission (agent*)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT discuss_permission (agent*)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT agent (#PCDATA)>\";\n\t\t\n\t\t$doctype .= \"\\n\\t<!ELEMENT category (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT title (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT text (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT shorttext (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ATTLIST shorttext text_type (text|html) #REQUIRED>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT longtext (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT filename (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT rating (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT url (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT description (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT header (#PCDATA)>\";\n\t\t$doctype .= \"\\n\\t<!ELEMENT footer (#PCDATA)>\";\n\t\t\n\t\t$doctype .= \"\\n]>\";\n\t\t\n\t\t$this->_document->doctype = $doctype;\n\t\t$this->addSite($site);\n\t\treturn $this->_document->toNormalizedString();\n//\t\treturn $this->_document->toString();\n\t}", "function br_rc_single_content_template() {\n\n\t$single_content_template = plugin_dir_path( dirname( __FILE__ ) );\n\t$single_content_template .= 'templates/br-rc-content-single.php';\n\n\t// Filter the default path\n\t$single_content_template = apply_filters( 'br_rc_single_content_template_filter', \n\t\t\t\t\t\t\t\t\t\t\t $single_content_template );\n\n\t// Return the path\n\treturn $single_content_template;\n}", "function index() {\n\t\t$templateMgr =& TemplateManager::getManager();\n\t\t$this->setupTemplate();\n\t\t$templateMgr->display('management/tools/index.tpl');\n\t}", "private function generateSitemap()\n {\n\n if ($site_map = $this->generateXml()) {\n\n if ($this->saveFile($site_map)) {\n\n $this->submitFile();\n\n }\n\n }\n\n }", "public function generateContent()\n {\n parent::generateContent();\n $pathArray = $this->currentPageStrategy->getCurrentPagePath();\n $titleString = '';\n foreach ($pathArray as $page) {\n /** @var $page Page */\n\n $titleString .= ' - ' . (($t = $page->getTitle()) == '_404' ? 'Siden blev ikke fundet' : $t);\n }\n\n return $titleString;\n }", "function index()\n {\n //call some deafaults not to spoil template\n $data=$this->default_data();\n $this->template($data);\n\n }", "public function render(){\n require_once($_SERVER['DOCUMENT_ROOT'].\"//views/\".self::$page_name.\"/\".self::$page_name.\".php\");\n }", "private function makeHTML($path) {\n $output = shell_exec(\"sudo /var/www/sphinx/./myMake.sh \" . $path . \" html\");\n //$output = shell_exec(\"sudo sphinx-build -b html $path/source/ $path/build/html\");\n //dd($output);\n $this->addNewNews(0, 0, 3, \"Erstellt HTML\");\n }", "public static function head()\n {\n require_once(getcwd() . \"/views/Template/head.php\");\n }", "public function generate()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$objTemplate = new \\BackendTemplate('be_wildcard');\n\n\t\t\t$objTemplate->wildcard = '### BOOK NAVIGATION ###';\n\t\t\t$objTemplate->title = $this->headline;\n\t\t\t$objTemplate->id = $this->id;\n\t\t\t$objTemplate->link = $this->name;\n\t\t\t$objTemplate->href = 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id=' . $this->id;\n\n\t\t\treturn $objTemplate->parse();\n\t\t}\n\n\t\tglobal $objPage;\n\n\t\tif (!$this->rootPage || !in_array($this->rootPage, $objPage->trail))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\treturn parent::generate();\n\t}", "public static function generate_index_file($folder) {\n\n $filename = public_path().\"/\".$folder.\"/index.php\"; \n\n if(!file_exists($filename)) {\n\n $index_file = fopen($filename,'w');\n\n $sitename = Setting::get(\"site_name\");\n\n fwrite($index_file, '<?php echo \"You Are trying to access wrong path!!!!--|E\"; ?>'); \n\n fclose($index_file);\n }\n \n }", "function page($page_name=null, $content_type=\"text/html\")\n{\n\t$page_path = PAGES . \"/\" . $page_name . \".php\";\n\tif(!file_exists($page_path)) throw new FrameworkException(\"$page_path: page doesn't exist\");\n\n\theader(\"content-type: \".$content_type);\n\trequire_once $page_path;\n}", "function index_template()\n {\n return 'photocrati-nextgen_admin#nextgen_admin_page';\n }", "function TEMPLATE_ENGINE_HAML_TO_PHP_info(){\nhttp://titanpad.com/moZN7Lm1Nr\n return array(\n \"template_engine_name\" => 'HAML-TO-PHP',\n \"template_engine_version\" => 'WEB '.date('Y-m-d'),\n \"template_engine_settings\" => \"\",\n \"template_engine_url\" => \"haml-to-php.com\"\n );\n}", "function index(){\n\n global $wear;\n $template = $this->loadView($wear->front . \"/index\");\n $template->set(\"page\" , SITE_NAME . \" | Home\");\n $template->render(); \n\n }", "public function theme_page_output() {\n require get_theme_file_path( '/templates/theme-page.php' );\n\t}", "public static function indexTpl()\n {\n extract(FeedPage::$var);\n?>\n<?php include(\"tpl/index.tpl.php\"); ?>\n<?php\n }", "function head() {\n\n\techo '<h1>ATOM.CMS</h1>';\n\t\n}", "function generer_webmaster_tools(){\n\t/* CONFIG */\n\t$config = unserialize($GLOBALS['meta']['seo']);\n\n\tif ($config['webmaster_tools']['id'])\n\t\treturn '<meta name=\"google-site-verification\" content=\"' . $config['webmaster_tools']['id'] . '\" />\n\t\t';\n}", "function generate_construct_site_title() {\n\t\t$generate_settings = wp_parse_args(\n\t\t\tget_option( 'generate_settings', array() ),\n\t\t\tgenerate_get_defaults()\n\t\t);\n\n\t\t// Get the title and tagline.\n\t\t$title = get_bloginfo( 'title' );\n\t\t$tagline = get_bloginfo( 'description' );\n\n\t\t// If the disable title checkbox is checked, or the title field is empty, return true.\n\t\t$disable_title = ( '1' == $generate_settings['hide_title'] || '' == $title ) ? true : false;\n\n\t\t// If the disable tagline checkbox is checked, or the tagline field is empty, return true.\n\t\t$disable_tagline = ( '1' == $generate_settings['hide_tagline'] || '' == $tagline ) ? true : false;\n\n\t\t// Build our site title.\n\t\t$site_title = apply_filters( 'generate_site_title_output', sprintf(\n\t\t\t'<%1$s class=\"main-title\" itemprop=\"headline\">\n\t\t\t\t<a href=\"%2$s\" rel=\"home\">\n\t\t\t\t\t%3$s\n\t\t\t\t</a>\n\t\t\t</%1$s>',\n\t\t\t( is_front_page() && is_home() ) ? 'h1' : 'p',\n\t\t\tesc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ),\n\t\t\tget_bloginfo( 'name' )\n\t\t) );\n\n\t\t// Build our tagline.\n\t\t$site_tagline = apply_filters( 'generate_site_description_output', sprintf(\n\t\t\t'<p class=\"site-description\" itemprop=\"description\">\n\t\t\t\t%1$s\n\t\t\t</p>',\n\t\t\thtml_entity_decode( get_bloginfo( 'description', 'display' ) )\n\t\t) );\n\n\t\t// Site title and tagline.\n\t\tif ( false == $disable_title || false == $disable_tagline ) {\n\t\t\tif ( generate_get_option( 'inline_logo_site_branding' ) && generate_has_logo_site_branding() ) {\n\t\t\t\techo '<div class=\"site-branding-container\">';\n\t\t\t\tgenerate_construct_logo();\n\t\t\t}\n\n\t\t\techo apply_filters( 'generate_site_branding_output', sprintf( // WPCS: XSS ok, sanitization ok.\n\t\t\t\t'<div class=\"site-branding\">\n\t\t\t\t\t%1$s\n\t\t\t\t\t%2$s\n\t\t\t\t</div>',\n\t\t\t\t( ! $disable_title ) ? $site_title : '',\n\t\t\t\t( ! $disable_tagline ) ? $site_tagline : ''\n\t\t\t) );\n\n\t\t\tif ( generate_get_option( 'inline_logo_site_branding' ) && generate_has_logo_site_branding() ) {\n\t\t\t\techo '</div><!-- .site-branding-container -->';\n\t\t\t}\n\t\t}\n\t}", "function portal_essentials( $id = null, $style = null, $docs = null ) {\n\n ob_start();\n\n\tinclude( portal_template_hierarchy( '/projects/overview/index.php' ) );\n\n return ob_get_clean();\n\n}", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->registerResource('css', $this->cssResource);\n $output .= $this->registerResource('js', $this->jsResource);\n $output .= $this->fixHTML5();\n $output .= '</head><body>';\n echo $output;\n }", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->fixHTML5();\n $output .= $this->registerCustomResources();\n $output .= '</head><body>';\n echo $output;\n }", "function about_action()\n\n{\n $pageTitle = \"about page\";\n require_once __DIR__ . '/../templates/about.php';\n}", "public function makeTemplate($input) {\n\t\t$info = array(\n\t\t\t'{generator_name}' => $input['generator_name'],\n\t\t\t'{module_name_l}' => $this->clean($input['generator_name']),\n\t\t\t'{description}' => $input['description'],\n\t\t\t'{author}' => $input['author'],\n\t\t\t'{website}' => $input['website'],\n\t\t\t'{package}' => $input['package'],\n\t\t\t'{subpackage}' => $input['subpackage'],\n\t\t\t'{copyright}' => $input['copyright'],\n\t\t\t'{frontend}' => $input['frontend'],\n\t\t\t'{backend}' => $input['backend'],\n\t\t\t);\n\t\t$info['{validation_fields}'] = $this->makeValidation($input['fields']);\n\t\t$info['{details_fields}'] = $this->makeDetails($input['fields']);\n\t\t$info['{model_fields}'] = $this->makeModel($input['fields']);\n\t\t$info['{adminform_fields}'] = $this->makeAdminForms($input['fields']);\n\t\t// array of files to replace\n\t\t$filearray = array(\n\t\t\t'config/routes.php',\n\t\t\t'controllers/admin.php',\n\t\t\t'details.php',\n\t\t\t'events.php',\n\t\t\t'language/english/sample_lang.php',\n\t\t\t'models/sample_m.php',\n\t\t\t'plugin.php',\n\t\t\t'views/admin/form.php',\n\t\t\t'views/admin/index.php'\n\t\t\t);\n\t\t// conditional front end controller stuff\n\t\tif ($input['frontend'] == 'true') {\n\t\t\t$filearray[] = 'controllers/sample.php';\n\t\t\t$filearray[] = 'views/index.php';\n\t\t}\n\t\t$url = __DIR__ . '/../public/generated/';\n\t\t$this->cpdir(__DIR__ . '/../generator/module_full', __DIR__ . '/../public/generated/'.$info['{module_name_l}']);\n\t\t// where is the module generated\n\t\t$moduleurl = $url.$info['{module_name_l}'];\n\t\tfor ($i = 0; $i < count($filearray); $i++) {\n\t\t\t$filedestination = $moduleurl.'/'.$filearray[$i];\n\t\t\t// load the template = module_full/targetfile\n\t\t\t$current = file_get_contents($filedestination);\n\t\t\t// replace the template tags\n\t\t\t$current = $this->str_replace_assoc($info, $current);\n\t\t\t// put the contents in the new file\n\t\t\tfile_put_contents($filedestination, $current);\n\t\t}\n\t\t// rename the specific files that are name sensitive\n\t\trename($moduleurl.'/language/english/sample_lang.php', $moduleurl.'/language/english/'.$info['{module_name_l}'].'_lang.php');\n\t\trename($moduleurl.'/models/sample_m.php', $moduleurl.'/models/'.$info['{module_name_l}'].'_m.php');\n\t\tif ($input['frontend'] == 'true') {\n\t\t\t// rename the extra front end stuff if applicable\n\t\t\trename($moduleurl.'/controllers/sample.php', $moduleurl.'/controllers/'.$info['{module_name_l}'].'.php');\n\t\t\trename($moduleurl.'/css/sample.css', $moduleurl.'/css/'.$info['{module_name_l}'].'.css');\n\t\t}\n\t\t// comment out to disable zip compression\n\t\t$this->Zip($url.$info['{module_name_l}'], $url.$info['{module_name_l}'].'.zip');\n\t\treturn $info['{module_name_l}'].'.zip';\n\t}", "function install_site() {\n \n}", "function admin_generate(){\n\t\t$fp = fopen('files/sitemap.xml', 'w+');\n\n\t$start_string = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/</loc>\n \t\t<changefreq>daily</changefreq>\n \t\t<priority>1</priority>\n\t</url>';\n\n\t\tfwrite($fp, $start_string);\n\n\t\t// projdu vsechny produkty\n\t\tApp::import('Model', 'Product');\n\t\t$this->Sitemap->Product = new Product;\n\t\t\n\t\t$this->Sitemap->Product->recursive = -1;\n\t\t$products = $this->Sitemap->Product->find('all', array('fields' => array('Product.url', 'Product.modified')));\n\n\t\tforeach ( $products as $product ){\n\t\t\t// pripnout k sitemape\n\t\t\t$mod = explode(' ', $product['Product']['modified']);\n\t\t\t$mod = $mod[0];\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . $product['Product']['url'] . '</loc>\n \t\t<lastmod>' . $mod . '</lastmod>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.9</priority>\n\t</url>'; \n\n\t\t\tfwrite($fp, $string);\n\t\t}\n\t\t\n\t\t// projdu vsechny kategorie\n\t\tApp::import('Model', 'Category');\n\t\t$this->Sitemap->Category = new Category;\n\t\t\n\t\t$this->Sitemap->Category->recursive = -1;\n\t\t$categories = $this->Sitemap->Category->find('all', array('fields' => array('Category.id', 'Category.url')));\n\n\t\t$skip = array(0 => '5', '25', '26', '53');\n\t\tforeach ( $categories as $category ){\n\t\t\tif ( in_array($category['Category']['id'], $skip) ){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$mod = date('Y-m-d');\n\n\t\t\t// pripnout k sitemape\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . $category['Category']['url'] . '</loc>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.8</priority>\n\t</url>'; \n\n\t\t\tfwrite($fp, $string);\n\t\t\t\n\t\t}\n\t\t\n\t\t// projdu vsechny vyrobce\n\t\tApp::import('Model', 'Manufacturer');\n\t\t$this->Sitemap->Manufacturer = new Manufacturer;\n\t\t\n\t\t$this->Sitemap->Manufacturer->recursive = -1;\n\t\t$manufacturers = $this->Sitemap->Manufacturer->find('all', array('fields' => array('Manufacturer.id', 'Manufacturer.name')));\n\t\t\n\t\tforeach ( $manufacturers as $manufacturer ){\n\t\t\t// pripnout k sitemape\n\t\t\t// vytvorim si url z name a id\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . strip_diacritic($manufacturer['Manufacturer']['name']) . '-v' . $manufacturer['Manufacturer']['id'] . '</loc>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.8</priority>\n\t</url>';\n\t\t\tfwrite($fp, $string);\n\t\t}\n\t\t\n\t\t// projdu vsechny obsahove stranky\n\t\tApp::import('Model', 'Content');\n\t\t$this->Sitemap->Content = new Content;\n\t\t\n\t\t$this->Sitemap->Content->recursive = -1;\n\t\t$contents = $this->Sitemap->Content->find('all', array('fields' => array('Content.path')));\n\t\t\n\t\tforeach ( $contents as $content ){\n\t\t\t// pripnout k sitemape\n\t\t\tif ( $content['Content']['path'] == 'index' ){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . $content['Content']['path'] . '</loc>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.7</priority>\n\t</url>';\n\t\t\tfwrite($fp, $string);\n\t\t}\n\t\t\n\t\t$end_string = '\n</urlset>';\n\t\tfwrite($fp, $end_string);\n\t\tfclose($fp);\n\t\t// uzavrit soubor\n\t\tdie('here');\n\t}", "abstract protected function view_generatePageContent();", "function defaultTemplate(){\n $this->addLocations(); // add addon files to pathfinder\n return array($this->template_file);\n }", "function sitepath()\n {\n return \"/mover/\";\n }", "private function loadMasterTemplate() {\n\t\t//SOME_THEMES should be defined in SOME_PATH/includes/defines.php\n\t\t$path_and_file = SOME_THEMES.DS.$this->template.DS.$this->file.'.php';\n\t\tif (!file_exists($path_and_file)) {\n\t\t\tthrow new SomeFileNotFoundException(\"Master template file {$this->file} for {$this->template} not found\");\n\t\t}\n\t\t\n\t\tob_start();\n\t\t//$content = file_get_contents(SOME_THEMES.DS.'default'.DS.'index.php');\n\t\t$templatefile = $path_and_file;\n\t\trequire_once($templatefile);\n\t\t$content = ob_get_clean();\n\t\treturn $content;\n\t}", "public function handleStaticPage($file) {\n\t\t# Build page HTML\n\t\t$html = $this->getInLayout($this->getTemplateForPage($file));\n\n\t\t# Write cache\t\t\n\t\t$this->writeFile(SNUG_HTDOCS . $file, $html);\n\t\t\n\t\t# Return compiled HTML\n\t\treturn $html;\n\t}", "public function index()\r\n\t{\r\n\t\t$this->addHook($this->i18n->languageDetector()); #jaki jest domyslny jezyk usera\r\n\t\t\r\n\t\t$this->main->metatags_helper; #do pliku main.php zostaje wczytany plik metatags_helper itd\r\n\t\t$this->main->head_helper;\r\n\t\t$this->main->loader_helper;\r\n\t\t$this->main->module_helper;\r\n\t\t$this->main->model_helper;\r\n\t\t$this->main->directory_helper;\r\n\t\t$this->main->translate_helper;\r\n\t}", "public function __viewTemplate()\n {\n $this->_context[2] = 'single';\n $this->addStylesheetToHead(self::$assets_base_url . 'editor.css');\n $this->addStylesheetToHead(self::$assets_base_url . 'highlighters/highlight-xsl.css');\n $this->addScriptToHead(self::$assets_base_url . 'editor.js');\n $this->addScriptToHead(self::$assets_base_url . 'highlighters/highlight-xsl.js');\n $name = $this->_context[1];\n $filename = $name . '.xsl';\n $title = $filename;\n $this->setTitle(__(('%1$s &ndash; %2$s &ndash; %3$s'), array($title, __('Pages'), __('Symphony'))));\n //$this->setPageType('table');\n $this->Body->setAttribute('spellcheck', 'false');\n $this->appendSubheading($title);\n $breadcrumbs = array(\n Widget::Anchor(__('Pages'), SYMPHONY_URL . '/blueprints/pages/'),\n new XMLElement('span', __(Helpers::capitalizeWords($name)))\n );\n $this->insertBreadcrumbs($breadcrumbs);\n \n $this->insertAction(\n Widget::Anchor(\n __('Edit Page'), \n SYMPHONY_URL . '/blueprints/pages/edit/' . PageManager::fetchIDFromHandle($name) . '/',\n __('Edit Page Configuration'),\n 'button'\n )\n );\n\n $this->Form->setAttribute('class', 'columns');\n $this->Form->setAttribute('action', SYMPHONY_URL . '/blueprints/pages/' . $name . '/');\n\n $fieldset = new XMLElement('fieldset');\n $fieldset->appendChild(Widget::Input('fields[name]', $filename, 'hidden'));\n $fieldset->appendChild($label);\n //$fieldset->appendChild((isset($this->_errors['name']) ? Widget::Error($label, $this->_errors['name']) : $label));\n\n $label = Widget::Label(__('Body'));\n $label->appendChild(\n Widget::Textarea(\n 'fields[body]',\n 30,\n 100,\n $filename ? htmlentities(file_get_contents(WORKSPACE . '/pages/' . $filename), ENT_COMPAT, 'UTF-8') : '',\n array('id' => 'text-area', 'class' => 'code hidden')\n )\n );\n //$fieldset->appendChild((isset($this->_errors['body']) ? Widget::Error($label, $this->_errors['body']) : $label));\n\n $fieldset->appendChild($label);\n $this->Form->appendChild($fieldset);\n\n $this->Form->appendChild(\n new XMLElement(\n 'div',\n new XMLElement('p', __('Saving')),\n array('id' => 'saving-popup')\n )\n );\n //$this->_context = array('edit', 'pages', 'single');\n $this->Form->appendChild(\n new XMLElement(\n 'div',\n Widget::Input(\n 'action[save]',\n __('Save Changes'),\n 'submit',\n array('class' => 'button', 'accesskey' => 's')\n ),\n array('class' => 'actions')\n )\n );\n }", "public function __construct($args = null)\n\t{\n\t\tglobal $App;\n\t\t\n\t\tif (isset($App->config->site->public_dir))\n\t\t\t$publicDir = $App->config->site->public_dir;\n\t\telse\n\t\t\t$publicDir = 'public_html';\n\t\t\n\t\t# from root; end with /; ex: BP.'/app/views/'\n\t\t$this->vars['base_path'] = (isset($args['base_path'])? $args['base_path']:BP.'/app/views/');\n\t\t\n\t\t# from root; end with /; ex: '/assets/'\n\t\t$this->vars['assets_path'] = (isset($args['assets_path'])? $args['assets_path']:'/assets/');\n\t\t\n\t\t# from root; end with /; ex: BP.'/public_html/assets/'\n\t\t$this->vars['base_assets_path'] = (isset($args['assets_path'])? $args['assets_path']:BP.'/'.$publicDir.'/assets/'); \n\t\t\n\t\t# from root; end with /; ex: BP.'/app/views/_layouts/base.phtml'\n\t\t$this->vars['layout'] = (isset($args['layout'])? $args['layout']:BP.'/app/views/_layouts/base.phtml'); \n\t\t\n\t\t# put in base_path dir; ex: 404-error.phtml\n\t\t$this->vars['404'] = (isset($args['404'])? $args['404']:'404-error.phtml'); \n\t\t\n\t\t# put in base_path dir; ex: 401-error.phtml\n\t\t$this->vars['401'] = (isset($args['401'])? $args['401']:'401-error.phtml'); \n\t\t\n\t\t# put in base_path dir; ex: 403-error.phtml\n\t\t$this->vars['403'] = (isset($args['403'])? $args['403']:'403-error.phtml'); \n\n\t\t# put in base_path dir; ex: 403-error.phtml\n\t\t$this->vars['error_page'] = (isset($args['error_page'])? $args['error_page']:'error.phtml');\n\n\t\t# turn on or off page caching\n\t\t$this->vars['cache'] = (isset($args['cache'])? $args['cache']:true);\n\n\t\t# global variables for layout template\n\t\t$this->vars['variables'] = (isset($args['variables'])? $args['variables']:[]);\n\t}", "function spit ()\n\t{\n\t\tif (RequestPHP::get_path() === '/') {\n\t\t\tob_start();\n\t\t\t\tinclude_once APP.\"views/home.html.php\";\n\t\t\treturn ob_get_clean();\n\t\t}\n\t\tif (file_exists(APP.\"views/partials/{RequestPHP::get_path()}.html.php\")) {\n\t\t\tob_start();\n\t\t\t\tinclude_once APP.\"views/{RequestPHP::get_path()}.html.php\";\n\t\t\treturn ob_get_clean();\n\t\t}\n\t\telse {\n\t\t\tinclude_once APP.\"views/404.html.php\";\n\t\t}\n\t}", "public function __construct($dir = '')\n\t{\n $this->template = Fenom::factory(PATH_TEMPLATES.DS.$dir, PATH_RUNTIME);\n $this->template->setCompileDir(PATH_RUNTIME);\n $this->template->setOptions(Fenom::AUTO_STRIP);\n $this->template->setOptions(Fenom::FORCE_COMPILE);\n \t}", "function rewrite_static_tags() {\n\tadd_rewrite_tag('%proxy%', '([^&]+)');\n add_rewrite_tag('%manual%', '([^&]+)');\n add_rewrite_tag('%manual_file%', '([^&]+)');\n add_rewrite_tag('%file_name%', '([^&]+)');\n add_rewrite_tag('%file_dir%', '([^&]+)');\n}" ]
[ "0.6062174", "0.60565645", "0.5993228", "0.5978365", "0.59348536", "0.5927432", "0.58737856", "0.58288825", "0.58262706", "0.5798565", "0.5753417", "0.5731446", "0.57046425", "0.56972384", "0.56777877", "0.56762123", "0.5660759", "0.56600976", "0.5656785", "0.56182444", "0.5602362", "0.5562729", "0.55387497", "0.5530295", "0.55245525", "0.5517094", "0.5500798", "0.5498707", "0.54810256", "0.54781765", "0.54571974", "0.5427399", "0.54149294", "0.540724", "0.5403695", "0.5395856", "0.5387014", "0.53867173", "0.5378262", "0.53726846", "0.5368902", "0.53604907", "0.5348421", "0.5327334", "0.53239894", "0.532112", "0.5312049", "0.5307976", "0.5306458", "0.52981156", "0.5296578", "0.5289103", "0.52881503", "0.5285156", "0.52780604", "0.5277229", "0.52715325", "0.52710617", "0.52637637", "0.52622145", "0.52578545", "0.52440137", "0.5234101", "0.52324", "0.522974", "0.5224889", "0.52236295", "0.5218185", "0.5214897", "0.5211757", "0.5207869", "0.52068096", "0.5205595", "0.5201741", "0.5200099", "0.5198362", "0.519427", "0.5193727", "0.5192879", "0.5191436", "0.51906186", "0.518553", "0.51797986", "0.51769394", "0.5176674", "0.5174519", "0.51726264", "0.51725817", "0.5169734", "0.5168897", "0.5168473", "0.5166976", "0.51614684", "0.51522565", "0.5150194", "0.51461375", "0.51433533", "0.5142422", "0.5141738", "0.51409805", "0.51353437" ]
0.0
-1
Returns the static model of the specified AR class.
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model() {\n return parent::model(get_called_class());\n }", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }" ]
[ "0.74850124", "0.73803526", "0.7154113", "0.71401674", "0.70629025", "0.703232", "0.69285315", "0.69285315", "0.6925706", "0.6902751", "0.6894916", "0.6894916", "0.68900806", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id); $criteria->compare('username',$this->username,true); $criteria->compare('password',$this->password,true); $criteria->compare('reg_date',$this->reg_date,true); if ($this->filter_online) { if ($this->filter_online == self::STATUS_OFFLINE) $criteria->addCondition('NOW() - last_activity > 5*60 OR last_activity IS NULL'); else $criteria->addCondition('NOW() - last_activity <= 5*60'); } return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function getModels()\n\t{\n\t\t$scope = $this->scopeName;\n\t\treturn CActiveRecord::model($this->baseModel)->$scope()->findAll();\n\t}", "protected function findModel()\n {\n $class = $this->model;\n $query = $class::query();\n\n foreach ($this->input as $key => $value) {\n $where = is_array($value) ? 'whereIn' : 'where';\n $query->$where($key, $value);\n }\n\n return $query->get();\n }", "public function modelScans()\n {\n if ($this->scanEverything) {\n return $this->getAllClasses();\n }\n\n return $this->scanModels;\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function searchableBy()\n {\n return [];\n }", "public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public static function find($model, $conditions = null, $orderby = null){\n\t\t$sql = \"SELECT * FROM \" . self::table_for($model);\n\t\tif ($conditions) $sql .= \" WHERE \" . self::make_conditions($conditions);\n\t\tif ($orderby)\t$sql .= \" ORDER BY \" . $orderby;\n\t\t\n\t\t$resultset = self::do_query($sql);\n\t\treturn self::get_results($resultset, $model);\n\t}", "function get_model_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"make_model\",\"id,name,del_status\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "public function getList()\n {\n $this->db->order_by(\"id\", 'desc');\n $this->db->where('status', 1);\n return $this->db->get($this->model);\n }", "public function findAll()\n {\n $fields = $options = [];\n //$options['debug'] = 1;\n $options['enablefieldsfe'] = 1;\n\n return $this->search($fields, $options);\n }", "public function get_multiple()\n\t{\n\t\t$options = array_merge(array(\n\t\t\t'offset' => 0,\n\t\t\t'limit' => 20,\n\t\t\t'sort_by' => 'name',\n\t\t\t'order' => 'ASC'\n\t\t), Input::all(), $this->options);\n\n\t\t// Preparing our query\n\t\t$results = $this->model->with($this->includes);\n\n\t\tif(count($this->join) > 0)\n\t\t{\n\t\t\tforeach ($this->join as $table => $settings) {\n\t\t\t\t$results = $results->join($table, $settings['join'][0], $settings['join'][1], $settings['join'][2]);\n\t\t\t\tif($settings['columns'])\n\t\t\t\t{\n\t\t\t\t\t$options['sort_by'] = (in_array($options['sort_by'], $settings['columns']) ? $table : $this->model->table()).'.'.$options['sort_by'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(stripos($options['sort_by'], '.') === 0)\n\t\t{\n\t\t\t$options['sort_by'] = $this->model->table().'.' . $options['sort_by'];\n\t\t}\n\t\t\n\t\t// Add where's to our query\n\t\tif(array_key_exists('search', $options))\n\t\t{\n\t\t\tforeach($options['search']['columns'] as $column)\n\t\t\t{\n\t\t\t\t$results = $results->or_where($column, '~*', $options['search']['string']);\n\t\t\t}\n\t\t}\n\n\t\t$total = (int) $results->count();\n\n\t\t// Add order_by, skip & take to our results query\n\t\t$results = $results->order_by($options['sort_by'], $options['order'])->skip($options['offset'])->take($options['limit'])->get();\n\n\t\t$response = array(\n\t\t\t'results' => to_array($results),\n\t\t\t'total' => $total,\n\t\t\t'pages' => ceil($total / $options['limit'])\n\t\t);\n\n\t\treturn Response::json($response);\n\t}", "public function findAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function filter($params) {\n $model = $this->model;\n $keyword = isset($params['keyword'])?$params['keyword']:'';\n $sort = isset($params['sort'])?$params['sort']:''; \n if ($sort == 'name') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('name'); \n }\n else if ($sort == 'newest') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('updated_at','desc'); \n }\n else {\n $query = $model->where('name','LIKE','%'.$keyword.'%'); \n }\n /** filter by class_id */ \n if (isset($params['byclass']) && isset($params['bysubject'])) {\n $query = $model->listClass($params['byclass'], $params['bysubject']);\n return $query; \n }\n else if (isset($params['byclass'])) { \n $query = $model->listClass($params['byclass']);\n return $query;\n }\n else if (isset($params['bysubject'])) {\n $query = $model->listClass(0,$params['bysubject']);\n return $query;\n }\n /** filter by course status */\n if (isset($params['incomming'])) {\n $query = $model->listCourse('incomming');\n return $query;\n }\n else if (isset($params['upcomming'])) {\n $query = $model->listCourse('upcomming');\n return $query;\n }\n $result = $query->paginate(10); \n return $result; \n }", "public function getAll($model, $filters = array())\n {\n $repo = $this->getRepository($model);\n\n return $repo->getAll($filters);\n }", "public function filters(Model $model): array\n {\n return [];\n }", "public function getResults()\n {\n if($this->search) {\n foreach ($this->filters as $field) {\n $field = array_filter(explode('.', $field));\n if(count($field) == 2) {\n $this->query->whereHas($field[0], function ($q) use ($field) {\n $q->where($field[1], 'ilike', \"%{$this->search}%\");\n });\n }\n if(count($field) == 1) {\n $this->query->orWhere($field[0], 'ilike', \"%{$this->search}%\");\n }\n }\n }\n\n if($this->where) {\n foreach ($this->where as $field => $value) {\n $this->query->where($field, $value);\n }\n }\n\n if ($this->whereBetween) {\n foreach ($this->whereBetween as $field => $value)\n $this->query->whereBetween($field, $value);\n }\n// dd($this->query->toSql());\n return $this->query->paginate($this->per_page);\n }", "protected function _searchInModel(Model $model, Builder $items){\n foreach($model->searchable as $param){\n if($param != 'id'){\n if(isset($this->request[$param]))\n $items = $items->where($param, $this->request[$param]);\n if(isset($this->request[$param.'_like']))\n $items = $items->where($param, 'like', '%'.$this->request[$param.'_like'].'%');\n }else{\n if(isset($this->request['id'])){\n $ids = explode(',', $this->request['id']);\n $items = $items->whereIn('id', $ids);\n }\n }\n }\n\n return $items;\n }", "public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function findAll()\n {\n return $this->driver->findAll($this->model);\n }", "public function getAllFilters();", "public function GetAll()\n {\n return $this->model->all();\n }", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function findWhere($model, $conditions, $limit = 0){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n\n $sql = 'select * from ' . $table . ' where ';\n $values = [];\n $counter = 1;\n\n foreach ($conditions as $key => $value) {\n if($counter > 1)\n $sql .= ' AND ';\n\n $sql .= $key . '=?';\n $values[] = $value; \n $counter++;\n }\n\n if($limit > 0)\n $sql .= ' LIMIT ' . $limit;\n \n $stmt = $this->pdo->prepare($sql);\n $stmt->execute($values);\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('type', $this->type);\n\n return $criteria;\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getModels()\n {\n return $this->_models;\n }", "public function getSearchFields();", "public function all()\n {\n return $this->model->get();\n }", "public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "public function getAll()\n {\n return $this->fetchAll($this->searchQuery(0));\n }", "public function listAction() {\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$select = null;\n\t\t\n\t\tif ($this->_request->getParam('data')) {\n\t\t\t\n\t\t\t$data = unserialize($this->_request->getParam('data'));\n\t\t\t$aWhere = array();\n\t\t\t$searchText = array();\n\t\t\t\n\t\t\tforeach ($data['query'] as $key => $q) {\n\t\t\t\n\t\t\t\tif (isset($data['fields'][$key]) && !empty($data['fields'][$key])) {\n\t\t\t\t\n\t\t\t\t\t$func = addslashes($data['func'][$key]);\n\t\t\t\t\t$q =\taddslashes($q);\n\t\t\t\t\t$tmpWhere = array();\n\t\t\t\t\t$searchText[] = implode(' OU ', $data['fields'][$key]) . ' ' . $this->view->func[$func] . ' \"' . stripslashes($q) . '\"';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['fields'][$key] as $field) {\n\t\t\t\t\t\n\t\t\t\t\t\t$field\t=\taddslashes($field);\n\t\t\t\t\t\tswitch ($func) {\n\t\t\t\t\t\t\tcase 'LIKE':\n\t\t\t\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t\t\tcase '=':\n\t\t\t\t\t\t\tcase '!=':\n\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\tcase '>=':\n\t\t\t\t\t\t\tcase '<':\n\t\t\t\t\t\t\tcase '<=':\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' ' . $func . ' \\'' . $q . '\\''; }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"= ''\":\n\t\t\t\t\t\t\tcase \"!= ''\":\n\t\t\t\t\t\t\tcase 'IS NULL':\n\t\t\t\t\t\t\tcase 'IS NOT NULL':\n\t\t\t\t\t\t\t\t$tmpWhere[] = $field . ' ' . stripslashes($func);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' LIKE \\'%' . $q . '%\\''; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$aWhere[] = '(' . implode(' OR ', $tmpWhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($aWhere)) { $select = $model->select()->where(implode(' AND ', $aWhere)); }\n\t\t\t$this->view->searchText = $searchText;\n\t\t}\n\t\t$this->view->model = $modelName;\n\t\t$this->view->allData = $model->fetchAll($select);\n\t\t$this->view->data = Zend_Paginator::factory($this->view->allData)\n\t\t\t\t\t\t\t->setCurrentPageNumber($this->_getParam('page', 1));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function index(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required',\n 'searched' => 'required',\n ]);\n\n try {\n if ($request->type == 'Categories') {\n return Category::search($request->searched)->take(20)->get();\n }\n\n if ($request->type == 'Submissions') {\n return $this->sugarFilter(Submission::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Comments') {\n return $this->withoutChildren(Comment::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Users') {\n return User::search($request->searched)->take(20)->get();\n }\n } catch (\\Exception $exception) {\n app('sentry')->captureException($exception);\n\n return [];\n }\n }", "public function getReturnModels(){\r\n return array_values($this->models);\r\n }", "public function findAll()\n {\n $models = $this->getDoctrineRepository()->findAll();\n $this->events()->trigger(__FUNCTION__ . '.post', $this, array(\n 'model' => $models,\n 'om' => $this->getObjectManager())\n );\n return $models;\n }", "public function models();", "public function search($conditions)\n\t{\n\t\t$limit = (isset($conditions['limit']) && $conditions['limit'] !== null ? $conditions['limit'] : 10);\n\t\t$result = array();\n\t\t$alphabets = [];\n\n\t\tDB::enableQueryLog();\n\n\t\t$mem = new Memcached();\n\t\t$mem->addServer(env('memcached_server'), env('memcached_port'));\n\n\t\t/* Get Default Logo Link on setting_object table */\n\t\t$logoMem = $mem->get('logo_course');\n\n\t\tif ($logoMem)\n\t\t{\n\t\t\t$default_logo = $logoMem;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$default_logo = $this->getDefaultLogo();\n\t\t\t$mem->set('logo_course', $default_logo);\n\t\t}\n\n\t\tif (isset($conditions['alphabet']) && $conditions['alphabet'] !== null && sizeof($conditions['alphabet']) > 0) {\n\t\t\tforeach ($conditions['alphabet'] as $item) {\n\t\t\t\t$alphabets[] = \"lower(entity.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t\t$alphabets[] = \"lower(curriculum.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t}\n\t\t}\n\n\t\t$extraGroup = (isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : '' );\n\t\t$extraGroup = str_replace(' ASC', '',$extraGroup);\n\t\t$extraGroup = str_replace(' DESC', '',$extraGroup);\n\n\t\t$searchData = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->limit($limit)\n\t\t\t->offset(isset($conditions['page']) && $conditions['page'] !== null ? ($conditions['page']-1) * $limit : 0)\n\t\t\t->get();\n\n\t\t$searchAll = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t//->groupBy('course.course_id','schedule.instructor_id','curriculum.curriculum_id','entity.logo', 'course.day_of_week','entity.name','curriculum.name','course.time_start', 'course.time_end','event_type.name')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->get();\n\n\t\t//echo(\"<br>Total : \" . sizeof($searchData) . \" records\");\n\t\tforeach ($searchData as $data) {\n\t\t\t/*echo('<br>' . $data->program_id . '|' . $data->program_name . '|'. $data->activity_id . '|' . $data->provider_name . '|' . $data->location_name);*/\n\t\t\t//echo('<br>' . $data->provider_id . '|' . $data->provider_name . '|' . $data->location_name);\n\n\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\n\n\t\t\t//echo('<br>' . $data->course_id . \"~\" . $data->program_name . '#'.$day->name. \"|\". date('h:i',strtotime($data->time_start)) . '-' .date('h:i',strtotime($data->time_end)));\n\t\t\t$item = ['course_id' => $data->course_id,\n\t\t\t\t'entity_logo' => ($data->entity_logo ? $data->entity_logo : $default_logo),\n\t\t\t\t'entity_name' => $data->entity_name,\n\t\t\t\t'curriculum_name' => $data->curriculum_name,\n\t\t\t\t'day_name' => $day->name,\n\t\t\t\t'time_start' => date('H:i',strtotime($data->time_start)),\n\t\t\t\t'time_end' => date('H:i',strtotime($data->time_end))];\n\n\t\t\t/*$schedules = DB::table('schedule')\n\t\t\t\t->select('schedule.schedule_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\tforeach ($schedules as $schedule) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t}*/\n\n\t\t\t$programs = DB::table('curriculum')\n\t\t\t\t->select('program.program_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\t$searchActivities = [];\n\t\t\tforeach ($programs as $program) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t\t$activities = DB::table('program')\n\t\t\t\t\t->select('activity.logo', 'program.provider_id', DB::raw('program.name program_name'))\n\t\t\t\t\t->join('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t\t\t->leftjoin('activity_classification', 'activity.activity_classification_id', 'activity_classification.activity_classification_id')\n\t\t\t\t\t->where('program.program_id', $program->program_id)\n\t\t\t\t\t->whereRaw(\n\t\t\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\t\t\t\t\t\t('program.status = 0')\n\t\t\t\t\t)\n\t\t\t\t\t//->groupBy('activity.logo')\n\t\t\t\t\t->get();\n\n\t\t\t\tforeach ($activities as $activity) {\n\t\t\t\t\t//echo('<img src=\"' . $activity->logo . '\" style=\"width:2%;\" alt=\"' . $activity->program_name . '\" title=\"' . $activity->program_name . '\">');\n\t\t\t\t\t$searchActivity = [\n\t\t\t\t\t\t'logo' => $activity->logo,\n\t\t\t\t\t\t'name' => $activity->program_name,\n\t\t\t\t\t];\n\t\t\t\t\tarray_push($searchActivities, $searchActivity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray_push($result, array('item' => $item, 'activity' => $searchActivities));\n\t\t}\n\n\t\t$final = array('totalPage' => ceil(sizeof($searchAll)/$limit), 'total' => ( sizeof($searchAll) > 0 ? sizeof($searchAll) : 0), 'result' => $result, 'debug' => DB::getQueryLog()[0]['query']);\n\t\treturn $final;\n\t}", "public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}", "public function all()\n {\n return $this->model->get();\n }", "public function master_search() {\r\n $this->db->join(\r\n '__Vehicles', \r\n '__Vehicles.__ContactId = ' . $this->table_name. '.' . $this->contactId_fieldname ,\r\n 'left outer'\r\n ); \r\n return $this->get();\r\n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function findBy(array $filters);", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getList()\n {\n return $this->model->getList();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList($params = [])\n {\n $model = $this->prepareModel();\n return $model::all();\n }", "abstract protected function getSearchModelName(): string;", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public function getFilters();", "public function getSearch();", "public static function getList(array $filters){\n return self::model()->findAllByAttributes($filters);\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function actionList() {\n switch ($_GET['model']) {\n case 'Product':\n $models = Product::model()->findAll();\n break;\n case 'Vendor':\n $models = Vendor::model()->findAll();\n break;\n case 'FavoriteProduct':\n $models = FavoriteProduct::model()->findAll();\n break;\n case 'Order':\n $models = Order::model()->findAll();\n break;\n case 'Rating':\n $models = Rating::model()->findAll();\n break;\n case 'Review':\n $models = Review::model()->findAll();\n break;\n case 'UserAddress':\n $models = UserAddress::model()->findAll();\n break;\n case 'OrderDetail':\n $models = OrderDetail::model()->findAll();\n break;\n default:\n $this->_sendResponse(0, 'You have pass invalid modal name');\n Yii::app()->end();\n }\n // Did we get some results?\n if (empty($models)) {\n // No\n $this->_sendResponse(0, 'No Record found ');\n } else {\n // Prepare response\n $rows = array();\n $i = 0;\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n if ($_GET['model'] == 'Order') {\n $rows[$i]['cart_items'] = Product::model()->getProducts($model->product_id);\n $rows[$i]['order_detail'] = OrderDetail::model()->findAll(array('condition' => 'order_id ='.$model->id));\n }\n $i = $i + 1;\n }\n // Send the response\n $this->_sendResponse(1, '', $rows);\n }\n }", "static public function filterData($model_name)\n {\n $query = \"{$model_name}Query\";\n $objects = $query::create()->find();\n \n if ($objects != null) {\n\n $array = array();\n foreach ($objects as $object) {\n $array[$object->getId()] = $object->__toString();\n }\n\n return $array;\n } else {\n return array();\n }\n }", "public static function getList(string $filter='')\n {\n $query = self::with(['product','insuredPerson','agency'])->whereNotNull('n_OwnerId_FK');\n\n $filterArray = json_decode(request('filter'));\n\n if (is_object($filterArray)) {\n foreach($filterArray as $key=>$value) {\n if (empty($value)) {\n continue;\n }\n if (is_array($value)) {\n $query->whereIn($key, $value);\n continue;\n }\n $query->where($key, 'like', \"%$value%\");\n }\n }\n return $query;\n }", "public function getCriteria();", "public static function getSearchable()\n {\n return [\n 'columns' => [],\n 'joins' => [\n \n ]\n ];\n }", "static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }", "public function findByModelName($model_name);", "abstract public function getFieldsSearchable();", "function _get_by_related($model, $arguments = array())\r\n\t{\r\n\t\tif ( ! empty($model))\r\n\t\t{\r\n\t\t\t// Add model to start of arguments\r\n\t\t\t$arguments = array_merge(array($model), $arguments);\r\n\t\t}\r\n\r\n\t\t$this->_related('where', $arguments);\r\n\r\n\t\treturn $this->get();\r\n\t}", "public static function getModels()\n\t{\n\t\t$result = [];\n\t\t$path = __DIR__ . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR;\n\t\t$Iterator = new RecursiveDirectoryIterator($path);\n\t\t$objects = new RecursiveIteratorIterator($Iterator, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach ($objects as $name => $object)\n\t\t{\n\t\t\tif (strtolower(substr($name, -4) != '.php'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = strtolower(str_replace($path, '', substr($name, 0, strlen($name) - 4)));\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '\\\\', $name);\n\t\t\t$name = 'Model\\\\' . ucwords($name, '\\\\');\n\t\t\tif (class_exists($name))\n\t\t\t{\n\t\t\t\t$result[]= $name;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }", "public function getListQuery();", "public function search($model, $request)\n {\n $search = filter_var($request->get('search'), FILTER_SANITIZE_STRING);\n\n // Get optional filters\n // FILTER: GEOLOCATION\n if($request->input('location')) {\n $location = filter_var($request->get('location'), FILTER_SANITIZE_STRING);\n }\n if($request->input('geo_lat')) {\n $geo_lat = filter_var($request->get('geo_lat'), FILTER_SANITIZE_STRING);\n $geo_lng = filter_var($request->get('geo_lng'), FILTER_SANITIZE_STRING);\n }\n\n /**\n * Get current page number for location manual Pagination\n */\n $page = $request->get('page') ? $request->get('page') : 1;\n\n\n // Location first, since it's a special query\n if(isset($geo_lat) && isset($geo_lng)) {\n \n $location_data = Posts::location($geo_lat, $geo_lng, $search, 25, 100); \n\n // Hard and dirty search function through collection\n // since search with location method doesn't work still\n if($search !== '') {\n $location_data = $location_data->filter(function ($item) use ($search) {\n return stripos($item->name, $search) !== false;\n });\n }\n\n // Paginate results because location method can't\n $paginate = new Paginate;\n return $paginate->paginate($location_data, 15, $page, [\n 'path' => '/search/'\n ]);\n\n } \n // Section selection handler (brands/shops/prods/strains)\n elseif($search)\n {\n return $model->where('name', 'like', \"%$search%\");\n }\n\n }", "public function getWorkFlowModels()\n {\n return $this->postRequest('GetWorkFlowModels');\n }", "public function getList()\n {\n $filter = $this->getEvent()->getRouteMatch()->getParam('filter', null);\n return $this->getService()\n ->getList($filter);\n }", "private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\n\t}", "function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}", "public function actionViewModelList($modelName)\n\t{\n\t\t$pageSize = BaseModel::PAGE_SIZE;\n\t\tif ($_POST[\"sortBy\"]) {\n\t\t\t$order = $_POST[\"sortBy\"];\n\t\t}\n\t\t//echo $order;\n\t\t/*if (!$modelName) {\n\t\t\t\n\t\t}*/\n\t\t$sess_data = Yii::app()->session->get($modelName.'search');\n\t\t$searchId = $_GET[\"search_id\"];\n\t\t$fromSearchId = TriggerValues::model() -> decodeSearchId($searchId);\n\t\t//print_r($fromSearchId);\n\t\t//echo \"<br/>\";\n\t\t//Если задан $_POST/GET с формы, то сливаем его с массивом из searchId с приоритетом у searchId\n\t\tif ($_POST[$modelName.'SearchForm'])\n\t\t{\n\t\t\t$fromPage = array_merge($_POST[$modelName.'SearchForm'], $fromSearchId);\n\t\t} else {\n\t\t\t//Если же он не задан, то все данные берем из searchId\n\t\t\t$fromPage = $fromSearchId;\n\t\t}\n\t\t//print_r($fromPage);\n\t\tif ((!$fromPage)&&(!$sess_data))\n\t\t{\n\t\t\t//Если никаких критереев не задано, то выдаем все модели.\n\t\t\t$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t} else {\n\t\t\tif ($_GET[\"clear\"]==1)\n\t\t\t{\n\t\t\t\t//Если критерии заданы, но мы хотим их сбросить, то снова выдаем все и обнуляем нужную сессию\n\t\t\t\tYii::app()->session->remove($modelName.'search');\n\t\t\t\t$page = 1;\n\t\t\t\t//was://$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromSearchId,$order);\n\t\t\t} else {\n\t\t\t\t//Если же заданы какие-то критерии, но не со страницы, то вместо них подаем данные из сессии\n\t\t\t\tif (!$fromPage)\n\t\t\t\t{\n\t\t\t\t\t$fromPage = $sess_data;\n\t\t\t\t\t//echo \"from session\";\n\t\t\t\t}\n\t\t\t\t//Адаптируем критерии под специализацию. Если для данной специализации нет какого-то критерия, а он где-то сохранен, то убираем его.\n\t\t\t\t$fromPage = Filters::model() -> FilterSearchCriteria($fromPage, $modelName);\n\t\t\t\t//Если критерии заданы и обнулять их не нужно, то запускаем поиск и сохраняем его критерии в сессию.\n\t\t\t\tYii::app()->session->add($modelName.'search',$fromPage);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromPage,$order);\n\t\t\t}\n\t\t}\n\t\t//делаем из массива объектов dataProvider\n $dataProvider = new CArrayDataProvider($searched['objects'],\n array( 'keyField' =>'id'\n ));\n\t\t$this -> layout = 'layoutNoForm';\n\t\t//Определяем страницу.\n\t\t$maxPage = ceil(count($searched['objects'])/$pageSize);\n\t\tif ($_GET[\"page\"]) {\n\t\t\t$_POST[\"page\"] = $_GET[\"page\"];\n\t\t}\n\t\t$page = $_POST[\"page\"] ? $_POST[\"page\"] : 1;\n\t\t$page = (($page >= 1)&&($page <= $maxPage)) ? $page : 1;\n\t\t$_POST[$modelName.'SearchForm'] = $fromPage;\n\t\t$this->render('show_list', array(\n\t\t\t'objects' => array_slice($searched['objects'],($page - 1) * $pageSize, $pageSize),\n\t\t\t'modelName' => $modelName,\n\t\t\t'filterForm' => $modelName::model() -> giveFilterForm($fromPage),\n\t\t\t'fromPage' => $fromPage,\n\t\t\t'description' => $searched['description'],\n\t\t\t'specialities' => Filters::model() -> giveSpecialities(),\n\t\t\t'page' => $page,\n\t\t\t'maxPage' => $maxPage,\n\t\t\t'total' => count($searched['objects'])\n\t\t));\n\t\t\n\t}", "public function search_through(Request $request)\n {\n $reports = Payment::query();\n\n if (!empty($request->query())) {\n foreach ($request->query() as $key => $value) {\n if ($key == 'date') {\n $reports->whereDate('created_at', '>=', $value);\n } else {\n $reports->where($key, $value);\n }\n }\n }\n\n return $reports->get();\n }", "public function models($query, array $options = [])\n {\n $hits = $this->run($query);\n list($models, $totalCount) = $this->search->config()->models($hits, $options);\n // Remember total number of results.\n $this->setCachedCount($query, $totalCount);\n\n return Collection::make($models);\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n return $this->repository->all();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function queryset(){\n return $this->_get_queryset();\n }", "public function index(Request $request)\n {\n $keyword = $request->get('search');\n $perPage = $request->get('limit');\n $perPage = empty($perPage) ? 25 : $perPage;\n\n if (!empty($keyword)) {\n $filters = Filter::where('sl_gender', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_color', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_occasion', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_style', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_age', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_from', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_to', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_city_id', 'LIKE', \"%$keyword%\")\n ->orWhere('user_id', 'LIKE', \"%$keyword%\")\n ->paginate($perPage);\n } else {\n $filters = Filter::paginate($perPage);\n }\n\n return $filters;\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getSearchCriterias()\n {\n return $this->_searchCriterias;\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "private function getSearchConditions()\n {\n $searchConditions = [];\n\n $userIds = $this->request->get('ids') ?? [];\n if ($userIds) {\n $searchConditions['id'] = $userIds;\n }\n\n $email = $this->request->get('email') ?? '';\n if ($email) {\n $searchConditions['email'] = $email;\n }\n\n return $searchConditions;\n }", "public function findAllAction();", "public function search(Request $request)\n {\n if(!$request->has('query')) {\n return response()->json(['message' => 'Please type a keyword.']);\n }\n\n $userTenant = Auth::userTenant();\n $user = Auth::user();\n\n $searchableModelNameSpace = 'App\\\\Models\\\\';\n $result = [];\n // Loop through the searchable models.\n foreach (config('scout.searchableModels') as $model) {\n $modelClass = $searchableModelNameSpace.$model;\n $modelService = app($model.'Ser');\n\n if($model == 'Task') {\n $allowedModels = $modelService->searchForUserTenant($userTenant, $request->get('query'))->get();\n } else {\n $foundModels = $modelClass::search($request->get('query'))->get();\n if ($model === 'Comment') {\n $foundModels->where('groupId', '!=', null)->toArray();\n }\n $policy = app()->make('App\\Policies\\V2\\\\' . $model . 'Policy');\n $allowedModels = $foundModels->filter(function(BaseModel $foundModel) use($user, $policy) {\n return $policy->getAccess($user, $foundModel);\n });\n }\n\n $result[Str::lower($model) . 's'] = $allowedModels;\n }\n\n $responseData = ['message' => 'Keyword(s) matched!', 'results' => $result, 'pagination' => ['more' => false]];\n $responseHeader = Response::HTTP_OK;\n if (!count($result)) {\n $responseData = ['message' => 'No results found, please try with different keywords.'];\n $responseHeader = Response::HTTP_NOT_FOUND;\n }\n\n return response()->json($responseData, $responseHeader);\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\" && isset($UserProfile))\n\t\t\t$sSavedFilterList = $UserProfile->GetSearchFilters(CurrentUserName(), \"fsolicitudlistsrch\");\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJson(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nombre_contacto->AdvancedSearch->ToJson(), \",\"); // Field nombre_contacto\n\t\t$sFilterList = ew_Concat($sFilterList, $this->name->AdvancedSearch->ToJson(), \",\"); // Field name\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lastname->AdvancedSearch->ToJson(), \",\"); // Field lastname\n\t\t$sFilterList = ew_Concat($sFilterList, $this->_email->AdvancedSearch->ToJson(), \",\"); // Field email\n\t\t$sFilterList = ew_Concat($sFilterList, $this->address->AdvancedSearch->ToJson(), \",\"); // Field address\n\t\t$sFilterList = ew_Concat($sFilterList, $this->phone->AdvancedSearch->ToJson(), \",\"); // Field phone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->cell->AdvancedSearch->ToJson(), \",\"); // Field cell\n\t\t$sFilterList = ew_Concat($sFilterList, $this->created_at->AdvancedSearch->ToJson(), \",\"); // Field created_at\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_sucursal->AdvancedSearch->ToJson(), \",\"); // Field id_sucursal\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoinmueble->AdvancedSearch->ToJson(), \",\"); // Field tipoinmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipovehiculo->AdvancedSearch->ToJson(), \",\"); // Field tipovehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomaquinaria->AdvancedSearch->ToJson(), \",\"); // Field tipomaquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomercaderia->AdvancedSearch->ToJson(), \",\"); // Field tipomercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->documento_mercaderia->AdvancedSearch->ToJson(), \",\"); // Field documento_mercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoespecial->AdvancedSearch->ToJson(), \",\"); // Field tipoespecial\n\t\t$sFilterList = ew_Concat($sFilterList, $this->email_contacto->AdvancedSearch->ToJson(), \",\"); // Field email_contacto\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function getAndFilter() {\n\t\treturn $this->db->getAndFilter();\n\t}" ]
[ "0.6743169", "0.6743169", "0.660761", "0.6479806", "0.63798267", "0.63454884", "0.6310211", "0.630157", "0.6253882", "0.62494963", "0.62494963", "0.6111013", "0.6077699", "0.60734916", "0.604629", "0.60349816", "0.60323626", "0.6014135", "0.5981404", "0.5979577", "0.59790176", "0.59686154", "0.5932365", "0.59278476", "0.59224707", "0.58915573", "0.5889474", "0.5850065", "0.5846599", "0.58258194", "0.58169955", "0.5811794", "0.58071834", "0.5792253", "0.5776716", "0.5769704", "0.5762866", "0.5762595", "0.5750857", "0.5740329", "0.5738501", "0.5727578", "0.57241714", "0.57224226", "0.57219917", "0.57193714", "0.5717115", "0.5713116", "0.57129574", "0.57069343", "0.56932455", "0.56813276", "0.5671539", "0.56690705", "0.5668895", "0.5668895", "0.5668895", "0.5668847", "0.56679785", "0.56638783", "0.56562364", "0.56505203", "0.5649221", "0.56414455", "0.56334", "0.56329614", "0.5631676", "0.562298", "0.56168723", "0.5612008", "0.5608453", "0.55940604", "0.5580047", "0.5572055", "0.55555546", "0.55500674", "0.5547689", "0.5547594", "0.55458593", "0.55359334", "0.553295", "0.55324304", "0.5530852", "0.5525286", "0.552028", "0.5517957", "0.5513443", "0.55082744", "0.5506695", "0.5499769", "0.5499749", "0.54954296", "0.54954296", "0.54954296", "0.5494633", "0.54934925", "0.54930055", "0.5491269", "0.54898334", "0.5489441", "0.5484841" ]
0.0
-1
Get implicitly tagged wrapped element.
public function implicit(int $tag, int $class = Identifier::CLASS_UNIVERSAL): UnspecifiedType;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWrapperElement();", "public function getWrapTag()\n {\n return $this->wrapTag;\n }", "public function getOpenTagWrapper()\n {\n }", "public function getWrapperElement()\n {\n return $this->config['wrapper'] ?? 'div';\n }", "public function tag() { return $this->_m_tag; }", "public function tag() { return $this->_m_tag; }", "public function tag() { return $this->_m_tag; }", "public function tag() { return $this->_m_tag; }", "public function tag() { return $this->_m_tag; }", "public function tag()\r\n\t{\r\n\t\treturn $this->tag;\r\n\t}", "public function tag()\r\n\t{\r\n\t\treturn $this->tag;\r\n\t}", "public function getCanonical(): ?TagInterface;", "public function tag()\n\t{\n\t\treturn $this->tag;\n\t}", "public function getTag()\n {\n return $this->get('tag');\n }", "public function getTag();", "public function getTag();", "private function getTag()\n {\n return $this->tag;\n }", "public function getTag() {\n return $this->_tag;\n }", "public function getWrapper()\n {\n return $this->wrapper;\n }", "public function asElement() {\n //public Element asElement()\n return $element;\n }", "public function getTag()\n {\n return $this->tag;\n }", "public function getTag()\n {\n return $this->tag;\n }", "public function getTag()\n {\n return $this->tag;\n }", "public function & getRoot()\n\t{\n\t\t$r = null;\n\t\tforeach($this->m_document->childNodes as $c)\n\t\t{\n\t\t\tif($c->nodeType == XML_ELEMENT_NODE)\n\t\t\t{\n\t\t\t\t$r = new ZXmlTag($c);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(!$r)\n\t\t\t$r = new ZXmlTag($this->m_document);\n\n\t\treturn $r;\n\t}", "abstract protected function getTag() : Tag;", "public function getNestableElementDummy(): NestableElement\n {\n return $this->nestableElementDummy;\n }", "public function getTag()\n {\n }", "protected function get_element() {\n\t\tif ( ! $this->element ) {\n\t\t\t$this->element = \\esc_attr( \\apply_filters( 'wpseo_breadcrumb_single_link_wrapper', 'span' ) );\n\t\t}\n\n\t\treturn $this->element;\n\t}", "public function metaTag()\n {\n return $this->meta()->where('id', $this->meta_id)->first();\n }", "public function tagRaw() { return $this->_m_tagRaw; }", "public function getTag(): string;", "public function getTag()\n {\n return $this->getAdapter()->getTag();\n }", "public function getTag(): string\n {\n return $this->tag;\n }", "public function tag(): string\n {\n return $this->tag;\n }", "public function get_tag()\n {\n }", "public function tag(): string;", "abstract function getAsElem($dom);", "public function getTag(): string|null;", "public function getContentElement(): ?ContentElementInterface\n {\n return $this->getChildElement(1);\n }", "public function getTag(): ?string\n {\n return $this->tag;\n }", "private function retrieve_tag($tag)\n {\n if (isset($this->tags[$tag . 'count'])) { //if the openener is not in the Object we ignore it\n $temp_parent = $this->tags['parent']; //check to see if it's a closable tag.\n while ($temp_parent) { //till we reach '' (the initial value);\n if ($tag . $this->tags[$tag . 'count'] === $temp_parent) { //if this is it use it\n break;\n }\n $temp_parent = isset($this->tags[$temp_parent . 'parent']) ? $this->tags[$temp_parent . 'parent'] : ''; //otherwise keep on climbing up the DOM Tree\n }\n if ($temp_parent) { //if we caught something\n $this->indent_level = $this->tags[$tag . $this->tags[$tag . 'count']]; //set the indent_level accordingly\n $this->tags['parent'] = $this->tags[$temp_parent . 'parent']; //and set the current parent\n }\n unset($this->tags[$tag . $this->tags[$tag . 'count'] . 'parent']); //delete the closed tags parent reference...\n unset($this->tags[$tag . $this->tags[$tag . 'count']]); //...and the tag itself\n if ($this->tags[$tag . 'count'] === 1) {\n unset($this->tags[$tag . 'count']);\n } else {\n $this->tags[$tag . 'count']--;\n }\n }\n }", "public function getElement()\n {\n return $this->element;\n }", "public function getDerivationElement(): ?ComplexContentDerivationElementInterface\n {\n return $this->getChildElement(1);\n }", "public function Get_Tag() {\n // Populate the curly tags\n $tag = array(\n 'code' => $this->tag,\n 'category' => $this->category,\n 'hint' => $this->hint,\n 'name' => $this->name,\n 'method' => array($this,'_Render'),\n );\n // Return the tag\n return $tag;\n }", "public function getOpeningTag() {\n return $this->openingTag;\n }", "public function getCloseTagWrapper()\n {\n }", "public function getTag(string $name): ?TagInterface;", "public function getTag()\n\t{\n\t\treturn $this->data['tag'];\n\t}", "public function getElement()\n\t{\n\t\treturn $this->_element;\n\t}", "public function getTagName() {}", "protected function get_tag() {\n\t\treturn self::TAG;\n\t}", "public function get($tag)\n {\n foreach($this->iterator as $node) {\n if ($node instanceof Node && $node->tag === $tag) {\n return $node;\n }\n }\n return new Node();\n }", "public function taggable()\n {\n return $this->morphTo();\n }", "public function taggable()\n {\n return $this->morphTo();\n }", "public function taggable()\n {\n return $this->morphTo();\n }", "public function taggable()\n {\n return $this->morphTo();\n }", "public function taggable()\n {\n return $this->morphTo();\n }", "public function getTagName()\n {\n return $this->_tag;\n }", "public function getTag()\n {\n return $this->name;\n }", "public function element(): ?string\n {\n return $this->element ?: $this->first();\n }", "public function element($tag,$content = false)\r\n {\r\n $element = new Element($this,$tag,$content);\r\n\r\n if($this->nestElement instanceof Element)\r\n {\r\n $this->nestElement->child($element);\r\n }\r\n\r\n return $element;\r\n }", "public function getTag($tagName);", "public function getTagName();", "public function getBase() {\n\t\t\t\n\t\t\treturn $this->tag;\n\t\t\t\n\t\t}", "public function getElement() {\r\n $elementId = (int)$this->getProperty('elementId', 0);\r\n $elementClass = $this->getProperty('elementType', '');\r\n if ($elementId && !empty($elementClass)) {\r\n return $this->modx->getObject($elementClass, $elementId);\r\n }\r\n\r\n return null;\r\n }", "protected function get_wrapper() {\n\t\tif ( ! $this->wrapper ) {\n\t\t\t$this->wrapper = \\apply_filters( 'wpseo_breadcrumb_output_wrapper', 'span' );\n\t\t\t$this->wrapper = \\tag_escape( $this->wrapper );\n\t\t\tif ( ! \\is_string( $this->wrapper ) || $this->wrapper === '' ) {\n\t\t\t\t$this->wrapper = 'span';\n\t\t\t}\n\t\t}\n\n\t\treturn $this->wrapper;\n\t}", "public function inner()\n {\n return $this->inner;\n }", "public function inner()\n {\n return $this->inner;\n }", "public function getElement();", "public function getElement();", "public function getDocTag($name)\n {\n return $this->getDocTags($name)->first();\n }", "protected function wrapper(): ?string\n {\n return get_class($this->resource)::$wrap;\n }", "abstract public function getTag($tagName);", "public function parentNode()\n {\n return new Element($this->node->parentNode);\n }", "public function getRoot() : ElementInterface\n {\n return $this->root;\n }", "public function getFontIconTag()\n {\n if ($this->hasFontIcon()) {\n return parent::getFontIconTag();\n }\n \n if (($parent = $this->getParent()) && $parent->FontIconTag) {\n return $parent->FontIconTag;\n }\n }", "public function element($_element=NULL){\n if(\n isset($this->_elements[$_element]) &&\n $this->_elements[$_element] instanceof Dadiweb_Tags_Abstract\n ){\n return $this->_elements[$_element]->open(\n array('name'=>$this->getFormName())\n );\n }else{\n throw Dadiweb_Throw_ErrorException::showThrow(\n sprintf(\n 'Element \"%s\" is not defined into class \"%s\"',\n $_element,\n get_class($this)\n )\n );\n }\n }", "abstract protected function get_root_element();", "public function outerHTML()\n\t{\n\t\t$output = \"\";\n\t\t\n\t\t$doc = new DOMDocument(\"1.0\", \"UTF-8\");\n\t\t$element = $doc->importNode(dom_import_simplexml($this), true);\n\t\t$doc->appendChild($element);\n\t\t\n\t\treturn $element->ownerDocument->saveHTML($element);\n\t}", "public function getCalledElement();", "public function document()\n {\n return $this->DOM->getNode(0)->parentNode;\n }", "function get_tag()\n {\n\t $id = 'id=\"'.$this->OP_[id]->get().'\"';\n\t $name='name=\"'.$this->OP_[name]->get().'\"';\n\t $value='value=\"'.$this->OP_[value]->get().'\"';\n\t $type='type=\"hidden\"';\n\t $my_value = \"<input $id $name $type $value>\";\n\t return $my_value;\n }", "abstract protected function getObjectTag();", "public function getHtml_tag()\n\t{\n\t\treturn $this->html_tag;\n\t}", "function currentElement()\n {\n return $this->current ? $this->current->parentNode : NULL;\n }", "public function __toString() {\n return $this->tag();\n }", "private function getWrapperNode(DOMXPath $xpath, DOMElement $node)\n {\n $content = $xpath->query('.//*[@data-element=\"wrapper\"]', $node);\n\n return $content->item(0);\n }", "public function getContentType(): ?TagInterface;", "public function setTag(string $tag): HtmlElementInterface;", "public function getInnerInterface()\n {\n return $this->innerInterface;\n }", "function getRoot ()\n\t{\n\t\treturn $this->doc->document_element();\n\t}", "function tag_wrap($tag, $content = \"\", $class = NULL){\n\t$result = (is_block($tag)) ? \"\\r<\" : \"<\" ;\n\t$result .= $tag;\n\t$result .= (!empty($class)) ? ' class=\"'.$class.'\">' : '>' ;\n\t$result .= $content;\n\t$result .= (is_block($tag)) ? \"\\r</$tag>\\n\" : \"</$tag>\" ;\n\t\n\treturn $result;\n}", "public function getTagName() {\n\t\treturn $this->_tagName;\n\t}", "public function getString()\n {\n if (!$name = strtolower(trim($this->name))) {\n throw new \\InvalidArgumentException('请设置标签元素的名称!');\n }\n\n $attrString = $this->getAttrs(true);\n $content = $this->_handleChildAndContent();\n\n $eleString = sprintf(\"\\n<{$name}%s>%s\", $attrString, $content);\n $eleString .= $this->isAloneTag($name) ? \"\\n\" : \"</{$name}>\\n\";\n\n // has parent\n if ($parent = $this->parent) {\n\n if ($this->isAloneTag($parent->name)) {\n throw new \\InvalidArgumentException('不能设置单标签元素 ' . $parent->name . '为父元素!');\n }\n\n $parent->setContent($eleString);\n $eleString = $parent->getString();\n }\n\n unset($name, $attrString, $content, $parent);\n\n return $eleString;\n }", "private function retrieve_tag() {\n\t\t$replacement = null;\n\n\t\tif ( isset( $this->args->ID ) ) {\n\t\t\t$tags = $this->get_terms( $this->args->ID, 'post_tag' );\n\t\t\tif ( $tags !== '' ) {\n\t\t\t\t$replacement = $tags;\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function getTag()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_tag]))\n\t\t{\n\t\t\treturn $this->primarySearchData[$this->ref_tag];\n\t\t}else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function getTag($tag)\n {\n //print \"getting tag\\n\";\n return $this->_tagDTD->toTagStr($tag);\n }", "public function getTagName() {\n\t\treturn $this->tagName;\n\t}", "public function tags()\n {\n return $this->_refs('tags');\n }", "public function getTag()\n {\n return parent::getTag()\n ->unsetAttr('value')\n ->setAttr(\"type\", \"file\");\n }", "public function getElement()\n {\n if ($this->element_id != 0) {\n return $this->getTable('Element')->find($this->element_id);\n }\n }" ]
[ "0.7120756", "0.6824807", "0.6656835", "0.6388917", "0.61759466", "0.61759466", "0.61759466", "0.61759466", "0.61759466", "0.59846723", "0.59846723", "0.5984364", "0.5974605", "0.59608805", "0.595303", "0.595303", "0.58979744", "0.58972484", "0.58344924", "0.58077514", "0.57769305", "0.57769305", "0.57769305", "0.5751518", "0.56963575", "0.56851006", "0.56475174", "0.5640516", "0.56349885", "0.5610136", "0.56080836", "0.56067836", "0.5538751", "0.5529632", "0.5499622", "0.54992926", "0.54969794", "0.54658306", "0.5457779", "0.54286736", "0.5410384", "0.5405583", "0.5392693", "0.53901005", "0.53876543", "0.5383327", "0.53756297", "0.5365001", "0.53575426", "0.53536856", "0.5324862", "0.5309494", "0.5306424", "0.5299173", "0.5299173", "0.5299173", "0.5299173", "0.5288141", "0.52748334", "0.5273493", "0.52679384", "0.5262262", "0.5244887", "0.52291065", "0.52211946", "0.52171355", "0.52096564", "0.52096564", "0.5197387", "0.5197387", "0.51860744", "0.51672596", "0.5163826", "0.51619464", "0.5135408", "0.51042", "0.5096292", "0.5084943", "0.50769573", "0.50651085", "0.5047219", "0.5038627", "0.50372046", "0.5017429", "0.50127286", "0.49974096", "0.49931455", "0.49904174", "0.4989504", "0.49730682", "0.4961793", "0.49589935", "0.49523216", "0.49515426", "0.49410394", "0.493738", "0.49342087", "0.49302372", "0.49299955", "0.49232647", "0.49197474" ]
0.0
-1
Adicionar ao select a tabela TbdMarcacao
function getImagensCategoria($limite, $categoria){ #De modo que: Selecione N marcações (numero de marcacoes = $limit) #As marcações serão referentes as categorias ou subcategorias selecionadas (categorias = $categorias, subcategorias = $subcategorias) $this->db->select('*'); $this->db->from('Tbdimagem'); $this->db->join('imagem_categoria', 'Tbdimagem.idImagem = imagem_categoria.idImagem'); $this->db->where('imagem_categoria.idCategoria', $categoria); $this->db->order_by('rand()'); $this->db->limit($limite); $query = $this->db->get(); return $query->result_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function selectTable(){\n\t\tView::show(\"user/seleccionaTablas\");\n\t}", "public function SelecionaBanco()\r\n\t\t{\r\n\t\t\tmysql_select_db($this->banco);\r\n\t\t}", "private function ExibirTamanhos(){\r\n $oDadosCamiseta;\r\n $sSql = \"SELECT * FROM tamanho_camiseta\";\r\n $oDadosCamiseta = $this->Fbd->PesquisarSQL($sSql);\r\n \r\n foreach($oDadosCamiseta as $oRegistro){\r\n echo \"<option value='\".$oRegistro->sigla.\"' class='sctOptTamanho'>\".$oRegistro->nome.\"</option>\";\r\n }\r\n }", "function consultar_select($id, $columna_descripcion, $tabla){\n\t\t//Primero conectarse a la bd\n\t\t$conexion_bd = conectar_bd();\n\n\t\t$resultado = '<select name =\"'.$tabla.'\"><option value=\"\" disabled selected>Selecciona una opción</option>';\n\n \t$consulta = \"SELECT $id, $columna_descripcion FROM $tabla\";\n \t$resultados = $conexion_bd->query($consulta);\n \twhile ($row = mysqli_fetch_array($resultados, MYSQLI_BOTH)) {\n\t\t\t$resultado .= '<option value=\"'.$row[\"$id\"].'\">'.$row[\"$columna_descripcion\"].'</option>';\n\t\t}\n \n \t// desconectarse al termino de la consulta\n\t\tdesconectar_bd($conexion_bd);\n\n\t\t$resultado .= '</select><label>Marca</label></div>';\n\n\t\treturn $resultado;\n\n\t}", "public function select($tienda);", "public function select($cotizacion);", "function CreaSelect($Nombre,$Sql,$Comentario,$valor=\"\"){\n\t\t$result = mysql_query($Sql);\n\t\techo \"\\t<tr><td>$Comentario</td><td><select name='$Nombre'>\\n\";\n\t\twhile($row=mysql_fetch_row($result))\n\t\t{\n\t\t \tif($row[0]==$valor)$seleccionar=\"selected\";\n\t\t \telse $seleccionar=\"\";\n\t\t\techo \"\\t\\t<option $seleccionar value='\".$row[0].\"'>\".$row[1].\"</option>\\n\"\t;\n\t\t}\n\t\t\techo \"</select></td></tr>\\n\";\n\t\t\n\t}", "public function Select(){\n\t\t\t//Query para selecionar a tabela contatos\n\t\t\t$sql=\"SELECT p.*, e.* FROM tbl_paciente AS p INNER JOIN tbl_endereco AS e ON p.id_endereco = e.id_endereco WHERE ativo = 1 AND status = 1;\";\n\n\t\t\t//Instancio o banco e crio uma variavel\n\t\t\t$conex = new Mysql_db();\n\n\t\t\t/*Chama o método para conectar no banco de dados e guarda o retorno da conexao\n\t\t\tna variavel que $PDO_conex*/\n\t\t\t$PDO_conex = $conex->Conectar();\n\n\t\t\t//Executa o select no banco de dados e guarda o retorno na variavel select\n\t\t\t$select = $PDO_conex->query($sql);\n\n\t\t\t//Contador\n\t\t\t$cont = 0;\n\n\t\t\t//Estrutura de repetição para pegar dados\n\n \n\n\t\t\twhile ($rs = $select->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t#Cria um array de objetos na classe contatos\n\n //var_dump($rs);exit();\n\n\t\t\t\t//$lista_paciente[] = $rs;\n\n $lista_pacientes[] = new Paciente();\n \n\t\t\t\t// Guarda os dados no banco de dados em cada indice do objeto criado\n\t\t\t\t$lista_pacientes[$cont]->id_paciente = $rs['id_paciente'];\n $lista_pacientes[$cont]->id_endereco = $rs['id_endereco'];\n $lista_pacientes[$cont]->id_convenio = $rs['id_convenio'];\n $lista_pacientes[$cont]->nome = $rs['nome'];\n $lista_pacientes[$cont]->sobrenome = $rs['sobrenome'];\n $lista_pacientes[$cont]->dt_nasc = $rs['dt_nasc'];\n $lista_pacientes[$cont]->rg = $rs['rg'];\n $lista_pacientes[$cont]->cpf = $rs['cpf'];\n $lista_pacientes[$cont]->carteirinha_convenio = $rs['carterinha_convenio'];\n $lista_pacientes[$cont]->foto = $rs['foto'];\n $lista_pacientes[$cont]->status = $rs['status'];\n\t\t\t\t$lista_pacientes[$cont]->id_endereco = $rs['id_endereco'];\n $lista_pacientes[$cont]->cep = $rs['cep'];\n $lista_pacientes[$cont]->logradouro = $rs['logradouro'];\n $lista_pacientes[$cont]->numero = $rs['numero'];\n $lista_pacientes[$cont]->id_estado = $rs['id_estado'];\n $lista_pacientes[$cont]->cidade = $rs['cidade'];\n $lista_pacientes[$cont]->bairro = $rs['bairro'];\n\n\t\t\t\t// Soma mais um no contador\n\t\t\t\t$cont+=1;\n\t\t\t}\n\n\t\t\t$conex::Desconectar();\n\n\t\t\t//Apenas retorna o $list_contatos se existir dados no banco de daos\n\t\t\tif (isset($lista_pacientes)) {\n\t\t\t\t# code...\n\t\t\t\treturn $lista_pacientes;\n\t\t\t}\n\n\t\t}", "private function _montaInicioSelectQuestionario()\r\n {\r\n $select = $this->select()\r\n ->setIntegrityCheck(false);\r\n\r\n $select->from(array('pp' => KT_B_PERGUNTA_PEDIDO),\r\n array('cd_pergunta_pedido',\r\n 'tx_titulo_pergunta',\r\n 'st_multipla_resposta',\r\n 'st_obriga_resposta',\r\n 'tx_ajuda_pergunta'),\r\n $this->_schema);\r\n $select->join(array('orpp' => $this->_name),\r\n '(pp.cd_pergunta_pedido = orpp.cd_pergunta_pedido)',\r\n array('st_resposta_texto',\r\n 'ni_ordem_apresenta'),\r\n $this->_schema);\r\n $select->join(array('rp' => KT_B_RESPOSTA_PEDIDO),\r\n '(orpp.cd_resposta_pedido = rp.cd_resposta_pedido)',\r\n array('cd_resposta_pedido',\r\n 'tx_titulo_resposta'),\r\n $this->_schema);\r\n \r\n return $select;\r\n }", "function listarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_sel';\n\t\t$this->transaccion='WF_tabla_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_tabla','int4');\n\t\t$this->captura('id_tipo_proceso','int4');\n\t\t$this->captura('vista_id_tabla_maestro','int4');\n\t\t$this->captura('bd_scripts_extras','text');\n\t\t$this->captura('vista_campo_maestro','varchar');\n\t\t$this->captura('vista_scripts_extras','text');\n\t\t$this->captura('bd_descripcion','text');\n\t\t$this->captura('vista_tipo','varchar');\n\t\t$this->captura('menu_icono','varchar');\n\t\t$this->captura('menu_nombre','varchar');\n\t\t$this->captura('vista_campo_ordenacion','varchar');\n\t\t$this->captura('vista_posicion','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('menu_codigo','varchar');\n\t\t$this->captura('bd_nombre_tabla','varchar');\n\t\t$this->captura('bd_codigo_tabla','varchar');\n\t\t$this->captura('vista_dir_ordenacion','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('nombre_tabla_maestro','varchar');\n\t\t$this->captura('vista_estados_new','text');\n\t\t$this->captura('vista_estados_delete','text');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function listarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_sel';\n\t\t$this->transaccion='WF_TABLAINS_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('historico','historico','varchar');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_' . $_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['bd_nombre_tabla'],'int4');\n\t\t\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] == 'maestro') {\n\t\t\t\t\n\t\t\t$this->captura('estado','varchar');\n\t\t\t$this->captura('id_estado_wf','int4');\n\t\t\t$this->captura('id_proceso_wf','int4');\n\t\t\t$this->captura('obs','text');\n\t\t\t$this->captura('nro_tramite','varchar');\n\t\t}\n\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t\n\t\t\t$this->captura($value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\n\t\t\t//campos adicionales\n\t\t\tif ($value['bd_campos_adicionales'] != '' && $value['bd_campos_adicionales'] != null) {\n\t\t\t\t$campos_adicionales = explode(',', $value['bd_campos_adicionales']);\n\t\t\t\t\n\t\t\t\tforeach ($campos_adicionales as $campo_adicional) {\n\t\t\t\t\t\n\t\t\t\t\t$valores = explode(' ', $campo_adicional);\n\t\t\t\t\t$this->captura($valores[1],$valores[2]);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$this->captura('estado_reg','varchar');\t\t\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "private function criarBarraDeBuscaAction(){\n $cidades = $this->Localidades()->getCidades(\"RJ\");\n $busca = new form_busca();//1- primeiro eu instancio o formularioarray('selecione'=>'selecione','nome' => 'nome','cidade' => 'cidade')\n $busca->get('cidade')->setAttribute('options',$cidades);\n $busca->get('bairro')->setAttribute('options', array(0=>'Selecione uma Cidade'));\n //\n $categoriaDao = \\Base\\Model\\daoFactory::factory('SubCategoriaImovel');\n $dadosCategoria = $categoriaDao->recuperarTodos();\n $categorias = $this->SelectHelper()->getArrayData(\"selecione\",$dadosCategoria);\n $busca->get('tipo')->setAttribute('options', $categorias);\n //\n $transacaoDao = \\Base\\Model\\daoFactory::factory('TipoTransacao');\n $dadosTransacoes = $transacaoDao->recuperarTodos();\n $transacoes = $this->SelectHelper()->getArrayData(\"selecione\",$dadosTransacoes);\n $busca->get('transacao')->setAttribute('options', $transacoes);\n //\n $arrayPreco = array(array(\"value\"=>0, \"label\"=>\"selecione\", \"disabled\" => \"disabled\", \"selected\" => \"selected\"),array(\"value\" => 1, \"label\" => \"R$ 100.000 a R$ 200.000\"),array(\"value\" => 2, \"label\" => \"R$ 200.000 a R$ 300.000\"),array(\"value\" => 3, \"label\" => \"R$ 300.000 a R$ 400.000\"),array(\"value\" => 4, \"label\" => \"R$ 400.000 a R$ 500.000\"),array(\"value\" => 5, \"label\" => \"acima de R$ 500.000\"));\n $busca->get('valor')->setAttribute('options', $arrayPreco);\n return $busca;\n }", "function recorre_tabla_anidada($nombreta, $nombretp, $selectDestino){\r\n$sql_query= \"Select * From $nombreta Where universidad = '$nombretp'\";\t\r\n$consulta=pg_query($sql_query);\r\necho \"<div><select name='$selectDestino' id='$selectDestino' onChange='cargaContenido(this.id)'>\";\r\necho \"<option value='0'>Seleccione $nombreta</option>\";\r\nwhile($fila=pg_fetch_row($consulta)){\r\n\techo \"<option value='\".$fila[0].\"'>\".$fila[0].\"</option>\";}\t\t\t\r\necho \"</select></div>\";\t\r\n}", "function recorre_tabla_anidada($nombreta, $nombretp, $selectDestino){\r\n$sql_query= \"Select * From $nombreta Where universidad = '$nombretp'\";\t\r\n$consulta=pg_query($sql_query);\r\necho \"<div><select name='$selectDestino' id='$selectDestino' onChange='cargaContenido(this.id)'>\";\r\necho \"<option value='0'>Seleccione $nombreta</option>\";\r\nwhile($fila=pg_fetch_row($consulta)){\r\n\techo \"<option value='\".$fila[0].\"'>\".$fila[1].\"</option>\";}\t\t\t\r\necho \"</select></div>\";\t\r\n}", "public function select($actividades_fuera);", "public function seleccionar($tablas, $columnas, $condicion = \"\", $agrupamiento = \"\", $ordenamiento = \"\", $filaInicial = NULL, $numeroFilas = NULL) {\n $listaColumnas = array();\n $listaTablas = array();\n $limite = \"\";\n\n if (!is_array($tablas)){\n $tablas = array($tablas);\n\n }\n \n if (!is_array($columnas)){\n $columnas = array($columnas);\n\n }\n\n foreach ($columnas as $alias => $columna) {\n\n if (preg_match(\"/(^[a-zA-z]+[a-zA-Z0-9]*)/\", $alias)) {\n $alias = \" AS $alias\";\n } else {\n $alias = '';\n }\n\n $listaColumnas[] = $columna . $alias;\n }\n\n $columnas = implode(', ', $listaColumnas);\n\n foreach ($tablas as $alias => $tabla) {\n\n if (preg_match(\"/(^[a-zA-z]+[a-zA-Z0-9]*)/\", $alias)) {\n $alias = ' AS ' . $alias;\n } else {\n $alias = '';\n }\n\n $tabla = $this->prefijo . $tabla;\n $listaTablas[] = $tabla . $alias;\n }\n\n if (!empty($condicion)) {\n $condicion = ' WHERE ' . $condicion;\n }\n\n if (!empty($agrupamiento)) {\n $agrupamiento = ' GROUP BY ' . $agrupamiento;\n }\n\n if (!empty($ordenamiento)) {\n $ordenamiento = ' ORDER BY ' . $ordenamiento;\n }\n\n if (is_int($numeroFilas) && $numeroFilas > 0) {\n $limite = ' LIMIT ';\n\n if (is_int($filaInicial) && $filaInicial >= 0) {\n $limite .= \"$filaInicial, \";\n }\n\n $limite .= $numeroFilas;\n }\n\n $tablas = implode(', ', $listaTablas);\n $sentencia = 'SELECT ' . $columnas . ' FROM ' . $tablas . $condicion . $agrupamiento . $ordenamiento . $limite;\n\n $this->sentenciaSql = $sentencia;\n\n return $this->ejecutar($sentencia);\n }", "public static function tablaMarcas()\n {\n //Comprueba si hay un registro seleccionado\n if(!empty($_GET[\"id_marca\"]))\n {\n //Se valida que sea un numero\n if(is_numeric($_GET[\"id_marca\"]))\n {\n //Variable con los datos de la marca\n $datos_marca = Sentencias::Seleccionar(\"marcas\", \"id\", array($_GET[\"id_marca\"]), 0, null);\n\n //Se valida que tenga datos y que exista\n if($datos_marca != null)\n {\n $marca = $datos_marca[\"marca\"];\n }\n }\n\n else\n {\n header(\"Location: marcas.php\");\n }\n }\n\n else\n {\n //$marca = null;\n }\n \n //Variable con los permisos del usuario\n $dato_tipo = Sentencias::Seleccionar(\"tipos_usuarios\", \"id\", array($_SESSION[\"tipo\"]), 0, null);\n\n //Renderiza si tiene los permisos de lectura\n if($dato_tipo[\"marcas\"] > 0)\n {\n //Variable con todos los registro de la tabla marcas\n $datos_marcas = null; \n\n echo\n (\"\n <div class='row' id='lista'>\n <div class='col s12'>\n <div class='col s12 center-align'>\n <h4>Lista de marcas ingresadas</h4>\n </div>\n \"); \n\n //Se valida si se hara una busqueda\n if(!empty($_GET[\"accion\"]))\n {\n //Se valida si la opcion es 1\n if($_GET[\"accion\"] == 1)\n {\n echo\n (\"\n <div class='center-align'>\n <h4>Buscando por nombre de la marca</h4>\n </div>\n \");\n\n //Se renderiza el formulario de busqueda\n echo\n (\"\n <form method='post' class='col s10 offset-s1 m12'>\n\n <!--Se crea la barra de busqueda-->\n <div class='input-field col s8'>\n <i class='material-icons prefix'>search</i>\n <input id='buscar' type='text' class='validate' name='buscar'>\n <label for='buscar'>Ingrese el nombre de la marca a buscar</label>\n </div>\n <div class='col s4 offset-s2 l2'>\n <button name='busqueda' class='waves-effect waves-light btn blue darken-4'>Buscar</button>\n </div>\n <div class='col s4 offset-s2 l2'>\n <a href='marcas.php' class='waves-effect waves-light btn blue darken-4'>Limpiar</a>\n </div>\n </form>\n \");\n\n //Se empieza a validar los valores ingresados para la busqueda\n if(isset($_POST[\"busqueda\"]))\n {\n $busqueda = trim($_POST[\"buscar\"]);\n\n if(Validaciones::longitud($busqueda, 20) && Validaciones::nombre($busqueda))\n {\n $datos_marcas = Sentencias::Seleccionar(\"marcas\", \"marca\", array(\"$busqueda%\"), 1, 1);\n }\n\n else\n {\n Ventanas::Mensaje(2, \"el paremetro de busqueda no es valido\", null);\n }\n }\n }\n\n else\n {\n header(\"Location: marcas.php\");\n }\n }\n\n else\n {\n echo\n (\"\n <div class='center-align'>\n <h4>Selecciona una opcion de busqueda en la tabla</h4>\n </div>\n \");\n\n $datos_marcas = Sentencias::Seleccionar(\"marcas\", null, null, null, null); \n }\n\n //Renderiza la tabla\n echo\n (\"\n <table class='highlight centered col s12'>\n <thead>\n <tr>\n <th>Imagen</th>\n <th><a class='blue-text text-darken-4' href='marcas.php?accion=1'>Marca</a></th>\n <th>Accion</th>\n </tr>\n </thead>\n <tbody>\n \");\n\n //Se valida si hay datos en la variable\n if($datos_marcas != null)\n {\n //Empieza el foreach para mostrar las marcas\n foreach($datos_marcas as $row_marcas)\n {\n echo\n (\"\n <tr>\n <td><img class='circle' width='50' height='50' src='../img/marcas/$row_marcas[imagen]'></td>\n <td>\".$row_marcas['marca'].\"</td>\n <td><a href='marcas.php?id_marca=\".$row_marcas['id'].\"' class='blue-text text-darken-4'><i class='material-icons'>mode_edit</i></a></td>\n </tr>\n \");\n }\n }\n\n echo\n (\" \n </tbody>\n </table>\n </div>\n </div>\n \");\n }\n }", "static public function ctrCargarSelectModalidad(){\r\n\r\n $tabla = \"tbl_modalidades\";\r\n\r\n $respuesta = ModeloModalidades::mdlCargarSelect($tabla);\r\n\r\n return $respuesta;\r\n\r\n }", "public function select($producto);", "private function tbl_guiones_registro_tipo_formulario() {\r\n\t\t\t$this->guiones_registro_tipo = $this->esquema->createTable('GUIONES_REGISTRO_TIPO');\r\n\t\t\t$this->guiones_registro_tipo->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del tipo de guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre del tipo de guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado del tipo de Guion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_tipo->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}", "private function tbl_permisos_seleccion() {\r\n\t\t\t$this->permisos_seleccion = $this->esquema->createTable('PERMISOS_SELECCION');\r\n\t\t\t$this->permisos_seleccion->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Permiso Seleccion'\r\n\t\t\t));\r\n\t\t\t$this->permisos_seleccion->addColumn('PERMISO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Permiso del Usuario [ID de la tabla PERMISOS]'\r\n\t\t\t));\r\n\t\t\t$this->permisos_seleccion->addColumn('MODULO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Permiso del Modulo [ID de la tabla PERMISOS_MODULOS]'\r\n\t\t\t));\r\n\t\t\t$this->permisos_seleccion->addColumn('ACCESO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Permiso del Permiso Acceso [ID de la tabla PERMISOS_ACCESO]'\r\n\t\t\t));\r\n\t\t\t$this->permisos_seleccion->setPrimaryKey(array('ID'));\r\n\t\t\t$this->permisos_seleccion->addForeignKeyConstraint($this->permisos, array('PERMISO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->permisos_seleccion->addForeignKeyConstraint($this->permisos_modulo, array('MODULO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->permisos_seleccion->addForeignKeyConstraint($this->permisos_acceso, array('ACCESO'), array('ID'), $this->opcForeign);\r\n\t\t}", "public function listmAction() \n { \n $form = new Formulario(\"form\");\n // valores iniciales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d=new AlbumTable($this->dbAdapter);\n // Empleados\n $arreglo='';\n $datos = $d->getEmp(''); \n foreach ($datos as $dat)\n {\n $idc=$dat['id'];$nom=$dat['nombre'].' '.$dat['apellido'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idEmp\")->setValueOptions($arreglo); \n //\n $datos = $d->getGeneral1(\"select tipo from n_tip_matriz where id = \".$id);\n $tipo = $datos['tipo']; \n $arreglo=''; \n $con=' ';\n if ($tipo==1) \n $con=' and tipo=1'; \n if ($tipo==2) \n $con=' and tipo=2'; \n $datos = $d->getConnom2($con); \n if ($con!=' ')\n {\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n }\n $form->get(\"tipo\")->setValueOptions($arreglo); \n }\n $datos=0;\n $valores=array\n (\n \"titulo\" => $this->tfor,\n \"form\" => $form,\n 'url' => $this->getRequest()->getBaseUrl(),\n 'tipo' => $tipo, \n \"ttablas\" => \"Empleado, Cargo, Centro de costos, Eliminar\",\n 'datos' => $d->getGeneral(\"select a.id, concat(a.nombre ,' ' ,a.apellido) as nomEmp, \n b.nombre as nomCar, c.nombre as nomConc from a_empleados a \n left join t_cargos b on a.idCar=b.id\n inner join n_cencostos c on a.idCcos=c.id \n order by a.nombre,a.apellido\"),\n 'datosM' => $d->getGeneral(\"select a.id, b.nombre as nomMatz, a.idConc, b.alias, b.tipo,b.valor \n from n_tip_matriz_tnv a \n inner join n_conceptos b on b.id=a.idConc where a.idTmatz=\".$id ), \n \"lin\" => $this->lin\n ); \n // ------------------------ Fin valores del formulario \n return new ViewModel($valores); \n\n }", "function cargarDatosTablaProceso($link=0){\n\t\t$this->procedimiento='wf.ft_tabla_sel';\n\t\t$this->transaccion='WF_tabla_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t$this->setCount(false);\n\t\t$this->resetParametros();\n\t\t$this->resetCaptura();\n\t\t$primera_vez = 1;\n\t\t\n\t\t$this->setParametrosConsulta();\t\t\n\t\t\n\t\t//obtener los datos de la tabla maestro (datos de tabla y columnas)\n\t\t$this->captura('id_tabla','int4');\n\t\t$this->captura('id_tipo_proceso','int4');\n\t\t$this->captura('vista_id_tabla_maestro','int4');\n\t\t$this->captura('bd_scripts_extras','text');\n\t\t$this->captura('vista_campo_maestro','varchar');\n\t\t$this->captura('vista_scripts_extras','text');\n\t\t$this->captura('bd_descripcion','text');\n\t\t$this->captura('vista_tipo','varchar');\n\t\t$this->captura('menu_icono','varchar');\n\t\t$this->captura('menu_nombre','varchar');\n\t\t$this->captura('vista_campo_ordenacion','varchar');\n\t\t$this->captura('vista_posicion','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('menu_codigo','varchar');\n\t\t$this->captura('bd_nombre_tabla','varchar');\n\t\t$this->captura('bd_codigo_tabla','varchar');\n\t\t$this->captura('vista_dir_ordenacion','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('nombre_tabla_maestro','varchar');\n\t\t$this->captura('vista_estados_new','text');\n\t\t$this->captura('vista_estados_delete','text');\n\t\t\n\t\t$this->armarConsulta();\t\n\t\tif ($link == 0) {\n\t\t\t$cone = new conexion();\t\n\t\t\t$link = $cone->conectarnp();\n\t\t\t$primera_vez = 0;\t\t\t\n\t\t}\n\t\t\n\t\t$array = array();\n\t\ttry {\n\t\t\t$res = pg_query($link,$this->consulta);\n\t\t} catch (Exception $e) {\n\t\t\t$this->respuesta=new Mensaje();\n\t\t\t$resp_procedimiento=$this->divRespuesta(str_replace('ERROR: ','', pg_last_error($link)));\n\t\t\t$this->respuesta->setMensaje('ERROR',$this->nombre_archivo,$resp_procedimiento['mensaje'],$resp_procedimiento['mensaje_tec'],'base',$this->procedimiento,$this->transaccion,$this->tipo_procedimiento,$this->consulta);\n\t\t\treturn $this->respuesta;\n\t\t}\n\t\t\n\t\tif ($res) {\n\t\t\t$i = 0;\n\t\t\twhile ($row = pg_fetch_array($res,NULL,PGSQL_ASSOC)){\n\t\t\t\t//obtener las columnas\n\t\t\t\t$array[$i] = array();\n\t\t\t\t\n\t\t\t\t$array[$i]['atributos'] = $row;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->arreglo_consultas['filtro'] = ' tipcol.id_tabla = '. $row['id_tabla'];\n\t\t\t\t$columnas = $this->cargarDatosColumnaProceso($link);//llama a la funcion para obtener atributos de una tabla\n\t\t\t\t\n\t\t\t\tif ($columnas instanceof Mensaje)//Si es instancia de mensaje\n\t\t\t\t\treturn $columnas;\n\t\t\t\t\t//retornar en mensaje\n\t\t\t\t\n\t\t\t\t$array[$i]['columnas'] = $columnas;\n\t\t\t\t\n\t\t\t\t//obtener las tablas\n\t\t\t\t//se cambia el filtro para la siguiente consulta\n\t\t\t\t$this->arreglo_consultas['filtro'] = ' tabla.vista_id_tabla_maestro = '. $row['id_tabla'];\n\t\t\t\t$tablas = $this->cargarDatosTablaProceso($link);//Llama a esta misma funcion que me devolvera las tablas detalle\n\t\t\t\t\n\t\t\t\tif ($tablas instanceof Mensaje)//Si es instancia de mensaje\n\t\t\t\t\treturn $tablas;\n\t\t\t\t\t//retornar en mensaje\t\t\t\n\t\t\t\t$array[$i]['detalles'] = $tablas;\n\t\t\t\t$i++;\n\t\t\t\t\n\t\t\t}\n\t\t\tpg_free_result($res);\n\t\t} else {\n\t\t\t$resp_procedimiento=$this->divRespuesta(str_replace('ERROR: ','', pg_last_error($link)));\t\t\t\t\n\t\t\t//Existe error en la base de datos tomamamos el mensaje y elmensaje tecnico\n\t\t\t$this->respuesta=new Mensaje();\n\t\t\t$this->respuesta->setMensaje('ERROR',$this->nombre_archivo,$resp_procedimiento['mensaje'],$resp_procedimiento['mensaje_tec'],'base',$this->procedimiento,$this->transaccion,$this->tipo_procedimiento,$this->consulta);\n\t\t\treturn $this->respuesta;\n\t\t}\n\t\t\n\t\tif ($primera_vez == 0) {\n\t\t\t\n\t\t\t$this->respuesta=new Mensaje();\n\t\t\t$this->respuesta->setMensaje('EXITO',$this->nombre_archivo,'Consulta ejecutada con exito','Consulta ejecutada con exito','base',$this->procedimiento,$this->transaccion,$this->tipo_procedimiento,$this->consulta);\n\t\t\t$this->respuesta->setDatos($array);\n\t\t\treturn $this->respuesta;\n\t\t} else {\n\t\t\treturn $array;\n\t\t}\t\t\n\t}", "public function listaAction() \n { \n $form = new Formulario(\"form\");\n // valores iniciales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n // Lista de cargos\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = New AlbumTable($this->dbAdapter); \n $arreglo[0]='( NO TIENE )';\n $datos = $d->getCargos();// Listado de cargos\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idCar\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getNcargos();\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idNcar\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getCencos();// Listado de centros de costos\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idDep\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getSedes();// Listado de sedes\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idSed\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getDepar();\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idGdot\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getGdot();// Grupo de dotaciones\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idGdot\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getNasp();// Nivel de aspecto del cargo\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idNasp\")->setValueOptions($arreglo); \n // Tipos de salarios\n $arreglo = '';\n $datos = $d->getSalarios(''); \n $arreglo='';\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=number_format($dat['salario']).' (COD: '.$dat['codigo'].')';\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idTnomm\")->setValueOptions($arreglo); \n // Fin valor de formularios\n $valores=array\n (\n \"titulo\" => $this->tfor,\n \"form\" => $form, \n 'url' => $this->getRequest()->getBaseUrl(),\n 'id' => $id,\n \"lin\" => $this->lin\n ); \n // ------------------------ Fin valores del formulario \n \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Zona de validacion del fomrulario --------------------\n $album = new ValFormulario();\n $form->setInputFilter($album->getInputFilter()); \n $form->setData($request->getPost()); \n $form->setValidationGroup('nombre','numero'); // ------------------------------------- 2 CAMPOS A VALDIAR DEL FORMULARIO (C) \n // Fin validacion de formulario ---------------------------\n if ($form->isValid()) {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u = new Cargos($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n if ($data->id==0)\n $id = $u->actRegistro($data); // Trae el ultimo id de insercion en nuevo registro \n else \n {\n $u->actRegistro($data); \n $id = $data->id;\n }\n // Guardar tipos de nominas afectado por automaticos\n $f = new CargosS($this->dbAdapter);\n // Eliminar registros de tipos de nomina afectados por automaticos \n $d->modGeneral(\"Delete from t_cargos_sa where idCar=\".$id); \n $i=0;\n foreach ($data->idTnomm as $dato){\n $idSal = $data->idTnomm[$i];$i++; \n $f->actRegistro($idSal,$id); \n } \n $this->flashMessenger()->addMessage(''); \n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin.'a/'.$data->id);\n }\n }\n return new ViewModel($valores);\n \n }else{ \n if ($id > 0) // Cuando ya hay un registro asociado\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new Cargos($this->dbAdapter); // ---------------------------------------------------------- 4 FUNCION DENTRO DEL MODELO (C) \n $datos = $u->getRegistroId($id);\n $a = $datos['nombre'];\n $b = $datos['deno'];\n $c = $datos['idCar_a'];\n $d = $datos['plazas'];\n $e = $datos['respo'];\n $f = $datos['mision'];\n $g = $datos['idNcar'];\n\n $i = $datos['idGdot'];\n $j = $datos['idNasp'];\n // Valores guardados\n $form->get(\"nombre\")->setAttribute(\"value\",\"$a\"); \n $form->get(\"deno\")->setAttribute(\"value\",\"$b\"); \n $form->get(\"numero\")->setAttribute(\"value\",$d); // Plazas\n $form->get(\"respo\")->setAttribute(\"value\",\"$e\"); \n $form->get(\"mision\")->setAttribute(\"value\",\"$f\"); \n $form->get(\"idSed\")->setAttribute(\"value\",$datos['idSed']); \n $form->get(\"idDep\")->setAttribute(\"value\",$datos['idCcos']); \n // Jefe directo\n $d = New AlbumTable($this->dbAdapter); \n $datos = $d->getCargos();\n $form->get(\"idCar\")->setAttribute(\"value\",\"$c\"); \n $form->get(\"idNcar\")->setAttribute(\"value\",\"$g\"); \n\n $form->get(\"idGdot\")->setAttribute(\"value\",\"$i\"); \n $form->get(\"idNasp\")->setAttribute(\"value\",\"$j\"); \n // Escalas salariales\n $datos = $d->getSalCargos(' and idCar='.$id);\n $arreglo=''; \n foreach ($datos as $dat){\n $arreglo[]=$dat['idSal'];\n } \n $form->get(\"idTnomm\")->setValue($arreglo); \n return new ViewModel($valores);\n } \n \n }\n }", "private function tbl_guiones_registro_afectacion() {\r\n\t\t\t$this->guiones_registro_afectacion = $this->esquema->createTable('GUIONES_REGISTRO_AFECTACION');\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la afectacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la afectacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado de la afectacion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_afectacion->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}", "public function mostrarTablaAsegurados() {\n\n\t\t$item = null;\n\t\t$valor = null;\n\n\t\t$asegurados = ControladorAsegurados::ctrMostrarAsegurados($item, $valor);\n\n\t\tif ($asegurados == null) {\n\t\t\t\n\t\t\t$datosJson = '{\n\t\t\t\t\"data\": []\n\t\t\t}';\n\n\t\t} else {\n\n\t\t\t$datosJson = '{\n\t\t\t\"data\": [';\n\n\t\t\tfor ($i = 0; $i < count($asegurados); $i++) { \n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS LA EMPRESA\n\t\t\t\t=============================================*/\n\n\t\t\t\t$itemEmpleador = \"id\";\n\t\t\t\t$valorEmpleador = $asegurados[$i][\"id_empleador\"];\n\n\t\t\t\t$Empleadores = ControladorEmpleadores::ctrMostrarEmpleadores($itemEmpleadore, $valorEmpresa);\n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS EL TIPO DE SEGURO\n\t\t\t\t=============================================*/\n\n\t\t\t\t$itemSeguro = \"id\";\n\t\t\t\t$valorSeguro = $asegurados[$i][\"id_seguro\"];\n\n\t\t\t\t$seguros = ControladorSeguros::ctrMostrarSeguros($itemSeguro, $valorSeguro);\n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS LAS LOCALIDADES\n\t\t\t\t=============================================*/\n\n\t\t\t\t$itemLocalidad = \"id\";\n\t\t\t\t$valorLocalidad = $asegurados[$i][\"id_localidad\"];\n\n\t\t\t\t$localidades = ControladorLocalidades::ctrMostrarLocalidades($itemLocalidad, $valorLocalidad);\t\n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS LAS OCUPACIONES\n\t\t\t\t=============================================*/\n\n\t\t\t\t$itemOcupacion = \"id\";\n\t\t\t\t$valorOcupacion = $asegurados[$i][\"id_ocupacion\"];\n\n\t\t\t\t$ocupaciones = ControladorOcupaciones::ctrMostrarOcupaciones($itemOcupacion, $valorOcupacion);\t\t\t\t\n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS LAS ACCIONES\n\t\t\t\t=============================================*/\n\n\t\t\t\t$botones1 = \"<div class='btn-group'><button class='btn btn-info btnAgregarBeneficiario' idAsegurado='\".$asegurados[$i][\"id\"].\"' data-toggle='tooltip' title='Agregar Beneficiario'><i class='fas fa-check'></i></button></div>\";\n\n\t\t\t\t$botones2 = \"<div class='btn-group'><button class='btn btn-warning btnEditarEmpleador' idAsegurado='\".$asegurados[$i][\"id\"].\"' data-toggle='tooltip' title='Editar'><i class='fas fa-pencil-alt'></i></button><button class='btn btn-danger btnEliminarAsegurado' idAsegurado='\".$asegurados[$i][\"id\"].\"' data-toggle='tooltip' title='Eliminar'><i class='fas fa-times'></i></button></div>\";\n\n\t\t\t\t$datosJson .='[\n\t\t\t\t\t\"'.$botones1.'\",\t\n\t\t\t\t\t\"'.$empleadores[\"razon_social\"].'\",\t\t\t\n\t\t\t\t\t\"'.$seguros[\"tipo_seguro\"].'\",\t\n\t\t\t\t\t\"'.$asegurados[$i][\"matricula\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"documento_ci\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"paterno\"].' '.$asegurados[$i][\"materno\"].' '.$asegurados[$i][\"nombre\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"sexo\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"fecha_nacimiento\"].'\",\n\t\t\t\t\t\"'.$Localidades[\"nombre_localidad\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"zona\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"calle\"].' '.$asegurados[$i][\"nro_calle\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"salario\"].'\",\n\t\t\t\t\t\"'.$ocupaciones[\"nombre_ocupacion\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"fecha_ingreso\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"estado\"].'\",\n\t\t\t\t\t\"'.$botones2.'\"\n\t\t\t\t],';\n\t\t\t}\n\n\t\t\t$datosJson = substr($datosJson, 0, -1);\n\n\t\t\t$datosJson .= ']\n\t\t\t}';\t\n\n\t\t}\n\n\t\techo $datosJson;\n\t\n\t}", "function evt__cuadro_fechas__seleccionar ($fecha_cuadro){\n }", "public function limparTabela(){\r\n\t\t$sql = 'DELETE FROM oficina';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$consulta->execute();\r\n\t}", "protected function fijarTabla(){\n \n return \"categorias\";\n \n }", "public function select($usuario_has_hojaruta);", "function evt__Agregar()\n\t{\n\t\t$this->tabla()->resetear();\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "public function select(){\n\t$sql=\"SELECT * FROM tipousuario\";\n\treturn ejecutarConsulta($sql);\n}", "public static function tableName()\n { return 'magistrado'; }", "public function cadastrar(){\r\n //DEFINIR A DATA DE CADASTRO\r\n $this->cadastro = date('Y-m-d H:i:s');\r\n\r\n $db = new Database('cartao');\r\n $this->id = $db->insert([\r\n 'bandeira' => $this->bandeira,\r\n 'numero' => $this->numero,\r\n 'doador' => $this->doador,\r\n ]);\r\n\r\n }", "public function BuscarCadastro()\n\t{\n\t\treturn TableFactory::getInstance('Cadastro')->incluirCadastro();\n\t}", "public function mostrarDados(){\n\t\t$sql = \"SELECT cliente.cod_cliente, cliente.nome_cliente, categoria.cod_categoria, categoria.desc_categoria, servico.cod_servico, servico.desc_servico, servico.foto\t\n\t\t\t\tFROM cliente INNER JOIN (categoria INNER JOIN servico ON categoria.cod_categoria = servico.cod_categoria) ON cliente.cod_cliente = servico.cod_cliente\n\t\t\t\twhere cod_servico = '$this->cod_servico'\";\n\t\t$qry= self:: executarSQL($sql);\n\t\t$linha = self::listar($qry);\n\t\t\n\t\t$this-> cod_servico = $linha['cod_servico'];\n\t\t$this-> cod_categoria = $linha['cod_categoria'];\n\t\t$this-> desc_categoria = $linha['desc_categoria'];\n\t\t$this-> cod_cliente = $linha['cod_cliente'];\n\t\t$this-> nome_cliente = $linha['nome_cliente'];\n\t\t$this-> desc_servico = $linha['desc_servico'];\n\t\t$this-> foto = $linha['foto'];\n\t}", "function listado() {\r\n return self::consulta('SELECT * FROM \".self::$nTabla.\"');\r\n }", "public function select()\n {\n $sql = \"SELECT * FROM tipousuario\";\n return ejecutarConsulta($sql);\n }", "function insertarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_ime';\n\t\t$this->transaccion='WF_TABLAINS_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t$this->setParametro('tipo_proceso','tipo_proceso','varchar');\n\t\t//si es detalle se añade un parametro para el id del maestro\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] != 'maestro') {\n\t\t\t\n\t\t\t$this->setParametro($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_campo_maestro'],\n\t\t\t\t\t\t\t\t$_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_campo_maestro'],'integer');\n\t\t}\n\t\t//Define los parametros para la funcion\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t$this->setParametro($value['bd_nombre_columna'],$value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\t\n\t\t}\t\t\t\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function selectByIdac_consumos($consumo_id){\n\t\t\t$this->connection = Connection::getinstance()->getConn();\n\t\t\t$PreparedStatement = \"SELECT consumo_id, socio_id, nro_medidor, fecha_lectura, fecha_emision, periodo_mes, periodo_anio, consumo_total_lectura, consumo_por_pagar, costo_consumo_por_pagar, estado, fecha_hora_pago, usuario_pago, monto_pagado, pagado_por, ci_pagado_por,\n (SELECT CONCAT(nombres,' ',apellidos) FROM asapasc.ac_socios WHERE socio_id = asapasc.ac_consumos.socio_id) AS socio \n FROM asapasc.ac_consumos WHERE consumo_id = \".Connection::inject($consumo_id).\" ;\";\n\t\t\t$ResultSet = mysql_query($PreparedStatement,$this->connection);\n\t\t\tlogs::set_log(__FILE__,__CLASS__,__METHOD__, $PreparedStatement);\n\n\t\t\t$elem = new ac_consumosTO();\n\t\t\twhile($row = mysql_fetch_array($ResultSet)){\n\t\t\t\t$elem = new ac_consumosTO();\n\t\t\t\t$elem->setConsumo_id($row['consumo_id']);\n\t\t\t\t$elem->setSocio_id($row['socio_id']);\n\t\t\t\t$elem->setNro_medidor($row['nro_medidor']);\n\t\t\t\t$elem->setFecha_lectura($row['fecha_lectura']);\n\t\t\t\t$elem->setFecha_emision($row['fecha_emision']);\n\t\t\t\t$elem->setPeriodo_mes($row['periodo_mes']);\n\t\t\t\t$elem->setPeriodo_anio($row['periodo_anio']);\n\t\t\t\t$elem->setConsumo_total_lectura($row['consumo_total_lectura']);\n\t\t\t\t$elem->setConsumo_por_pagar($row['consumo_por_pagar']);\n\t\t\t\t$elem->setCosto_consumo_por_pagar($row['costo_consumo_por_pagar']);\n\t\t\t\t$elem->setEstado($row['estado']);\n\t\t\t\t$elem->setFecha_hora_pago($row['fecha_hora_pago']);\n\t\t\t\t$elem->setUsuario_pago($row['usuario_pago']);\n\t\t\t\t$elem->setMonto_pagado($row['monto_pagado']);\n\t\t\t\t$elem->setPagado_por($row['pagado_por']);\n\t\t\t\t$elem->setCi_pagado_por($row['ci_pagado_por']);\n $elem->setSocio($row['socio']);\n\n\t\t\t}\n\t\t\tmysql_free_result($ResultSet);\n\t\t\treturn $elem;\n\t\t}", "function insertarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_ime';\n\t\t$this->transaccion='WF_tabla_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tipo_proceso','id_tipo_proceso','int4');\n\t\t$this->setParametro('vista_id_tabla_maestro','vista_id_tabla_maestro','int4');\n\t\t$this->setParametro('bd_scripts_extras','bd_scripts_extras','text');\n\t\t$this->setParametro('vista_campo_maestro','vista_campo_maestro','varchar');\n\t\t$this->setParametro('vista_scripts_extras','vista_scripts_extras','text');\n\t\t$this->setParametro('bd_descripcion','bd_descripcion','text');\n\t\t$this->setParametro('vista_tipo','vista_tipo','varchar');\n\t\t$this->setParametro('menu_icono','menu_icono','varchar');\n\t\t$this->setParametro('menu_nombre','menu_nombre','varchar');\n\t\t$this->setParametro('vista_campo_ordenacion','vista_campo_ordenacion','varchar');\n\t\t$this->setParametro('vista_posicion','vista_posicion','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('menu_codigo','menu_codigo','varchar');\n\t\t$this->setParametro('bd_nombre_tabla','bd_nombre_tabla','varchar');\n\t\t$this->setParametro('bd_codigo_tabla','bd_codigo_tabla','varchar');\n\t\t$this->setParametro('vista_dir_ordenacion','vista_dir_ordenacion','varchar');\n\t\t$this->setParametro('vista_estados_new','vista_estados_new','varchar');\n\t\t$this->setParametro('vista_estados_delete','vista_estados_delete','varchar');\t\t\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function crearTablas(){\r\n\t\t\t$this->crearTablaUsuario();\r\n\t\t\t$this->crearTablaDeporte();\r\n\t\t\t$this->crearTablaUsuarioDeporte();\r\n\t\t\t$this->crearTablaPassw();\r\n\t\t}", "function recorre_tabla($nombret,$campot){\r\n$sql_query= \"Select $campot From $nombret where estado=true\";\r\n$consulta = pg_query($sql_query);\r\nwhile($fila=pg_fetch_row($consulta)) \r\n { echo \"<option value='\".$fila[1].\"'>\".$fila[0].\"</option>\"; } \r\n}", "public function SelectById($paciente){\n\t\t\t$sql = \"SELECT p.*, e.* FROM tbl_paciente AS p INNER JOIN tbl_endereco AS e ON p.id_endereco = e.id_endereco WHERE id_paciente = \". $paciente->id_paciente;\n\n\t\t\t//Instancio o banco e crio uma variavel\n\t\t\t$conex = new Mysql_db();\n\n\t\t\t/*Chama o método para conectar no banco de dados e guarda o retorno da conexao\n\t\t\tna variavel que $PDO_conex*/\n\t\t\t$PDO_conex = $conex->Conectar();\n\n\t\t\t$select = $PDO_conex->query($sql);\n\n\t\t\t//Executa o script no banco de dados\n\t\t\tif($rs = $select->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t//Se der true redireciona a tela\n\n\t\t\t\t$paciente = array();\n\n $paciente = $rs;\n\n\t\t\t\t// Guarda os dados no banco de dados em cada indice do objeto criado\n\t\t\t\t/*$paciente->id_paciente = $rs['id_paciente'];\n $paciente->id_endereco = $rs['id_endereco'];\n $paciente->id_convenio = $rs['id_convenio'];\n $paciente->nome = $rs['nome'];\n $paciente->sobrenome = $rs['sobrenome'];\n $paciente->dt_nasc = $rs['dt_nasc'];\n $paciente->rg = $rs['rg'];\n $paciente->cpf = $rs['cpf'];\n $paciente->carteirinha_convenio = $rs['carteirinha_convenio'];\n $paciente->foto = $rs['foto'];\n $paciente->status = $rs['status'];\n\t\t\t\t $paciente->id_endereco = $rs['id_endereco'];\n $paciente->cep = $rs['cep'];\n $paciente->logradouro = $rs['logradouro'];\n $paciente->numero = $rs['numero'];\n $paciente->id_estado = $rs['id_estado'];\n $paciente->cidade = $rs['cidade'];\n $paciente->bairro = $rs['bairro']; */\n\n return $paciente;\n\n\t\t\t}else {\n\t\t\t\t//Mensagem de erro\n\t\t\t\techo \"Error ao selecionar no Banco de Dados\";\n\t\t\t}\n\n\t\t\t//Fecha a conexão com o banco de dados\n\t\t\t$conex->Desconectar();\n\t\t}", "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}", "public function Carrera()\n {\n include('conexion.php');\n $Consulta_Carrera = \"SELECT * FROM p_carrera ORDER BY car_nombre\";\n $Resultado_Consulta_Carrera = $conexion->prepare($Consulta_Carrera);\n $Resultado_Consulta_Carrera->execute();\n while ($a = $Resultado_Consulta_Carrera->fetch())\n {\n echo '<option value=\"'.$a[car_codigo].'\">'.$a[car_nombre].'</option>';\n }\n\n }", "static public function ctrCargarSelectOrientacion(){\r\n\r\n $tabla = \"tbl_orientacion\";\r\n\r\n $respuesta = ModeloModalidades::mdlCargarSelect($tabla);\r\n\r\n return $respuesta;\r\n\r\n }", "function cargarDatosColumnaProceso($link=0){\n\t\t$this->procedimiento='wf.ft_tipo_columna_sel';\n\t\t$this->transaccion='WF_TIPCOLES_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t$this->setCount(false);\n\t\t$this->resetParametros();\n\t\t$this->resetCaptura();\n\t\t\n\t\t$this->setParametrosConsulta();\t\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t\t\t\n\t\t$this->captura('id_tipo_columna','int4');\n\t\t$this->captura('id_tabla','int4');\n\t\t$this->captura('id_tipo_proceso','int4');\n\t\t$this->captura('bd_campos_adicionales','text');\n\t\t$this->captura('form_combo_rec','varchar');\n\t\t$this->captura('bd_joins_adicionales','text');\n\t\t$this->captura('bd_descripcion_columna','text');\n\t\t$this->captura('bd_tamano_columna','varchar');\n\t\t$this->captura('bd_formula_calculo','text');\n\t\t$this->captura('form_sobreescribe_config','text');\n\t\t$this->captura('form_tipo_columna','varchar');\n\t\t$this->captura('grid_sobreescribe_filtro','text');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('bd_nombre_columna','varchar');\n\t\t$this->captura('form_es_combo','varchar');\n\t\t$this->captura('form_label','varchar');\n\t\t$this->captura('grid_campos_adicionales','text');\n\t\t$this->captura('bd_tipo_columna','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('momento','varchar');\n\t\t\n\t\t$this->armarConsulta();\t\n\t\t\t\t\n\t\t$array = array();\n\t\t$res = pg_query($link,$this->consulta);\n\t\tif ($res) {\n\t\t\twhile ($row = pg_fetch_array($res,NULL,PGSQL_ASSOC)){\n\t\t\t\tarray_push ($array, $row);\n\t\t\t}\n\t\t\tpg_free_result($res);\n\t\t\treturn $array;\n\t\t} else {\n\t\t\t$resp_procedimiento=$this->divRespuesta(str_replace('ERROR: ','', pg_last_error($link)));\n\t\t\t$this->respuesta=new Mensaje();\t\t\t\t\n\t\t\t//Existe error en la base de datos tomamamos el mensaje y elmensaje tecnico\n\t\t\t$this->respuesta->setMensaje('ERROR',$this->nombre_archivo,$resp_procedimiento['mensaje'],$resp_procedimiento['mensaje_tec'],'base',$this->procedimiento,$this->transaccion,$this->tipo_procedimiento,$this->consulta);\n\t\t\treturn $this->respuesta;\n\t\t}\n\t}", "function listadoSelect();", "function abrirSeleccionAlumno(){\n\t\t\t$seleccionTiempo\t\t= new SeleccionTiempo();\n\t\t\t//$condicionadoss\t\t\t= new ReconsideracionBaja();\n\n\t\t\t$this->redirect(\"profesor/informacion\");\n\t\t\treturn;\n\t\t\t\n\t\t\t$day = date (\"d\");\n\t\t\t$month = date (\"m\");\n\t\t\t$year = date (\"Y\");\n\t\t\t$date1 = date (\"Y-m-d\", mktime(0, 0, 0, $month, $day, $year));\n\n\t\t\t$nomina = Session::get_data('registro');\n\t\t\t$division = Session::get_data('coordinacion');\n\n\t\t\tunset( $this -> noCondicionados );\n\t\t\tunset( $this -> condicionados );\n\t\t\t$Periodos = new Periodos();\n\t\t\t$periodo = $Periodos -> get_periodo_actual();\n\n\t\t\t$i = 0;\n\t\t\tforeach( $seleccionTiempo -> find_all_by_sql\n\t\t\t\t\t ( \"select al.miReg registroo, al.vcNomAlu, al.enPlan\n\t\t\t\t\t\tFrom alumnos al\n\t\t\t\t\t\twhere (pago = 1\n\t\t\t\t\t\tor condonado = 1)\n\t\t\t\t\t\tand al.miReg not in\n\t\t\t\t\t\t( select registro\n\t\t\t\t\t\t from reconsideracion_baja\n\t\t\t\t\t\t where periodo = '\".$periodo.\"')\n\t\t\t\t\t\t order by al.miReg\" ) as $selTiempo ){\n\n\t\t\t\t$this -> noCondicionados[$i] = $selTiempo;\n\t\t\t\t$i ++;\n\t\t\t}\n\t\t\t/*\n\t\t\t$i = 0;\n\t\t\tforeach( $condicionadoss -> find_all_by_sql\n\t\t\t\t\t( \"Select rb.registro as registroo, al.vcNomAlu, al.enPlan\n\t\t\t\t\t\tfrom reconsideracion_baja rb, alumnos al\n\t\t\t\t\t\twhere rb.procede = 1\n\t\t\t\t\t\tand rb.periodo = \".$periodo.\"\n\t\t\t\t\t\tand rb.registro = al.miReg\n\t\t\t\t\t\torder by registro\" ) as $condicionado ){\n\n\t\t\t\t$this -> condicionados[$i]\t\t= $condicionado;\n\t\t\t\t$i ++;\n\t\t\t}\n\t\t\t*/\n }", "protected function _getTableOptions(){ }", "function getTituloCombo($tabelaProcura){\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n $retorno = $pk = '';\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n # Recupera o nome da tabela e gera o nome da classe\n if($tabelaProcura != $aTabela['NOME']) \n continue;\n\n # Varre a estrutura dos campos da tabela em questao\n foreach($aTabela as $oCampo){ \n //print \"@@{$oCampo->NOME}\\n\";\n //print_r($aTabela); exit;\n # Se o campo for chave, nao sera usado\n if($oCampo->CHAVE == 1){\n $pk = $oCampo->NOME;\n \n if((String)$oCampo->FKTABELA == ''){\n continue;\n }\n }\n\n # Se o campo for do tipo numerico, nao sera usado, nao sera usado\n if(!preg_match(\"#varchar#is\", (String)$oCampo->TIPO)) continue;\n \n # Se o campo tiver nomenclatura que nao remeta a nome/descricao sera eliminado \n if(preg_match(\"#(?:nome|descricao)#is\", (String)$oCampo->NOME)){\n $retorno = (String)$oCampo->NOME;\n break;\n }\n \n # Se o campo tiver nomenclatura que nao remeta a nome/descricao sera eliminado \n if(preg_match(\"#(?:usuario|login|nome_?(?:pessoa|cliente|servidor)|descricao|titulo|nm_(?:pessoa|cliente|servidor|estado_?civil|lotacao|credenciado)|desc_)#is\", (String)$oCampo->NOME)){\n $retorno = (String)$oCampo->NOME;\n break;\n }\n \n # Recupera valores a serem substituidos no modelo\n \n }\n break;\n }\n if($retorno == '')\n $retorno = $pk;\n return (string)$retorno;\n }", "static public function mdlCargarSelect($tabla) {\r\n\r\n $stmt = ConexionBD::Abrir_Conexion()->prepare(\"SELECT Activo FROM $tabla\");\r\n $stmt->execute();\r\n\r\n return $stmt->fetchall();\r\n }", "function generar()\r\n\t{\r\n\t\tforeach($this->columnas as $ef) {\r\n\t\t \t$this->datos->tabla('columnas')->nueva_fila($ef->get_datos());\r\n\t\t}\r\n\t\tparent::generar();\r\n\t}", "function SelectValuesSeguros_Empresas($db_conx, $table) {\r\n $sql = \"\";\r\n if ($table == \"seguros\") {\r\n $sql = \"SELECT * FROM tseguros ORDER BY seg_descrip ASC\";\r\n } else {\r\n $sql = \"SELECT * FROM tempresas ORDER BY emp_descrip ASC\";\r\n }\r\n $query = mysqli_query($db_conx, $sql);\r\n\r\n $n_filas = $query->num_rows;\r\n $data = '<select size=\"12\" class=\"cmb' . $table . '\" id=\"cmb' . $table . '\">\r\n <option value=\"\">Ninguno</option>';\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] . \"_\" . $row[2] . '</option>';\r\n $c++;\r\n }\r\n $data .= '</select>';\r\n echo $data;\r\n}", "public function mostrar_insertar() {\r\n\t\t\t$this -> pantalla_edicion('insertar'); \r\n\t\t }", "function creaTablaPartidos(){\r\n // Create connection\r\n $conn = dameConexion();//new mysqli($servername, $username, $password, $dbname);\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Conexión fallida: \" . $conn->connect_error);\r\n }\r\n \r\n // sql to create table carta (Nombre, Coleccion, Imagen, fecha, entrada)\r\n $sql = \"CREATE TABLE partidos (\r\n id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,\r\n Local VARCHAR(15) NOT NULL,\r\n Visitante VARCHAR(15),\r\n Resultado VARCHAR(5),\r\n Entrada INT(6)\r\n )\";\r\n \r\n if ($conn->query($sql) === TRUE) {\r\n echo \"Tabla creada correctamente\";\r\n } else {\r\n \r\n //echo \"Error creando la tabla: \" . $conn->error;\r\n }\r\n \r\n $conn->close();\r\n}", "public function asignado() {\n \treturn $this->db\n \t\t->select(format_select(array(\n \t\t\t'cirugia.idCirugia' \t\t\t => 'idCirugia',\n \t\t\t'empleado.idEmpleado' \t\t => 'idEmpleado',\n \t\t\t'empleado.matricula'\t\t\t => 'matricula',\n \t\t\t'empleado.nombre' \t\t\t => 'nombre',\n \t\t\t'empleado.apellido_paterno' => 'a_paterno',\n \t\t\t'empleado.apellido_materno' => 'a_materno',\n \t\t\t'especialidad.nombre' \t\t => 'especialidad',\n \t\t\t'cirugia.fecha' \t\t\t\t => 'fecha',\n \t\t\t'quirofano.nombre'\t\t\t => 'quirofano'\n \t\t)))\n \t\t->join('usuario','tipo_usuario.idTipo_Usuario = usuario.idTipo_Usuario')\n \t\t->join('empleado','empleado.idEmpleado = usuario.idEmpleado')\n \t\t->join('departamento','departamento.idDepartamento = tipo_usuario.idDepartamento')\n \t\t->join('especialidad','especialidad.idEspecialidad = departamento.idEspecialidad')\n \t\t->join('proceso_tipo_usuario','proceso_tipo_usuario.idTipo_Usuario = tipo_usuario.idTipo_Usuario')\n \t\t->join('proceso','proceso.idProceso = proceso_tipo_usuario.idProceso')\n \t\t->join('cirugia','cirugia.idProceso = proceso.idProceso AND cirugia.idquirofano > 0 AND cirugia.status = \"1\"')\n \t\t->join('quirofano','cirugia.idQuirofano = quirofano.idQuirofano')\n \t\t->get('tipo_usuario')\n \t\t->result_array();\n }", "function loadSelectValores($tabla, $codigo, $opt) {\r\n\tswitch ($tabla) {\r\n\t\tcase \"ORDENAR-PROCESOS\":\r\n\t\t\t$c[0] = \"p.CodProceso\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"p.Descripcion\"; $v[1] = \"Descripci&oacute;n\";\r\n\t\t\t$c[2] = \"p.Estado\"; $v[2] = \"Estado\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-FASES\":\r\n\t\t\t$c[0] = \"f.CodFase\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"f.Descripcion\"; $v[1] = \"Descripci&oacute;n\";\r\n\t\t\t$c[2] = \"f.Estado\"; $v[2] = \"Estado\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-TIPOACTUACION\":\r\n\t\t\t$c[0] = \"taf.CodTipoActuacion\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"taf.Descripcion\"; $v[1] = \"Descripci&oacute;n\";\r\n\t\t\t$c[2] = \"taf.Estado\"; $v[2] = \"Estado\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ESTADO-ACTUACION-DETALLE\":\r\n\t\t\t$c[0] = \"PE\"; $v[0] = \"Pendiente\";\r\n\t\t\t$c[1] = \"EJ\"; $v[1] = \"En Ejecución\";\r\n\t\t\t$c[2] = \"AN\"; $v[2] = \"Anulada\";\r\n\t\t\t$c[3] = \"TE\"; $v[3] = \"Terminada\";\r\n\t\t\t$c[4] = \"CE\"; $v[4] = \"Cerrada\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-ACTUACION-DETALLE\":\r\n\t\t\t$c[0] = \"a.CodFase, af.Anio, af.Secuencia, af.CodActuacion\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"oe.Organismo, de.Dependencia\"; $v[1] = \"Ente Externo\";\r\n\t\t\t$c[2] = \"a.Descripcion\"; $v[2] = \"Actividad\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ESTADO-ACTUACION-PRORROGA\":\r\n\t\t\t$c[0] = \"PR\"; $v[0] = \"En Preparación\";\r\n\t\t\t$c[1] = \"RV\"; $v[1] = \"Revisada\";\r\n\t\t\t$c[2] = \"AP\"; $v[2] = \"Aprobada\";\r\n\t\t\t$c[3] = \"AN\"; $v[3] = \"Anulada\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-ACTUACION-PRORROGA\":\r\n\t\t\t$c[0] = \"p.CodProrroga\"; $v[0] = \"Prorroga\";\r\n\t\t\t$c[1] = \"p.Motivo\"; $v[1] = \"Motivo\";\r\n\t\t\t$c[2] = \"a.Descripcion\"; $v[2] = \"Actividad\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-VALORACION-DETALLE\":\r\n\t\t\t$c[0] = \"a.CodFase, vj.Anio, vj.Secuencia, vj.CodValJur\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"oe.Organismo, de.Dependencia\"; $v[1] = \"Ente Externo\";\r\n\t\t\t$c[2] = \"a.Descripcion\"; $v[2] = \"Actividad\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-POTESTAD-DETALLE\":\r\n\t\t\t$c[0] = \"a.CodFase, vj.Anio, vj.Secuencia, vj.CodPotestad\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"oe.Organismo, de.Dependencia\"; $v[1] = \"Ente Externo\";\r\n\t\t\t$c[2] = \"a.Descripcion\"; $v[2] = \"Actividad\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-DETERMINACION-DETALLE\":\r\n\t\t\t$c[0] = \"a.CodFase, vj.Anio, vj.Secuencia, vj.CodDeterminacion\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"oe.Organismo, de.Dependencia\"; $v[1] = \"Ente Externo\";\r\n\t\t\t$c[2] = \"a.Descripcion\"; $v[2] = \"Actividad\";\r\n\t\t\tbreak;\r\n\t}\r\n\t\r\n\t$i = 0;\r\n\tswitch ($opt) {\r\n\t\tcase 0:\r\n\t\t\tforeach ($c as $cod) {\r\n\t\t\t\tif ($cod == $codigo) echo \"<option value='\".$cod.\"' selected>\".$v[$i].\"</option>\";\r\n\t\t\t\telse echo \"<option value='\".$cod.\"'>\".$v[$i].\"</option>\";\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase 1:\r\n\t\t\tforeach ($c as $cod) {\r\n\t\t\t\tif ($cod == $codigo) echo \"<option value='\".$cod.\"' selected>\".$v[$i].\"</option>\";\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n}", "public function select($calendario);", "private static function setgenerateCACHE_SELECT($schmaTabls)\n {\n self::getFileCashDB()->set($schmaTabls, self::CACHE_SELECT);\n }", "function carregaABTest() {\n $tabela = new TabelaModel(\"abtest\", \"id_abtest\", \"nm_abtest\");\n $coluna = $this->adicionaColunaNormal($tabela, \"ID abtest\", \"id_abtest\", true, TIPO_INPUT_INTEIRO);\n // $coluna->setInvisible();\n $coluna = $this->adicionaColunaNormal($tabela, \"Nome do ABTest\", \"nm_abtest\", false, TIPO_INPUT_TEXTO_CURTO);\n $coluna->setDetalhesInclusao(true, true, \"novo test AB\");\n $coluna = $this->adicionaColunaNormal($tabela, \"URL ABTest (opcional)\", \"url_abtest\", false, TIPO_INPUT_TEXTO_CURTO);\n $coluna->setHintText(\"Exemplo: login/new\");\n $coluna->setDetalhesInclusao(true, true, null);\n $coluna = $this->adicionaColunaNormal($tabela, \"Descrição\", \"desc_abtest\", false, TIPO_INPUT_TEXTAREA, 250);\n $coluna->setDetalhesInclusao(true, true, null);\n $coluna = $this->adicionaColunaComFK($tabela, \"Tipo ABTest\", \"id_tipo_abtest\", false, false, \"tipo_abtest\", TIPO_INPUT_SELECT_FK);\n $coluna->setDetalhesInclusao(true, true, FIRST_OPTION);\n\n $this->adicionaColunaCalculada($tabela, \"Participantes\", \"cont_participantes\", \"select count(*) as cont_participantes from abtest_usuario,abtest_variacao where abtest_variacao.id_abtest_variacao=abtest_usuario.id_abtest_variacao and abtest_variacao.id_abtest=\");\n $this->adicionaColunaCalculada($tabela, \"Variações\", \"cont_variacoes\", \"select count(*) as cont_variacoes from abtest_variacao where abtest_variacao.id_abtest=\");\n $this->adicionaColunaCalculada($tabela, \"Votos\", \"count_votos\", \"select sum(count_abtest_variacao) as count_votos from abtest_variacao where abtest_variacao.id_abtest=\");\n\n $tabela->setPaginaInclusao(getHomeDir() . \"abtest\");\n\n return $tabela;\n }", "public function crear() {\n /**\n * guardamos la consulta en $sql\n * ejecutamos la consulta en php \n * asignamos el id del objeto = al ultimo id que añadimos a la bd, asi coincidiran el id objeto con tupla\n * lista de atributos a introducir valores de atributos a introducir\n * formato insertar datos INSERT INTO NombreTabla (NombreAtributo1, NombreAtributo2) VALUES (ValorAtributo1, ValorAtributo2)\n */\n // para acceder a una cosntante de la clase NombreClase::NOMBRECONSTANTE\n \n try {\n $sql=\"INSERT INTO \".Bebidas::TABLA[0].\" (nombre, descripcion, tipo, estado, foto) VALUES ('$this->nombre', '$this->descripcion', '$this->tipo', '$this->estado', '$this->foto')\";\n $this->conexion->query($sql);\n $this->__set(\"id_bebida\", $this->conexion->insert_id);\n } catch (Exception $ex) {\n echo 'error '.$ex;\n }\n \n }", "public function listaCaixa($codEmpresa,$codSetor,$codCaixa)\n {\n $conexao=Conexao::getConnection();\n $result=array();\n \n $sql =\"SELECT '' CodCaixa,'=>Selecionar Caixa<=' Caixa \";\n $sql.=\"UNION ALL \";\n \n $sql.=\"SELECT cod_caixa CodCaixa ,des_caixa Caixa \";\n $sql.=\" FROM tb_caixas \";\n \n $smtm=$conexao -> prepare($sql);\n \n if ($codCaixa != \"\" )\n {\n $sql.= \" WHERE cod_empresa =? AND \";\n $sql.= \" cod_setor =? AND \";\n $sql.= \" cod_caixa =? \";\n \n $smtm=$conexao->prepare($sql);\n \n $smtm->bindValue(1,$codEmpresa);\n $smtm->bindValue(2,$codSetor);\n $smtm->bindValue(3,$codCaixa);\n \n }\n elseif ($codSetor != \"\" )\n {\n \n $sql.= \" WHERE cod_empresa=? AND \";\n $sql.= \" cod_setor =? \";\n \n $smtm=$conexao->prepare($sql);\n \n $smtm->bindValue(1,$codEmpresa);\n $smtm->bindValue(2,$codSetor);\n \n }\n \n $smtm->execute();\n $result=$smtm->fetchAll(PDO::FETCH_ASSOC);\n $conexao=null;\n\n $html=\"\";\n foreach ($result as $key=>$coluna){\n\n if ( $key=='' )\n {\n $html.='<option disabled selected value=\"'. $coluna[\"CodCaixa\"] .'\">' .$coluna[\"Caixa\"] .\"</option>\"; \n }\n else\n {\n $html.='<option value=\"'. $coluna[\"CodCaixa\"] .'\">' .$coluna[\"Caixa\"] .\"</option>\"; \n }\n }\n return $html;\n }", "public function actionSelect(){\n $select = $this->select('Pilih donk akhh..', ['kopi'=>'kopi', 'susu'=>'susu']);\n echo \"Pilihan nya adalah : $select\";\n }", "function carregaTipoABTest() {\n $tabela = new TabelaModel(\"tipo_abtest\", \"id_tipo_abtest\", \"nm_tipo_abtest\");\n $coluna = $this->adicionaColunaNormal($tabela, \"ID Tipo abtest\", \"id_tipo_abtest\", true, TIPO_INPUT_INTEIRO);\n //$coluna->setInvisible();\n $coluna = $this->adicionaColunaNormal($tabela, \"Tipo do ABTest\", \"nm_tipo_abtest\", false, TIPO_INPUT_TEXTO_CURTO);\n $coluna->setDetalhesInclusao(true, true, \"Novo tipo Teste AB\");\n $coluna = $this->adicionaColunaComFK($tabela, \"Pagina\", \"id_pagina\", false, true, \"pagina\", TIPO_INPUT_SELECT_FK);\n $coluna->setDetalhesInclusao(true, false, null);\n $coluna = $this->adicionaColunaNormal($tabela, \"Guest only?\", \"flag_guest_only\", false, TIPO_INPUT_BOOLEAN);\n $coluna->setDetalhesInclusao(true, false, null);\n\n\n $tabela->setPaginaInclusao(getHomeDir() . \"tipoabtest\");\n\n return $tabela;\n }", "function recorre_tabla($nombret,$campot){\r\n$sql_query= \"Select $campot From $nombret\";\r\n$consulta = pg_query($sql_query);\r\nwhile($fila=pg_fetch_row($consulta)) \r\n { echo \"<option value='\".$fila[0].\"'>\".$fila[0].\"</option>\"; } \r\n}", "public function actionConsultarNumeroFactura()\n\t{\n//\t\techo $id;\n\t\t$tipoTalonario=$_POST['tipoTalonario'];\n\t\t$data = Talonario::model()->findByPk($tipoTalonario);\n\t\t$data = CHtml::listData($data,'idTalonario','proximo');\n\t\tforeach($data as $value=>$name) {\n\t\t\techo CHtml::tag('option',\n\t\t\t\tarray('value'=>$value),CHtml::encode($name),true);\n\t\t}\n\t}", "public function buscaTarefa($tarefa)\n {\n //Monta a Query\n $query = \"SELECT * FROM tarefas WHERE id={$tarefa->id};\";\n //Executa a Query no Banco\n $resultado = mysqli_query($this->conexao, $query);\n\n $tarefa_atual = mysqli_fetch_assoc($resultado);\n\n $categoria = new Categoria();\n $categoria->setId($tarefa_atual['categoria_id']);\n\n $tarefa_select = new Tarefa($tarefa_atual['nome'], $categoria, $tarefa_atual['id_usuario']);\n $tarefa_select->id = $tarefa_atual['id'];\n $tarefa_select->inicio = $tarefa_atual['data_inicio'];\n $tarefa_select->fim = $tarefa_atual['data_fim'];\n\n //Retorna o resultado da inserção (Positivo ou Negativo)\n return $tarefa_select;\n }", "public function comboContrato($idCliente, $tipo, $isContagemAuditoria = NULL) {\n $arrRetorno = array();\n //pega o id empresa caso seja uma contagem de auditoria\n $idEmpresa = getIdEmpresa();\n //verifica antes se eh uma contagem de auditoria\n if ($isContagemAuditoria) {\n $sql = \"SELECT con.id, con.id_cliente, con.numero, con.ano, con.uf, con.tipo, emp.sigla, cli.id_fornecedor FROM $this->table con, cliente cli, empresa emp \"\n . \"WHERE con.is_ativo IN (0, 1) AND \"\n . \"con.id_cliente = cli.id AND \"\n . \"cli.id_empresa = emp.id AND \"\n . \"emp.id = $idEmpresa \"\n . \" ORDER BY sigla ASC, id_fornecedor DESC\";\n } else {\n if ($tipo == '01') {\n $sql = \"SELECT id, id_cliente, numero, uf, ano, tipo, '-' AS sigla FROM $this->table WHERE is_ativo IN (0, 1) AND id_cliente = $idCliente ORDER BY id ASC\";\n } else {\n $sql = \"SELECT id, id_cliente, numero, uf, ano, tipo, '-' AS sigla FROM $this->table WHERE is_ativo = 1 AND id_cliente = $idCliente ORDER BY id ASC\";\n }\n }\n $stm = DB::prepare($sql);\n $stm->execute();\n //loop dos contratos\n $ret = $stm->fetchAll(PDO::FETCH_ASSOC);\n //sempre com um item vazio para nao dar erro no script\n $arrRetorno[] = array(\n 'id' => 0,\n 'numeroAno' => 'Selecione um contrato',\n 'tipo' => '',\n 'sigla' => '');\n if ($isContagemAuditoria) {\n foreach ($ret as $linha) {\n if ($linha['id_fornecedor'] > 0) {\n $sql = \"SELECT id, sigla, tipo FROM fornecedor WHERE id = :idFornecedor\";\n $stmSigla = DB::prepare($sql);\n $stmSigla->bindParam(':idFornecedor', $linha['id_fornecedor']);\n $stmSigla->execute();\n $siglaFornecedor = $stmSigla->fetch(PDO::FETCH_ASSOC);\n //apenas fornecedores, retirar turmas daqui\n if (!$siglaFornecedor['tipo']) {\n $arrRetorno[] = array('id' => $linha['id'],\n 'numeroAno' => ' [ ' . strtoupper($linha['uf']) . ' ] ' . $linha['numero'] . '/' . $linha['ano'],\n 'tipo' => '[ ' . $linha['tipo'] . ' ]',\n 'sigla' => '[ ' . $linha['tipo'] . ' ] ' . $linha['sigla'] . ' &laquo; ' . $siglaFornecedor['sigla'] . ' &raquo; ');\n }\n } else {\n $arrRetorno[] = array('id' => $linha['id'],\n 'numeroAno' => ' [ ' . strtoupper($linha['uf']) . ' ] ' . $linha['numero'] . '/' . $linha['ano'],\n 'tipo' => '[ ' . $linha['tipo'] . ' ]',\n 'sigla' => '[ ' . $linha['tipo'] . ' ] ' . $linha['sigla'] . ' . ');\n }\n }\n return $arrRetorno;\n } else {\n foreach ($ret as $linha) {\n $arrRetorno[] = array('id' => $linha['id'],\n 'numeroAno' => ' [ ' . strtoupper($linha['uf']) . ' ] ' . $linha['numero'] . '/' . $linha['ano'],\n 'tipo' => '[ ' . $linha['tipo'] . ' ]',\n 'sigla' => '[ ' . $linha['tipo'] . ' ] ' . $linha['sigla']);\n }\n return $arrRetorno;\n }\n }", "public function select(){\n\t\t$sql = \"SELECT * FROM equipo_tipo\n\t\t\t\twhere equi_tip_estado = 1\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function addtecnologia($value,$marca) {\n \t\t$centros = new Zend_Db_Table('tecnologias');\n $rows = $centros->fetchAll(\n\t\t\t\t$centros->select()->from(array(\"t\" => \"tecnologias\"), array(\"t.CodTecnologia\",\"t.NombreTecnologia\"))\n ->join(array('mt' => \"marcas_tecnologias\"),\"t.CodTecnologia = mt.CodTecnologia\",array())\n ->where(\"t.CodTecnologia in (select mt.CodTecnologia from marcas_tecnologias where mt.CodMarca=$marca)\")\n ->order('t.NombreTecnologia asc')\n \t)->toArray();\n //creo el arreglo de options\n $select= array();\n $select[0]='(Seleccione una tecnologia)';\n\t\tforeach ($rows as $rowArray) {\n\t\t\t$select[$rowArray['CodTecnologia']]=$rowArray['NombreTecnologia'];\n\t\t}\n\t\t$element = new Zend_Form_Element_Select(\"tecnologia\");\n\t\t$element->setRequired(true)->setLabel('Tecnologia');\n\t\t$element->setMultiOptions($select);\n\t\t$element->setValue($value);\n\t\t$element->setAttrib('onChange','\n ajaxModeloField();');\n\t\t$element->setDecorators(array(\n 'ViewHelper',\n 'Description',\n 'Errors',\n array(array('data'=>'HtmlTag'), array('tag' => 'td')),\n array('Label', array('tag' => 'td')),\n array(array('row'=>'HtmlTag'),array('tag'=>'tr'))\n ));\n\t\t$this->espcequip->addElement($element);\n }", "function SelectPaciente($db_conx, $query = NULL) {\r\n\r\n if ($query == NULL) {\r\n $sql = \"SELECT * FROM tpaciente\";\r\n $query = mysqli_query($db_conx, $sql);\r\n }\r\n $n_columnas = $query->field_count;\r\n $n_filas = $query->num_rows;\r\n $data = '<tr class=\"row_header\">\r\n <td>COD</td> \r\n <td>Nombre / Cedula </td> \r\n <td>F. Nacimiento</td>\r\n <td>Genero / Est. Civil</td>\r\n <td>Instruccion</td>\r\n <td>Hist. Clinica</td>\r\n <td>Telefono</td>\r\n <td>Seguro / Empresa</td>\r\n <td id=\"custom-action\"></td>\r\n </tr>';\r\n while ($row = mysqli_fetch_array($query)) {\r\n $data .= '<tr class=\"row_data\">';\r\n $data .= '<td><span id=\"td_' . $row[0] . '_0\">' . $row[0] . '</span></td>'; //Cod \r\n $data .= '<td><span id=\"td_' . $row[0] . '_6\">' . $row[6] . '</span> '; //pape\r\n $data .= '<span id=\"td_' . $row[0] . '_7\">' . $row[7] . '</span> '; //sape\r\n $data .= '<span id=\"td_' . $row[0] . '_4\">' . $row[4] . '</span> '; //pnom\r\n $data .= '<span id=\"td_' . $row[0] . '_5\">' . $row[5] . '</span><br>'; //snom \r\n $data .= '<span id=\"td_' . $row[0] . '_3\">' . $row[3] . '</span></td>'; //ced\r\n $data .= '<td><span id=\"td_' . $row[0] . '_8\">' . $row[8] . '</span></td>'; //fnac\r\n $data .= '<td><span id=\"td_' . $row[0] . '_9\">' . $row[9] . '</span><br>'; //genero\r\n $data .= '<span id=\"td_' . $row[0] . '_10\">' . $row[10] . '</span></td>'; //estcivil\r\n $data .= '<td><span id=\"td_' . $row[0] . '_11\">' . $row[11] . '</span></td>'; //Instruccion\r\n $data .= '<td><span id=\"td_' . $row[0] . '_12\">' . $row[12] . '</span></td>'; //Hist Clinico\r\n $data .= '<td><span id=\"td_' . $row[0] . '_13\">' . $row[13] . '</span></td>'; //Telefono\r\n //SELECT SEGURO DESCRIPTION\r\n $temprow[1] = \"\";\r\n if (isset($row[1])) {\r\n $tempsql = \"SELECT * FROM tseguros WHERE seg_codigo = $row[1]\";\r\n $tempquery = mysqli_query($db_conx, $tempsql);\r\n $temprow = mysqli_fetch_array($tempquery);\r\n }\r\n\r\n $data .= '<td><span style=\"display:none;\" id=\"seg_' . $row[0] . '\">' . $row[1] . '</span>\r\n <span>' . $temprow[1] . '</span><br>'; //Seguro\r\n //SELECT EMPRESA DESCRIPTION\r\n $temprow[1] = \"\";\r\n if (isset($row[2])) {\r\n $tempsql = \"SELECT * FROM tempresas WHERE emp_codigo = $row[2]\";\r\n $tempquery = mysqli_query($db_conx, $tempsql);\r\n $temprow = mysqli_fetch_array($tempquery);\r\n }\r\n $data .= '<span style=\"display:none;\" id=\"emp_' . $row[0] . '\">' . $row[2] . '</span>\r\n <span>' . $temprow[1] . '</span></td>'; //Empresa\r\n\r\n $data .= '<td id=\"custom-action\"><button id=\"editar\" onclick=\"editPaciente(' . $row[0] . ')\">Editar</button></td></tr>';\r\n }\r\n echo $data;\r\n}", "public function mostrar_categorias(){\n $conexion = Conexion();\n $sql=\"SELECT * from tbl_categoria\"; \n foreach ($conexion->query($sql) as $row){\n echo \"<option value='{$row ['id_categoria']}'>{$row ['nombre']}</option>\"; \n }\n }", "function tb_ajuste_colaborador_form($selected_id = '', $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1, $ShowCancel = 0, $TemplateDV = '', $TemplateDVP = ''){\n\t// and fill it with data of record whose ID is $selected_id. If $selected_id\n\t// is empty, an empty form is shown, with only an 'Add New'\n\t// button displayed.\n\n\tglobal $Translation;\n\n\t// mm: get table permissions\n\t$arrPerm=getTablePermissions('tb_ajuste_colaborador');\n\tif(!$arrPerm[1] && $selected_id==''){ return ''; }\n\t$AllowInsert = ($arrPerm[1] ? true : false);\n\t// print preview?\n\t$dvprint = false;\n\tif($selected_id && $_REQUEST['dvprint_x'] != ''){\n\t\t$dvprint = true;\n\t}\n\n\t$filterer_colaborador_id = thisOr(undo_magic_quotes($_REQUEST['filterer_colaborador_id']), '');\n\t$filterer_gestor_id = thisOr(undo_magic_quotes($_REQUEST['filterer_gestor_id']), '');\n\n\t// populate filterers, starting from children to grand-parents\n\n\t// unique random identifier\n\t$rnd1 = ($dvprint ? rand(1000000, 9999999) : '');\n\t// combobox: dta_data\n\t$combo_dta_data = new DateCombo;\n\t$combo_dta_data->DateFormat = \"dmy\";\n\t$combo_dta_data->MinYear = 1900;\n\t$combo_dta_data->MaxYear = 2100;\n\t$combo_dta_data->DefaultDate = parseMySQLDate('<%%creationDate%%>', '<%%creationDate%%>');\n\t$combo_dta_data->MonthNames = $Translation['month names'];\n\t$combo_dta_data->NamePrefix = 'dta_data';\n\t// combobox: colaborador_id\n\t$combo_colaborador_id = new DataCombo;\n\t// combobox: str_ajuste\n\t$combo_str_ajuste = new Combo;\n\t$combo_str_ajuste->ListType = 0;\n\t$combo_str_ajuste->MultipleSeparator = ', ';\n\t$combo_str_ajuste->ListBoxHeight = 10;\n\t$combo_str_ajuste->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/tb_ajuste_colaborador.str_ajuste.csv')){\n\t\t$str_ajuste_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/tb_ajuste_colaborador.str_ajuste.csv')));\n\t\t$combo_str_ajuste->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($str_ajuste_data)));\n\t\t$combo_str_ajuste->ListData = $combo_str_ajuste->ListItem;\n\t}else{\n\t\t$combo_str_ajuste->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"Atestados/Declara&#231;&#245;es;;Duplicidade de registro;;Esquecimento;;Fora do local de trabalho;;Problemas com a localiza&#231;&#227;o;;Problemas com a rede do cliente;;Sem justificativa;;Sem m&#225;quina para registro;;Sistema fora do ar\")));\n\t\t$combo_str_ajuste->ListData = $combo_str_ajuste->ListItem;\n\t}\n\t$combo_str_ajuste->SelectName = 'str_ajuste';\n\t$combo_str_ajuste->AllowNull = false;\n\t// combobox: gestor_id\n\t$combo_gestor_id = new DataCombo;\n\n\tif($selected_id){\n\t\t// mm: check member permissions\n\t\tif(!$arrPerm[2]){\n\t\t\treturn \"\";\n\t\t}\n\t\t// mm: who is the owner?\n\t\t$ownerGroupID=sqlValue(\"select groupID from membership_userrecords where tableName='tb_ajuste_colaborador' and pkValue='\".makeSafe($selected_id).\"'\");\n\t\t$ownerMemberID=sqlValue(\"select lcase(memberID) from membership_userrecords where tableName='tb_ajuste_colaborador' and pkValue='\".makeSafe($selected_id).\"'\");\n\t\tif($arrPerm[2]==1 && getLoggedMemberID()!=$ownerMemberID){\n\t\t\treturn \"\";\n\t\t}\n\t\tif($arrPerm[2]==2 && getLoggedGroupID()!=$ownerGroupID){\n\t\t\treturn \"\";\n\t\t}\n\n\t\t// can edit?\n\t\tif(($arrPerm[3]==1 && $ownerMemberID==getLoggedMemberID()) || ($arrPerm[3]==2 && $ownerGroupID==getLoggedGroupID()) || $arrPerm[3]==3){\n\t\t\t$AllowUpdate=1;\n\t\t}else{\n\t\t\t$AllowUpdate=0;\n\t\t}\n\n\t\t$res = sql(\"select * from `tb_ajuste_colaborador` where `id`='\".makeSafe($selected_id).\"'\", $eo);\n\t\tif(!($row = db_fetch_array($res))){\n\t\t\treturn error_message($Translation['No records found'], 'tb_ajuste_colaborador_view.php', false);\n\t\t}\n\t\t$urow = $row; /* unsanitized data */\n\t\t$hc = new CI_Input();\n\t\t$row = $hc->xss_clean($row); /* sanitize data */\n\t\t$combo_dta_data->DefaultDate = $row['dta_data'];\n\t\t$combo_colaborador_id->SelectedData = $row['colaborador_id'];\n\t\t$combo_str_ajuste->SelectedData = $row['str_ajuste'];\n\t\t$combo_gestor_id->SelectedData = $row['gestor_id'];\n\t}else{\n\t\t$combo_colaborador_id->SelectedData = $filterer_colaborador_id;\n\t\t$combo_str_ajuste->SelectedText = ( $_REQUEST['FilterField'][1]=='5' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"\");\n\t\t$combo_gestor_id->SelectedData = $filterer_gestor_id;\n\t}\n\t$combo_colaborador_id->HTML = '<span id=\"colaborador_id-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"colaborador_id\" id=\"colaborador_id' . $rnd1 . '\" value=\"' . html_attr($combo_colaborador_id->SelectedData) . '\">';\n\t$combo_colaborador_id->MatchText = '<span id=\"colaborador_id-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"colaborador_id\" id=\"colaborador_id' . $rnd1 . '\" value=\"' . html_attr($combo_colaborador_id->SelectedData) . '\">';\n\t$combo_str_ajuste->Render();\n\t$combo_gestor_id->HTML = '<span id=\"gestor_id-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"gestor_id\" id=\"gestor_id' . $rnd1 . '\" value=\"' . html_attr($combo_gestor_id->SelectedData) . '\">';\n\t$combo_gestor_id->MatchText = '<span id=\"gestor_id-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"gestor_id\" id=\"gestor_id' . $rnd1 . '\" value=\"' . html_attr($combo_gestor_id->SelectedData) . '\">';\n\n\tob_start();\n\t?>\n\n\t<script>\n\t\t// initial lookup values\n\t\tAppGini.current_colaborador_id__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['colaborador_id'] : $filterer_colaborador_id); ?>\"};\n\t\tAppGini.current_gestor_id__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['gestor_id'] : $filterer_gestor_id); ?>\"};\n\n\t\tjQuery(function() {\n\t\t\tsetTimeout(function(){\n\t\t\t\tif(typeof(colaborador_id_reload__RAND__) == 'function') colaborador_id_reload__RAND__();\n\t\t\t\tif(typeof(gestor_id_reload__RAND__) == 'function') gestor_id_reload__RAND__();\n\t\t\t}, 10); /* we need to slightly delay client-side execution of the above code to allow AppGini.ajaxCache to work */\n\t\t});\n\t\tfunction colaborador_id_reload__RAND__(){\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\n\n\t\t\t$j(\"#colaborador_id-container__RAND__\").select2({\n\t\t\t\t/* initial default value */\n\t\t\t\tinitSelection: function(e, c){\n\t\t\t\t\t$j.ajax({\n\t\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: { id: AppGini.current_colaborador_id__RAND__.value, t: 'tb_ajuste_colaborador', f: 'colaborador_id' },\n\t\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t\tc({\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$j('[name=\"colaborador_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t\t$j('[id=colaborador_id-container-readonly__RAND__]').html('<span id=\"colaborador_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\n\t\t\t\t\t\t\tif(typeof(colaborador_id_update_autofills__RAND__) == 'function') colaborador_id_update_autofills__RAND__();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\twidth: '100%',\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\n\t\t\t\tminimumResultsForSearch: 10,\n\t\t\t\tloadMorePadding: 200,\n\t\t\t\tajax: {\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tcache: true,\n\t\t\t\t\tdata: function(term, page){ /* */ return { s: term, p: page, t: 'tb_ajuste_colaborador', f: 'colaborador_id' }; },\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\n\t\t\t}).on('change', function(e){\n\t\t\t\tAppGini.current_colaborador_id__RAND__.value = e.added.id;\n\t\t\t\tAppGini.current_colaborador_id__RAND__.text = e.added.text;\n\t\t\t\t$j('[name=\"colaborador_id\"]').val(e.added.id);\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\n\t\t\t\tif(typeof(colaborador_id_update_autofills__RAND__) == 'function') colaborador_id_update_autofills__RAND__();\n\t\t\t});\n\n\t\t\tif(!$j(\"#colaborador_id-container__RAND__\").length){\n\t\t\t\t$j.ajax({\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: { id: AppGini.current_colaborador_id__RAND__.value, t: 'tb_ajuste_colaborador', f: 'colaborador_id' },\n\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t$j('[name=\"colaborador_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t$j('[id=colaborador_id-container-readonly__RAND__]').html('<span id=\"colaborador_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(colaborador_id_update_autofills__RAND__) == 'function') colaborador_id_update_autofills__RAND__();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t<?php }else{ ?>\n\n\t\t\t$j.ajax({\n\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: { id: AppGini.current_colaborador_id__RAND__.value, t: 'tb_ajuste_colaborador', f: 'colaborador_id' },\n\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t$j('[id=colaborador_id-container__RAND__], [id=colaborador_id-container-readonly__RAND__]').html('<span id=\"colaborador_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\t\t\t\t\tif(typeof(colaborador_id_update_autofills__RAND__) == 'function') colaborador_id_update_autofills__RAND__();\n\t\t\t\t}\n\t\t\t});\n\t\t<?php } ?>\n\n\t\t}\n\t\tfunction gestor_id_reload__RAND__(){\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\n\n\t\t\t$j(\"#gestor_id-container__RAND__\").select2({\n\t\t\t\t/* initial default value */\n\t\t\t\tinitSelection: function(e, c){\n\t\t\t\t\t$j.ajax({\n\t\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: { id: AppGini.current_gestor_id__RAND__.value, t: 'tb_ajuste_colaborador', f: 'gestor_id' },\n\t\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t\tc({\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$j('[name=\"gestor_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t\t$j('[id=gestor_id-container-readonly__RAND__]').html('<span id=\"gestor_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\n\t\t\t\t\t\t\tif(typeof(gestor_id_update_autofills__RAND__) == 'function') gestor_id_update_autofills__RAND__();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\twidth: '100%',\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\n\t\t\t\tminimumResultsForSearch: 10,\n\t\t\t\tloadMorePadding: 200,\n\t\t\t\tajax: {\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tcache: true,\n\t\t\t\t\tdata: function(term, page){ /* */ return { s: term, p: page, t: 'tb_ajuste_colaborador', f: 'gestor_id' }; },\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\n\t\t\t}).on('change', function(e){\n\t\t\t\tAppGini.current_gestor_id__RAND__.value = e.added.id;\n\t\t\t\tAppGini.current_gestor_id__RAND__.text = e.added.text;\n\t\t\t\t$j('[name=\"gestor_id\"]').val(e.added.id);\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\n\t\t\t\tif(typeof(gestor_id_update_autofills__RAND__) == 'function') gestor_id_update_autofills__RAND__();\n\t\t\t});\n\n\t\t\tif(!$j(\"#gestor_id-container__RAND__\").length){\n\t\t\t\t$j.ajax({\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: { id: AppGini.current_gestor_id__RAND__.value, t: 'tb_ajuste_colaborador', f: 'gestor_id' },\n\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t$j('[name=\"gestor_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t$j('[id=gestor_id-container-readonly__RAND__]').html('<span id=\"gestor_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(gestor_id_update_autofills__RAND__) == 'function') gestor_id_update_autofills__RAND__();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t<?php }else{ ?>\n\n\t\t\t$j.ajax({\n\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: { id: AppGini.current_gestor_id__RAND__.value, t: 'tb_ajuste_colaborador', f: 'gestor_id' },\n\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t$j('[id=gestor_id-container__RAND__], [id=gestor_id-container-readonly__RAND__]').html('<span id=\"gestor_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\t\t\t\t\tif(typeof(gestor_id_update_autofills__RAND__) == 'function') gestor_id_update_autofills__RAND__();\n\t\t\t\t}\n\t\t\t});\n\t\t<?php } ?>\n\n\t\t}\n\t</script>\n\t<?php\n\n\t$lookups = str_replace('__RAND__', $rnd1, ob_get_contents());\n\tob_end_clean();\n\n\n\t// code for template based detail view forms\n\n\t// open the detail view template\n\tif($dvprint){\n\t\t$template_file = is_file(\"./{$TemplateDVP}\") ? \"./{$TemplateDVP}\" : './templates/tb_ajuste_colaborador_templateDVP.html';\n\t\t$templateCode = @file_get_contents($template_file);\n\t}else{\n\t\t$template_file = is_file(\"./{$TemplateDV}\") ? \"./{$TemplateDV}\" : './templates/tb_ajuste_colaborador_templateDV.html';\n\t\t$templateCode = @file_get_contents($template_file);\n\t}\n\n\t// process form title\n\t$templateCode = str_replace('<%%DETAIL_VIEW_TITLE%%>', 'Detalhes do Ajuste de Colaborador', $templateCode);\n\t$templateCode = str_replace('<%%RND1%%>', $rnd1, $templateCode);\n\t$templateCode = str_replace('<%%EMBEDDED%%>', ($_REQUEST['Embedded'] ? 'Embedded=1' : ''), $templateCode);\n\t// process buttons\n\tif($AllowInsert){\n\t\tif(!$selected_id) $templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-success\" id=\"insert\" name=\"insert_x\" value=\"1\" onclick=\"return tb_ajuste_colaborador_validateData();\"><i class=\"glyphicon glyphicon-plus-sign\"></i> ' . $Translation['Save New'] . '</button>', $templateCode);\n\t\t$templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"insert\" name=\"insert_x\" value=\"1\" onclick=\"return tb_ajuste_colaborador_validateData();\"><i class=\"glyphicon glyphicon-plus-sign\"></i> ' . $Translation['Save As Copy'] . '</button>', $templateCode);\n\t}else{\n\t\t$templateCode = str_replace('<%%INSERT_BUTTON%%>', '', $templateCode);\n\t}\n\n\t// 'Back' button action\n\tif($_REQUEST['Embedded']){\n\t\t$backAction = 'AppGini.closeParentModal(); return false;';\n\t}else{\n\t\t$backAction = '$j(\\'form\\').eq(0).attr(\\'novalidate\\', \\'novalidate\\'); document.myform.reset(); return true;';\n\t}\n\n\tif($selected_id){\n\t\tif(!$_REQUEST['Embedded']) $templateCode = str_replace('<%%DVPRINT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"dvprint\" name=\"dvprint_x\" value=\"1\" onclick=\"$$(\\'form\\')[0].writeAttribute(\\'novalidate\\', \\'novalidate\\'); document.myform.reset(); return true;\" title=\"' . html_attr($Translation['Print Preview']) . '\"><i class=\"glyphicon glyphicon-print\"></i> ' . $Translation['Print Preview'] . '</button>', $templateCode);\n\t\tif($AllowUpdate){\n\t\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-success btn-lg\" id=\"update\" name=\"update_x\" value=\"1\" onclick=\"return tb_ajuste_colaborador_validateData();\" title=\"' . html_attr($Translation['Save Changes']) . '\"><i class=\"glyphicon glyphicon-ok\"></i> ' . $Translation['Save Changes'] . '</button>', $templateCode);\n\t\t}else{\n\t\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);\n\t\t}\n\t\tif(($arrPerm[4]==1 && $ownerMemberID==getLoggedMemberID()) || ($arrPerm[4]==2 && $ownerGroupID==getLoggedGroupID()) || $arrPerm[4]==3){ // allow delete?\n\t\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-danger\" id=\"delete\" name=\"delete_x\" value=\"1\" onclick=\"return confirm(\\'' . $Translation['are you sure?'] . '\\');\" title=\"' . html_attr($Translation['Delete']) . '\"><i class=\"glyphicon glyphicon-trash\"></i> ' . $Translation['Delete'] . '</button>', $templateCode);\n\t\t}else{\n\t\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);\n\t\t}\n\t\t$templateCode = str_replace('<%%DESELECT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"deselect\" name=\"deselect_x\" value=\"1\" onclick=\"' . $backAction . '\" title=\"' . html_attr($Translation['Back']) . '\"><i class=\"glyphicon glyphicon-chevron-left\"></i> ' . $Translation['Back'] . '</button>', $templateCode);\n\t}else{\n\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%DESELECT_BUTTON%%>', ($ShowCancel ? '<button type=\"submit\" class=\"btn btn-default\" id=\"deselect\" name=\"deselect_x\" value=\"1\" onclick=\"' . $backAction . '\" title=\"' . html_attr($Translation['Back']) . '\"><i class=\"glyphicon glyphicon-chevron-left\"></i> ' . $Translation['Back'] . '</button>' : ''), $templateCode);\n\t}\n\n\t// set records to read only if user can't insert new records and can't edit current record\n\tif(($selected_id && !$AllowUpdate && !$AllowInsert) || (!$selected_id && !$AllowInsert)){\n\t\t$jsReadOnly .= \"\\tjQuery('#dta_data').prop('readonly', true);\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#dta_dataDay, #dta_dataMonth, #dta_dataYear').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#colaborador_id').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#colaborador_id_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#str_ajuste').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"str_ajuste\\\">' + (jQuery('#str_ajuste').val() || '') + '</div>'); jQuery('#str_ajuste-multi-selection-help').hide();\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#bol_evidencia').prop('disabled', true);\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#int_quantidade').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"int_quantidade\\\">' + (jQuery('#int_quantidade').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#gestor_id').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#gestor_id_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#bol_notificacao').prop('disabled', true);\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('.select2-container').hide();\\n\";\n\n\t\t$noUploads = true;\n\t}elseif($AllowInsert){\n\t\t$jsEditable .= \"\\tjQuery('form').eq(0).data('already_changed', true);\"; // temporarily disable form change handler\n\t\t\t$jsEditable .= \"\\tjQuery('form').eq(0).data('already_changed', false);\"; // re-enable form change handler\n\t}\n\n\t// process combos\n\t$templateCode = str_replace('<%%COMBO(dta_data)%%>', ($selected_id && !$arrPerm[3] ? '<div class=\"form-control-static\">' . $combo_dta_data->GetHTML(true) . '</div>' : $combo_dta_data->GetHTML()), $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(dta_data)%%>', $combo_dta_data->GetHTML(true), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(colaborador_id)%%>', $combo_colaborador_id->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(colaborador_id)%%>', $combo_colaborador_id->MatchText, $templateCode);\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(colaborador_id)%%>', urlencode($combo_colaborador_id->MatchText), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(str_ajuste)%%>', $combo_str_ajuste->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(str_ajuste)%%>', $combo_str_ajuste->SelectedData, $templateCode);\n\t$templateCode = str_replace('<%%COMBO(gestor_id)%%>', $combo_gestor_id->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(gestor_id)%%>', $combo_gestor_id->MatchText, $templateCode);\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(gestor_id)%%>', urlencode($combo_gestor_id->MatchText), $templateCode);\n\n\t/* lookup fields array: 'lookup field name' => array('parent table name', 'lookup field caption') */\n\t$lookup_fields = array( 'colaborador_id' => array('tb_contratacao', 'Colaborador'), 'gestor_id' => array('tb_contratacao', 'Gestor'));\n\tforeach($lookup_fields as $luf => $ptfc){\n\t\t$pt_perm = getTablePermissions($ptfc[0]);\n\n\t\t// process foreign key links\n\t\tif($pt_perm['view'] || $pt_perm['edit']){\n\t\t\t$templateCode = str_replace(\"<%%PLINK({$luf})%%>\", '<button type=\"button\" class=\"btn btn-default view_parent hspacer-md\" id=\"' . $ptfc[0] . '_view_parent\" title=\"' . html_attr($Translation['View'] . ' ' . $ptfc[1]) . '\"><i class=\"glyphicon glyphicon-eye-open\"></i></button>', $templateCode);\n\t\t}\n\n\t\t// if user has insert permission to parent table of a lookup field, put an add new button\n\t\tif($pt_perm['insert'] && !$_REQUEST['Embedded']){\n\t\t\t$templateCode = str_replace(\"<%%ADDNEW({$ptfc[0]})%%>\", '<button type=\"button\" class=\"btn btn-success add_new_parent hspacer-md\" id=\"' . $ptfc[0] . '_add_new\" title=\"' . html_attr($Translation['Add New'] . ' ' . $ptfc[1]) . '\"><i class=\"glyphicon glyphicon-plus-sign\"></i></button>', $templateCode);\n\t\t}\n\t}\n\n\t// process images\n\t$templateCode = str_replace('<%%UPLOADFILE(id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_responsavel)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(dta_data)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(colaborador_id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_ajuste)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(bol_evidencia)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(int_quantidade)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(gestor_id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(bol_notificacao)%%>', '', $templateCode);\n\n\t// process values\n\tif($selected_id){\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(id)%%>', safe_html($urow['id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(id)%%>', html_attr($row['id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(id)%%>', urlencode($urow['id']), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_responsavel)%%>', safe_html($urow['str_responsavel']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_responsavel)%%>', urlencode($urow['str_responsavel']), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(dta_data)%%>', @date('d/m/Y', @strtotime(html_attr($row['dta_data']))), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(dta_data)%%>', urlencode(@date('d/m/Y', @strtotime(html_attr($urow['dta_data'])))), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(colaborador_id)%%>', safe_html($urow['colaborador_id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(colaborador_id)%%>', html_attr($row['colaborador_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(colaborador_id)%%>', urlencode($urow['colaborador_id']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(str_ajuste)%%>', safe_html($urow['str_ajuste']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(str_ajuste)%%>', html_attr($row['str_ajuste']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_ajuste)%%>', urlencode($urow['str_ajuste']), $templateCode);\n\t\t$templateCode = str_replace('<%%CHECKED(bol_evidencia)%%>', ($row['bol_evidencia'] ? \"checked\" : \"\"), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(int_quantidade)%%>', safe_html($urow['int_quantidade']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(int_quantidade)%%>', html_attr($row['int_quantidade']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(int_quantidade)%%>', urlencode($urow['int_quantidade']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(gestor_id)%%>', safe_html($urow['gestor_id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(gestor_id)%%>', html_attr($row['gestor_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(gestor_id)%%>', urlencode($urow['gestor_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%CHECKED(bol_notificacao)%%>', ($row['bol_notificacao'] ? \"checked\" : \"\"), $templateCode);\n\t}else{\n\t\t$templateCode = str_replace('<%%VALUE(id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_responsavel)%%>', '<%%creatorUsername%%>', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_responsavel)%%>', urlencode('<%%creatorUsername%%>'), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(dta_data)%%>', '<%%creationDate%%>', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(dta_data)%%>', urlencode('<%%creationDate%%>'), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(colaborador_id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(colaborador_id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_ajuste)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_ajuste)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%CHECKED(bol_evidencia)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(int_quantidade)%%>', '1', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(int_quantidade)%%>', urlencode('1'), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(gestor_id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(gestor_id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%CHECKED(bol_notificacao)%%>', '', $templateCode);\n\t}\n\n\t// process translations\n\tforeach($Translation as $symbol=>$trans){\n\t\t$templateCode = str_replace(\"<%%TRANSLATION($symbol)%%>\", $trans, $templateCode);\n\t}\n\n\t// clear scrap\n\t$templateCode = str_replace('<%%', '<!-- ', $templateCode);\n\t$templateCode = str_replace('%%>', ' -->', $templateCode);\n\n\t// hide links to inaccessible tables\n\tif($_REQUEST['dvprint_x'] == ''){\n\t\t$templateCode .= \"\\n\\n<script>\\$j(function(){\\n\";\n\t\t$arrTables = getTableList();\n\t\tforeach($arrTables as $name => $caption){\n\t\t\t$templateCode .= \"\\t\\$j('#{$name}_link').removeClass('hidden');\\n\";\n\t\t\t$templateCode .= \"\\t\\$j('#xs_{$name}_link').removeClass('hidden');\\n\";\n\t\t}\n\n\t\t$templateCode .= $jsReadOnly;\n\t\t$templateCode .= $jsEditable;\n\n\t\tif(!$selected_id){\n\t\t}\n\n\t\t$templateCode.=\"\\n});</script>\\n\";\n\t}\n\n\t// ajaxed auto-fill fields\n\t$templateCode .= '<script>';\n\t$templateCode .= '$j(function() {';\n\n\n\t$templateCode.=\"});\";\n\t$templateCode.=\"</script>\";\n\t$templateCode .= $lookups;\n\n\t// handle enforced parent values for read-only lookup fields\n\n\t// don't include blank images in lightbox gallery\n\t$templateCode = preg_replace('/blank.gif\" data-lightbox=\".*?\"/', 'blank.gif\"', $templateCode);\n\n\t// don't display empty email links\n\t$templateCode=preg_replace('/<a .*?href=\"mailto:\".*?<\\/a>/', '', $templateCode);\n\n\t/* default field values */\n\t$rdata = $jdata = get_defaults('tb_ajuste_colaborador');\n\tif($selected_id){\n\t\t$jdata = get_joined_record('tb_ajuste_colaborador', $selected_id);\n\t\tif($jdata === false) $jdata = get_defaults('tb_ajuste_colaborador');\n\t\t$rdata = $row;\n\t}\n\t$templateCode .= loadView('tb_ajuste_colaborador-ajax-cache', array('rdata' => $rdata, 'jdata' => $jdata));\n\n\t// hook: tb_ajuste_colaborador_dv\n\tif(function_exists('tb_ajuste_colaborador_dv')){\n\t\t$args=array();\n\t\ttb_ajuste_colaborador_dv(($selected_id ? $selected_id : FALSE), getMemberInfo(), $templateCode, $args);\n\t}\n\n\treturn $templateCode;\n}", "public function select(){\n\t\t$sql = \"SELECT * FROM cargo\n\t\t\t\twhere car_estado = 1\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "function generateHTMLcboProjects_tabla($selected=\"\", $class=\"\",$onchange){\n\t\t\t\treturn arraySelectJs($this->Projects(), \"project_id_todo[]\", \"class=\\\"$class\\\" \". $onchange, $selected, true);\n\t\t\t}", "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 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}", "public function initialize()\n\t{\n\t // attributes\n\t\t$this->setName('tbaluno');\n\t\t$this->setPhpName('Tbaluno');\n\t\t$this->setClassname('Tbaluno');\n\t\t$this->setPackage('lib.model');\n\t\t$this->setUseIdGenerator(true);\n\t\t$this->setPrimaryKeyMethodInfo('tbpessoa_id_pessoa_seq');\n\t\t// columns\n\t\t$this->addColumn('ID_PESSOA', 'IdPessoa', 'INTEGER', true, null, null);\n\t\t$this->addPrimaryKey('MATRICULA', 'Matricula', 'BIGINT', true, null, null);\n\t\t$this->addColumn('NOME', 'Nome', 'VARCHAR', true, 100, null);\n\t\t$this->addColumn('CELULAR', 'Celular', 'VARCHAR', false, 15, null);\n\t\t$this->addColumn('EMAIL', 'Email', 'VARCHAR', false, 100, null);\n\t\t$this->addColumn('FONE_RESIDENCIAL', 'FoneResidencial', 'VARCHAR', false, 15, null);\n\t\t$this->addColumn('FOTO', 'Foto', 'BLOB', false, null, null);\n\t\t$this->addForeignKey('ID_NECES_ESPECIAL', 'IdNecesEspecial', 'VARCHAR', 'tbnecesespecial', 'ID_NECES_ESPECIAL', true, 255, null);\n\t\t$this->addColumn('DT_NASCIMENTO', 'DtNascimento', 'DATE', true, null, null);\n\t\t$this->addForeignKey('NATURALIDADE', 'Naturalidade', 'INTEGER', 'tbcidade', 'ID_CIDADE', true, null, null);\n\t\t$this->addColumn('UF_NASCIMENTO', 'UfNascimento', 'CHAR', false, 2, null);\n\t\t$this->addForeignKey('NACIONALIDADE', 'Nacionalidade', 'INTEGER', 'tbpais', 'ID_PAIS', true, null, null);\n\t\t$this->addColumn('SEXO', 'Sexo', 'CHAR', true, 1, null);\n\t\t$this->addColumn('ESTADO_CIVIL', 'EstadoCivil', 'VARCHAR', false, 15, null);\n\t\t$this->addColumn('TITULO', 'Titulo', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('TITULO_ZONA', 'TituloZona', 'INTEGER', false, null, null);\n\t\t$this->addColumn('TITULO_SECAO', 'TituloSecao', 'INTEGER', false, null, null);\n\t\t$this->addColumn('RG', 'Rg', 'VARCHAR', true, 20, null);\n\t\t$this->addColumn('RG_DT_EXPED', 'RgDtExped', 'DATE', false, null, null);\n\t\t$this->addColumn('RG_ORG_EXPED', 'RgOrgExped', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('CPF', 'Cpf', 'VARCHAR', true, 11, null);\n\t\t$this->addColumn('RESERVISTA', 'Reservista', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('PAI', 'Pai', 'VARCHAR', false, 50, null);\n\t\t$this->addColumn('MAE', 'Mae', 'VARCHAR', false, 50, null);\n\t\t$this->addForeignKey('CEP', 'Cep', 'VARCHAR', 'tblogradouro', 'CEP', true, 9, null);\n\t\t$this->addColumn('NUMERO', 'Numero', 'VARCHAR', true, 8, null);\n\t\t$this->addColumn('COMPLEMENTO', 'Complemento', 'VARCHAR', false, 50, null);\n\t\t$this->addForeignKey('ID_VERSAO_CURSO', 'IdVersaoCurso', 'INTEGER', 'tbcursoversao', 'ID_VERSAO_CURSO', true, null, null);\n\t\t$this->addForeignKey('ID_TIPO_INGRESSO', 'IdTipoIngresso', 'INTEGER', 'tbtipoingresso', 'ID_TIPO_INGRESSO', true, null, null);\n\t\t$this->addColumn('DT_INGRESSO', 'DtIngresso', 'DATE', true, null, null);\n\t\t$this->addForeignKey('ID_SITUACAO', 'IdSituacao', 'INTEGER', 'tbalunosituacao', 'ID_SITUACAO', true, null, null);\n\t\t$this->addColumn('DT_SITUACAO', 'DtSituacao', 'DATE', false, null, null);\n\t\t$this->addForeignKey('ID_DESTINO', 'IdDestino', 'INTEGER', 'tbinstexterna', 'ID_INST_EXTERNA', false, null, null);\n\t\t$this->addForeignKey('ID_2GRAU', 'Id2grau', 'INTEGER', 'tbinstexterna', 'ID_INST_EXTERNA', false, null, null);\n\t\t$this->addColumn('ANO_CONCL_2GRAU', 'AnoConcl2grau', 'INTEGER', false, null, null);\n\t\t$this->addForeignKey('ID_3GRAU', 'Id3grau', 'INTEGER', 'tbinstexterna', 'ID_INST_EXTERNA', false, null, null);\n\t\t$this->addColumn('ANO_CONCL_3GRAU', 'AnoConcl3grau', 'INTEGER', false, null, null);\n\t\t$this->addForeignKey('ID_TRABALHO', 'IdTrabalho', 'INTEGER', 'tbinstexterna', 'ID_INST_EXTERNA', false, null, null);\n\t\t$this->addForeignKey('CEP_TRABALHO', 'CepTrabalho', 'VARCHAR', 'tblogradouro', 'CEP', false, 8, null);\n\t\t$this->addColumn('FONE_TRABALHO', 'FoneTrabalho', 'VARCHAR', false, 15, null);\n\t\t$this->addColumn('RAMAL_TRABALHO', 'RamalTrabalho', 'VARCHAR', false, 5, null);\n\t\t$this->addColumn('MEDIA_GERAL', 'MediaGeral', 'NUMERIC', false, 10, null);\n\t\t$this->addColumn('CH_ELETIVA_CURSADA', 'ChEletivaCursada', 'INTEGER', false, null, null);\n\t\t$this->addColumn('CH_ELETIVA_SOLICITADA', 'ChEletivaSolicitada', 'INTEGER', false, null, null);\n\t\t$this->addColumn('CH_OBRIG_CURSADA', 'ChObrigCursada', 'INTEGER', false, null, null);\n\t\t$this->addColumn('CH_OBRIG_SOLICITADA', 'ChObrigSolicitada', 'INTEGER', false, null, null);\n\t\t$this->addColumn('CH_TOTAL', 'ChTotal', 'INTEGER', false, null, null);\n\t\t$this->addColumn('OP_INGRESSO', 'OpIngresso', 'INTEGER', false, null, 0);\n\t\t$this->addForeignKey('ID_POLO', 'IdPolo', 'INTEGER', 'tbpolos', 'ID_POLO', true, null, 0);\n\t\t$this->addColumn('CREATED_AT', 'CreatedAt', 'DATE', false, null, null);\n\t\t$this->addColumn('UPDATED_AT', 'UpdatedAt', 'DATE', false, null, null);\n\t\t$this->addColumn('CREATED_BY', 'CreatedBy', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('UPDATED_BY', 'UpdatedBy', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('ID_ANTIGO', 'IdAntigo', 'INTEGER', false, null, null);\n\t\t$this->addForeignKey('ID_RACA', 'IdRaca', 'INTEGER', 'tbaluno_racacor', 'ID_RACA', true, null, null);\n\t\t$this->addColumn('ENADE', 'Enade', 'BOOLEAN', false, null, false);\n\t\t// validators\n\t}", "function modificarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_ime';\n\t\t$this->transaccion='WF_tabla_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tabla','id_tabla','int4');\n\t\t$this->setParametro('id_tipo_proceso','id_tipo_proceso','int4');\n\t\t$this->setParametro('vista_id_tabla_maestro','vista_id_tabla_maestro','int4');\n\t\t$this->setParametro('bd_scripts_extras','bd_scripts_extras','text');\n\t\t$this->setParametro('vista_campo_maestro','vista_campo_maestro','varchar');\n\t\t$this->setParametro('vista_scripts_extras','vista_scripts_extras','text');\n\t\t$this->setParametro('bd_descripcion','bd_descripcion','text');\n\t\t$this->setParametro('vista_tipo','vista_tipo','varchar');\n\t\t$this->setParametro('menu_icono','menu_icono','varchar');\n\t\t$this->setParametro('menu_nombre','menu_nombre','varchar');\n\t\t$this->setParametro('vista_campo_ordenacion','vista_campo_ordenacion','varchar');\n\t\t$this->setParametro('vista_posicion','vista_posicion','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('menu_codigo','menu_codigo','varchar');\n\t\t$this->setParametro('bd_nombre_tabla','bd_nombre_tabla','varchar');\n\t\t$this->setParametro('bd_codigo_tabla','bd_codigo_tabla','varchar');\n\t\t$this->setParametro('vista_dir_ordenacion','vista_dir_ordenacion','varchar');\n\t\t$this->setParametro('vista_estados_new','vista_estados_new','varchar');\n\t\t$this->setParametro('vista_estados_delete','vista_estados_delete','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function setInstancia($tabla){\r\n\t\t//DB_DataObject::debugLevel(1);\r\n\t\t//Crea una nueva instancia de $tabla a partir de DataObject\r\n\t\t$objDBO = DB_DataObject::Factory($tabla);\r\n\t\t\r\n\t\t$campos = $objDBO->table();\r\n\t\tunset($campos[\"id\"]);\r\n\t\tunset($campos[\"fecha\"]);\r\n\t\t\r\n\t\t//Asigna los valores\r\n\t\tforeach($campos as $key => $value){\r\n\t\t\t$objDBO->$key = utf8_decode($this->$key);\r\n\t\t}\r\n\t\t$objDBO->fecha = date(\"Y-m-d H:i:s\");\r\n\t\t$objDBO->find();\r\n\t\tif($objDBO->fetch()){\r\n\t\t\t$ret = $objDBO->id;\r\n\t\t}else{\r\n\t\t\t$ret = $objDBO->insert();\r\n\t\t}\r\n\t\t\r\n\t\t//Libera el objeto DBO\r\n\t\t$objDBO->free();\r\n\t\t\r\n\r\n\t\treturn ($ret);\r\n\t}", "function frmEstimacionesShow($sender, $params)\n {\n $items[\"uno\"]=\"ADICIONAL\";\n $items[\"dos\"]=\"ADITIVA/DEDUCTIVA\";\n $items[\"tres\"]=\"EXTRAORDINARIA\";\n $items[\"cuatro\"]=\"NORMAL\";\n $this->cboTipo->setItems($items);\n $this->txtMoneda->Text=\"MONEDA NACIONAL\";\n }", "function select_tb_penduduk(){\n\t\t$this->load->model('mamdani');\n\t\t//$klasifikasi['klasifikasi']=$this->mamdani->getdata();\n\t\t$klasifikasi['jumlah_aset']=$this->mamdani->jumlah_aset();\n\t\t$klasifikasi['tingkat']= $this->mamdani->klasifikasi3();\n\n\t\t$this->load->view('templates/header');\n\t\t$this->load->view('admin/lihatdata/tabel_klasifikasi_penduduk',$klasifikasi);\n\t\t$this->load->view('templates/footer');\n\t\t// var_dump($jml_aset);\n\t\t// die;\n\n\t}", "public function RelatorioCentroCusto($idobra, $idcentro) {\n $obra = new clsObra();\n $obra->preencheDados($idobra);\n\n $centroNome = \"\";\n if ($idcentro > 0) {\n $centro = new clsCentroCusto();\n $centro->RetornaCentroCusto($idcentro);\n $centroNome = \" - Centro de Custo: \" . $centro->getDescCentro();\n }\n\n $html = '<table border = \"3\" cellspacing = \"2\" cellpadding = \"2\">\n <tr height = \"2\">\n </br>\n <b><span style=\"font-size: 20px\">Retirada de Material</span></b>\n </br>\n <span align=\"center\" style=\"font-size: 20px\">Obra: ' . $obra->getDescricao() . $centroNome . '</span>\n <th align = \"center\" class = \"small\" width = \"150px\">Data Retirada</th>\n <th align = \"center\" class = \"small\" width = \"600px\">Material</th>\n <th align = \"center\" class = \"small\" width = \"150px\">Quantidade</th>\n </tr>';\n\n\n $SQL = \"SELECT re.QUANTRETIRADA, re.DATARETESTOQUE, CONCAT(mt.DESCMATERIAL, ' / ' , un.SIGLAUNID) MATERIAL\n FROM retirada_estoque re\n INNER JOIN material mt\n ON re.IDMATERIAL = mt.IDMATERIAL\n INNER JOIN unidade un\n ON re.IDUNIDADE = un.IDUNIDADE\n WHERE re.IDOBRA = \" . $idobra . \"\";\n//die($SQL);\n if ($idcentro > 0) {\n $SQL.=\" AND re.IDCENTRO =\" . $idcentro . \" \";\n }\n\n\n $SQL.=\" ORDER BY STR_TO_DATE(re.DATARETESTOQUE,'%d/%m/%Y'), mt.DESCMATERIAL \";\n\n $con = new gtiConexao();\n $con->gtiConecta();\n $tbl = $con->gtiPreencheTabela($SQL);\n $con->gtiDesconecta();\n\n //die($SQL);\n foreach ($tbl as $chave => $linha) {\n\n $html .= ' <tr height = \"1\">\n <td align = \"center\" class = \"small\" width = \"100px\"> ' . htmlentities($linha['DATARETESTOQUE']) . ' </td>\n <td align = \"center\" class = \"small\" width = \"100px\"> ' . htmlentities($linha['MATERIAL']) . ' </td>\n <td align = \"center\" class = \"small\" width = \"100px\"> ' . $linha['QUANTRETIRADA'] . ' </td>\n </tr>';\n }\n\n\n $html .= '</table> ';\n\n\n\n\n\n\n $html .= '<table border = \"3\" cellspacing = \"2\" cellpadding = \"2\">\n <tr height = \"2\">\n </br>\n <b><span style=\"font-size: 20px\">Retirada de Material - Soma Geral</span></b> \n <th align = \"center\" class = \"small\" width = \"650px\">Material</th>\n <th align = \"center\" class = \"small\" width = \"250px\">Quantidade</th>\n </tr>';\n\n\n $SQL = \"SELECT SUM(re.QUANTRETIRADA) SOMA, re.DATARETESTOQUE, CONCAT(mt.DESCMATERIAL, ' / ' , un.SIGLAUNID) MATERIAL\n FROM retirada_estoque re\n INNER JOIN material mt\n ON re.IDMATERIAL = mt.IDMATERIAL\n INNER JOIN unidade un\n ON re.IDUNIDADE = un.IDUNIDADE\n WHERE re.IDOBRA = \" . $idobra . \"\";\n//die($SQL);\n if ($idcentro > 0) {\n $SQL.=\" AND re.IDCENTRO =\" . $idcentro . \" \";\n }\n\n\n $SQL.=\" GROUP BY mt.DESCMATERIAL \n ORDER BY mt.DESCMATERIAL \";\n\n $con = new gtiConexao();\n $con->gtiConecta();\n $tbl = $con->gtiPreencheTabela($SQL);\n $con->gtiDesconecta();\n\n //die($SQL);\n foreach ($tbl as $chave => $linha) {\n\n $html .= ' <tr height = \"1\"> \n <td align = \"center\" class = \"small\" width = \"100px\"> ' . htmlentities($linha['MATERIAL']) . ' </td>\n <td align = \"center\" class = \"small\" width = \"100px\"> ' . $linha['SOMA'] . ' </td>\n </tr>';\n }\n\n\n $html .= '</table> ';\n\n\n\n\n\n //die(print_r($arrayNota));\n\n return $html;\n }", "private function tbl_guiones_registro() {\r\n\t\t\t$this->guiones_registro = $this->esquema->createTable('GUIONES_REGISTRO');\r\n\t\t\t$this->guiones_registro->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del registro del guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('FECHA', 'datetime', array(\r\n\t\t\t\t'notnull' => false,\r\n\t\t\t\t'comment' => 'Fecha de ingreso del registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('USUARIO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del usuario del registro [ID de la tabla USUARIOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('TIPO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del tipo de registro [ID de la tabla GUIONES_REGISTRO_TIPO]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('AFECTACION', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la afectacion del registro [ID de la tabla GUIONES_REGISTRO_AFECTACION]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('AVISO', 'bigint', array(\r\n\t\t\t\t'notnull' => false,\r\n\t\t\t\t'default' => 0,\r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'Numero del aviso del registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('UBICACION', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la UBICACION del registro [ID de la tabla GUIONES_REGISTRO_UBICACION]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->usuarios, array('USUARIO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_tipo, array('TIPO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_afectacion, array('AFECTACION'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_ubicacion, array('UBICACION'), array('ID'), $this->opcForeign);\r\n\t\t}", "function ListaZonaHoraria()\n {\n $this->Consulta(\"*\",\"zonashorarias\",\"\");\n // Contar la cantidad de resultados\n $this->Filas = mysql_num_rows($this->Resultado);\n if( $this->Filas > 0){\n for( $i=0; $i < $this->Filas; $i++ ) {\n // Obtener resultados\n $Columnas = mysql_fetch_assoc($this->Resultado);\n echo \"<option value=\\\"\".$Columnas['id'].\"\\\">\".$Columnas['nombre'].\"</option>\";\n }\n }else{\n echo \"<option value=\\\"0\\\">No hay datos</option>\";\n }\n }", "function select($id){\r\n\t\t$sql = \"SELECT * FROM gestaoti.unidade_organizacional WHERE seq_unidade_organizacional = $id\";\r\n\t\t$result = $this->database->query($sql);\r\n\t\t$result = $this->database->result;\r\n\r\n\t\t$row = pg_fetch_object($result);\r\n\t\t$this->SEQ_UNIDADE_ORGANIZACIONAL = $row->seq_unidade_organizacional;\r\n\t\t$this->NOM_UNIDADE_ORGANIZACIONAL = $row->nom_unidade_organizacional;\r\n\t\t$this->SEQ_UNIDADE_ORGANIZACIONAL_PAI = $row->seq_unidade_organizacional_pai;\r\n\t\t$this->SGL_UNIDADE_ORGANIZACIONAL = $row->sgl_unidade_organizacional;\r\n\t}", "private function tbl_usuarios_empresa() {\r\n\t\t\t$this->usuarios_empresa = $this->esquema->createTable('USUARIOS_EMPRESA');\r\n\t\t\t$this->usuarios_empresa->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la Empresa'\r\n\t\t\t));\r\n\t\t\t$this->usuarios_empresa->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la Empresa'\r\n\t\t\t));\r\n\t\t\t$this->usuarios_empresa->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'Estado de la Empresa [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->usuarios_empresa->setPrimaryKey(array('ID'));\r\n\t\t\t$this->usuarios_empresa->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}", "public function createTable(){\nreturn $this->pdo->exec(\n\"CREATE TABLE `sottocategoria` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `codice_categoria` varchar(3) NOT NULL,\n `codice` varchar(3) NOT NULL,\n `descrizione` varchar(80) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `index_codice_cat` (`codice_categoria`),\n KEY `index_codice` (`codice`),\n CONSTRAINT `fk_categoriasottocategoria_1` FOREIGN KEY (`codice_categoria`) REFERENCES `categoria` (`codice`) ON DELETE NO ACTION ON UPDATE NO ACTION\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\"\n);\n}", "public function getSelect($param) {\n //operario y poder seleccionar el operario que va ser foranea en otra tabla\n $json = FALSE;\n extract($param);\n $select = \"\";\n $select .= \"<option value='0'>Seleccione un Operario</option>\";\n foreach ($conexion->getPDO()->query(\"SELECT fk_usuario, nombres FROM operario ORDER BY nombres\") as $fila) {\n $select .= \"<option value='{$fila['fk_usuario']}'>{$fila['fk_usuario']} - {$fila['nombres']}</option>\";\n }\n echo $json ? json_encode($select) : (\"<select id='$id'>$select</select>\");\n }", "public function mostrarTablasMaestras(){\n\t\tif($_GET[\"bd\"] == \"vtama_tipo_producto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/tipoProducto.controlador.php\";\n\t\t\trequire_once \"../models/tipoProducto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$entrada = \"tablaMaestra\";\n\t\t\t$tipoProductos = ControladorTipoProducto::ctrMostrarTipoProducto($item,$valor,$entrada);\n\t\t\tif(count($tipoProductos) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($tipoProductos); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarTipoProducto' codTipoProducto='\".$tipoProductos[$i][\"cod_tipo_producto\"].\"' data-toggle='modal' data-target='#modalTipoProducto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarTipoProducto' codTipoProducto='\".$tipoProductos[$i][\"cod_tipo_producto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[ \n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($tipoProductos[$i][\"dsc_tipo_producto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_tipo_documento\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/tipoDocumento.controlador.php\";\n\t\t\trequire_once \"../models/tipoDocumento.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$tipoDocumentos = ControladorTipoDocumento::ctrMostrarTipoDocumento($item,$valor);\n\t\t\tif(count($tipoDocumentos) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($tipoDocumentos); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarTipoDocumento' codTipoDocumento='\".$tipoDocumentos[$i][\"cod_tipo_documento\"].\"' data-toggle='modal' data-target='#modalTipoDocumento' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarTipoDocumento' codTipoDocumento='\".$tipoDocumentos[$i][\"cod_tipo_documento\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[ \n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($tipoDocumentos[$i][\"dsc_tipo_documento\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_categoria_cliente\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/categoriaCliente.controlador.php\";\n\t\t\trequire_once \"../models/categoriaCliente.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$categoriaClientes = ControladorCategoriaCliente::ctrMostrarCategoriaClientes($item,$valor);\n\t\t\tif(count($categoriaClientes) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($categoriaClientes); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarCategoriaCliente' codCategoriaCliente='\".$categoriaClientes[$i][\"cod_categoria_cliente\"].\"' data-toggle='modal' data-target='#modalCategoriaCliente' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarCategoriaCliente' codCategoriaCliente='\".$categoriaClientes[$i][\"cod_categoria_cliente\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[ \n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($categoriaClientes[$i][\"dsc_categoria_cliente\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_pais\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/pais.controlador.php\";\n\t\t\trequire_once \"../models/pais.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$paises = ControladorPais::ctrMostrarPaises($item,$valor);\n\t\t\tif(count($paises) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($paises); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarPais' codPais='\".$paises[$i][\"cod_pais\"].\"' data-toggle='modal' data-target='#modalPais' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarPais' codPais='\".$paises[$i][\"cod_pais\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($paises[$i][\"dsc_pais\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_estado_cotizacion\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/estadoCotizacion.controlador.php\";\n\t\t\trequire_once \"../models/estadoCotizacion.modelo.php\";\n\t\t\t$item = $valor = $entrada = null;\n\t\t\t$estadoCotizacion = ControladorEstadoCotizacion::ctrMostrarEstadoCotizacion($item,$valor,$entrada);\n\t\t\tif(count($estadoCotizacion) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($estadoCotizacion); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarEstadoCotizacion' codEstadoCotizacion='\".$estadoCotizacion[$i][\"cod_estado_cotizacion\"].\"' data-toggle='modal' data-target='#modalEstadoCotizacion' title='Editar'><i class='fa fa-pencil'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($estadoCotizacion[$i][\"dsc_estado_cotizacion\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= '] \n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_perfil\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/perfil.controlador.php\";\n\t\t\trequire_once \"../models/perfil.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$perfil = ControladorPerfil::ctrMostrarPerfil($item,$valor);\n\t\t\tif(count($perfil) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($perfil); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarPerfil' codPerfil='\".$perfil[$i][\"cod_perfil\"].\"' data-toggle='modal' data-target='#modalPerfil' title='Editar'><i class='fa fa-pencil'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($perfil[$i][\"dsc_perfil\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_moneda\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/moneda.controlador.php\";\n\t\t\trequire_once \"../models/moneda.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$moneda = ControladorMoneda::ctrMostrarMoneda($item,$valor);\n\t\t\tif(count($moneda) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($moneda); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarMoneda' codMoneda='\".$moneda[$i][\"cod_moneda\"].\"' data-toggle='modal' data-target='#modalMoneda' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarMoneda' codMoneda='\".$moneda[$i][\"cod_moneda\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($moneda[$i][\"dsc_moneda\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_forma_pago\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/formaPago.controlador.php\";\n\t\t\trequire_once \"../models/formaPago.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$formaPago = ControladorFormaPago::ctrMostrarFormaPago($item,$valor);\n\t\t\tif(count($formaPago) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($formaPago); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarFormaPago' codFormaPago='\".$formaPago[$i][\"cod_forma_pago\"].\"' data-toggle='modal' data-target='#modalFormaPago' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarFormaPago' codFormaPago='\".$formaPago[$i][\"cod_forma_pago\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($formaPago[$i][\"dsc_forma_pago\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_canal_contacto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/canalContacto.controlador.php\";\n\t\t\trequire_once \"../models/canalContacto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$canalContacto = ControladorCanalContacto::ctrMostrarCanalContacto($item,$valor);\n\t\t\tif(count($canalContacto) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($canalContacto); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarCanalContacto' codCanalContacto='\".$canalContacto[$i][\"cod_canal_contacto\"].\"' data-toggle='modal' data-target='#modalCanalContacto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarCanalContacto' codCanalContacto='\".$canalContacto[$i][\"cod_canal_contacto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($canalContacto[$i][\"dsc_canal_contacto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_estado_contacto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/estadoContacto.controlador.php\";\n\t\t\trequire_once \"../models/estadoContacto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$estadoContacto = ControladorEstadoContacto::ctrMostrarEstadoContacto($item,$valor);\n\t\t\tif(count($estadoContacto) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($estadoContacto); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarEstadoContacto' codEstadoContacto='\".$estadoContacto[$i][\"cod_estado_contacto\"].\"' data-toggle='modal' data-target='#modalEstadoContacto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarEstadoContacto' codEstadoContacto='\".$estadoContacto[$i][\"cod_estado_contacto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($estadoContacto[$i][\"dsc_estado_contacto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_tipo_contacto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/tipoContacto.controlador.php\";\n\t\t\trequire_once \"../models/tipoContacto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$tipoContacto = ControladorTipoContacto::ctrMostrarTipoContacto($item,$valor);\n\t\t\tif(count($tipoContacto) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($tipoContacto); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarTipoContacto' codTipoContacto='\".$tipoContacto[$i][\"cod_tipo_contacto\"].\"' data-toggle='modal' data-target='#modalTipoContacto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarTipoContacto' codTipoContacto='\".$tipoContacto[$i][\"cod_tipo_contacto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($tipoContacto[$i][\"dsc_tipo_contacto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}\n\t\techo $datosJson;\n\t}", "function tablaDatos(){\n\n $editar = $this->Imagenes($this->PrimaryKey,0);\n $eliminar = $this->Imagenes($this->PrimaryKey,1);\n $sql = 'SELECT\n C.id_componentes,\n P.descripcion planta,\n S.descripcion secciones,\n E.descripcion Equipo,\n C.`descripcion` Componente\n ,'.$editar.','.$eliminar.' \nFROM\n `componentes` C\nINNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\nINNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\nINNER JOIN\n plantas P ON P.id_planta = S.id_planta\nWHERE\n \n C.`activo` = 1';\n \n $datos = $this->Consulta($sql,1); \n if(count($datos)){\n $_array_formu = array();\n $_array_formu = $this->generateHead($datos);\n $this->CamposHead = ( isset($_array_formu[0]) && is_array($_array_formu[0]) )? $_array_formu[0]: array();\n \n $tablaHtml = '<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body recargaDatos\" style=\"page-break-after: always;\">\n <div class=\"table-responsive\">';\n $tablaHtml .='';\n \t\t$tablaHtml .= $this->print_table($_array_formu, 7, true, 'table table-striped table-bordered',\"id='tablaDatos'\");\n \t\t$tablaHtml .=' </div>\n </div>\n </div>\n </div>\n </div>\n ';\n }else{\n $tablaHtml = '<div class=\"col-md-8\">\n <div class=\"alert alert-info alert-dismissable\">\n <button class=\"close\" aria-hidden=\"true\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Atenci&oacute;n</strong>\n No se encontraron registros.\n </div>\n </div>';\n }\n \n if($this->_datos=='r') echo $tablaHtml;\n else return $tablaHtml;\n \n }", "public function select($titulos){\n $id=$titulos->getId();\n\n try {\n $sql= \"SELECT `id`, `descripcion`, `universidad_id`, `docente_id`\"\n .\"FROM `titulos`\"\n .\"WHERE `id`='$id'\";\n $data = $this->ejecutarConsulta($sql);\n for ($i=0; $i < count($data) ; $i++) {\n $titulos->setId($data[$i]['id']);\n $titulos->setDescripcion($data[$i]['descripcion']);\n $titulos->setUniversidad_id($data[$i]['universidad_id']);\n $docente = new Docente();\n $docente->setId($data[$i]['docente_id']);\n $titulos->setDocente_id($docente);\n\n }\n return $titulos; } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n return null;\n }\n }", "static public function mdlSelecMembresiasCaducadas($tabla,$empresa){\n\n\t\tif($empresa == \"0\"){\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT m.*,t.nombre_membresia,mb.nombre_completo,e.nombre,mb.celular FROM $tabla m LEFT JOIN tipo_membresia t ON t.id_tipo_membresia=m.id_tipo_membresia LEFT JOIN miembros mb ON mb.id_miembro=m.id_miembro LEFT JOIN empresa e ON e.id_empresa=t.id_empresa WHERE m.estado = '2'\");\n\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}else{\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT m.*,t.nombre_membresia,mb.nombre_completo,e.nombre,mb.celular FROM $tabla m LEFT JOIN tipo_membresia t ON t.id_tipo_membresia=m.id_tipo_membresia LEFT JOIN miembros mb ON mb.id_miembro=m.id_miembro LEFT JOIN empresa e ON e.id_empresa=t.id_empresa WHERE t.id_empresa = '\".$empresa.\"' AND m.estado = '2' \");\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n }", "public function __construct()\r\n {\r\n parent::__construct();\r\n \r\n parent::setDatabase('fiscalizacao'); \r\n parent::setActiveRecord('Comitiva');\r\n parent::setDefaultOrder('id', 'Asc'); \r\n parent::addFilterField('idChefeVtr', '='); \r\n parent::setDefaultOrder('idViatura', '='); \r\n parent::addFilterField('comitiva', 'like'); \r\n parent::setDefaultOrder('dataChegada', '='); \r\n parent::setDefaultOrder('obs', 'like'); \r\n \r\n // creates the form, with a table inside\r\n $this->form = new TQuickForm('Pesquisa Comitiva');\r\n $this->form->class = 'tform';\r\n $this->form->style = 'width: 650px';\r\n $this->form->setFormTitle('Pesquisa de Comitiva - Escolha uma opção para realizar a pesquisa!');\r\n\r\n // create the form fields\r\n $id = new TCombo('id');\r\n $idViatura = new TCombo('idViatura');\r\n $idChefeVtr = new TCombo('idChefeVtr');\r\n $comitiva = new TEntry('tipoComitiva');\r\n $dataChegada = new TDate('dataChegada');\r\n $obs = new TEntry('obs');\r\n\r\n $vtr = array();\r\n $vtr['VAN-UN25269'] = 'VAN-UN25269';\r\n $vtr['VAN-UN25265'] = 'VAN-UN25265';\r\n $vtr['MARRUA-UN24772'] = 'MARRUÁ-UN24772';\r\n $idViatura->addItems($vtr);\r\n\r\n $mil = array();\r\n $mil['TEN INOUE'] = 'TEN INOUE';\r\n $mil['SGT VERISSIMO'] = 'SGT VERISSIMO';\r\n $mil['SGT SANTIAGO'] = 'SGT SANTIAGO';\r\n $idChefeVtr->addItems($mil);\r\n \r\n // add a row for the filter field \r\n $this->form->addQuickField('Viatura', $idViatura, 250);\r\n $this->form->addQuickField('Chefe Vtr', $idChefeVtr, 250);\r\n $this->form->addQuickField('Data', $dataChegada, 250);\r\n $this->form->addQuickField('Comitiva', $comitiva, 250);\r\n $this->form->addQuickField('OBS', $obs, 250);\r\n \r\n $this->form->setData( TSession::getValue('Product_filter_data') );\r\n $this->form->addQuickAction( _t('Find'), new TAction(array($this, 'onSearch')), 'ico_find.png');\r\n $this->form->addQuickAction( _t('New'), new TAction(array('ComitivaForm', 'onEdit')), 'ico_new.png');\r\n \r\n // creates a DataGrid\r\n $this->datagrid = new TQuickGrid;\r\n $this->datagrid->setHeight(420);\r\n // creates a DataGrid\r\n $id = $this->datagrid->addQuickColumn('ID', 'id', 'center', 50);\r\n $idChefeVtr = $this->datagrid->addQuickColumn('Chefe', 'idChefeVtr', 'left', 200);\r\n $idViatura = $this->datagrid->addQuickColumn('Viatura', 'idViatura', 'left', 100);\r\n $comitiva = $this->datagrid->addQuickColumn('Comitiva', 'tipoComitiva', 'left', 150);\r\n $comitiva = $this->datagrid->addQuickColumn('Nome', 'nome', 'left', 150);\r\n \r\n $dataChegada = $this->datagrid->addQuickColumn('Data Chegada', 'dataChegada', 'left', 100);\r\n $horaChegada = $this->datagrid->addQuickColumn('Hora Chegada', 'horaChegada', 'left', 100);\r\n $vooChegada = $this->datagrid->addQuickColumn('Voo Chegada', 'vooChegada', 'left', 100);\r\n \r\n $dataRegresso = $this->datagrid->addQuickColumn('Data Regresso', 'dataRegresso', 'left', 100);\r\n $horaRegresso = $this->datagrid->addQuickColumn('Hora Regresso', 'horaRegresso', 'left', 100);\r\n $vooRegresso = $this->datagrid->addQuickColumn('Voo Regresso', 'vooRegresso', 'left', 100);\r\n \r\n \r\n\r\n // create the datagrid actions\r\n $edit_action = new TDataGridAction(array('ComitivaForm', 'onEdit'));\r\n $delete_action = new TDataGridAction(array($this, 'onDelete'));\r\n \r\n // add the actions to the datagrid\r\n $this->datagrid->addQuickAction(_t('Edit'), $edit_action, 'id', 'ico_edit.png');\r\n $this->datagrid->addQuickAction(_t('Delete'), $delete_action, 'id', 'ico_delete.png');\r\n \r\n // create the datagrid model\r\n $this->datagrid->createModel();\r\n // create the page navigation\r\n $this->pageNavigation = new TPageNavigation;\r\n $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));\r\n $this->pageNavigation->setWidth($this->datagrid->getWidth());\r\n \r\n // create the page container\r\n $container = new TVBox;\r\n $container->add(new TXMLBreadCrumb('menu.xml', 'PesquisaComitiva'));\r\n $container->add($this->form);\r\n $container->add($this->datagrid);\r\n $container->add($this->pageNavigation);\r\n \r\n parent::add($container);\r\n }", "public function consultarTiposJSONSelectAction() {\n $select = \"<select>\";\n //$select = $select . \"<option value='' >Seleccione una Acción</option>\";\n $select = $select . \"<option value=\" . User::$VENDEDOR . \" >\" . User::$VENDEDOR_TEXT . \"</option>\";\n $select = $select . \"<option value=\" . User::$COMPRADOR . \" >\" . User::$COMPRADOR_TEXT . \"</option>\";\n $select = $select . \"<option value=\" . User::$APROBADOR . \" >\" . User::$APROBADOR_TEXT . \"</option>\";\n $select = $select . \"<option value=\" . User::$DIGITADOR . \" >\" . User::$DIGITADOR_TEXT . \"</option>\";\n $select = $select . \"</select>\";\n\n $response = new Response($select);\n return $response;\n }", "function getListDiagrammer() {\n\n global $idAnalyst;\n $idProject = $_SESSION[\"permisosDeMenu\"];\n global $diagramerASMController;\n\n //obtenemos con el controlador del diagramador los elementos del select\n //id array para los valores de las opciones\n //array los valores a mostrar\n //action funcion que se desea ejercer en dicho elemento select\n $diagramerASMController = new asmsController;\n $ASMs = $diagramerASMController->getASMstexto($idProject);\n $id = array();\n $array = array();\n for ($i = 0; $i < count($ASMs); $i++) {\n $asm = $ASMs[$i];\n $idASM = $asm->getIdASM();\n $name = $asm->getName();\n $id[] = $idASM;\n $array[] = $name;\n }\n $action = \"lookDiagram(value)\";\n $select = select($id, $array, $action, \"...\");\n return $select;\n}", "public function __construct() {\r\n parent::__construct();\r\n parent::set_tabel('jadwal', 'kd_jadwal');\r\n }", "public function __construct()\n {\n parent::__construct();\n $this->table = 'actividades';\n }", "function setColeccion() {\n $this->query = \"SELECT * FROM PROFESOR\";\n $this->datos = BDConexionSistema::getInstancia()->query($this->query);\n\n for ($x = 0; $x < $this->datos->num_rows; $x++) {\n $this->addElemento($this->datos->fetch_object(\"Profesor\"));\n }\n }" ]
[ "0.631368", "0.6264864", "0.6182935", "0.61774856", "0.61525846", "0.6087659", "0.59744745", "0.5956121", "0.5888529", "0.58554995", "0.5823347", "0.58118075", "0.580819", "0.5803332", "0.5776428", "0.57350105", "0.5700218", "0.5698973", "0.5691174", "0.5664526", "0.5664291", "0.56631225", "0.56453", "0.56442577", "0.56305563", "0.56157786", "0.56143636", "0.5611538", "0.560619", "0.55851036", "0.5578151", "0.5567545", "0.5560609", "0.5557693", "0.5551551", "0.55507314", "0.5544713", "0.55264884", "0.55231684", "0.5514382", "0.5507979", "0.55036736", "0.54996383", "0.5486422", "0.54758364", "0.546819", "0.5452453", "0.54478663", "0.54441917", "0.54385895", "0.5431093", "0.542958", "0.542767", "0.5420867", "0.5415901", "0.5409459", "0.5407114", "0.5406851", "0.54040253", "0.5395609", "0.5393422", "0.53849757", "0.53778124", "0.5373974", "0.53707296", "0.536628", "0.53655356", "0.53643143", "0.5348291", "0.5345218", "0.53446335", "0.5344478", "0.5334822", "0.5329935", "0.5326971", "0.53254974", "0.53250307", "0.5324376", "0.5319991", "0.53065306", "0.5306386", "0.530491", "0.53021646", "0.5297836", "0.5297355", "0.529241", "0.5290867", "0.52899545", "0.5289683", "0.52863175", "0.52847093", "0.528025", "0.5276502", "0.5270206", "0.52690804", "0.5266266", "0.52648574", "0.5264715", "0.5264484", "0.5264477", "0.5261939" ]
0.0
-1
Adicionar ao select a tabela TbdMarcacao
function getImagensSubcategoria($limite, $subcategorias){ #De modo que: Selecione N marcações (numero de marcacoes = $limit) #As marcações serão referentes as categorias ou subcategorias selecionadas (categorias = $categorias, subcategorias = $subcategorias) $this->db->select('*'); $this->db->from('Tbdimagem'); $this->db->join('imagem_subcategoria', 'Tbdimagem.idImagem = imagem_subcategoria.idImagem'); $this->db->where('imagem_subcategoria.idSubcategoria', $subcategorias); $this->db->limit($limite); $query = $this->db->get(); return $query->result_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function selectTable(){\n\t\tView::show(\"user/seleccionaTablas\");\n\t}", "public function SelecionaBanco()\r\n\t\t{\r\n\t\t\tmysql_select_db($this->banco);\r\n\t\t}", "private function ExibirTamanhos(){\r\n $oDadosCamiseta;\r\n $sSql = \"SELECT * FROM tamanho_camiseta\";\r\n $oDadosCamiseta = $this->Fbd->PesquisarSQL($sSql);\r\n \r\n foreach($oDadosCamiseta as $oRegistro){\r\n echo \"<option value='\".$oRegistro->sigla.\"' class='sctOptTamanho'>\".$oRegistro->nome.\"</option>\";\r\n }\r\n }", "function consultar_select($id, $columna_descripcion, $tabla){\n\t\t//Primero conectarse a la bd\n\t\t$conexion_bd = conectar_bd();\n\n\t\t$resultado = '<select name =\"'.$tabla.'\"><option value=\"\" disabled selected>Selecciona una opción</option>';\n\n \t$consulta = \"SELECT $id, $columna_descripcion FROM $tabla\";\n \t$resultados = $conexion_bd->query($consulta);\n \twhile ($row = mysqli_fetch_array($resultados, MYSQLI_BOTH)) {\n\t\t\t$resultado .= '<option value=\"'.$row[\"$id\"].'\">'.$row[\"$columna_descripcion\"].'</option>';\n\t\t}\n \n \t// desconectarse al termino de la consulta\n\t\tdesconectar_bd($conexion_bd);\n\n\t\t$resultado .= '</select><label>Marca</label></div>';\n\n\t\treturn $resultado;\n\n\t}", "public function select($tienda);", "public function select($cotizacion);", "function CreaSelect($Nombre,$Sql,$Comentario,$valor=\"\"){\n\t\t$result = mysql_query($Sql);\n\t\techo \"\\t<tr><td>$Comentario</td><td><select name='$Nombre'>\\n\";\n\t\twhile($row=mysql_fetch_row($result))\n\t\t{\n\t\t \tif($row[0]==$valor)$seleccionar=\"selected\";\n\t\t \telse $seleccionar=\"\";\n\t\t\techo \"\\t\\t<option $seleccionar value='\".$row[0].\"'>\".$row[1].\"</option>\\n\"\t;\n\t\t}\n\t\t\techo \"</select></td></tr>\\n\";\n\t\t\n\t}", "public function Select(){\n\t\t\t//Query para selecionar a tabela contatos\n\t\t\t$sql=\"SELECT p.*, e.* FROM tbl_paciente AS p INNER JOIN tbl_endereco AS e ON p.id_endereco = e.id_endereco WHERE ativo = 1 AND status = 1;\";\n\n\t\t\t//Instancio o banco e crio uma variavel\n\t\t\t$conex = new Mysql_db();\n\n\t\t\t/*Chama o método para conectar no banco de dados e guarda o retorno da conexao\n\t\t\tna variavel que $PDO_conex*/\n\t\t\t$PDO_conex = $conex->Conectar();\n\n\t\t\t//Executa o select no banco de dados e guarda o retorno na variavel select\n\t\t\t$select = $PDO_conex->query($sql);\n\n\t\t\t//Contador\n\t\t\t$cont = 0;\n\n\t\t\t//Estrutura de repetição para pegar dados\n\n \n\n\t\t\twhile ($rs = $select->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t#Cria um array de objetos na classe contatos\n\n //var_dump($rs);exit();\n\n\t\t\t\t//$lista_paciente[] = $rs;\n\n $lista_pacientes[] = new Paciente();\n \n\t\t\t\t// Guarda os dados no banco de dados em cada indice do objeto criado\n\t\t\t\t$lista_pacientes[$cont]->id_paciente = $rs['id_paciente'];\n $lista_pacientes[$cont]->id_endereco = $rs['id_endereco'];\n $lista_pacientes[$cont]->id_convenio = $rs['id_convenio'];\n $lista_pacientes[$cont]->nome = $rs['nome'];\n $lista_pacientes[$cont]->sobrenome = $rs['sobrenome'];\n $lista_pacientes[$cont]->dt_nasc = $rs['dt_nasc'];\n $lista_pacientes[$cont]->rg = $rs['rg'];\n $lista_pacientes[$cont]->cpf = $rs['cpf'];\n $lista_pacientes[$cont]->carteirinha_convenio = $rs['carterinha_convenio'];\n $lista_pacientes[$cont]->foto = $rs['foto'];\n $lista_pacientes[$cont]->status = $rs['status'];\n\t\t\t\t$lista_pacientes[$cont]->id_endereco = $rs['id_endereco'];\n $lista_pacientes[$cont]->cep = $rs['cep'];\n $lista_pacientes[$cont]->logradouro = $rs['logradouro'];\n $lista_pacientes[$cont]->numero = $rs['numero'];\n $lista_pacientes[$cont]->id_estado = $rs['id_estado'];\n $lista_pacientes[$cont]->cidade = $rs['cidade'];\n $lista_pacientes[$cont]->bairro = $rs['bairro'];\n\n\t\t\t\t// Soma mais um no contador\n\t\t\t\t$cont+=1;\n\t\t\t}\n\n\t\t\t$conex::Desconectar();\n\n\t\t\t//Apenas retorna o $list_contatos se existir dados no banco de daos\n\t\t\tif (isset($lista_pacientes)) {\n\t\t\t\t# code...\n\t\t\t\treturn $lista_pacientes;\n\t\t\t}\n\n\t\t}", "private function _montaInicioSelectQuestionario()\r\n {\r\n $select = $this->select()\r\n ->setIntegrityCheck(false);\r\n\r\n $select->from(array('pp' => KT_B_PERGUNTA_PEDIDO),\r\n array('cd_pergunta_pedido',\r\n 'tx_titulo_pergunta',\r\n 'st_multipla_resposta',\r\n 'st_obriga_resposta',\r\n 'tx_ajuda_pergunta'),\r\n $this->_schema);\r\n $select->join(array('orpp' => $this->_name),\r\n '(pp.cd_pergunta_pedido = orpp.cd_pergunta_pedido)',\r\n array('st_resposta_texto',\r\n 'ni_ordem_apresenta'),\r\n $this->_schema);\r\n $select->join(array('rp' => KT_B_RESPOSTA_PEDIDO),\r\n '(orpp.cd_resposta_pedido = rp.cd_resposta_pedido)',\r\n array('cd_resposta_pedido',\r\n 'tx_titulo_resposta'),\r\n $this->_schema);\r\n \r\n return $select;\r\n }", "function listarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_sel';\n\t\t$this->transaccion='WF_tabla_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_tabla','int4');\n\t\t$this->captura('id_tipo_proceso','int4');\n\t\t$this->captura('vista_id_tabla_maestro','int4');\n\t\t$this->captura('bd_scripts_extras','text');\n\t\t$this->captura('vista_campo_maestro','varchar');\n\t\t$this->captura('vista_scripts_extras','text');\n\t\t$this->captura('bd_descripcion','text');\n\t\t$this->captura('vista_tipo','varchar');\n\t\t$this->captura('menu_icono','varchar');\n\t\t$this->captura('menu_nombre','varchar');\n\t\t$this->captura('vista_campo_ordenacion','varchar');\n\t\t$this->captura('vista_posicion','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('menu_codigo','varchar');\n\t\t$this->captura('bd_nombre_tabla','varchar');\n\t\t$this->captura('bd_codigo_tabla','varchar');\n\t\t$this->captura('vista_dir_ordenacion','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('nombre_tabla_maestro','varchar');\n\t\t$this->captura('vista_estados_new','text');\n\t\t$this->captura('vista_estados_delete','text');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function listarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_sel';\n\t\t$this->transaccion='WF_TABLAINS_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('historico','historico','varchar');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_' . $_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['bd_nombre_tabla'],'int4');\n\t\t\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] == 'maestro') {\n\t\t\t\t\n\t\t\t$this->captura('estado','varchar');\n\t\t\t$this->captura('id_estado_wf','int4');\n\t\t\t$this->captura('id_proceso_wf','int4');\n\t\t\t$this->captura('obs','text');\n\t\t\t$this->captura('nro_tramite','varchar');\n\t\t}\n\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t\n\t\t\t$this->captura($value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\n\t\t\t//campos adicionales\n\t\t\tif ($value['bd_campos_adicionales'] != '' && $value['bd_campos_adicionales'] != null) {\n\t\t\t\t$campos_adicionales = explode(',', $value['bd_campos_adicionales']);\n\t\t\t\t\n\t\t\t\tforeach ($campos_adicionales as $campo_adicional) {\n\t\t\t\t\t\n\t\t\t\t\t$valores = explode(' ', $campo_adicional);\n\t\t\t\t\t$this->captura($valores[1],$valores[2]);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$this->captura('estado_reg','varchar');\t\t\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "private function criarBarraDeBuscaAction(){\n $cidades = $this->Localidades()->getCidades(\"RJ\");\n $busca = new form_busca();//1- primeiro eu instancio o formularioarray('selecione'=>'selecione','nome' => 'nome','cidade' => 'cidade')\n $busca->get('cidade')->setAttribute('options',$cidades);\n $busca->get('bairro')->setAttribute('options', array(0=>'Selecione uma Cidade'));\n //\n $categoriaDao = \\Base\\Model\\daoFactory::factory('SubCategoriaImovel');\n $dadosCategoria = $categoriaDao->recuperarTodos();\n $categorias = $this->SelectHelper()->getArrayData(\"selecione\",$dadosCategoria);\n $busca->get('tipo')->setAttribute('options', $categorias);\n //\n $transacaoDao = \\Base\\Model\\daoFactory::factory('TipoTransacao');\n $dadosTransacoes = $transacaoDao->recuperarTodos();\n $transacoes = $this->SelectHelper()->getArrayData(\"selecione\",$dadosTransacoes);\n $busca->get('transacao')->setAttribute('options', $transacoes);\n //\n $arrayPreco = array(array(\"value\"=>0, \"label\"=>\"selecione\", \"disabled\" => \"disabled\", \"selected\" => \"selected\"),array(\"value\" => 1, \"label\" => \"R$ 100.000 a R$ 200.000\"),array(\"value\" => 2, \"label\" => \"R$ 200.000 a R$ 300.000\"),array(\"value\" => 3, \"label\" => \"R$ 300.000 a R$ 400.000\"),array(\"value\" => 4, \"label\" => \"R$ 400.000 a R$ 500.000\"),array(\"value\" => 5, \"label\" => \"acima de R$ 500.000\"));\n $busca->get('valor')->setAttribute('options', $arrayPreco);\n return $busca;\n }", "function recorre_tabla_anidada($nombreta, $nombretp, $selectDestino){\r\n$sql_query= \"Select * From $nombreta Where universidad = '$nombretp'\";\t\r\n$consulta=pg_query($sql_query);\r\necho \"<div><select name='$selectDestino' id='$selectDestino' onChange='cargaContenido(this.id)'>\";\r\necho \"<option value='0'>Seleccione $nombreta</option>\";\r\nwhile($fila=pg_fetch_row($consulta)){\r\n\techo \"<option value='\".$fila[0].\"'>\".$fila[0].\"</option>\";}\t\t\t\r\necho \"</select></div>\";\t\r\n}", "function recorre_tabla_anidada($nombreta, $nombretp, $selectDestino){\r\n$sql_query= \"Select * From $nombreta Where universidad = '$nombretp'\";\t\r\n$consulta=pg_query($sql_query);\r\necho \"<div><select name='$selectDestino' id='$selectDestino' onChange='cargaContenido(this.id)'>\";\r\necho \"<option value='0'>Seleccione $nombreta</option>\";\r\nwhile($fila=pg_fetch_row($consulta)){\r\n\techo \"<option value='\".$fila[0].\"'>\".$fila[1].\"</option>\";}\t\t\t\r\necho \"</select></div>\";\t\r\n}", "public function select($actividades_fuera);", "public function seleccionar($tablas, $columnas, $condicion = \"\", $agrupamiento = \"\", $ordenamiento = \"\", $filaInicial = NULL, $numeroFilas = NULL) {\n $listaColumnas = array();\n $listaTablas = array();\n $limite = \"\";\n\n if (!is_array($tablas)){\n $tablas = array($tablas);\n\n }\n \n if (!is_array($columnas)){\n $columnas = array($columnas);\n\n }\n\n foreach ($columnas as $alias => $columna) {\n\n if (preg_match(\"/(^[a-zA-z]+[a-zA-Z0-9]*)/\", $alias)) {\n $alias = \" AS $alias\";\n } else {\n $alias = '';\n }\n\n $listaColumnas[] = $columna . $alias;\n }\n\n $columnas = implode(', ', $listaColumnas);\n\n foreach ($tablas as $alias => $tabla) {\n\n if (preg_match(\"/(^[a-zA-z]+[a-zA-Z0-9]*)/\", $alias)) {\n $alias = ' AS ' . $alias;\n } else {\n $alias = '';\n }\n\n $tabla = $this->prefijo . $tabla;\n $listaTablas[] = $tabla . $alias;\n }\n\n if (!empty($condicion)) {\n $condicion = ' WHERE ' . $condicion;\n }\n\n if (!empty($agrupamiento)) {\n $agrupamiento = ' GROUP BY ' . $agrupamiento;\n }\n\n if (!empty($ordenamiento)) {\n $ordenamiento = ' ORDER BY ' . $ordenamiento;\n }\n\n if (is_int($numeroFilas) && $numeroFilas > 0) {\n $limite = ' LIMIT ';\n\n if (is_int($filaInicial) && $filaInicial >= 0) {\n $limite .= \"$filaInicial, \";\n }\n\n $limite .= $numeroFilas;\n }\n\n $tablas = implode(', ', $listaTablas);\n $sentencia = 'SELECT ' . $columnas . ' FROM ' . $tablas . $condicion . $agrupamiento . $ordenamiento . $limite;\n\n $this->sentenciaSql = $sentencia;\n\n return $this->ejecutar($sentencia);\n }", "public static function tablaMarcas()\n {\n //Comprueba si hay un registro seleccionado\n if(!empty($_GET[\"id_marca\"]))\n {\n //Se valida que sea un numero\n if(is_numeric($_GET[\"id_marca\"]))\n {\n //Variable con los datos de la marca\n $datos_marca = Sentencias::Seleccionar(\"marcas\", \"id\", array($_GET[\"id_marca\"]), 0, null);\n\n //Se valida que tenga datos y que exista\n if($datos_marca != null)\n {\n $marca = $datos_marca[\"marca\"];\n }\n }\n\n else\n {\n header(\"Location: marcas.php\");\n }\n }\n\n else\n {\n //$marca = null;\n }\n \n //Variable con los permisos del usuario\n $dato_tipo = Sentencias::Seleccionar(\"tipos_usuarios\", \"id\", array($_SESSION[\"tipo\"]), 0, null);\n\n //Renderiza si tiene los permisos de lectura\n if($dato_tipo[\"marcas\"] > 0)\n {\n //Variable con todos los registro de la tabla marcas\n $datos_marcas = null; \n\n echo\n (\"\n <div class='row' id='lista'>\n <div class='col s12'>\n <div class='col s12 center-align'>\n <h4>Lista de marcas ingresadas</h4>\n </div>\n \"); \n\n //Se valida si se hara una busqueda\n if(!empty($_GET[\"accion\"]))\n {\n //Se valida si la opcion es 1\n if($_GET[\"accion\"] == 1)\n {\n echo\n (\"\n <div class='center-align'>\n <h4>Buscando por nombre de la marca</h4>\n </div>\n \");\n\n //Se renderiza el formulario de busqueda\n echo\n (\"\n <form method='post' class='col s10 offset-s1 m12'>\n\n <!--Se crea la barra de busqueda-->\n <div class='input-field col s8'>\n <i class='material-icons prefix'>search</i>\n <input id='buscar' type='text' class='validate' name='buscar'>\n <label for='buscar'>Ingrese el nombre de la marca a buscar</label>\n </div>\n <div class='col s4 offset-s2 l2'>\n <button name='busqueda' class='waves-effect waves-light btn blue darken-4'>Buscar</button>\n </div>\n <div class='col s4 offset-s2 l2'>\n <a href='marcas.php' class='waves-effect waves-light btn blue darken-4'>Limpiar</a>\n </div>\n </form>\n \");\n\n //Se empieza a validar los valores ingresados para la busqueda\n if(isset($_POST[\"busqueda\"]))\n {\n $busqueda = trim($_POST[\"buscar\"]);\n\n if(Validaciones::longitud($busqueda, 20) && Validaciones::nombre($busqueda))\n {\n $datos_marcas = Sentencias::Seleccionar(\"marcas\", \"marca\", array(\"$busqueda%\"), 1, 1);\n }\n\n else\n {\n Ventanas::Mensaje(2, \"el paremetro de busqueda no es valido\", null);\n }\n }\n }\n\n else\n {\n header(\"Location: marcas.php\");\n }\n }\n\n else\n {\n echo\n (\"\n <div class='center-align'>\n <h4>Selecciona una opcion de busqueda en la tabla</h4>\n </div>\n \");\n\n $datos_marcas = Sentencias::Seleccionar(\"marcas\", null, null, null, null); \n }\n\n //Renderiza la tabla\n echo\n (\"\n <table class='highlight centered col s12'>\n <thead>\n <tr>\n <th>Imagen</th>\n <th><a class='blue-text text-darken-4' href='marcas.php?accion=1'>Marca</a></th>\n <th>Accion</th>\n </tr>\n </thead>\n <tbody>\n \");\n\n //Se valida si hay datos en la variable\n if($datos_marcas != null)\n {\n //Empieza el foreach para mostrar las marcas\n foreach($datos_marcas as $row_marcas)\n {\n echo\n (\"\n <tr>\n <td><img class='circle' width='50' height='50' src='../img/marcas/$row_marcas[imagen]'></td>\n <td>\".$row_marcas['marca'].\"</td>\n <td><a href='marcas.php?id_marca=\".$row_marcas['id'].\"' class='blue-text text-darken-4'><i class='material-icons'>mode_edit</i></a></td>\n </tr>\n \");\n }\n }\n\n echo\n (\" \n </tbody>\n </table>\n </div>\n </div>\n \");\n }\n }", "static public function ctrCargarSelectModalidad(){\r\n\r\n $tabla = \"tbl_modalidades\";\r\n\r\n $respuesta = ModeloModalidades::mdlCargarSelect($tabla);\r\n\r\n return $respuesta;\r\n\r\n }", "public function select($producto);", "private function tbl_guiones_registro_tipo_formulario() {\r\n\t\t\t$this->guiones_registro_tipo = $this->esquema->createTable('GUIONES_REGISTRO_TIPO');\r\n\t\t\t$this->guiones_registro_tipo->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del tipo de guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre del tipo de guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado del tipo de Guion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_tipo->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}", "private function tbl_permisos_seleccion() {\r\n\t\t\t$this->permisos_seleccion = $this->esquema->createTable('PERMISOS_SELECCION');\r\n\t\t\t$this->permisos_seleccion->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Permiso Seleccion'\r\n\t\t\t));\r\n\t\t\t$this->permisos_seleccion->addColumn('PERMISO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Permiso del Usuario [ID de la tabla PERMISOS]'\r\n\t\t\t));\r\n\t\t\t$this->permisos_seleccion->addColumn('MODULO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Permiso del Modulo [ID de la tabla PERMISOS_MODULOS]'\r\n\t\t\t));\r\n\t\t\t$this->permisos_seleccion->addColumn('ACCESO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Permiso del Permiso Acceso [ID de la tabla PERMISOS_ACCESO]'\r\n\t\t\t));\r\n\t\t\t$this->permisos_seleccion->setPrimaryKey(array('ID'));\r\n\t\t\t$this->permisos_seleccion->addForeignKeyConstraint($this->permisos, array('PERMISO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->permisos_seleccion->addForeignKeyConstraint($this->permisos_modulo, array('MODULO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->permisos_seleccion->addForeignKeyConstraint($this->permisos_acceso, array('ACCESO'), array('ID'), $this->opcForeign);\r\n\t\t}", "public function listmAction() \n { \n $form = new Formulario(\"form\");\n // valores iniciales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d=new AlbumTable($this->dbAdapter);\n // Empleados\n $arreglo='';\n $datos = $d->getEmp(''); \n foreach ($datos as $dat)\n {\n $idc=$dat['id'];$nom=$dat['nombre'].' '.$dat['apellido'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idEmp\")->setValueOptions($arreglo); \n //\n $datos = $d->getGeneral1(\"select tipo from n_tip_matriz where id = \".$id);\n $tipo = $datos['tipo']; \n $arreglo=''; \n $con=' ';\n if ($tipo==1) \n $con=' and tipo=1'; \n if ($tipo==2) \n $con=' and tipo=2'; \n $datos = $d->getConnom2($con); \n if ($con!=' ')\n {\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n }\n $form->get(\"tipo\")->setValueOptions($arreglo); \n }\n $datos=0;\n $valores=array\n (\n \"titulo\" => $this->tfor,\n \"form\" => $form,\n 'url' => $this->getRequest()->getBaseUrl(),\n 'tipo' => $tipo, \n \"ttablas\" => \"Empleado, Cargo, Centro de costos, Eliminar\",\n 'datos' => $d->getGeneral(\"select a.id, concat(a.nombre ,' ' ,a.apellido) as nomEmp, \n b.nombre as nomCar, c.nombre as nomConc from a_empleados a \n left join t_cargos b on a.idCar=b.id\n inner join n_cencostos c on a.idCcos=c.id \n order by a.nombre,a.apellido\"),\n 'datosM' => $d->getGeneral(\"select a.id, b.nombre as nomMatz, a.idConc, b.alias, b.tipo,b.valor \n from n_tip_matriz_tnv a \n inner join n_conceptos b on b.id=a.idConc where a.idTmatz=\".$id ), \n \"lin\" => $this->lin\n ); \n // ------------------------ Fin valores del formulario \n return new ViewModel($valores); \n\n }", "function cargarDatosTablaProceso($link=0){\n\t\t$this->procedimiento='wf.ft_tabla_sel';\n\t\t$this->transaccion='WF_tabla_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t$this->setCount(false);\n\t\t$this->resetParametros();\n\t\t$this->resetCaptura();\n\t\t$primera_vez = 1;\n\t\t\n\t\t$this->setParametrosConsulta();\t\t\n\t\t\n\t\t//obtener los datos de la tabla maestro (datos de tabla y columnas)\n\t\t$this->captura('id_tabla','int4');\n\t\t$this->captura('id_tipo_proceso','int4');\n\t\t$this->captura('vista_id_tabla_maestro','int4');\n\t\t$this->captura('bd_scripts_extras','text');\n\t\t$this->captura('vista_campo_maestro','varchar');\n\t\t$this->captura('vista_scripts_extras','text');\n\t\t$this->captura('bd_descripcion','text');\n\t\t$this->captura('vista_tipo','varchar');\n\t\t$this->captura('menu_icono','varchar');\n\t\t$this->captura('menu_nombre','varchar');\n\t\t$this->captura('vista_campo_ordenacion','varchar');\n\t\t$this->captura('vista_posicion','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('menu_codigo','varchar');\n\t\t$this->captura('bd_nombre_tabla','varchar');\n\t\t$this->captura('bd_codigo_tabla','varchar');\n\t\t$this->captura('vista_dir_ordenacion','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('nombre_tabla_maestro','varchar');\n\t\t$this->captura('vista_estados_new','text');\n\t\t$this->captura('vista_estados_delete','text');\n\t\t\n\t\t$this->armarConsulta();\t\n\t\tif ($link == 0) {\n\t\t\t$cone = new conexion();\t\n\t\t\t$link = $cone->conectarnp();\n\t\t\t$primera_vez = 0;\t\t\t\n\t\t}\n\t\t\n\t\t$array = array();\n\t\ttry {\n\t\t\t$res = pg_query($link,$this->consulta);\n\t\t} catch (Exception $e) {\n\t\t\t$this->respuesta=new Mensaje();\n\t\t\t$resp_procedimiento=$this->divRespuesta(str_replace('ERROR: ','', pg_last_error($link)));\n\t\t\t$this->respuesta->setMensaje('ERROR',$this->nombre_archivo,$resp_procedimiento['mensaje'],$resp_procedimiento['mensaje_tec'],'base',$this->procedimiento,$this->transaccion,$this->tipo_procedimiento,$this->consulta);\n\t\t\treturn $this->respuesta;\n\t\t}\n\t\t\n\t\tif ($res) {\n\t\t\t$i = 0;\n\t\t\twhile ($row = pg_fetch_array($res,NULL,PGSQL_ASSOC)){\n\t\t\t\t//obtener las columnas\n\t\t\t\t$array[$i] = array();\n\t\t\t\t\n\t\t\t\t$array[$i]['atributos'] = $row;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->arreglo_consultas['filtro'] = ' tipcol.id_tabla = '. $row['id_tabla'];\n\t\t\t\t$columnas = $this->cargarDatosColumnaProceso($link);//llama a la funcion para obtener atributos de una tabla\n\t\t\t\t\n\t\t\t\tif ($columnas instanceof Mensaje)//Si es instancia de mensaje\n\t\t\t\t\treturn $columnas;\n\t\t\t\t\t//retornar en mensaje\n\t\t\t\t\n\t\t\t\t$array[$i]['columnas'] = $columnas;\n\t\t\t\t\n\t\t\t\t//obtener las tablas\n\t\t\t\t//se cambia el filtro para la siguiente consulta\n\t\t\t\t$this->arreglo_consultas['filtro'] = ' tabla.vista_id_tabla_maestro = '. $row['id_tabla'];\n\t\t\t\t$tablas = $this->cargarDatosTablaProceso($link);//Llama a esta misma funcion que me devolvera las tablas detalle\n\t\t\t\t\n\t\t\t\tif ($tablas instanceof Mensaje)//Si es instancia de mensaje\n\t\t\t\t\treturn $tablas;\n\t\t\t\t\t//retornar en mensaje\t\t\t\n\t\t\t\t$array[$i]['detalles'] = $tablas;\n\t\t\t\t$i++;\n\t\t\t\t\n\t\t\t}\n\t\t\tpg_free_result($res);\n\t\t} else {\n\t\t\t$resp_procedimiento=$this->divRespuesta(str_replace('ERROR: ','', pg_last_error($link)));\t\t\t\t\n\t\t\t//Existe error en la base de datos tomamamos el mensaje y elmensaje tecnico\n\t\t\t$this->respuesta=new Mensaje();\n\t\t\t$this->respuesta->setMensaje('ERROR',$this->nombre_archivo,$resp_procedimiento['mensaje'],$resp_procedimiento['mensaje_tec'],'base',$this->procedimiento,$this->transaccion,$this->tipo_procedimiento,$this->consulta);\n\t\t\treturn $this->respuesta;\n\t\t}\n\t\t\n\t\tif ($primera_vez == 0) {\n\t\t\t\n\t\t\t$this->respuesta=new Mensaje();\n\t\t\t$this->respuesta->setMensaje('EXITO',$this->nombre_archivo,'Consulta ejecutada con exito','Consulta ejecutada con exito','base',$this->procedimiento,$this->transaccion,$this->tipo_procedimiento,$this->consulta);\n\t\t\t$this->respuesta->setDatos($array);\n\t\t\treturn $this->respuesta;\n\t\t} else {\n\t\t\treturn $array;\n\t\t}\t\t\n\t}", "public function listaAction() \n { \n $form = new Formulario(\"form\");\n // valores iniciales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n // Lista de cargos\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = New AlbumTable($this->dbAdapter); \n $arreglo[0]='( NO TIENE )';\n $datos = $d->getCargos();// Listado de cargos\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idCar\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getNcargos();\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idNcar\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getCencos();// Listado de centros de costos\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idDep\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getSedes();// Listado de sedes\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idSed\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getDepar();\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idGdot\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getGdot();// Grupo de dotaciones\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idGdot\")->setValueOptions($arreglo); \n $arreglo = '';\n $datos = $d->getNasp();// Nivel de aspecto del cargo\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['nombre'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idNasp\")->setValueOptions($arreglo); \n // Tipos de salarios\n $arreglo = '';\n $datos = $d->getSalarios(''); \n $arreglo='';\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=number_format($dat['salario']).' (COD: '.$dat['codigo'].')';\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idTnomm\")->setValueOptions($arreglo); \n // Fin valor de formularios\n $valores=array\n (\n \"titulo\" => $this->tfor,\n \"form\" => $form, \n 'url' => $this->getRequest()->getBaseUrl(),\n 'id' => $id,\n \"lin\" => $this->lin\n ); \n // ------------------------ Fin valores del formulario \n \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Zona de validacion del fomrulario --------------------\n $album = new ValFormulario();\n $form->setInputFilter($album->getInputFilter()); \n $form->setData($request->getPost()); \n $form->setValidationGroup('nombre','numero'); // ------------------------------------- 2 CAMPOS A VALDIAR DEL FORMULARIO (C) \n // Fin validacion de formulario ---------------------------\n if ($form->isValid()) {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u = new Cargos($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n if ($data->id==0)\n $id = $u->actRegistro($data); // Trae el ultimo id de insercion en nuevo registro \n else \n {\n $u->actRegistro($data); \n $id = $data->id;\n }\n // Guardar tipos de nominas afectado por automaticos\n $f = new CargosS($this->dbAdapter);\n // Eliminar registros de tipos de nomina afectados por automaticos \n $d->modGeneral(\"Delete from t_cargos_sa where idCar=\".$id); \n $i=0;\n foreach ($data->idTnomm as $dato){\n $idSal = $data->idTnomm[$i];$i++; \n $f->actRegistro($idSal,$id); \n } \n $this->flashMessenger()->addMessage(''); \n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin.'a/'.$data->id);\n }\n }\n return new ViewModel($valores);\n \n }else{ \n if ($id > 0) // Cuando ya hay un registro asociado\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new Cargos($this->dbAdapter); // ---------------------------------------------------------- 4 FUNCION DENTRO DEL MODELO (C) \n $datos = $u->getRegistroId($id);\n $a = $datos['nombre'];\n $b = $datos['deno'];\n $c = $datos['idCar_a'];\n $d = $datos['plazas'];\n $e = $datos['respo'];\n $f = $datos['mision'];\n $g = $datos['idNcar'];\n\n $i = $datos['idGdot'];\n $j = $datos['idNasp'];\n // Valores guardados\n $form->get(\"nombre\")->setAttribute(\"value\",\"$a\"); \n $form->get(\"deno\")->setAttribute(\"value\",\"$b\"); \n $form->get(\"numero\")->setAttribute(\"value\",$d); // Plazas\n $form->get(\"respo\")->setAttribute(\"value\",\"$e\"); \n $form->get(\"mision\")->setAttribute(\"value\",\"$f\"); \n $form->get(\"idSed\")->setAttribute(\"value\",$datos['idSed']); \n $form->get(\"idDep\")->setAttribute(\"value\",$datos['idCcos']); \n // Jefe directo\n $d = New AlbumTable($this->dbAdapter); \n $datos = $d->getCargos();\n $form->get(\"idCar\")->setAttribute(\"value\",\"$c\"); \n $form->get(\"idNcar\")->setAttribute(\"value\",\"$g\"); \n\n $form->get(\"idGdot\")->setAttribute(\"value\",\"$i\"); \n $form->get(\"idNasp\")->setAttribute(\"value\",\"$j\"); \n // Escalas salariales\n $datos = $d->getSalCargos(' and idCar='.$id);\n $arreglo=''; \n foreach ($datos as $dat){\n $arreglo[]=$dat['idSal'];\n } \n $form->get(\"idTnomm\")->setValue($arreglo); \n return new ViewModel($valores);\n } \n \n }\n }", "private function tbl_guiones_registro_afectacion() {\r\n\t\t\t$this->guiones_registro_afectacion = $this->esquema->createTable('GUIONES_REGISTRO_AFECTACION');\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la afectacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la afectacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado de la afectacion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_afectacion->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}", "public function mostrarTablaAsegurados() {\n\n\t\t$item = null;\n\t\t$valor = null;\n\n\t\t$asegurados = ControladorAsegurados::ctrMostrarAsegurados($item, $valor);\n\n\t\tif ($asegurados == null) {\n\t\t\t\n\t\t\t$datosJson = '{\n\t\t\t\t\"data\": []\n\t\t\t}';\n\n\t\t} else {\n\n\t\t\t$datosJson = '{\n\t\t\t\"data\": [';\n\n\t\t\tfor ($i = 0; $i < count($asegurados); $i++) { \n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS LA EMPRESA\n\t\t\t\t=============================================*/\n\n\t\t\t\t$itemEmpleador = \"id\";\n\t\t\t\t$valorEmpleador = $asegurados[$i][\"id_empleador\"];\n\n\t\t\t\t$Empleadores = ControladorEmpleadores::ctrMostrarEmpleadores($itemEmpleadore, $valorEmpresa);\n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS EL TIPO DE SEGURO\n\t\t\t\t=============================================*/\n\n\t\t\t\t$itemSeguro = \"id\";\n\t\t\t\t$valorSeguro = $asegurados[$i][\"id_seguro\"];\n\n\t\t\t\t$seguros = ControladorSeguros::ctrMostrarSeguros($itemSeguro, $valorSeguro);\n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS LAS LOCALIDADES\n\t\t\t\t=============================================*/\n\n\t\t\t\t$itemLocalidad = \"id\";\n\t\t\t\t$valorLocalidad = $asegurados[$i][\"id_localidad\"];\n\n\t\t\t\t$localidades = ControladorLocalidades::ctrMostrarLocalidades($itemLocalidad, $valorLocalidad);\t\n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS LAS OCUPACIONES\n\t\t\t\t=============================================*/\n\n\t\t\t\t$itemOcupacion = \"id\";\n\t\t\t\t$valorOcupacion = $asegurados[$i][\"id_ocupacion\"];\n\n\t\t\t\t$ocupaciones = ControladorOcupaciones::ctrMostrarOcupaciones($itemOcupacion, $valorOcupacion);\t\t\t\t\n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS LAS ACCIONES\n\t\t\t\t=============================================*/\n\n\t\t\t\t$botones1 = \"<div class='btn-group'><button class='btn btn-info btnAgregarBeneficiario' idAsegurado='\".$asegurados[$i][\"id\"].\"' data-toggle='tooltip' title='Agregar Beneficiario'><i class='fas fa-check'></i></button></div>\";\n\n\t\t\t\t$botones2 = \"<div class='btn-group'><button class='btn btn-warning btnEditarEmpleador' idAsegurado='\".$asegurados[$i][\"id\"].\"' data-toggle='tooltip' title='Editar'><i class='fas fa-pencil-alt'></i></button><button class='btn btn-danger btnEliminarAsegurado' idAsegurado='\".$asegurados[$i][\"id\"].\"' data-toggle='tooltip' title='Eliminar'><i class='fas fa-times'></i></button></div>\";\n\n\t\t\t\t$datosJson .='[\n\t\t\t\t\t\"'.$botones1.'\",\t\n\t\t\t\t\t\"'.$empleadores[\"razon_social\"].'\",\t\t\t\n\t\t\t\t\t\"'.$seguros[\"tipo_seguro\"].'\",\t\n\t\t\t\t\t\"'.$asegurados[$i][\"matricula\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"documento_ci\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"paterno\"].' '.$asegurados[$i][\"materno\"].' '.$asegurados[$i][\"nombre\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"sexo\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"fecha_nacimiento\"].'\",\n\t\t\t\t\t\"'.$Localidades[\"nombre_localidad\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"zona\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"calle\"].' '.$asegurados[$i][\"nro_calle\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"salario\"].'\",\n\t\t\t\t\t\"'.$ocupaciones[\"nombre_ocupacion\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"fecha_ingreso\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"estado\"].'\",\n\t\t\t\t\t\"'.$botones2.'\"\n\t\t\t\t],';\n\t\t\t}\n\n\t\t\t$datosJson = substr($datosJson, 0, -1);\n\n\t\t\t$datosJson .= ']\n\t\t\t}';\t\n\n\t\t}\n\n\t\techo $datosJson;\n\t\n\t}", "public function limparTabela(){\r\n\t\t$sql = 'DELETE FROM oficina';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$consulta->execute();\r\n\t}", "function evt__cuadro_fechas__seleccionar ($fecha_cuadro){\n }", "protected function fijarTabla(){\n \n return \"categorias\";\n \n }", "public function select($usuario_has_hojaruta);", "function evt__Agregar()\n\t{\n\t\t$this->tabla()->resetear();\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "public function select(){\n\t$sql=\"SELECT * FROM tipousuario\";\n\treturn ejecutarConsulta($sql);\n}", "public static function tableName()\n { return 'magistrado'; }", "public function cadastrar(){\r\n //DEFINIR A DATA DE CADASTRO\r\n $this->cadastro = date('Y-m-d H:i:s');\r\n\r\n $db = new Database('cartao');\r\n $this->id = $db->insert([\r\n 'bandeira' => $this->bandeira,\r\n 'numero' => $this->numero,\r\n 'doador' => $this->doador,\r\n ]);\r\n\r\n }", "public function BuscarCadastro()\n\t{\n\t\treturn TableFactory::getInstance('Cadastro')->incluirCadastro();\n\t}", "public function mostrarDados(){\n\t\t$sql = \"SELECT cliente.cod_cliente, cliente.nome_cliente, categoria.cod_categoria, categoria.desc_categoria, servico.cod_servico, servico.desc_servico, servico.foto\t\n\t\t\t\tFROM cliente INNER JOIN (categoria INNER JOIN servico ON categoria.cod_categoria = servico.cod_categoria) ON cliente.cod_cliente = servico.cod_cliente\n\t\t\t\twhere cod_servico = '$this->cod_servico'\";\n\t\t$qry= self:: executarSQL($sql);\n\t\t$linha = self::listar($qry);\n\t\t\n\t\t$this-> cod_servico = $linha['cod_servico'];\n\t\t$this-> cod_categoria = $linha['cod_categoria'];\n\t\t$this-> desc_categoria = $linha['desc_categoria'];\n\t\t$this-> cod_cliente = $linha['cod_cliente'];\n\t\t$this-> nome_cliente = $linha['nome_cliente'];\n\t\t$this-> desc_servico = $linha['desc_servico'];\n\t\t$this-> foto = $linha['foto'];\n\t}", "function listado() {\r\n return self::consulta('SELECT * FROM \".self::$nTabla.\"');\r\n }", "function insertarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_ime';\n\t\t$this->transaccion='WF_TABLAINS_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t$this->setParametro('tipo_proceso','tipo_proceso','varchar');\n\t\t//si es detalle se añade un parametro para el id del maestro\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] != 'maestro') {\n\t\t\t\n\t\t\t$this->setParametro($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_campo_maestro'],\n\t\t\t\t\t\t\t\t$_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_campo_maestro'],'integer');\n\t\t}\n\t\t//Define los parametros para la funcion\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t$this->setParametro($value['bd_nombre_columna'],$value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\t\n\t\t}\t\t\t\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function select()\n {\n $sql = \"SELECT * FROM tipousuario\";\n return ejecutarConsulta($sql);\n }", "function selectByIdac_consumos($consumo_id){\n\t\t\t$this->connection = Connection::getinstance()->getConn();\n\t\t\t$PreparedStatement = \"SELECT consumo_id, socio_id, nro_medidor, fecha_lectura, fecha_emision, periodo_mes, periodo_anio, consumo_total_lectura, consumo_por_pagar, costo_consumo_por_pagar, estado, fecha_hora_pago, usuario_pago, monto_pagado, pagado_por, ci_pagado_por,\n (SELECT CONCAT(nombres,' ',apellidos) FROM asapasc.ac_socios WHERE socio_id = asapasc.ac_consumos.socio_id) AS socio \n FROM asapasc.ac_consumos WHERE consumo_id = \".Connection::inject($consumo_id).\" ;\";\n\t\t\t$ResultSet = mysql_query($PreparedStatement,$this->connection);\n\t\t\tlogs::set_log(__FILE__,__CLASS__,__METHOD__, $PreparedStatement);\n\n\t\t\t$elem = new ac_consumosTO();\n\t\t\twhile($row = mysql_fetch_array($ResultSet)){\n\t\t\t\t$elem = new ac_consumosTO();\n\t\t\t\t$elem->setConsumo_id($row['consumo_id']);\n\t\t\t\t$elem->setSocio_id($row['socio_id']);\n\t\t\t\t$elem->setNro_medidor($row['nro_medidor']);\n\t\t\t\t$elem->setFecha_lectura($row['fecha_lectura']);\n\t\t\t\t$elem->setFecha_emision($row['fecha_emision']);\n\t\t\t\t$elem->setPeriodo_mes($row['periodo_mes']);\n\t\t\t\t$elem->setPeriodo_anio($row['periodo_anio']);\n\t\t\t\t$elem->setConsumo_total_lectura($row['consumo_total_lectura']);\n\t\t\t\t$elem->setConsumo_por_pagar($row['consumo_por_pagar']);\n\t\t\t\t$elem->setCosto_consumo_por_pagar($row['costo_consumo_por_pagar']);\n\t\t\t\t$elem->setEstado($row['estado']);\n\t\t\t\t$elem->setFecha_hora_pago($row['fecha_hora_pago']);\n\t\t\t\t$elem->setUsuario_pago($row['usuario_pago']);\n\t\t\t\t$elem->setMonto_pagado($row['monto_pagado']);\n\t\t\t\t$elem->setPagado_por($row['pagado_por']);\n\t\t\t\t$elem->setCi_pagado_por($row['ci_pagado_por']);\n $elem->setSocio($row['socio']);\n\n\t\t\t}\n\t\t\tmysql_free_result($ResultSet);\n\t\t\treturn $elem;\n\t\t}", "function insertarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_ime';\n\t\t$this->transaccion='WF_tabla_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tipo_proceso','id_tipo_proceso','int4');\n\t\t$this->setParametro('vista_id_tabla_maestro','vista_id_tabla_maestro','int4');\n\t\t$this->setParametro('bd_scripts_extras','bd_scripts_extras','text');\n\t\t$this->setParametro('vista_campo_maestro','vista_campo_maestro','varchar');\n\t\t$this->setParametro('vista_scripts_extras','vista_scripts_extras','text');\n\t\t$this->setParametro('bd_descripcion','bd_descripcion','text');\n\t\t$this->setParametro('vista_tipo','vista_tipo','varchar');\n\t\t$this->setParametro('menu_icono','menu_icono','varchar');\n\t\t$this->setParametro('menu_nombre','menu_nombre','varchar');\n\t\t$this->setParametro('vista_campo_ordenacion','vista_campo_ordenacion','varchar');\n\t\t$this->setParametro('vista_posicion','vista_posicion','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('menu_codigo','menu_codigo','varchar');\n\t\t$this->setParametro('bd_nombre_tabla','bd_nombre_tabla','varchar');\n\t\t$this->setParametro('bd_codigo_tabla','bd_codigo_tabla','varchar');\n\t\t$this->setParametro('vista_dir_ordenacion','vista_dir_ordenacion','varchar');\n\t\t$this->setParametro('vista_estados_new','vista_estados_new','varchar');\n\t\t$this->setParametro('vista_estados_delete','vista_estados_delete','varchar');\t\t\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function crearTablas(){\r\n\t\t\t$this->crearTablaUsuario();\r\n\t\t\t$this->crearTablaDeporte();\r\n\t\t\t$this->crearTablaUsuarioDeporte();\r\n\t\t\t$this->crearTablaPassw();\r\n\t\t}", "function recorre_tabla($nombret,$campot){\r\n$sql_query= \"Select $campot From $nombret where estado=true\";\r\n$consulta = pg_query($sql_query);\r\nwhile($fila=pg_fetch_row($consulta)) \r\n { echo \"<option value='\".$fila[1].\"'>\".$fila[0].\"</option>\"; } \r\n}", "public function SelectById($paciente){\n\t\t\t$sql = \"SELECT p.*, e.* FROM tbl_paciente AS p INNER JOIN tbl_endereco AS e ON p.id_endereco = e.id_endereco WHERE id_paciente = \". $paciente->id_paciente;\n\n\t\t\t//Instancio o banco e crio uma variavel\n\t\t\t$conex = new Mysql_db();\n\n\t\t\t/*Chama o método para conectar no banco de dados e guarda o retorno da conexao\n\t\t\tna variavel que $PDO_conex*/\n\t\t\t$PDO_conex = $conex->Conectar();\n\n\t\t\t$select = $PDO_conex->query($sql);\n\n\t\t\t//Executa o script no banco de dados\n\t\t\tif($rs = $select->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t//Se der true redireciona a tela\n\n\t\t\t\t$paciente = array();\n\n $paciente = $rs;\n\n\t\t\t\t// Guarda os dados no banco de dados em cada indice do objeto criado\n\t\t\t\t/*$paciente->id_paciente = $rs['id_paciente'];\n $paciente->id_endereco = $rs['id_endereco'];\n $paciente->id_convenio = $rs['id_convenio'];\n $paciente->nome = $rs['nome'];\n $paciente->sobrenome = $rs['sobrenome'];\n $paciente->dt_nasc = $rs['dt_nasc'];\n $paciente->rg = $rs['rg'];\n $paciente->cpf = $rs['cpf'];\n $paciente->carteirinha_convenio = $rs['carteirinha_convenio'];\n $paciente->foto = $rs['foto'];\n $paciente->status = $rs['status'];\n\t\t\t\t $paciente->id_endereco = $rs['id_endereco'];\n $paciente->cep = $rs['cep'];\n $paciente->logradouro = $rs['logradouro'];\n $paciente->numero = $rs['numero'];\n $paciente->id_estado = $rs['id_estado'];\n $paciente->cidade = $rs['cidade'];\n $paciente->bairro = $rs['bairro']; */\n\n return $paciente;\n\n\t\t\t}else {\n\t\t\t\t//Mensagem de erro\n\t\t\t\techo \"Error ao selecionar no Banco de Dados\";\n\t\t\t}\n\n\t\t\t//Fecha a conexão com o banco de dados\n\t\t\t$conex->Desconectar();\n\t\t}", "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}", "public function Carrera()\n {\n include('conexion.php');\n $Consulta_Carrera = \"SELECT * FROM p_carrera ORDER BY car_nombre\";\n $Resultado_Consulta_Carrera = $conexion->prepare($Consulta_Carrera);\n $Resultado_Consulta_Carrera->execute();\n while ($a = $Resultado_Consulta_Carrera->fetch())\n {\n echo '<option value=\"'.$a[car_codigo].'\">'.$a[car_nombre].'</option>';\n }\n\n }", "static public function ctrCargarSelectOrientacion(){\r\n\r\n $tabla = \"tbl_orientacion\";\r\n\r\n $respuesta = ModeloModalidades::mdlCargarSelect($tabla);\r\n\r\n return $respuesta;\r\n\r\n }", "function cargarDatosColumnaProceso($link=0){\n\t\t$this->procedimiento='wf.ft_tipo_columna_sel';\n\t\t$this->transaccion='WF_TIPCOLES_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t$this->setCount(false);\n\t\t$this->resetParametros();\n\t\t$this->resetCaptura();\n\t\t\n\t\t$this->setParametrosConsulta();\t\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t\t\t\n\t\t$this->captura('id_tipo_columna','int4');\n\t\t$this->captura('id_tabla','int4');\n\t\t$this->captura('id_tipo_proceso','int4');\n\t\t$this->captura('bd_campos_adicionales','text');\n\t\t$this->captura('form_combo_rec','varchar');\n\t\t$this->captura('bd_joins_adicionales','text');\n\t\t$this->captura('bd_descripcion_columna','text');\n\t\t$this->captura('bd_tamano_columna','varchar');\n\t\t$this->captura('bd_formula_calculo','text');\n\t\t$this->captura('form_sobreescribe_config','text');\n\t\t$this->captura('form_tipo_columna','varchar');\n\t\t$this->captura('grid_sobreescribe_filtro','text');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('bd_nombre_columna','varchar');\n\t\t$this->captura('form_es_combo','varchar');\n\t\t$this->captura('form_label','varchar');\n\t\t$this->captura('grid_campos_adicionales','text');\n\t\t$this->captura('bd_tipo_columna','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('momento','varchar');\n\t\t\n\t\t$this->armarConsulta();\t\n\t\t\t\t\n\t\t$array = array();\n\t\t$res = pg_query($link,$this->consulta);\n\t\tif ($res) {\n\t\t\twhile ($row = pg_fetch_array($res,NULL,PGSQL_ASSOC)){\n\t\t\t\tarray_push ($array, $row);\n\t\t\t}\n\t\t\tpg_free_result($res);\n\t\t\treturn $array;\n\t\t} else {\n\t\t\t$resp_procedimiento=$this->divRespuesta(str_replace('ERROR: ','', pg_last_error($link)));\n\t\t\t$this->respuesta=new Mensaje();\t\t\t\t\n\t\t\t//Existe error en la base de datos tomamamos el mensaje y elmensaje tecnico\n\t\t\t$this->respuesta->setMensaje('ERROR',$this->nombre_archivo,$resp_procedimiento['mensaje'],$resp_procedimiento['mensaje_tec'],'base',$this->procedimiento,$this->transaccion,$this->tipo_procedimiento,$this->consulta);\n\t\t\treturn $this->respuesta;\n\t\t}\n\t}", "function listadoSelect();", "function abrirSeleccionAlumno(){\n\t\t\t$seleccionTiempo\t\t= new SeleccionTiempo();\n\t\t\t//$condicionadoss\t\t\t= new ReconsideracionBaja();\n\n\t\t\t$this->redirect(\"profesor/informacion\");\n\t\t\treturn;\n\t\t\t\n\t\t\t$day = date (\"d\");\n\t\t\t$month = date (\"m\");\n\t\t\t$year = date (\"Y\");\n\t\t\t$date1 = date (\"Y-m-d\", mktime(0, 0, 0, $month, $day, $year));\n\n\t\t\t$nomina = Session::get_data('registro');\n\t\t\t$division = Session::get_data('coordinacion');\n\n\t\t\tunset( $this -> noCondicionados );\n\t\t\tunset( $this -> condicionados );\n\t\t\t$Periodos = new Periodos();\n\t\t\t$periodo = $Periodos -> get_periodo_actual();\n\n\t\t\t$i = 0;\n\t\t\tforeach( $seleccionTiempo -> find_all_by_sql\n\t\t\t\t\t ( \"select al.miReg registroo, al.vcNomAlu, al.enPlan\n\t\t\t\t\t\tFrom alumnos al\n\t\t\t\t\t\twhere (pago = 1\n\t\t\t\t\t\tor condonado = 1)\n\t\t\t\t\t\tand al.miReg not in\n\t\t\t\t\t\t( select registro\n\t\t\t\t\t\t from reconsideracion_baja\n\t\t\t\t\t\t where periodo = '\".$periodo.\"')\n\t\t\t\t\t\t order by al.miReg\" ) as $selTiempo ){\n\n\t\t\t\t$this -> noCondicionados[$i] = $selTiempo;\n\t\t\t\t$i ++;\n\t\t\t}\n\t\t\t/*\n\t\t\t$i = 0;\n\t\t\tforeach( $condicionadoss -> find_all_by_sql\n\t\t\t\t\t( \"Select rb.registro as registroo, al.vcNomAlu, al.enPlan\n\t\t\t\t\t\tfrom reconsideracion_baja rb, alumnos al\n\t\t\t\t\t\twhere rb.procede = 1\n\t\t\t\t\t\tand rb.periodo = \".$periodo.\"\n\t\t\t\t\t\tand rb.registro = al.miReg\n\t\t\t\t\t\torder by registro\" ) as $condicionado ){\n\n\t\t\t\t$this -> condicionados[$i]\t\t= $condicionado;\n\t\t\t\t$i ++;\n\t\t\t}\n\t\t\t*/\n }", "protected function _getTableOptions(){ }", "function getTituloCombo($tabelaProcura){\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n $retorno = $pk = '';\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n # Recupera o nome da tabela e gera o nome da classe\n if($tabelaProcura != $aTabela['NOME']) \n continue;\n\n # Varre a estrutura dos campos da tabela em questao\n foreach($aTabela as $oCampo){ \n //print \"@@{$oCampo->NOME}\\n\";\n //print_r($aTabela); exit;\n # Se o campo for chave, nao sera usado\n if($oCampo->CHAVE == 1){\n $pk = $oCampo->NOME;\n \n if((String)$oCampo->FKTABELA == ''){\n continue;\n }\n }\n\n # Se o campo for do tipo numerico, nao sera usado, nao sera usado\n if(!preg_match(\"#varchar#is\", (String)$oCampo->TIPO)) continue;\n \n # Se o campo tiver nomenclatura que nao remeta a nome/descricao sera eliminado \n if(preg_match(\"#(?:nome|descricao)#is\", (String)$oCampo->NOME)){\n $retorno = (String)$oCampo->NOME;\n break;\n }\n \n # Se o campo tiver nomenclatura que nao remeta a nome/descricao sera eliminado \n if(preg_match(\"#(?:usuario|login|nome_?(?:pessoa|cliente|servidor)|descricao|titulo|nm_(?:pessoa|cliente|servidor|estado_?civil|lotacao|credenciado)|desc_)#is\", (String)$oCampo->NOME)){\n $retorno = (String)$oCampo->NOME;\n break;\n }\n \n # Recupera valores a serem substituidos no modelo\n \n }\n break;\n }\n if($retorno == '')\n $retorno = $pk;\n return (string)$retorno;\n }", "static public function mdlCargarSelect($tabla) {\r\n\r\n $stmt = ConexionBD::Abrir_Conexion()->prepare(\"SELECT Activo FROM $tabla\");\r\n $stmt->execute();\r\n\r\n return $stmt->fetchall();\r\n }", "function generar()\r\n\t{\r\n\t\tforeach($this->columnas as $ef) {\r\n\t\t \t$this->datos->tabla('columnas')->nueva_fila($ef->get_datos());\r\n\t\t}\r\n\t\tparent::generar();\r\n\t}", "function SelectValuesSeguros_Empresas($db_conx, $table) {\r\n $sql = \"\";\r\n if ($table == \"seguros\") {\r\n $sql = \"SELECT * FROM tseguros ORDER BY seg_descrip ASC\";\r\n } else {\r\n $sql = \"SELECT * FROM tempresas ORDER BY emp_descrip ASC\";\r\n }\r\n $query = mysqli_query($db_conx, $sql);\r\n\r\n $n_filas = $query->num_rows;\r\n $data = '<select size=\"12\" class=\"cmb' . $table . '\" id=\"cmb' . $table . '\">\r\n <option value=\"\">Ninguno</option>';\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] . \"_\" . $row[2] . '</option>';\r\n $c++;\r\n }\r\n $data .= '</select>';\r\n echo $data;\r\n}", "public function mostrar_insertar() {\r\n\t\t\t$this -> pantalla_edicion('insertar'); \r\n\t\t }", "function creaTablaPartidos(){\r\n // Create connection\r\n $conn = dameConexion();//new mysqli($servername, $username, $password, $dbname);\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Conexión fallida: \" . $conn->connect_error);\r\n }\r\n \r\n // sql to create table carta (Nombre, Coleccion, Imagen, fecha, entrada)\r\n $sql = \"CREATE TABLE partidos (\r\n id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,\r\n Local VARCHAR(15) NOT NULL,\r\n Visitante VARCHAR(15),\r\n Resultado VARCHAR(5),\r\n Entrada INT(6)\r\n )\";\r\n \r\n if ($conn->query($sql) === TRUE) {\r\n echo \"Tabla creada correctamente\";\r\n } else {\r\n \r\n //echo \"Error creando la tabla: \" . $conn->error;\r\n }\r\n \r\n $conn->close();\r\n}", "public function asignado() {\n \treturn $this->db\n \t\t->select(format_select(array(\n \t\t\t'cirugia.idCirugia' \t\t\t => 'idCirugia',\n \t\t\t'empleado.idEmpleado' \t\t => 'idEmpleado',\n \t\t\t'empleado.matricula'\t\t\t => 'matricula',\n \t\t\t'empleado.nombre' \t\t\t => 'nombre',\n \t\t\t'empleado.apellido_paterno' => 'a_paterno',\n \t\t\t'empleado.apellido_materno' => 'a_materno',\n \t\t\t'especialidad.nombre' \t\t => 'especialidad',\n \t\t\t'cirugia.fecha' \t\t\t\t => 'fecha',\n \t\t\t'quirofano.nombre'\t\t\t => 'quirofano'\n \t\t)))\n \t\t->join('usuario','tipo_usuario.idTipo_Usuario = usuario.idTipo_Usuario')\n \t\t->join('empleado','empleado.idEmpleado = usuario.idEmpleado')\n \t\t->join('departamento','departamento.idDepartamento = tipo_usuario.idDepartamento')\n \t\t->join('especialidad','especialidad.idEspecialidad = departamento.idEspecialidad')\n \t\t->join('proceso_tipo_usuario','proceso_tipo_usuario.idTipo_Usuario = tipo_usuario.idTipo_Usuario')\n \t\t->join('proceso','proceso.idProceso = proceso_tipo_usuario.idProceso')\n \t\t->join('cirugia','cirugia.idProceso = proceso.idProceso AND cirugia.idquirofano > 0 AND cirugia.status = \"1\"')\n \t\t->join('quirofano','cirugia.idQuirofano = quirofano.idQuirofano')\n \t\t->get('tipo_usuario')\n \t\t->result_array();\n }", "function loadSelectValores($tabla, $codigo, $opt) {\r\n\tswitch ($tabla) {\r\n\t\tcase \"ORDENAR-PROCESOS\":\r\n\t\t\t$c[0] = \"p.CodProceso\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"p.Descripcion\"; $v[1] = \"Descripci&oacute;n\";\r\n\t\t\t$c[2] = \"p.Estado\"; $v[2] = \"Estado\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-FASES\":\r\n\t\t\t$c[0] = \"f.CodFase\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"f.Descripcion\"; $v[1] = \"Descripci&oacute;n\";\r\n\t\t\t$c[2] = \"f.Estado\"; $v[2] = \"Estado\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-TIPOACTUACION\":\r\n\t\t\t$c[0] = \"taf.CodTipoActuacion\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"taf.Descripcion\"; $v[1] = \"Descripci&oacute;n\";\r\n\t\t\t$c[2] = \"taf.Estado\"; $v[2] = \"Estado\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ESTADO-ACTUACION-DETALLE\":\r\n\t\t\t$c[0] = \"PE\"; $v[0] = \"Pendiente\";\r\n\t\t\t$c[1] = \"EJ\"; $v[1] = \"En Ejecución\";\r\n\t\t\t$c[2] = \"AN\"; $v[2] = \"Anulada\";\r\n\t\t\t$c[3] = \"TE\"; $v[3] = \"Terminada\";\r\n\t\t\t$c[4] = \"CE\"; $v[4] = \"Cerrada\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-ACTUACION-DETALLE\":\r\n\t\t\t$c[0] = \"a.CodFase, af.Anio, af.Secuencia, af.CodActuacion\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"oe.Organismo, de.Dependencia\"; $v[1] = \"Ente Externo\";\r\n\t\t\t$c[2] = \"a.Descripcion\"; $v[2] = \"Actividad\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ESTADO-ACTUACION-PRORROGA\":\r\n\t\t\t$c[0] = \"PR\"; $v[0] = \"En Preparación\";\r\n\t\t\t$c[1] = \"RV\"; $v[1] = \"Revisada\";\r\n\t\t\t$c[2] = \"AP\"; $v[2] = \"Aprobada\";\r\n\t\t\t$c[3] = \"AN\"; $v[3] = \"Anulada\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-ACTUACION-PRORROGA\":\r\n\t\t\t$c[0] = \"p.CodProrroga\"; $v[0] = \"Prorroga\";\r\n\t\t\t$c[1] = \"p.Motivo\"; $v[1] = \"Motivo\";\r\n\t\t\t$c[2] = \"a.Descripcion\"; $v[2] = \"Actividad\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-VALORACION-DETALLE\":\r\n\t\t\t$c[0] = \"a.CodFase, vj.Anio, vj.Secuencia, vj.CodValJur\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"oe.Organismo, de.Dependencia\"; $v[1] = \"Ente Externo\";\r\n\t\t\t$c[2] = \"a.Descripcion\"; $v[2] = \"Actividad\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-POTESTAD-DETALLE\":\r\n\t\t\t$c[0] = \"a.CodFase, vj.Anio, vj.Secuencia, vj.CodPotestad\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"oe.Organismo, de.Dependencia\"; $v[1] = \"Ente Externo\";\r\n\t\t\t$c[2] = \"a.Descripcion\"; $v[2] = \"Actividad\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ORDENAR-DETERMINACION-DETALLE\":\r\n\t\t\t$c[0] = \"a.CodFase, vj.Anio, vj.Secuencia, vj.CodDeterminacion\"; $v[0] = \"C&oacute;digo\";\r\n\t\t\t$c[1] = \"oe.Organismo, de.Dependencia\"; $v[1] = \"Ente Externo\";\r\n\t\t\t$c[2] = \"a.Descripcion\"; $v[2] = \"Actividad\";\r\n\t\t\tbreak;\r\n\t}\r\n\t\r\n\t$i = 0;\r\n\tswitch ($opt) {\r\n\t\tcase 0:\r\n\t\t\tforeach ($c as $cod) {\r\n\t\t\t\tif ($cod == $codigo) echo \"<option value='\".$cod.\"' selected>\".$v[$i].\"</option>\";\r\n\t\t\t\telse echo \"<option value='\".$cod.\"'>\".$v[$i].\"</option>\";\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase 1:\r\n\t\t\tforeach ($c as $cod) {\r\n\t\t\t\tif ($cod == $codigo) echo \"<option value='\".$cod.\"' selected>\".$v[$i].\"</option>\";\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n}", "public function select($calendario);", "private static function setgenerateCACHE_SELECT($schmaTabls)\n {\n self::getFileCashDB()->set($schmaTabls, self::CACHE_SELECT);\n }", "function carregaABTest() {\n $tabela = new TabelaModel(\"abtest\", \"id_abtest\", \"nm_abtest\");\n $coluna = $this->adicionaColunaNormal($tabela, \"ID abtest\", \"id_abtest\", true, TIPO_INPUT_INTEIRO);\n // $coluna->setInvisible();\n $coluna = $this->adicionaColunaNormal($tabela, \"Nome do ABTest\", \"nm_abtest\", false, TIPO_INPUT_TEXTO_CURTO);\n $coluna->setDetalhesInclusao(true, true, \"novo test AB\");\n $coluna = $this->adicionaColunaNormal($tabela, \"URL ABTest (opcional)\", \"url_abtest\", false, TIPO_INPUT_TEXTO_CURTO);\n $coluna->setHintText(\"Exemplo: login/new\");\n $coluna->setDetalhesInclusao(true, true, null);\n $coluna = $this->adicionaColunaNormal($tabela, \"Descrição\", \"desc_abtest\", false, TIPO_INPUT_TEXTAREA, 250);\n $coluna->setDetalhesInclusao(true, true, null);\n $coluna = $this->adicionaColunaComFK($tabela, \"Tipo ABTest\", \"id_tipo_abtest\", false, false, \"tipo_abtest\", TIPO_INPUT_SELECT_FK);\n $coluna->setDetalhesInclusao(true, true, FIRST_OPTION);\n\n $this->adicionaColunaCalculada($tabela, \"Participantes\", \"cont_participantes\", \"select count(*) as cont_participantes from abtest_usuario,abtest_variacao where abtest_variacao.id_abtest_variacao=abtest_usuario.id_abtest_variacao and abtest_variacao.id_abtest=\");\n $this->adicionaColunaCalculada($tabela, \"Variações\", \"cont_variacoes\", \"select count(*) as cont_variacoes from abtest_variacao where abtest_variacao.id_abtest=\");\n $this->adicionaColunaCalculada($tabela, \"Votos\", \"count_votos\", \"select sum(count_abtest_variacao) as count_votos from abtest_variacao where abtest_variacao.id_abtest=\");\n\n $tabela->setPaginaInclusao(getHomeDir() . \"abtest\");\n\n return $tabela;\n }", "public function crear() {\n /**\n * guardamos la consulta en $sql\n * ejecutamos la consulta en php \n * asignamos el id del objeto = al ultimo id que añadimos a la bd, asi coincidiran el id objeto con tupla\n * lista de atributos a introducir valores de atributos a introducir\n * formato insertar datos INSERT INTO NombreTabla (NombreAtributo1, NombreAtributo2) VALUES (ValorAtributo1, ValorAtributo2)\n */\n // para acceder a una cosntante de la clase NombreClase::NOMBRECONSTANTE\n \n try {\n $sql=\"INSERT INTO \".Bebidas::TABLA[0].\" (nombre, descripcion, tipo, estado, foto) VALUES ('$this->nombre', '$this->descripcion', '$this->tipo', '$this->estado', '$this->foto')\";\n $this->conexion->query($sql);\n $this->__set(\"id_bebida\", $this->conexion->insert_id);\n } catch (Exception $ex) {\n echo 'error '.$ex;\n }\n \n }", "public function listaCaixa($codEmpresa,$codSetor,$codCaixa)\n {\n $conexao=Conexao::getConnection();\n $result=array();\n \n $sql =\"SELECT '' CodCaixa,'=>Selecionar Caixa<=' Caixa \";\n $sql.=\"UNION ALL \";\n \n $sql.=\"SELECT cod_caixa CodCaixa ,des_caixa Caixa \";\n $sql.=\" FROM tb_caixas \";\n \n $smtm=$conexao -> prepare($sql);\n \n if ($codCaixa != \"\" )\n {\n $sql.= \" WHERE cod_empresa =? AND \";\n $sql.= \" cod_setor =? AND \";\n $sql.= \" cod_caixa =? \";\n \n $smtm=$conexao->prepare($sql);\n \n $smtm->bindValue(1,$codEmpresa);\n $smtm->bindValue(2,$codSetor);\n $smtm->bindValue(3,$codCaixa);\n \n }\n elseif ($codSetor != \"\" )\n {\n \n $sql.= \" WHERE cod_empresa=? AND \";\n $sql.= \" cod_setor =? \";\n \n $smtm=$conexao->prepare($sql);\n \n $smtm->bindValue(1,$codEmpresa);\n $smtm->bindValue(2,$codSetor);\n \n }\n \n $smtm->execute();\n $result=$smtm->fetchAll(PDO::FETCH_ASSOC);\n $conexao=null;\n\n $html=\"\";\n foreach ($result as $key=>$coluna){\n\n if ( $key=='' )\n {\n $html.='<option disabled selected value=\"'. $coluna[\"CodCaixa\"] .'\">' .$coluna[\"Caixa\"] .\"</option>\"; \n }\n else\n {\n $html.='<option value=\"'. $coluna[\"CodCaixa\"] .'\">' .$coluna[\"Caixa\"] .\"</option>\"; \n }\n }\n return $html;\n }", "function carregaTipoABTest() {\n $tabela = new TabelaModel(\"tipo_abtest\", \"id_tipo_abtest\", \"nm_tipo_abtest\");\n $coluna = $this->adicionaColunaNormal($tabela, \"ID Tipo abtest\", \"id_tipo_abtest\", true, TIPO_INPUT_INTEIRO);\n //$coluna->setInvisible();\n $coluna = $this->adicionaColunaNormal($tabela, \"Tipo do ABTest\", \"nm_tipo_abtest\", false, TIPO_INPUT_TEXTO_CURTO);\n $coluna->setDetalhesInclusao(true, true, \"Novo tipo Teste AB\");\n $coluna = $this->adicionaColunaComFK($tabela, \"Pagina\", \"id_pagina\", false, true, \"pagina\", TIPO_INPUT_SELECT_FK);\n $coluna->setDetalhesInclusao(true, false, null);\n $coluna = $this->adicionaColunaNormal($tabela, \"Guest only?\", \"flag_guest_only\", false, TIPO_INPUT_BOOLEAN);\n $coluna->setDetalhesInclusao(true, false, null);\n\n\n $tabela->setPaginaInclusao(getHomeDir() . \"tipoabtest\");\n\n return $tabela;\n }", "public function actionSelect(){\n $select = $this->select('Pilih donk akhh..', ['kopi'=>'kopi', 'susu'=>'susu']);\n echo \"Pilihan nya adalah : $select\";\n }", "public function actionConsultarNumeroFactura()\n\t{\n//\t\techo $id;\n\t\t$tipoTalonario=$_POST['tipoTalonario'];\n\t\t$data = Talonario::model()->findByPk($tipoTalonario);\n\t\t$data = CHtml::listData($data,'idTalonario','proximo');\n\t\tforeach($data as $value=>$name) {\n\t\t\techo CHtml::tag('option',\n\t\t\t\tarray('value'=>$value),CHtml::encode($name),true);\n\t\t}\n\t}", "function recorre_tabla($nombret,$campot){\r\n$sql_query= \"Select $campot From $nombret\";\r\n$consulta = pg_query($sql_query);\r\nwhile($fila=pg_fetch_row($consulta)) \r\n { echo \"<option value='\".$fila[0].\"'>\".$fila[0].\"</option>\"; } \r\n}", "public function buscaTarefa($tarefa)\n {\n //Monta a Query\n $query = \"SELECT * FROM tarefas WHERE id={$tarefa->id};\";\n //Executa a Query no Banco\n $resultado = mysqli_query($this->conexao, $query);\n\n $tarefa_atual = mysqli_fetch_assoc($resultado);\n\n $categoria = new Categoria();\n $categoria->setId($tarefa_atual['categoria_id']);\n\n $tarefa_select = new Tarefa($tarefa_atual['nome'], $categoria, $tarefa_atual['id_usuario']);\n $tarefa_select->id = $tarefa_atual['id'];\n $tarefa_select->inicio = $tarefa_atual['data_inicio'];\n $tarefa_select->fim = $tarefa_atual['data_fim'];\n\n //Retorna o resultado da inserção (Positivo ou Negativo)\n return $tarefa_select;\n }", "public function comboContrato($idCliente, $tipo, $isContagemAuditoria = NULL) {\n $arrRetorno = array();\n //pega o id empresa caso seja uma contagem de auditoria\n $idEmpresa = getIdEmpresa();\n //verifica antes se eh uma contagem de auditoria\n if ($isContagemAuditoria) {\n $sql = \"SELECT con.id, con.id_cliente, con.numero, con.ano, con.uf, con.tipo, emp.sigla, cli.id_fornecedor FROM $this->table con, cliente cli, empresa emp \"\n . \"WHERE con.is_ativo IN (0, 1) AND \"\n . \"con.id_cliente = cli.id AND \"\n . \"cli.id_empresa = emp.id AND \"\n . \"emp.id = $idEmpresa \"\n . \" ORDER BY sigla ASC, id_fornecedor DESC\";\n } else {\n if ($tipo == '01') {\n $sql = \"SELECT id, id_cliente, numero, uf, ano, tipo, '-' AS sigla FROM $this->table WHERE is_ativo IN (0, 1) AND id_cliente = $idCliente ORDER BY id ASC\";\n } else {\n $sql = \"SELECT id, id_cliente, numero, uf, ano, tipo, '-' AS sigla FROM $this->table WHERE is_ativo = 1 AND id_cliente = $idCliente ORDER BY id ASC\";\n }\n }\n $stm = DB::prepare($sql);\n $stm->execute();\n //loop dos contratos\n $ret = $stm->fetchAll(PDO::FETCH_ASSOC);\n //sempre com um item vazio para nao dar erro no script\n $arrRetorno[] = array(\n 'id' => 0,\n 'numeroAno' => 'Selecione um contrato',\n 'tipo' => '',\n 'sigla' => '');\n if ($isContagemAuditoria) {\n foreach ($ret as $linha) {\n if ($linha['id_fornecedor'] > 0) {\n $sql = \"SELECT id, sigla, tipo FROM fornecedor WHERE id = :idFornecedor\";\n $stmSigla = DB::prepare($sql);\n $stmSigla->bindParam(':idFornecedor', $linha['id_fornecedor']);\n $stmSigla->execute();\n $siglaFornecedor = $stmSigla->fetch(PDO::FETCH_ASSOC);\n //apenas fornecedores, retirar turmas daqui\n if (!$siglaFornecedor['tipo']) {\n $arrRetorno[] = array('id' => $linha['id'],\n 'numeroAno' => ' [ ' . strtoupper($linha['uf']) . ' ] ' . $linha['numero'] . '/' . $linha['ano'],\n 'tipo' => '[ ' . $linha['tipo'] . ' ]',\n 'sigla' => '[ ' . $linha['tipo'] . ' ] ' . $linha['sigla'] . ' &laquo; ' . $siglaFornecedor['sigla'] . ' &raquo; ');\n }\n } else {\n $arrRetorno[] = array('id' => $linha['id'],\n 'numeroAno' => ' [ ' . strtoupper($linha['uf']) . ' ] ' . $linha['numero'] . '/' . $linha['ano'],\n 'tipo' => '[ ' . $linha['tipo'] . ' ]',\n 'sigla' => '[ ' . $linha['tipo'] . ' ] ' . $linha['sigla'] . ' . ');\n }\n }\n return $arrRetorno;\n } else {\n foreach ($ret as $linha) {\n $arrRetorno[] = array('id' => $linha['id'],\n 'numeroAno' => ' [ ' . strtoupper($linha['uf']) . ' ] ' . $linha['numero'] . '/' . $linha['ano'],\n 'tipo' => '[ ' . $linha['tipo'] . ' ]',\n 'sigla' => '[ ' . $linha['tipo'] . ' ] ' . $linha['sigla']);\n }\n return $arrRetorno;\n }\n }", "public function addtecnologia($value,$marca) {\n \t\t$centros = new Zend_Db_Table('tecnologias');\n $rows = $centros->fetchAll(\n\t\t\t\t$centros->select()->from(array(\"t\" => \"tecnologias\"), array(\"t.CodTecnologia\",\"t.NombreTecnologia\"))\n ->join(array('mt' => \"marcas_tecnologias\"),\"t.CodTecnologia = mt.CodTecnologia\",array())\n ->where(\"t.CodTecnologia in (select mt.CodTecnologia from marcas_tecnologias where mt.CodMarca=$marca)\")\n ->order('t.NombreTecnologia asc')\n \t)->toArray();\n //creo el arreglo de options\n $select= array();\n $select[0]='(Seleccione una tecnologia)';\n\t\tforeach ($rows as $rowArray) {\n\t\t\t$select[$rowArray['CodTecnologia']]=$rowArray['NombreTecnologia'];\n\t\t}\n\t\t$element = new Zend_Form_Element_Select(\"tecnologia\");\n\t\t$element->setRequired(true)->setLabel('Tecnologia');\n\t\t$element->setMultiOptions($select);\n\t\t$element->setValue($value);\n\t\t$element->setAttrib('onChange','\n ajaxModeloField();');\n\t\t$element->setDecorators(array(\n 'ViewHelper',\n 'Description',\n 'Errors',\n array(array('data'=>'HtmlTag'), array('tag' => 'td')),\n array('Label', array('tag' => 'td')),\n array(array('row'=>'HtmlTag'),array('tag'=>'tr'))\n ));\n\t\t$this->espcequip->addElement($element);\n }", "public function select(){\n\t\t$sql = \"SELECT * FROM equipo_tipo\n\t\t\t\twhere equi_tip_estado = 1\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "function SelectPaciente($db_conx, $query = NULL) {\r\n\r\n if ($query == NULL) {\r\n $sql = \"SELECT * FROM tpaciente\";\r\n $query = mysqli_query($db_conx, $sql);\r\n }\r\n $n_columnas = $query->field_count;\r\n $n_filas = $query->num_rows;\r\n $data = '<tr class=\"row_header\">\r\n <td>COD</td> \r\n <td>Nombre / Cedula </td> \r\n <td>F. Nacimiento</td>\r\n <td>Genero / Est. Civil</td>\r\n <td>Instruccion</td>\r\n <td>Hist. Clinica</td>\r\n <td>Telefono</td>\r\n <td>Seguro / Empresa</td>\r\n <td id=\"custom-action\"></td>\r\n </tr>';\r\n while ($row = mysqli_fetch_array($query)) {\r\n $data .= '<tr class=\"row_data\">';\r\n $data .= '<td><span id=\"td_' . $row[0] . '_0\">' . $row[0] . '</span></td>'; //Cod \r\n $data .= '<td><span id=\"td_' . $row[0] . '_6\">' . $row[6] . '</span> '; //pape\r\n $data .= '<span id=\"td_' . $row[0] . '_7\">' . $row[7] . '</span> '; //sape\r\n $data .= '<span id=\"td_' . $row[0] . '_4\">' . $row[4] . '</span> '; //pnom\r\n $data .= '<span id=\"td_' . $row[0] . '_5\">' . $row[5] . '</span><br>'; //snom \r\n $data .= '<span id=\"td_' . $row[0] . '_3\">' . $row[3] . '</span></td>'; //ced\r\n $data .= '<td><span id=\"td_' . $row[0] . '_8\">' . $row[8] . '</span></td>'; //fnac\r\n $data .= '<td><span id=\"td_' . $row[0] . '_9\">' . $row[9] . '</span><br>'; //genero\r\n $data .= '<span id=\"td_' . $row[0] . '_10\">' . $row[10] . '</span></td>'; //estcivil\r\n $data .= '<td><span id=\"td_' . $row[0] . '_11\">' . $row[11] . '</span></td>'; //Instruccion\r\n $data .= '<td><span id=\"td_' . $row[0] . '_12\">' . $row[12] . '</span></td>'; //Hist Clinico\r\n $data .= '<td><span id=\"td_' . $row[0] . '_13\">' . $row[13] . '</span></td>'; //Telefono\r\n //SELECT SEGURO DESCRIPTION\r\n $temprow[1] = \"\";\r\n if (isset($row[1])) {\r\n $tempsql = \"SELECT * FROM tseguros WHERE seg_codigo = $row[1]\";\r\n $tempquery = mysqli_query($db_conx, $tempsql);\r\n $temprow = mysqli_fetch_array($tempquery);\r\n }\r\n\r\n $data .= '<td><span style=\"display:none;\" id=\"seg_' . $row[0] . '\">' . $row[1] . '</span>\r\n <span>' . $temprow[1] . '</span><br>'; //Seguro\r\n //SELECT EMPRESA DESCRIPTION\r\n $temprow[1] = \"\";\r\n if (isset($row[2])) {\r\n $tempsql = \"SELECT * FROM tempresas WHERE emp_codigo = $row[2]\";\r\n $tempquery = mysqli_query($db_conx, $tempsql);\r\n $temprow = mysqli_fetch_array($tempquery);\r\n }\r\n $data .= '<span style=\"display:none;\" id=\"emp_' . $row[0] . '\">' . $row[2] . '</span>\r\n <span>' . $temprow[1] . '</span></td>'; //Empresa\r\n\r\n $data .= '<td id=\"custom-action\"><button id=\"editar\" onclick=\"editPaciente(' . $row[0] . ')\">Editar</button></td></tr>';\r\n }\r\n echo $data;\r\n}", "public function mostrar_categorias(){\n $conexion = Conexion();\n $sql=\"SELECT * from tbl_categoria\"; \n foreach ($conexion->query($sql) as $row){\n echo \"<option value='{$row ['id_categoria']}'>{$row ['nombre']}</option>\"; \n }\n }", "function tb_ajuste_colaborador_form($selected_id = '', $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1, $ShowCancel = 0, $TemplateDV = '', $TemplateDVP = ''){\n\t// and fill it with data of record whose ID is $selected_id. If $selected_id\n\t// is empty, an empty form is shown, with only an 'Add New'\n\t// button displayed.\n\n\tglobal $Translation;\n\n\t// mm: get table permissions\n\t$arrPerm=getTablePermissions('tb_ajuste_colaborador');\n\tif(!$arrPerm[1] && $selected_id==''){ return ''; }\n\t$AllowInsert = ($arrPerm[1] ? true : false);\n\t// print preview?\n\t$dvprint = false;\n\tif($selected_id && $_REQUEST['dvprint_x'] != ''){\n\t\t$dvprint = true;\n\t}\n\n\t$filterer_colaborador_id = thisOr(undo_magic_quotes($_REQUEST['filterer_colaborador_id']), '');\n\t$filterer_gestor_id = thisOr(undo_magic_quotes($_REQUEST['filterer_gestor_id']), '');\n\n\t// populate filterers, starting from children to grand-parents\n\n\t// unique random identifier\n\t$rnd1 = ($dvprint ? rand(1000000, 9999999) : '');\n\t// combobox: dta_data\n\t$combo_dta_data = new DateCombo;\n\t$combo_dta_data->DateFormat = \"dmy\";\n\t$combo_dta_data->MinYear = 1900;\n\t$combo_dta_data->MaxYear = 2100;\n\t$combo_dta_data->DefaultDate = parseMySQLDate('<%%creationDate%%>', '<%%creationDate%%>');\n\t$combo_dta_data->MonthNames = $Translation['month names'];\n\t$combo_dta_data->NamePrefix = 'dta_data';\n\t// combobox: colaborador_id\n\t$combo_colaborador_id = new DataCombo;\n\t// combobox: str_ajuste\n\t$combo_str_ajuste = new Combo;\n\t$combo_str_ajuste->ListType = 0;\n\t$combo_str_ajuste->MultipleSeparator = ', ';\n\t$combo_str_ajuste->ListBoxHeight = 10;\n\t$combo_str_ajuste->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/tb_ajuste_colaborador.str_ajuste.csv')){\n\t\t$str_ajuste_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/tb_ajuste_colaborador.str_ajuste.csv')));\n\t\t$combo_str_ajuste->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($str_ajuste_data)));\n\t\t$combo_str_ajuste->ListData = $combo_str_ajuste->ListItem;\n\t}else{\n\t\t$combo_str_ajuste->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"Atestados/Declara&#231;&#245;es;;Duplicidade de registro;;Esquecimento;;Fora do local de trabalho;;Problemas com a localiza&#231;&#227;o;;Problemas com a rede do cliente;;Sem justificativa;;Sem m&#225;quina para registro;;Sistema fora do ar\")));\n\t\t$combo_str_ajuste->ListData = $combo_str_ajuste->ListItem;\n\t}\n\t$combo_str_ajuste->SelectName = 'str_ajuste';\n\t$combo_str_ajuste->AllowNull = false;\n\t// combobox: gestor_id\n\t$combo_gestor_id = new DataCombo;\n\n\tif($selected_id){\n\t\t// mm: check member permissions\n\t\tif(!$arrPerm[2]){\n\t\t\treturn \"\";\n\t\t}\n\t\t// mm: who is the owner?\n\t\t$ownerGroupID=sqlValue(\"select groupID from membership_userrecords where tableName='tb_ajuste_colaborador' and pkValue='\".makeSafe($selected_id).\"'\");\n\t\t$ownerMemberID=sqlValue(\"select lcase(memberID) from membership_userrecords where tableName='tb_ajuste_colaborador' and pkValue='\".makeSafe($selected_id).\"'\");\n\t\tif($arrPerm[2]==1 && getLoggedMemberID()!=$ownerMemberID){\n\t\t\treturn \"\";\n\t\t}\n\t\tif($arrPerm[2]==2 && getLoggedGroupID()!=$ownerGroupID){\n\t\t\treturn \"\";\n\t\t}\n\n\t\t// can edit?\n\t\tif(($arrPerm[3]==1 && $ownerMemberID==getLoggedMemberID()) || ($arrPerm[3]==2 && $ownerGroupID==getLoggedGroupID()) || $arrPerm[3]==3){\n\t\t\t$AllowUpdate=1;\n\t\t}else{\n\t\t\t$AllowUpdate=0;\n\t\t}\n\n\t\t$res = sql(\"select * from `tb_ajuste_colaborador` where `id`='\".makeSafe($selected_id).\"'\", $eo);\n\t\tif(!($row = db_fetch_array($res))){\n\t\t\treturn error_message($Translation['No records found'], 'tb_ajuste_colaborador_view.php', false);\n\t\t}\n\t\t$urow = $row; /* unsanitized data */\n\t\t$hc = new CI_Input();\n\t\t$row = $hc->xss_clean($row); /* sanitize data */\n\t\t$combo_dta_data->DefaultDate = $row['dta_data'];\n\t\t$combo_colaborador_id->SelectedData = $row['colaborador_id'];\n\t\t$combo_str_ajuste->SelectedData = $row['str_ajuste'];\n\t\t$combo_gestor_id->SelectedData = $row['gestor_id'];\n\t}else{\n\t\t$combo_colaborador_id->SelectedData = $filterer_colaborador_id;\n\t\t$combo_str_ajuste->SelectedText = ( $_REQUEST['FilterField'][1]=='5' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"\");\n\t\t$combo_gestor_id->SelectedData = $filterer_gestor_id;\n\t}\n\t$combo_colaborador_id->HTML = '<span id=\"colaborador_id-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"colaborador_id\" id=\"colaborador_id' . $rnd1 . '\" value=\"' . html_attr($combo_colaborador_id->SelectedData) . '\">';\n\t$combo_colaborador_id->MatchText = '<span id=\"colaborador_id-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"colaborador_id\" id=\"colaborador_id' . $rnd1 . '\" value=\"' . html_attr($combo_colaborador_id->SelectedData) . '\">';\n\t$combo_str_ajuste->Render();\n\t$combo_gestor_id->HTML = '<span id=\"gestor_id-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"gestor_id\" id=\"gestor_id' . $rnd1 . '\" value=\"' . html_attr($combo_gestor_id->SelectedData) . '\">';\n\t$combo_gestor_id->MatchText = '<span id=\"gestor_id-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"gestor_id\" id=\"gestor_id' . $rnd1 . '\" value=\"' . html_attr($combo_gestor_id->SelectedData) . '\">';\n\n\tob_start();\n\t?>\n\n\t<script>\n\t\t// initial lookup values\n\t\tAppGini.current_colaborador_id__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['colaborador_id'] : $filterer_colaborador_id); ?>\"};\n\t\tAppGini.current_gestor_id__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['gestor_id'] : $filterer_gestor_id); ?>\"};\n\n\t\tjQuery(function() {\n\t\t\tsetTimeout(function(){\n\t\t\t\tif(typeof(colaborador_id_reload__RAND__) == 'function') colaborador_id_reload__RAND__();\n\t\t\t\tif(typeof(gestor_id_reload__RAND__) == 'function') gestor_id_reload__RAND__();\n\t\t\t}, 10); /* we need to slightly delay client-side execution of the above code to allow AppGini.ajaxCache to work */\n\t\t});\n\t\tfunction colaborador_id_reload__RAND__(){\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\n\n\t\t\t$j(\"#colaborador_id-container__RAND__\").select2({\n\t\t\t\t/* initial default value */\n\t\t\t\tinitSelection: function(e, c){\n\t\t\t\t\t$j.ajax({\n\t\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: { id: AppGini.current_colaborador_id__RAND__.value, t: 'tb_ajuste_colaborador', f: 'colaborador_id' },\n\t\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t\tc({\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$j('[name=\"colaborador_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t\t$j('[id=colaborador_id-container-readonly__RAND__]').html('<span id=\"colaborador_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\n\t\t\t\t\t\t\tif(typeof(colaborador_id_update_autofills__RAND__) == 'function') colaborador_id_update_autofills__RAND__();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\twidth: '100%',\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\n\t\t\t\tminimumResultsForSearch: 10,\n\t\t\t\tloadMorePadding: 200,\n\t\t\t\tajax: {\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tcache: true,\n\t\t\t\t\tdata: function(term, page){ /* */ return { s: term, p: page, t: 'tb_ajuste_colaborador', f: 'colaborador_id' }; },\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\n\t\t\t}).on('change', function(e){\n\t\t\t\tAppGini.current_colaborador_id__RAND__.value = e.added.id;\n\t\t\t\tAppGini.current_colaborador_id__RAND__.text = e.added.text;\n\t\t\t\t$j('[name=\"colaborador_id\"]').val(e.added.id);\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\n\t\t\t\tif(typeof(colaborador_id_update_autofills__RAND__) == 'function') colaborador_id_update_autofills__RAND__();\n\t\t\t});\n\n\t\t\tif(!$j(\"#colaborador_id-container__RAND__\").length){\n\t\t\t\t$j.ajax({\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: { id: AppGini.current_colaborador_id__RAND__.value, t: 'tb_ajuste_colaborador', f: 'colaborador_id' },\n\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t$j('[name=\"colaborador_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t$j('[id=colaborador_id-container-readonly__RAND__]').html('<span id=\"colaborador_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(colaborador_id_update_autofills__RAND__) == 'function') colaborador_id_update_autofills__RAND__();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t<?php }else{ ?>\n\n\t\t\t$j.ajax({\n\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: { id: AppGini.current_colaborador_id__RAND__.value, t: 'tb_ajuste_colaborador', f: 'colaborador_id' },\n\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t$j('[id=colaborador_id-container__RAND__], [id=colaborador_id-container-readonly__RAND__]').html('<span id=\"colaborador_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\t\t\t\t\tif(typeof(colaborador_id_update_autofills__RAND__) == 'function') colaborador_id_update_autofills__RAND__();\n\t\t\t\t}\n\t\t\t});\n\t\t<?php } ?>\n\n\t\t}\n\t\tfunction gestor_id_reload__RAND__(){\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\n\n\t\t\t$j(\"#gestor_id-container__RAND__\").select2({\n\t\t\t\t/* initial default value */\n\t\t\t\tinitSelection: function(e, c){\n\t\t\t\t\t$j.ajax({\n\t\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: { id: AppGini.current_gestor_id__RAND__.value, t: 'tb_ajuste_colaborador', f: 'gestor_id' },\n\t\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t\tc({\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$j('[name=\"gestor_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t\t$j('[id=gestor_id-container-readonly__RAND__]').html('<span id=\"gestor_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\n\t\t\t\t\t\t\tif(typeof(gestor_id_update_autofills__RAND__) == 'function') gestor_id_update_autofills__RAND__();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\twidth: '100%',\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\n\t\t\t\tminimumResultsForSearch: 10,\n\t\t\t\tloadMorePadding: 200,\n\t\t\t\tajax: {\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tcache: true,\n\t\t\t\t\tdata: function(term, page){ /* */ return { s: term, p: page, t: 'tb_ajuste_colaborador', f: 'gestor_id' }; },\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\n\t\t\t}).on('change', function(e){\n\t\t\t\tAppGini.current_gestor_id__RAND__.value = e.added.id;\n\t\t\t\tAppGini.current_gestor_id__RAND__.text = e.added.text;\n\t\t\t\t$j('[name=\"gestor_id\"]').val(e.added.id);\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\n\t\t\t\tif(typeof(gestor_id_update_autofills__RAND__) == 'function') gestor_id_update_autofills__RAND__();\n\t\t\t});\n\n\t\t\tif(!$j(\"#gestor_id-container__RAND__\").length){\n\t\t\t\t$j.ajax({\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: { id: AppGini.current_gestor_id__RAND__.value, t: 'tb_ajuste_colaborador', f: 'gestor_id' },\n\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t$j('[name=\"gestor_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t$j('[id=gestor_id-container-readonly__RAND__]').html('<span id=\"gestor_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(gestor_id_update_autofills__RAND__) == 'function') gestor_id_update_autofills__RAND__();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t<?php }else{ ?>\n\n\t\t\t$j.ajax({\n\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: { id: AppGini.current_gestor_id__RAND__.value, t: 'tb_ajuste_colaborador', f: 'gestor_id' },\n\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t$j('[id=gestor_id-container__RAND__], [id=gestor_id-container-readonly__RAND__]').html('<span id=\"gestor_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contratacao_view_parent]').hide(); }else{ $j('.btn[id=tb_contratacao_view_parent]').show(); }\n\n\t\t\t\t\tif(typeof(gestor_id_update_autofills__RAND__) == 'function') gestor_id_update_autofills__RAND__();\n\t\t\t\t}\n\t\t\t});\n\t\t<?php } ?>\n\n\t\t}\n\t</script>\n\t<?php\n\n\t$lookups = str_replace('__RAND__', $rnd1, ob_get_contents());\n\tob_end_clean();\n\n\n\t// code for template based detail view forms\n\n\t// open the detail view template\n\tif($dvprint){\n\t\t$template_file = is_file(\"./{$TemplateDVP}\") ? \"./{$TemplateDVP}\" : './templates/tb_ajuste_colaborador_templateDVP.html';\n\t\t$templateCode = @file_get_contents($template_file);\n\t}else{\n\t\t$template_file = is_file(\"./{$TemplateDV}\") ? \"./{$TemplateDV}\" : './templates/tb_ajuste_colaborador_templateDV.html';\n\t\t$templateCode = @file_get_contents($template_file);\n\t}\n\n\t// process form title\n\t$templateCode = str_replace('<%%DETAIL_VIEW_TITLE%%>', 'Detalhes do Ajuste de Colaborador', $templateCode);\n\t$templateCode = str_replace('<%%RND1%%>', $rnd1, $templateCode);\n\t$templateCode = str_replace('<%%EMBEDDED%%>', ($_REQUEST['Embedded'] ? 'Embedded=1' : ''), $templateCode);\n\t// process buttons\n\tif($AllowInsert){\n\t\tif(!$selected_id) $templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-success\" id=\"insert\" name=\"insert_x\" value=\"1\" onclick=\"return tb_ajuste_colaborador_validateData();\"><i class=\"glyphicon glyphicon-plus-sign\"></i> ' . $Translation['Save New'] . '</button>', $templateCode);\n\t\t$templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"insert\" name=\"insert_x\" value=\"1\" onclick=\"return tb_ajuste_colaborador_validateData();\"><i class=\"glyphicon glyphicon-plus-sign\"></i> ' . $Translation['Save As Copy'] . '</button>', $templateCode);\n\t}else{\n\t\t$templateCode = str_replace('<%%INSERT_BUTTON%%>', '', $templateCode);\n\t}\n\n\t// 'Back' button action\n\tif($_REQUEST['Embedded']){\n\t\t$backAction = 'AppGini.closeParentModal(); return false;';\n\t}else{\n\t\t$backAction = '$j(\\'form\\').eq(0).attr(\\'novalidate\\', \\'novalidate\\'); document.myform.reset(); return true;';\n\t}\n\n\tif($selected_id){\n\t\tif(!$_REQUEST['Embedded']) $templateCode = str_replace('<%%DVPRINT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"dvprint\" name=\"dvprint_x\" value=\"1\" onclick=\"$$(\\'form\\')[0].writeAttribute(\\'novalidate\\', \\'novalidate\\'); document.myform.reset(); return true;\" title=\"' . html_attr($Translation['Print Preview']) . '\"><i class=\"glyphicon glyphicon-print\"></i> ' . $Translation['Print Preview'] . '</button>', $templateCode);\n\t\tif($AllowUpdate){\n\t\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-success btn-lg\" id=\"update\" name=\"update_x\" value=\"1\" onclick=\"return tb_ajuste_colaborador_validateData();\" title=\"' . html_attr($Translation['Save Changes']) . '\"><i class=\"glyphicon glyphicon-ok\"></i> ' . $Translation['Save Changes'] . '</button>', $templateCode);\n\t\t}else{\n\t\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);\n\t\t}\n\t\tif(($arrPerm[4]==1 && $ownerMemberID==getLoggedMemberID()) || ($arrPerm[4]==2 && $ownerGroupID==getLoggedGroupID()) || $arrPerm[4]==3){ // allow delete?\n\t\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-danger\" id=\"delete\" name=\"delete_x\" value=\"1\" onclick=\"return confirm(\\'' . $Translation['are you sure?'] . '\\');\" title=\"' . html_attr($Translation['Delete']) . '\"><i class=\"glyphicon glyphicon-trash\"></i> ' . $Translation['Delete'] . '</button>', $templateCode);\n\t\t}else{\n\t\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);\n\t\t}\n\t\t$templateCode = str_replace('<%%DESELECT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"deselect\" name=\"deselect_x\" value=\"1\" onclick=\"' . $backAction . '\" title=\"' . html_attr($Translation['Back']) . '\"><i class=\"glyphicon glyphicon-chevron-left\"></i> ' . $Translation['Back'] . '</button>', $templateCode);\n\t}else{\n\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%DESELECT_BUTTON%%>', ($ShowCancel ? '<button type=\"submit\" class=\"btn btn-default\" id=\"deselect\" name=\"deselect_x\" value=\"1\" onclick=\"' . $backAction . '\" title=\"' . html_attr($Translation['Back']) . '\"><i class=\"glyphicon glyphicon-chevron-left\"></i> ' . $Translation['Back'] . '</button>' : ''), $templateCode);\n\t}\n\n\t// set records to read only if user can't insert new records and can't edit current record\n\tif(($selected_id && !$AllowUpdate && !$AllowInsert) || (!$selected_id && !$AllowInsert)){\n\t\t$jsReadOnly .= \"\\tjQuery('#dta_data').prop('readonly', true);\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#dta_dataDay, #dta_dataMonth, #dta_dataYear').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#colaborador_id').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#colaborador_id_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#str_ajuste').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"str_ajuste\\\">' + (jQuery('#str_ajuste').val() || '') + '</div>'); jQuery('#str_ajuste-multi-selection-help').hide();\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#bol_evidencia').prop('disabled', true);\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#int_quantidade').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"int_quantidade\\\">' + (jQuery('#int_quantidade').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#gestor_id').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#gestor_id_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#bol_notificacao').prop('disabled', true);\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('.select2-container').hide();\\n\";\n\n\t\t$noUploads = true;\n\t}elseif($AllowInsert){\n\t\t$jsEditable .= \"\\tjQuery('form').eq(0).data('already_changed', true);\"; // temporarily disable form change handler\n\t\t\t$jsEditable .= \"\\tjQuery('form').eq(0).data('already_changed', false);\"; // re-enable form change handler\n\t}\n\n\t// process combos\n\t$templateCode = str_replace('<%%COMBO(dta_data)%%>', ($selected_id && !$arrPerm[3] ? '<div class=\"form-control-static\">' . $combo_dta_data->GetHTML(true) . '</div>' : $combo_dta_data->GetHTML()), $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(dta_data)%%>', $combo_dta_data->GetHTML(true), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(colaborador_id)%%>', $combo_colaborador_id->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(colaborador_id)%%>', $combo_colaborador_id->MatchText, $templateCode);\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(colaborador_id)%%>', urlencode($combo_colaborador_id->MatchText), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(str_ajuste)%%>', $combo_str_ajuste->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(str_ajuste)%%>', $combo_str_ajuste->SelectedData, $templateCode);\n\t$templateCode = str_replace('<%%COMBO(gestor_id)%%>', $combo_gestor_id->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(gestor_id)%%>', $combo_gestor_id->MatchText, $templateCode);\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(gestor_id)%%>', urlencode($combo_gestor_id->MatchText), $templateCode);\n\n\t/* lookup fields array: 'lookup field name' => array('parent table name', 'lookup field caption') */\n\t$lookup_fields = array( 'colaborador_id' => array('tb_contratacao', 'Colaborador'), 'gestor_id' => array('tb_contratacao', 'Gestor'));\n\tforeach($lookup_fields as $luf => $ptfc){\n\t\t$pt_perm = getTablePermissions($ptfc[0]);\n\n\t\t// process foreign key links\n\t\tif($pt_perm['view'] || $pt_perm['edit']){\n\t\t\t$templateCode = str_replace(\"<%%PLINK({$luf})%%>\", '<button type=\"button\" class=\"btn btn-default view_parent hspacer-md\" id=\"' . $ptfc[0] . '_view_parent\" title=\"' . html_attr($Translation['View'] . ' ' . $ptfc[1]) . '\"><i class=\"glyphicon glyphicon-eye-open\"></i></button>', $templateCode);\n\t\t}\n\n\t\t// if user has insert permission to parent table of a lookup field, put an add new button\n\t\tif($pt_perm['insert'] && !$_REQUEST['Embedded']){\n\t\t\t$templateCode = str_replace(\"<%%ADDNEW({$ptfc[0]})%%>\", '<button type=\"button\" class=\"btn btn-success add_new_parent hspacer-md\" id=\"' . $ptfc[0] . '_add_new\" title=\"' . html_attr($Translation['Add New'] . ' ' . $ptfc[1]) . '\"><i class=\"glyphicon glyphicon-plus-sign\"></i></button>', $templateCode);\n\t\t}\n\t}\n\n\t// process images\n\t$templateCode = str_replace('<%%UPLOADFILE(id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_responsavel)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(dta_data)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(colaborador_id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_ajuste)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(bol_evidencia)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(int_quantidade)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(gestor_id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(bol_notificacao)%%>', '', $templateCode);\n\n\t// process values\n\tif($selected_id){\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(id)%%>', safe_html($urow['id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(id)%%>', html_attr($row['id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(id)%%>', urlencode($urow['id']), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_responsavel)%%>', safe_html($urow['str_responsavel']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_responsavel)%%>', urlencode($urow['str_responsavel']), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(dta_data)%%>', @date('d/m/Y', @strtotime(html_attr($row['dta_data']))), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(dta_data)%%>', urlencode(@date('d/m/Y', @strtotime(html_attr($urow['dta_data'])))), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(colaborador_id)%%>', safe_html($urow['colaborador_id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(colaborador_id)%%>', html_attr($row['colaborador_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(colaborador_id)%%>', urlencode($urow['colaborador_id']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(str_ajuste)%%>', safe_html($urow['str_ajuste']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(str_ajuste)%%>', html_attr($row['str_ajuste']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_ajuste)%%>', urlencode($urow['str_ajuste']), $templateCode);\n\t\t$templateCode = str_replace('<%%CHECKED(bol_evidencia)%%>', ($row['bol_evidencia'] ? \"checked\" : \"\"), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(int_quantidade)%%>', safe_html($urow['int_quantidade']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(int_quantidade)%%>', html_attr($row['int_quantidade']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(int_quantidade)%%>', urlencode($urow['int_quantidade']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(gestor_id)%%>', safe_html($urow['gestor_id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(gestor_id)%%>', html_attr($row['gestor_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(gestor_id)%%>', urlencode($urow['gestor_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%CHECKED(bol_notificacao)%%>', ($row['bol_notificacao'] ? \"checked\" : \"\"), $templateCode);\n\t}else{\n\t\t$templateCode = str_replace('<%%VALUE(id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_responsavel)%%>', '<%%creatorUsername%%>', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_responsavel)%%>', urlencode('<%%creatorUsername%%>'), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(dta_data)%%>', '<%%creationDate%%>', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(dta_data)%%>', urlencode('<%%creationDate%%>'), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(colaborador_id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(colaborador_id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_ajuste)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_ajuste)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%CHECKED(bol_evidencia)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(int_quantidade)%%>', '1', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(int_quantidade)%%>', urlencode('1'), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(gestor_id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(gestor_id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%CHECKED(bol_notificacao)%%>', '', $templateCode);\n\t}\n\n\t// process translations\n\tforeach($Translation as $symbol=>$trans){\n\t\t$templateCode = str_replace(\"<%%TRANSLATION($symbol)%%>\", $trans, $templateCode);\n\t}\n\n\t// clear scrap\n\t$templateCode = str_replace('<%%', '<!-- ', $templateCode);\n\t$templateCode = str_replace('%%>', ' -->', $templateCode);\n\n\t// hide links to inaccessible tables\n\tif($_REQUEST['dvprint_x'] == ''){\n\t\t$templateCode .= \"\\n\\n<script>\\$j(function(){\\n\";\n\t\t$arrTables = getTableList();\n\t\tforeach($arrTables as $name => $caption){\n\t\t\t$templateCode .= \"\\t\\$j('#{$name}_link').removeClass('hidden');\\n\";\n\t\t\t$templateCode .= \"\\t\\$j('#xs_{$name}_link').removeClass('hidden');\\n\";\n\t\t}\n\n\t\t$templateCode .= $jsReadOnly;\n\t\t$templateCode .= $jsEditable;\n\n\t\tif(!$selected_id){\n\t\t}\n\n\t\t$templateCode.=\"\\n});</script>\\n\";\n\t}\n\n\t// ajaxed auto-fill fields\n\t$templateCode .= '<script>';\n\t$templateCode .= '$j(function() {';\n\n\n\t$templateCode.=\"});\";\n\t$templateCode.=\"</script>\";\n\t$templateCode .= $lookups;\n\n\t// handle enforced parent values for read-only lookup fields\n\n\t// don't include blank images in lightbox gallery\n\t$templateCode = preg_replace('/blank.gif\" data-lightbox=\".*?\"/', 'blank.gif\"', $templateCode);\n\n\t// don't display empty email links\n\t$templateCode=preg_replace('/<a .*?href=\"mailto:\".*?<\\/a>/', '', $templateCode);\n\n\t/* default field values */\n\t$rdata = $jdata = get_defaults('tb_ajuste_colaborador');\n\tif($selected_id){\n\t\t$jdata = get_joined_record('tb_ajuste_colaborador', $selected_id);\n\t\tif($jdata === false) $jdata = get_defaults('tb_ajuste_colaborador');\n\t\t$rdata = $row;\n\t}\n\t$templateCode .= loadView('tb_ajuste_colaborador-ajax-cache', array('rdata' => $rdata, 'jdata' => $jdata));\n\n\t// hook: tb_ajuste_colaborador_dv\n\tif(function_exists('tb_ajuste_colaborador_dv')){\n\t\t$args=array();\n\t\ttb_ajuste_colaborador_dv(($selected_id ? $selected_id : FALSE), getMemberInfo(), $templateCode, $args);\n\t}\n\n\treturn $templateCode;\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 select(){\n\t\t$sql = \"SELECT * FROM cargo\n\t\t\t\twhere car_estado = 1\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "function generateHTMLcboProjects_tabla($selected=\"\", $class=\"\",$onchange){\n\t\t\t\treturn arraySelectJs($this->Projects(), \"project_id_todo[]\", \"class=\\\"$class\\\" \". $onchange, $selected, true);\n\t\t\t}", "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}", "public function initialize()\n\t{\n\t // attributes\n\t\t$this->setName('tbaluno');\n\t\t$this->setPhpName('Tbaluno');\n\t\t$this->setClassname('Tbaluno');\n\t\t$this->setPackage('lib.model');\n\t\t$this->setUseIdGenerator(true);\n\t\t$this->setPrimaryKeyMethodInfo('tbpessoa_id_pessoa_seq');\n\t\t// columns\n\t\t$this->addColumn('ID_PESSOA', 'IdPessoa', 'INTEGER', true, null, null);\n\t\t$this->addPrimaryKey('MATRICULA', 'Matricula', 'BIGINT', true, null, null);\n\t\t$this->addColumn('NOME', 'Nome', 'VARCHAR', true, 100, null);\n\t\t$this->addColumn('CELULAR', 'Celular', 'VARCHAR', false, 15, null);\n\t\t$this->addColumn('EMAIL', 'Email', 'VARCHAR', false, 100, null);\n\t\t$this->addColumn('FONE_RESIDENCIAL', 'FoneResidencial', 'VARCHAR', false, 15, null);\n\t\t$this->addColumn('FOTO', 'Foto', 'BLOB', false, null, null);\n\t\t$this->addForeignKey('ID_NECES_ESPECIAL', 'IdNecesEspecial', 'VARCHAR', 'tbnecesespecial', 'ID_NECES_ESPECIAL', true, 255, null);\n\t\t$this->addColumn('DT_NASCIMENTO', 'DtNascimento', 'DATE', true, null, null);\n\t\t$this->addForeignKey('NATURALIDADE', 'Naturalidade', 'INTEGER', 'tbcidade', 'ID_CIDADE', true, null, null);\n\t\t$this->addColumn('UF_NASCIMENTO', 'UfNascimento', 'CHAR', false, 2, null);\n\t\t$this->addForeignKey('NACIONALIDADE', 'Nacionalidade', 'INTEGER', 'tbpais', 'ID_PAIS', true, null, null);\n\t\t$this->addColumn('SEXO', 'Sexo', 'CHAR', true, 1, null);\n\t\t$this->addColumn('ESTADO_CIVIL', 'EstadoCivil', 'VARCHAR', false, 15, null);\n\t\t$this->addColumn('TITULO', 'Titulo', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('TITULO_ZONA', 'TituloZona', 'INTEGER', false, null, null);\n\t\t$this->addColumn('TITULO_SECAO', 'TituloSecao', 'INTEGER', false, null, null);\n\t\t$this->addColumn('RG', 'Rg', 'VARCHAR', true, 20, null);\n\t\t$this->addColumn('RG_DT_EXPED', 'RgDtExped', 'DATE', false, null, null);\n\t\t$this->addColumn('RG_ORG_EXPED', 'RgOrgExped', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('CPF', 'Cpf', 'VARCHAR', true, 11, null);\n\t\t$this->addColumn('RESERVISTA', 'Reservista', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('PAI', 'Pai', 'VARCHAR', false, 50, null);\n\t\t$this->addColumn('MAE', 'Mae', 'VARCHAR', false, 50, null);\n\t\t$this->addForeignKey('CEP', 'Cep', 'VARCHAR', 'tblogradouro', 'CEP', true, 9, null);\n\t\t$this->addColumn('NUMERO', 'Numero', 'VARCHAR', true, 8, null);\n\t\t$this->addColumn('COMPLEMENTO', 'Complemento', 'VARCHAR', false, 50, null);\n\t\t$this->addForeignKey('ID_VERSAO_CURSO', 'IdVersaoCurso', 'INTEGER', 'tbcursoversao', 'ID_VERSAO_CURSO', true, null, null);\n\t\t$this->addForeignKey('ID_TIPO_INGRESSO', 'IdTipoIngresso', 'INTEGER', 'tbtipoingresso', 'ID_TIPO_INGRESSO', true, null, null);\n\t\t$this->addColumn('DT_INGRESSO', 'DtIngresso', 'DATE', true, null, null);\n\t\t$this->addForeignKey('ID_SITUACAO', 'IdSituacao', 'INTEGER', 'tbalunosituacao', 'ID_SITUACAO', true, null, null);\n\t\t$this->addColumn('DT_SITUACAO', 'DtSituacao', 'DATE', false, null, null);\n\t\t$this->addForeignKey('ID_DESTINO', 'IdDestino', 'INTEGER', 'tbinstexterna', 'ID_INST_EXTERNA', false, null, null);\n\t\t$this->addForeignKey('ID_2GRAU', 'Id2grau', 'INTEGER', 'tbinstexterna', 'ID_INST_EXTERNA', false, null, null);\n\t\t$this->addColumn('ANO_CONCL_2GRAU', 'AnoConcl2grau', 'INTEGER', false, null, null);\n\t\t$this->addForeignKey('ID_3GRAU', 'Id3grau', 'INTEGER', 'tbinstexterna', 'ID_INST_EXTERNA', false, null, null);\n\t\t$this->addColumn('ANO_CONCL_3GRAU', 'AnoConcl3grau', 'INTEGER', false, null, null);\n\t\t$this->addForeignKey('ID_TRABALHO', 'IdTrabalho', 'INTEGER', 'tbinstexterna', 'ID_INST_EXTERNA', false, null, null);\n\t\t$this->addForeignKey('CEP_TRABALHO', 'CepTrabalho', 'VARCHAR', 'tblogradouro', 'CEP', false, 8, null);\n\t\t$this->addColumn('FONE_TRABALHO', 'FoneTrabalho', 'VARCHAR', false, 15, null);\n\t\t$this->addColumn('RAMAL_TRABALHO', 'RamalTrabalho', 'VARCHAR', false, 5, null);\n\t\t$this->addColumn('MEDIA_GERAL', 'MediaGeral', 'NUMERIC', false, 10, null);\n\t\t$this->addColumn('CH_ELETIVA_CURSADA', 'ChEletivaCursada', 'INTEGER', false, null, null);\n\t\t$this->addColumn('CH_ELETIVA_SOLICITADA', 'ChEletivaSolicitada', 'INTEGER', false, null, null);\n\t\t$this->addColumn('CH_OBRIG_CURSADA', 'ChObrigCursada', 'INTEGER', false, null, null);\n\t\t$this->addColumn('CH_OBRIG_SOLICITADA', 'ChObrigSolicitada', 'INTEGER', false, null, null);\n\t\t$this->addColumn('CH_TOTAL', 'ChTotal', 'INTEGER', false, null, null);\n\t\t$this->addColumn('OP_INGRESSO', 'OpIngresso', 'INTEGER', false, null, 0);\n\t\t$this->addForeignKey('ID_POLO', 'IdPolo', 'INTEGER', 'tbpolos', 'ID_POLO', true, null, 0);\n\t\t$this->addColumn('CREATED_AT', 'CreatedAt', 'DATE', false, null, null);\n\t\t$this->addColumn('UPDATED_AT', 'UpdatedAt', 'DATE', false, null, null);\n\t\t$this->addColumn('CREATED_BY', 'CreatedBy', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('UPDATED_BY', 'UpdatedBy', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('ID_ANTIGO', 'IdAntigo', 'INTEGER', false, null, null);\n\t\t$this->addForeignKey('ID_RACA', 'IdRaca', 'INTEGER', 'tbaluno_racacor', 'ID_RACA', true, null, null);\n\t\t$this->addColumn('ENADE', 'Enade', 'BOOLEAN', false, null, false);\n\t\t// validators\n\t}", "function modificarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_ime';\n\t\t$this->transaccion='WF_tabla_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tabla','id_tabla','int4');\n\t\t$this->setParametro('id_tipo_proceso','id_tipo_proceso','int4');\n\t\t$this->setParametro('vista_id_tabla_maestro','vista_id_tabla_maestro','int4');\n\t\t$this->setParametro('bd_scripts_extras','bd_scripts_extras','text');\n\t\t$this->setParametro('vista_campo_maestro','vista_campo_maestro','varchar');\n\t\t$this->setParametro('vista_scripts_extras','vista_scripts_extras','text');\n\t\t$this->setParametro('bd_descripcion','bd_descripcion','text');\n\t\t$this->setParametro('vista_tipo','vista_tipo','varchar');\n\t\t$this->setParametro('menu_icono','menu_icono','varchar');\n\t\t$this->setParametro('menu_nombre','menu_nombre','varchar');\n\t\t$this->setParametro('vista_campo_ordenacion','vista_campo_ordenacion','varchar');\n\t\t$this->setParametro('vista_posicion','vista_posicion','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('menu_codigo','menu_codigo','varchar');\n\t\t$this->setParametro('bd_nombre_tabla','bd_nombre_tabla','varchar');\n\t\t$this->setParametro('bd_codigo_tabla','bd_codigo_tabla','varchar');\n\t\t$this->setParametro('vista_dir_ordenacion','vista_dir_ordenacion','varchar');\n\t\t$this->setParametro('vista_estados_new','vista_estados_new','varchar');\n\t\t$this->setParametro('vista_estados_delete','vista_estados_delete','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function setInstancia($tabla){\r\n\t\t//DB_DataObject::debugLevel(1);\r\n\t\t//Crea una nueva instancia de $tabla a partir de DataObject\r\n\t\t$objDBO = DB_DataObject::Factory($tabla);\r\n\t\t\r\n\t\t$campos = $objDBO->table();\r\n\t\tunset($campos[\"id\"]);\r\n\t\tunset($campos[\"fecha\"]);\r\n\t\t\r\n\t\t//Asigna los valores\r\n\t\tforeach($campos as $key => $value){\r\n\t\t\t$objDBO->$key = utf8_decode($this->$key);\r\n\t\t}\r\n\t\t$objDBO->fecha = date(\"Y-m-d H:i:s\");\r\n\t\t$objDBO->find();\r\n\t\tif($objDBO->fetch()){\r\n\t\t\t$ret = $objDBO->id;\r\n\t\t}else{\r\n\t\t\t$ret = $objDBO->insert();\r\n\t\t}\r\n\t\t\r\n\t\t//Libera el objeto DBO\r\n\t\t$objDBO->free();\r\n\t\t\r\n\r\n\t\treturn ($ret);\r\n\t}", "function frmEstimacionesShow($sender, $params)\n {\n $items[\"uno\"]=\"ADICIONAL\";\n $items[\"dos\"]=\"ADITIVA/DEDUCTIVA\";\n $items[\"tres\"]=\"EXTRAORDINARIA\";\n $items[\"cuatro\"]=\"NORMAL\";\n $this->cboTipo->setItems($items);\n $this->txtMoneda->Text=\"MONEDA NACIONAL\";\n }", "public function RelatorioCentroCusto($idobra, $idcentro) {\n $obra = new clsObra();\n $obra->preencheDados($idobra);\n\n $centroNome = \"\";\n if ($idcentro > 0) {\n $centro = new clsCentroCusto();\n $centro->RetornaCentroCusto($idcentro);\n $centroNome = \" - Centro de Custo: \" . $centro->getDescCentro();\n }\n\n $html = '<table border = \"3\" cellspacing = \"2\" cellpadding = \"2\">\n <tr height = \"2\">\n </br>\n <b><span style=\"font-size: 20px\">Retirada de Material</span></b>\n </br>\n <span align=\"center\" style=\"font-size: 20px\">Obra: ' . $obra->getDescricao() . $centroNome . '</span>\n <th align = \"center\" class = \"small\" width = \"150px\">Data Retirada</th>\n <th align = \"center\" class = \"small\" width = \"600px\">Material</th>\n <th align = \"center\" class = \"small\" width = \"150px\">Quantidade</th>\n </tr>';\n\n\n $SQL = \"SELECT re.QUANTRETIRADA, re.DATARETESTOQUE, CONCAT(mt.DESCMATERIAL, ' / ' , un.SIGLAUNID) MATERIAL\n FROM retirada_estoque re\n INNER JOIN material mt\n ON re.IDMATERIAL = mt.IDMATERIAL\n INNER JOIN unidade un\n ON re.IDUNIDADE = un.IDUNIDADE\n WHERE re.IDOBRA = \" . $idobra . \"\";\n//die($SQL);\n if ($idcentro > 0) {\n $SQL.=\" AND re.IDCENTRO =\" . $idcentro . \" \";\n }\n\n\n $SQL.=\" ORDER BY STR_TO_DATE(re.DATARETESTOQUE,'%d/%m/%Y'), mt.DESCMATERIAL \";\n\n $con = new gtiConexao();\n $con->gtiConecta();\n $tbl = $con->gtiPreencheTabela($SQL);\n $con->gtiDesconecta();\n\n //die($SQL);\n foreach ($tbl as $chave => $linha) {\n\n $html .= ' <tr height = \"1\">\n <td align = \"center\" class = \"small\" width = \"100px\"> ' . htmlentities($linha['DATARETESTOQUE']) . ' </td>\n <td align = \"center\" class = \"small\" width = \"100px\"> ' . htmlentities($linha['MATERIAL']) . ' </td>\n <td align = \"center\" class = \"small\" width = \"100px\"> ' . $linha['QUANTRETIRADA'] . ' </td>\n </tr>';\n }\n\n\n $html .= '</table> ';\n\n\n\n\n\n\n $html .= '<table border = \"3\" cellspacing = \"2\" cellpadding = \"2\">\n <tr height = \"2\">\n </br>\n <b><span style=\"font-size: 20px\">Retirada de Material - Soma Geral</span></b> \n <th align = \"center\" class = \"small\" width = \"650px\">Material</th>\n <th align = \"center\" class = \"small\" width = \"250px\">Quantidade</th>\n </tr>';\n\n\n $SQL = \"SELECT SUM(re.QUANTRETIRADA) SOMA, re.DATARETESTOQUE, CONCAT(mt.DESCMATERIAL, ' / ' , un.SIGLAUNID) MATERIAL\n FROM retirada_estoque re\n INNER JOIN material mt\n ON re.IDMATERIAL = mt.IDMATERIAL\n INNER JOIN unidade un\n ON re.IDUNIDADE = un.IDUNIDADE\n WHERE re.IDOBRA = \" . $idobra . \"\";\n//die($SQL);\n if ($idcentro > 0) {\n $SQL.=\" AND re.IDCENTRO =\" . $idcentro . \" \";\n }\n\n\n $SQL.=\" GROUP BY mt.DESCMATERIAL \n ORDER BY mt.DESCMATERIAL \";\n\n $con = new gtiConexao();\n $con->gtiConecta();\n $tbl = $con->gtiPreencheTabela($SQL);\n $con->gtiDesconecta();\n\n //die($SQL);\n foreach ($tbl as $chave => $linha) {\n\n $html .= ' <tr height = \"1\"> \n <td align = \"center\" class = \"small\" width = \"100px\"> ' . htmlentities($linha['MATERIAL']) . ' </td>\n <td align = \"center\" class = \"small\" width = \"100px\"> ' . $linha['SOMA'] . ' </td>\n </tr>';\n }\n\n\n $html .= '</table> ';\n\n\n\n\n\n //die(print_r($arrayNota));\n\n return $html;\n }", "private function tbl_guiones_registro() {\r\n\t\t\t$this->guiones_registro = $this->esquema->createTable('GUIONES_REGISTRO');\r\n\t\t\t$this->guiones_registro->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del registro del guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('FECHA', 'datetime', array(\r\n\t\t\t\t'notnull' => false,\r\n\t\t\t\t'comment' => 'Fecha de ingreso del registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('USUARIO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del usuario del registro [ID de la tabla USUARIOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('TIPO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del tipo de registro [ID de la tabla GUIONES_REGISTRO_TIPO]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('AFECTACION', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la afectacion del registro [ID de la tabla GUIONES_REGISTRO_AFECTACION]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('AVISO', 'bigint', array(\r\n\t\t\t\t'notnull' => false,\r\n\t\t\t\t'default' => 0,\r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'Numero del aviso del registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('UBICACION', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la UBICACION del registro [ID de la tabla GUIONES_REGISTRO_UBICACION]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->usuarios, array('USUARIO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_tipo, array('TIPO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_afectacion, array('AFECTACION'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_ubicacion, array('UBICACION'), array('ID'), $this->opcForeign);\r\n\t\t}", "function select_tb_penduduk(){\n\t\t$this->load->model('mamdani');\n\t\t//$klasifikasi['klasifikasi']=$this->mamdani->getdata();\n\t\t$klasifikasi['jumlah_aset']=$this->mamdani->jumlah_aset();\n\t\t$klasifikasi['tingkat']= $this->mamdani->klasifikasi3();\n\n\t\t$this->load->view('templates/header');\n\t\t$this->load->view('admin/lihatdata/tabel_klasifikasi_penduduk',$klasifikasi);\n\t\t$this->load->view('templates/footer');\n\t\t// var_dump($jml_aset);\n\t\t// die;\n\n\t}", "private function tbl_usuarios_empresa() {\r\n\t\t\t$this->usuarios_empresa = $this->esquema->createTable('USUARIOS_EMPRESA');\r\n\t\t\t$this->usuarios_empresa->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la Empresa'\r\n\t\t\t));\r\n\t\t\t$this->usuarios_empresa->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la Empresa'\r\n\t\t\t));\r\n\t\t\t$this->usuarios_empresa->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'Estado de la Empresa [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->usuarios_empresa->setPrimaryKey(array('ID'));\r\n\t\t\t$this->usuarios_empresa->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}", "function ListaZonaHoraria()\n {\n $this->Consulta(\"*\",\"zonashorarias\",\"\");\n // Contar la cantidad de resultados\n $this->Filas = mysql_num_rows($this->Resultado);\n if( $this->Filas > 0){\n for( $i=0; $i < $this->Filas; $i++ ) {\n // Obtener resultados\n $Columnas = mysql_fetch_assoc($this->Resultado);\n echo \"<option value=\\\"\".$Columnas['id'].\"\\\">\".$Columnas['nombre'].\"</option>\";\n }\n }else{\n echo \"<option value=\\\"0\\\">No hay datos</option>\";\n }\n }", "public function createTable(){\nreturn $this->pdo->exec(\n\"CREATE TABLE `sottocategoria` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `codice_categoria` varchar(3) NOT NULL,\n `codice` varchar(3) NOT NULL,\n `descrizione` varchar(80) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `index_codice_cat` (`codice_categoria`),\n KEY `index_codice` (`codice`),\n CONSTRAINT `fk_categoriasottocategoria_1` FOREIGN KEY (`codice_categoria`) REFERENCES `categoria` (`codice`) ON DELETE NO ACTION ON UPDATE NO ACTION\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\"\n);\n}", "function select($id){\r\n\t\t$sql = \"SELECT * FROM gestaoti.unidade_organizacional WHERE seq_unidade_organizacional = $id\";\r\n\t\t$result = $this->database->query($sql);\r\n\t\t$result = $this->database->result;\r\n\r\n\t\t$row = pg_fetch_object($result);\r\n\t\t$this->SEQ_UNIDADE_ORGANIZACIONAL = $row->seq_unidade_organizacional;\r\n\t\t$this->NOM_UNIDADE_ORGANIZACIONAL = $row->nom_unidade_organizacional;\r\n\t\t$this->SEQ_UNIDADE_ORGANIZACIONAL_PAI = $row->seq_unidade_organizacional_pai;\r\n\t\t$this->SGL_UNIDADE_ORGANIZACIONAL = $row->sgl_unidade_organizacional;\r\n\t}", "public function getSelect($param) {\n //operario y poder seleccionar el operario que va ser foranea en otra tabla\n $json = FALSE;\n extract($param);\n $select = \"\";\n $select .= \"<option value='0'>Seleccione un Operario</option>\";\n foreach ($conexion->getPDO()->query(\"SELECT fk_usuario, nombres FROM operario ORDER BY nombres\") as $fila) {\n $select .= \"<option value='{$fila['fk_usuario']}'>{$fila['fk_usuario']} - {$fila['nombres']}</option>\";\n }\n echo $json ? json_encode($select) : (\"<select id='$id'>$select</select>\");\n }", "public function mostrarTablasMaestras(){\n\t\tif($_GET[\"bd\"] == \"vtama_tipo_producto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/tipoProducto.controlador.php\";\n\t\t\trequire_once \"../models/tipoProducto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$entrada = \"tablaMaestra\";\n\t\t\t$tipoProductos = ControladorTipoProducto::ctrMostrarTipoProducto($item,$valor,$entrada);\n\t\t\tif(count($tipoProductos) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($tipoProductos); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarTipoProducto' codTipoProducto='\".$tipoProductos[$i][\"cod_tipo_producto\"].\"' data-toggle='modal' data-target='#modalTipoProducto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarTipoProducto' codTipoProducto='\".$tipoProductos[$i][\"cod_tipo_producto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[ \n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($tipoProductos[$i][\"dsc_tipo_producto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_tipo_documento\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/tipoDocumento.controlador.php\";\n\t\t\trequire_once \"../models/tipoDocumento.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$tipoDocumentos = ControladorTipoDocumento::ctrMostrarTipoDocumento($item,$valor);\n\t\t\tif(count($tipoDocumentos) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($tipoDocumentos); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarTipoDocumento' codTipoDocumento='\".$tipoDocumentos[$i][\"cod_tipo_documento\"].\"' data-toggle='modal' data-target='#modalTipoDocumento' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarTipoDocumento' codTipoDocumento='\".$tipoDocumentos[$i][\"cod_tipo_documento\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[ \n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($tipoDocumentos[$i][\"dsc_tipo_documento\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_categoria_cliente\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/categoriaCliente.controlador.php\";\n\t\t\trequire_once \"../models/categoriaCliente.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$categoriaClientes = ControladorCategoriaCliente::ctrMostrarCategoriaClientes($item,$valor);\n\t\t\tif(count($categoriaClientes) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($categoriaClientes); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarCategoriaCliente' codCategoriaCliente='\".$categoriaClientes[$i][\"cod_categoria_cliente\"].\"' data-toggle='modal' data-target='#modalCategoriaCliente' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarCategoriaCliente' codCategoriaCliente='\".$categoriaClientes[$i][\"cod_categoria_cliente\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[ \n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($categoriaClientes[$i][\"dsc_categoria_cliente\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_pais\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/pais.controlador.php\";\n\t\t\trequire_once \"../models/pais.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$paises = ControladorPais::ctrMostrarPaises($item,$valor);\n\t\t\tif(count($paises) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($paises); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarPais' codPais='\".$paises[$i][\"cod_pais\"].\"' data-toggle='modal' data-target='#modalPais' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarPais' codPais='\".$paises[$i][\"cod_pais\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($paises[$i][\"dsc_pais\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_estado_cotizacion\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/estadoCotizacion.controlador.php\";\n\t\t\trequire_once \"../models/estadoCotizacion.modelo.php\";\n\t\t\t$item = $valor = $entrada = null;\n\t\t\t$estadoCotizacion = ControladorEstadoCotizacion::ctrMostrarEstadoCotizacion($item,$valor,$entrada);\n\t\t\tif(count($estadoCotizacion) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($estadoCotizacion); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarEstadoCotizacion' codEstadoCotizacion='\".$estadoCotizacion[$i][\"cod_estado_cotizacion\"].\"' data-toggle='modal' data-target='#modalEstadoCotizacion' title='Editar'><i class='fa fa-pencil'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($estadoCotizacion[$i][\"dsc_estado_cotizacion\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= '] \n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_perfil\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/perfil.controlador.php\";\n\t\t\trequire_once \"../models/perfil.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$perfil = ControladorPerfil::ctrMostrarPerfil($item,$valor);\n\t\t\tif(count($perfil) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($perfil); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarPerfil' codPerfil='\".$perfil[$i][\"cod_perfil\"].\"' data-toggle='modal' data-target='#modalPerfil' title='Editar'><i class='fa fa-pencil'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($perfil[$i][\"dsc_perfil\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_moneda\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/moneda.controlador.php\";\n\t\t\trequire_once \"../models/moneda.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$moneda = ControladorMoneda::ctrMostrarMoneda($item,$valor);\n\t\t\tif(count($moneda) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($moneda); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarMoneda' codMoneda='\".$moneda[$i][\"cod_moneda\"].\"' data-toggle='modal' data-target='#modalMoneda' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarMoneda' codMoneda='\".$moneda[$i][\"cod_moneda\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($moneda[$i][\"dsc_moneda\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_forma_pago\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/formaPago.controlador.php\";\n\t\t\trequire_once \"../models/formaPago.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$formaPago = ControladorFormaPago::ctrMostrarFormaPago($item,$valor);\n\t\t\tif(count($formaPago) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($formaPago); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarFormaPago' codFormaPago='\".$formaPago[$i][\"cod_forma_pago\"].\"' data-toggle='modal' data-target='#modalFormaPago' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarFormaPago' codFormaPago='\".$formaPago[$i][\"cod_forma_pago\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($formaPago[$i][\"dsc_forma_pago\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_canal_contacto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/canalContacto.controlador.php\";\n\t\t\trequire_once \"../models/canalContacto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$canalContacto = ControladorCanalContacto::ctrMostrarCanalContacto($item,$valor);\n\t\t\tif(count($canalContacto) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($canalContacto); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarCanalContacto' codCanalContacto='\".$canalContacto[$i][\"cod_canal_contacto\"].\"' data-toggle='modal' data-target='#modalCanalContacto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarCanalContacto' codCanalContacto='\".$canalContacto[$i][\"cod_canal_contacto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($canalContacto[$i][\"dsc_canal_contacto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_estado_contacto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/estadoContacto.controlador.php\";\n\t\t\trequire_once \"../models/estadoContacto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$estadoContacto = ControladorEstadoContacto::ctrMostrarEstadoContacto($item,$valor);\n\t\t\tif(count($estadoContacto) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($estadoContacto); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarEstadoContacto' codEstadoContacto='\".$estadoContacto[$i][\"cod_estado_contacto\"].\"' data-toggle='modal' data-target='#modalEstadoContacto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarEstadoContacto' codEstadoContacto='\".$estadoContacto[$i][\"cod_estado_contacto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($estadoContacto[$i][\"dsc_estado_contacto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_tipo_contacto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/tipoContacto.controlador.php\";\n\t\t\trequire_once \"../models/tipoContacto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$tipoContacto = ControladorTipoContacto::ctrMostrarTipoContacto($item,$valor);\n\t\t\tif(count($tipoContacto) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($tipoContacto); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarTipoContacto' codTipoContacto='\".$tipoContacto[$i][\"cod_tipo_contacto\"].\"' data-toggle='modal' data-target='#modalTipoContacto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarTipoContacto' codTipoContacto='\".$tipoContacto[$i][\"cod_tipo_contacto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($tipoContacto[$i][\"dsc_tipo_contacto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}\n\t\techo $datosJson;\n\t}", "function tablaDatos(){\n\n $editar = $this->Imagenes($this->PrimaryKey,0);\n $eliminar = $this->Imagenes($this->PrimaryKey,1);\n $sql = 'SELECT\n C.id_componentes,\n P.descripcion planta,\n S.descripcion secciones,\n E.descripcion Equipo,\n C.`descripcion` Componente\n ,'.$editar.','.$eliminar.' \nFROM\n `componentes` C\nINNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\nINNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\nINNER JOIN\n plantas P ON P.id_planta = S.id_planta\nWHERE\n \n C.`activo` = 1';\n \n $datos = $this->Consulta($sql,1); \n if(count($datos)){\n $_array_formu = array();\n $_array_formu = $this->generateHead($datos);\n $this->CamposHead = ( isset($_array_formu[0]) && is_array($_array_formu[0]) )? $_array_formu[0]: array();\n \n $tablaHtml = '<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body recargaDatos\" style=\"page-break-after: always;\">\n <div class=\"table-responsive\">';\n $tablaHtml .='';\n \t\t$tablaHtml .= $this->print_table($_array_formu, 7, true, 'table table-striped table-bordered',\"id='tablaDatos'\");\n \t\t$tablaHtml .=' </div>\n </div>\n </div>\n </div>\n </div>\n ';\n }else{\n $tablaHtml = '<div class=\"col-md-8\">\n <div class=\"alert alert-info alert-dismissable\">\n <button class=\"close\" aria-hidden=\"true\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Atenci&oacute;n</strong>\n No se encontraron registros.\n </div>\n </div>';\n }\n \n if($this->_datos=='r') echo $tablaHtml;\n else return $tablaHtml;\n \n }", "public function __construct()\r\n {\r\n parent::__construct();\r\n \r\n parent::setDatabase('fiscalizacao'); \r\n parent::setActiveRecord('Comitiva');\r\n parent::setDefaultOrder('id', 'Asc'); \r\n parent::addFilterField('idChefeVtr', '='); \r\n parent::setDefaultOrder('idViatura', '='); \r\n parent::addFilterField('comitiva', 'like'); \r\n parent::setDefaultOrder('dataChegada', '='); \r\n parent::setDefaultOrder('obs', 'like'); \r\n \r\n // creates the form, with a table inside\r\n $this->form = new TQuickForm('Pesquisa Comitiva');\r\n $this->form->class = 'tform';\r\n $this->form->style = 'width: 650px';\r\n $this->form->setFormTitle('Pesquisa de Comitiva - Escolha uma opção para realizar a pesquisa!');\r\n\r\n // create the form fields\r\n $id = new TCombo('id');\r\n $idViatura = new TCombo('idViatura');\r\n $idChefeVtr = new TCombo('idChefeVtr');\r\n $comitiva = new TEntry('tipoComitiva');\r\n $dataChegada = new TDate('dataChegada');\r\n $obs = new TEntry('obs');\r\n\r\n $vtr = array();\r\n $vtr['VAN-UN25269'] = 'VAN-UN25269';\r\n $vtr['VAN-UN25265'] = 'VAN-UN25265';\r\n $vtr['MARRUA-UN24772'] = 'MARRUÁ-UN24772';\r\n $idViatura->addItems($vtr);\r\n\r\n $mil = array();\r\n $mil['TEN INOUE'] = 'TEN INOUE';\r\n $mil['SGT VERISSIMO'] = 'SGT VERISSIMO';\r\n $mil['SGT SANTIAGO'] = 'SGT SANTIAGO';\r\n $idChefeVtr->addItems($mil);\r\n \r\n // add a row for the filter field \r\n $this->form->addQuickField('Viatura', $idViatura, 250);\r\n $this->form->addQuickField('Chefe Vtr', $idChefeVtr, 250);\r\n $this->form->addQuickField('Data', $dataChegada, 250);\r\n $this->form->addQuickField('Comitiva', $comitiva, 250);\r\n $this->form->addQuickField('OBS', $obs, 250);\r\n \r\n $this->form->setData( TSession::getValue('Product_filter_data') );\r\n $this->form->addQuickAction( _t('Find'), new TAction(array($this, 'onSearch')), 'ico_find.png');\r\n $this->form->addQuickAction( _t('New'), new TAction(array('ComitivaForm', 'onEdit')), 'ico_new.png');\r\n \r\n // creates a DataGrid\r\n $this->datagrid = new TQuickGrid;\r\n $this->datagrid->setHeight(420);\r\n // creates a DataGrid\r\n $id = $this->datagrid->addQuickColumn('ID', 'id', 'center', 50);\r\n $idChefeVtr = $this->datagrid->addQuickColumn('Chefe', 'idChefeVtr', 'left', 200);\r\n $idViatura = $this->datagrid->addQuickColumn('Viatura', 'idViatura', 'left', 100);\r\n $comitiva = $this->datagrid->addQuickColumn('Comitiva', 'tipoComitiva', 'left', 150);\r\n $comitiva = $this->datagrid->addQuickColumn('Nome', 'nome', 'left', 150);\r\n \r\n $dataChegada = $this->datagrid->addQuickColumn('Data Chegada', 'dataChegada', 'left', 100);\r\n $horaChegada = $this->datagrid->addQuickColumn('Hora Chegada', 'horaChegada', 'left', 100);\r\n $vooChegada = $this->datagrid->addQuickColumn('Voo Chegada', 'vooChegada', 'left', 100);\r\n \r\n $dataRegresso = $this->datagrid->addQuickColumn('Data Regresso', 'dataRegresso', 'left', 100);\r\n $horaRegresso = $this->datagrid->addQuickColumn('Hora Regresso', 'horaRegresso', 'left', 100);\r\n $vooRegresso = $this->datagrid->addQuickColumn('Voo Regresso', 'vooRegresso', 'left', 100);\r\n \r\n \r\n\r\n // create the datagrid actions\r\n $edit_action = new TDataGridAction(array('ComitivaForm', 'onEdit'));\r\n $delete_action = new TDataGridAction(array($this, 'onDelete'));\r\n \r\n // add the actions to the datagrid\r\n $this->datagrid->addQuickAction(_t('Edit'), $edit_action, 'id', 'ico_edit.png');\r\n $this->datagrid->addQuickAction(_t('Delete'), $delete_action, 'id', 'ico_delete.png');\r\n \r\n // create the datagrid model\r\n $this->datagrid->createModel();\r\n // create the page navigation\r\n $this->pageNavigation = new TPageNavigation;\r\n $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));\r\n $this->pageNavigation->setWidth($this->datagrid->getWidth());\r\n \r\n // create the page container\r\n $container = new TVBox;\r\n $container->add(new TXMLBreadCrumb('menu.xml', 'PesquisaComitiva'));\r\n $container->add($this->form);\r\n $container->add($this->datagrid);\r\n $container->add($this->pageNavigation);\r\n \r\n parent::add($container);\r\n }", "public function select($titulos){\n $id=$titulos->getId();\n\n try {\n $sql= \"SELECT `id`, `descripcion`, `universidad_id`, `docente_id`\"\n .\"FROM `titulos`\"\n .\"WHERE `id`='$id'\";\n $data = $this->ejecutarConsulta($sql);\n for ($i=0; $i < count($data) ; $i++) {\n $titulos->setId($data[$i]['id']);\n $titulos->setDescripcion($data[$i]['descripcion']);\n $titulos->setUniversidad_id($data[$i]['universidad_id']);\n $docente = new Docente();\n $docente->setId($data[$i]['docente_id']);\n $titulos->setDocente_id($docente);\n\n }\n return $titulos; } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n return null;\n }\n }", "static public function mdlSelecMembresiasCaducadas($tabla,$empresa){\n\n\t\tif($empresa == \"0\"){\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT m.*,t.nombre_membresia,mb.nombre_completo,e.nombre,mb.celular FROM $tabla m LEFT JOIN tipo_membresia t ON t.id_tipo_membresia=m.id_tipo_membresia LEFT JOIN miembros mb ON mb.id_miembro=m.id_miembro LEFT JOIN empresa e ON e.id_empresa=t.id_empresa WHERE m.estado = '2'\");\n\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}else{\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT m.*,t.nombre_membresia,mb.nombre_completo,e.nombre,mb.celular FROM $tabla m LEFT JOIN tipo_membresia t ON t.id_tipo_membresia=m.id_tipo_membresia LEFT JOIN miembros mb ON mb.id_miembro=m.id_miembro LEFT JOIN empresa e ON e.id_empresa=t.id_empresa WHERE t.id_empresa = '\".$empresa.\"' AND m.estado = '2' \");\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n }", "public function __construct()\n {\n parent::__construct();\n $this->table = 'actividades';\n }", "public function __construct() {\r\n parent::__construct();\r\n parent::set_tabel('jadwal', 'kd_jadwal');\r\n }", "function LUPE_criar_tabela_tab($prefixo, $rs, $vetCampo, $vetHidTab, $exc_tabela = '', $exc_campo = '') {\r\n\r\n echo \"<table id='tab{$prefixo}_Tabela' width='100%' border='1' cellspacing='0' cellpadding='0' vspace='0' hspace='0' class='Generica'>\\n\";\r\n echo \"<tr class='Generica'>\\n\";\r\n\r\n if (Ativo()) {\r\n echo \"<td class='Acao' width='1%' nowrap>\";\r\n echo '<a href=\"\" onclick=\"return tab'.$prefixo.'_Incluir();\" class=\"Titulo\"><img src=\"imagens/Incluir.gif\" border=\"0\" alt=\"Incluir\"></a>';\r\n echo \"</td>\\n\";\r\n }\r\n\r\n ForEach($vetCampo as $Campo => $Valor ) {\r\n echo \"<td class='Titulo'><b>\\n\";\r\n echo $Valor['nome'];\r\n echo \"</b></td>\\n\";\r\n }\r\n\r\n echo \"</tr>\\n\";\r\n\r\n if (mssql_num_rows($rs) != 0) {\r\n for ($i = 0; $i < mssql_num_rows($rs); $i++) {\r\n $row = mssql_fetch_array($rs);\r\n\r\n echo \"<tr id='tab{$prefixo}_linha{$i}' align=left>\\n\";\r\n\r\n if (Ativo()) {\r\n echo \"<td class='Acao' nowrap>\";\r\n\r\n echo '<a class=\"Registro\" href=\"\" onclick=\"return tab'.$prefixo.'_Alterar('.$i.');\"><img src=\"imagens/Alterar.gif\" border=\"0\" alt=\"Alterar\"></a>';\r\n\r\n echo '&nbsp;';\r\n\r\n echo '<a class=\"Registro\" href=\"\" onclick=\"return tab'.$prefixo.'_Excluir('.$i.');\"><img src=\"imagens/Excluir.gif\" border=\"0\" alt=\"Excluir\"></a>';\r\n\r\n if ($exc_campo == '' || $exc_tabela == '') {\r\n $exclui = 'N';\r\n } else {\r\n $sql = \"select $exc_campo from $exc_tabela where $exc_campo = \".$row[$exc_campo];\r\n if (mssql_num_rows(execsql($sql)) == 0)\r\n $exclui = 'N';\r\n else\r\n $exclui = 'E';\r\n }\r\n\r\n echo \"<input id='{$prefixo}_excluir$i' type='hidden' name='{$prefixo}_excluir[]' value='$exclui'>\\n\";\r\n\r\n ForEach($vetHidTab as $Valor)\r\n \t echo \"<input id='{$prefixo}_$Valor$i' type='hidden' name='{$prefixo}_{$Valor}[]' value='\".$row[$Valor].\"'>\\n\";\r\n\r\n echo \"</td>\\n\";\r\n }\r\n\r\n ForEach($vetCampo as $Campo => $Valor ) {\r\n echo \"<td id='{$prefixo}_cel_{$Campo}_{$i}' class='Registro'>\\n\";\r\n\r\n switch ($Valor['tipo']) {\r\n \tcase 'descDominio':\r\n if ($Valor['vetDominio'][$row[$Campo]] == '')\r\n echo $row[$Campo];\r\n else\r\n echo $Valor['vetDominio'][$row[$Campo]];\r\n \t\tbreak;\r\n\r\n default:\r\n echo $row[$Campo];\r\n \t\tbreak;\r\n }\r\n\r\n echo \"</td>\\n\";\r\n }\r\n\r\n echo\"</tr>\\n\";\r\n }\r\n }\r\n\r\n echo \"</table>\\n\";\r\n echo \"<script type='text/javascript'>\r\n tab{$prefixo}_TotLin = \".mssql_num_rows($rs).\";\r\n tab{$prefixo}_AtuLin = -1;\r\n </script>\";\r\n\r\n return 0;\r\n}", "public function consultarTiposJSONSelectAction() {\n $select = \"<select>\";\n //$select = $select . \"<option value='' >Seleccione una Acción</option>\";\n $select = $select . \"<option value=\" . User::$VENDEDOR . \" >\" . User::$VENDEDOR_TEXT . \"</option>\";\n $select = $select . \"<option value=\" . User::$COMPRADOR . \" >\" . User::$COMPRADOR_TEXT . \"</option>\";\n $select = $select . \"<option value=\" . User::$APROBADOR . \" >\" . User::$APROBADOR_TEXT . \"</option>\";\n $select = $select . \"<option value=\" . User::$DIGITADOR . \" >\" . User::$DIGITADOR_TEXT . \"</option>\";\n $select = $select . \"</select>\";\n\n $response = new Response($select);\n return $response;\n }", "function setColeccion() {\n $this->query = \"SELECT * FROM PROFESOR\";\n $this->datos = BDConexionSistema::getInstancia()->query($this->query);\n\n for ($x = 0; $x < $this->datos->num_rows; $x++) {\n $this->addElemento($this->datos->fetch_object(\"Profesor\"));\n }\n }" ]
[ "0.6311839", "0.62640345", "0.6181283", "0.61738825", "0.6148754", "0.6083265", "0.59719336", "0.5954116", "0.5885341", "0.5854881", "0.58229345", "0.5812404", "0.5804384", "0.57995105", "0.5773797", "0.57340986", "0.57001346", "0.5696487", "0.56876206", "0.5666154", "0.56643575", "0.5661186", "0.5644684", "0.56430143", "0.5634129", "0.5616269", "0.5614032", "0.5613156", "0.5608011", "0.55826527", "0.55805624", "0.5564132", "0.5562241", "0.5558694", "0.5552776", "0.5549946", "0.5544102", "0.5524741", "0.55235887", "0.5511819", "0.5509954", "0.55063975", "0.5496277", "0.54837346", "0.5473254", "0.5466641", "0.5450154", "0.5446778", "0.5440471", "0.5436617", "0.54296166", "0.5428588", "0.5423664", "0.5422697", "0.5412038", "0.5410722", "0.54089093", "0.5405085", "0.5402186", "0.53915894", "0.5391263", "0.5386305", "0.53797406", "0.53730077", "0.53674465", "0.53663427", "0.5362384", "0.53621775", "0.53469884", "0.534481", "0.5343688", "0.5341521", "0.53337693", "0.5327919", "0.5326287", "0.53250915", "0.53225636", "0.5322103", "0.53187376", "0.5309327", "0.53074324", "0.5304259", "0.5301113", "0.5297647", "0.5295331", "0.5294108", "0.5293189", "0.5289882", "0.52897835", "0.5286024", "0.5279685", "0.5279474", "0.5276233", "0.52675426", "0.52668643", "0.52663314", "0.52662843", "0.5265421", "0.5261973", "0.52616847", "0.5261573" ]
0.0
-1
echo microtime(true) $this>startTime ;
public function appEnd() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function haveTime(){\n\t\tif($this->mCallbackHaveTime){\n\t\t\treturn call_user_func_array($this->mCallbackHaveTime, [$this]);\n\t\t}\n\t\treturn microtime(true) - $this->fStartTime < $this->fStepTime;\n\t}", "protected function startTime()\n {\n return microtime(true);\n }", "function timer_start(){\n\t\t$mtime = explode(' ', microtime());\n\t\t$this->time_start = $mtime[1] + $mtime[0];\n\t\treturn true;\n\t}", "public function hasStarttime(){\n return $this->_has(2);\n }", "public function microtime();", "protected function getTime()\n {\n return microtime(true);\n }", "function isOverExecuted()\n {\n if ($this->start_time+$this->max_execution_time<time()) return true;\n else return false;\n }", "public static function timer_start() {\n $mtime = microtime();\n $mtime = explode(' ', $mtime);\n self::$time_start = $mtime[1] + $mtime[0];\n return true;\n }", "function timestamp()\n {\n return microtime(true);\n }", "protected function getTime() {\n return microtime(true);\n }", "private static function startTimer(): bool\n {\n self::$TimerBegin = microtime(true);\n return true;\n }", "public function hasStarttime(){\n return $this->_has(7);\n }", "function now() {\n return microtime(true)*1000;\n}", "static function ts(){\r\n $dt = microtime(true) - self::$starttime;\r\n return self::mtformat($dt);\r\n }", "public function hasSpeed(){\r\n return $this->_has(22);\r\n }", "private function _upTime() \n {\n return microtime(true) - $this->_startTime;\n }", "public function hasSpeed(){\r\n return $this->_has(19);\r\n }", "public function hasKernelTime(){\n return $this->_has(1);\n }", "public function microtime()\n\t{\n\t\treturn microtime(true);\n\t}", "public function hasStartTimeMs()\n {\n return $this->start_time_ms !== null;\n }", "public function hasTime(){\n return $this->_has(3);\n }", "function timer(){\n static $start;\n\n if (is_null($start))\n {\n $start = microtime(true);\n }\n else\n {\n $diff = round((microtime(true) - $start), 4);\n $start = null;\n return $diff;\n }\n}", "public function hasLogintime(){\n return $this->_has(2);\n }", "public function time($id){\n if(!array_key_exists($id,$this->times)) return false;\n $time = $this->times[$id];\n if($this->_id == $id) $time += microtime(true) - $this->_start;\n return $time;\n }", "function GetExecutionTime($start) \r\n{\r\n\t//return sprintf('%1.6f', (microtime(true) - $start)) . ' sec';\r\n\treturn (microtime(true) - $start) . ' sec';\r\n}", "public function hasTime(){\n return $this->_has(6);\n }", "function start(){\n\t\t$this->time_start = $this->microtime_float();\n\t}", "public static function time() {\n if (is_null(self::$_time)) {\n self::$_time = microtime(true);\n } else {\n echo 'Time-Consumed:- ' . (microtime(true) - self::$_time) . PHP_EOL;\n }\n }", "private function isTimeLimitReached() \n {\n return $this->timeLimit < (microtime(true) - $this->startTime);\n }", "public function hasPassed() {\n \treturn $this < new \\DateTime();\n }", "public function get_starttime()\n {\n }", "function process_time(){\n $time = number_format( microtime(true) - LIM_START_MICROTIME, 6);\n return($time);\n}", "public static function time( string $name ) {\n\n if ( ! isset( self::$time_tracking[ $name ] ) ) {\n self::$time_tracking[ $name ] = microtime( true );\n return self::$time_tracking[ $name ];\n }\n else {\n return false;\n }\n }", "public function benchmarkStart()\n\t{\n\t\t$this->startTime = round(microtime(true) * 1000);\n\t}", "public function hasCTime(){\n return $this->_has(6);\n }", "public function testElapsed() {\n // Stop the timer\n $this->timer->stop();\n\n // Get the elapsed time\n $elapsed_time = $this->timer->get_elapsed();\n\n // It should be less than a second\n $this->assertTrue( $elapsed_time > 0 && $elapsed_time < 1 );\n }", "public function getTimeElapsed()\n {\n $start_time = $this->getStartTime();\n\n if (isset($start_time)) {\n $end_time = $this->getEndTime();\n\n if (!isset($end_time)) {\n $end_time = microtime(true);\n }\n\n return $end_time - $this->getStartTime();\n }\n\n return false;\n }", "public function getElapsedTime();", "public function check()\n {\n return time()%2==1; // condition\n }", "public function runtime ()\n {\n return time() - $this->_start_time;\n }", "protected function isTimeLimit(): bool\n {\n return (microtime(true) - $this->startTime) > $this->options->timeLimit;\n }", "public static function getStartTime() : float\n {\n if (!isset(static::$startTime)) {\n static::$startTime = microtime(true);\n }//end if\n \n return static::$startTime;\n \n }", "private function getCurrentTime()\n {\n return microtime(true);\n }", "private function getCurrentTime() {\n return microtime( true );\n }", "function StartTimer() {\n\tglobal $timestart;\n\t$mtime = microtime();\n\t$mtime = explode(\" \",$mtime);\n\t$mtime = $mtime[1] + $mtime[0];\n\t$timestart = $mtime;\n\treturn true;\n}", "function __construct() {\n $this->start_time = microtime(true);\n }", "public function hasBepro2Time(){\n return $this->_has(4);\n }", "public function startTime() {\n return intval($this['started']);\n }", "public function time()\n\t{\n\t\treturn $this->endTimer-$this->startTimer;\n\t}", "function etime($time_start){\n $time_end = microtime(true);\n $execution_time = ($time_end - $time_start);\n\n return number_format((float) $execution_time, 1);\n}", "function get_execution_time() {\n\treturn microtime(true) - __CHV_TIME_EXECUTION_STARTS__;\n}", "function get_execution_time() {\n static $microtime_start = null;\n if($microtime_start === null)\n {\n $microtime_start = microtime(true);\n return 0.0;\n }\n return microtime(true) - $microtime_start;\n}", "function __shesql_logger_is_microtime_enabled(array &$shesql){\n}", "public function getExecutionTime()/*# : float */;", "public function isElapsed()\n {\n return ($this->isTimeout() || $this->isLimitExceeded());\n }", "public function hasBepro1Time(){\n return $this->_has(3);\n }", "static function microtime ()\n\t{\n\t\tlist ($usec, $sec) = explode(' ', microtime());\n\t\t$result = ((float) $usec + (float) $sec) * 1000;\n\t\t\n\t\tstatic $microtime_start;\n\t\tif (empty($microtime_start)) {\n\t\t\t$microtime_start = $result;\n\t\t}\n\t\treturn $result - $microtime_start;\n\t}", "public function hasTimeLimitReached(): bool;", "private function _getMicroTime (){\n\t\treturn microtime(true);\n\t}", "public function hasLastTime(){\n return $this->_has(18);\n }", "public function hasStarted(){\n return (bool) Carbon::now()->greaterThanOrEqualTo(Carbon::parse($this->starts_on));\n }", "public static function start()\n {\n $start = round(microtime(true) * 1000);\n echo $start . \"\\n\";\n return $start;\n }", "public static function now()\n {\n return app() -> runningUnitTests() ? now() -> timestamp : microtime( true );\n }", "public static function currentTimeMillis()\n {\n return microtime(true) * 10000;\n }", "public function isTime();", "protected function _time($reset = false)\n {\n static $start;\n\n $res = 0;\n if ($reset) {\n $res = microtime(true) - $start;\n }\n $start = microtime(true);\n\n return $res;\n }", "public function hasCleartime(){\n return $this->_has(2);\n }", "public function currentTime();", "public function is_time()\n {\n }", "function stop_timing() {\n $this->time = number_format(microtime(true) - $this->start_time, 3);\n }", "public function hasStarted()\n {\n \treturn mb_strlen($this->actualstart);\n }", "public function hasPartinTime(){\n return $this->_has(1);\n }", "public function hasLocalStartTime(){\n return $this->_has(4);\n }", "protected static function _time()\n\t{\n\t\treturn time();\n\t}", "abstract protected function isRealTime();", "public function hasJumpTimeS()\n {\n return $this->jump_time_s !== null;\n }", "public function isStarted()\n {\n return $this->started_at > 0;\n }", "public function __construct()\n {\n $this->_timeStart = (float)microtime(true); \n parent::__construct();\n }", "public function getUseTime() \n \t{\n \t\treturn $this->use_time;\n \t}", "function clock_start($key = 'main') {\n $time = explode(' ', microtime());\n $start = (float)$time[0] + (float)$time[1];\n $GLOBALS['_clock_'][$key]['start'] = $start;\n return $start;\n }", "public function hasRelivetime(){\n return $this->_has(3);\n }", "private static function time()\n {\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n }", "public function checkTimeEnd(): bool;", "private static function time_exec()\n {\n $current = self::time();\n self::$time_exec = $current-self::$time_start;\n }", "public function getTime()\n {\n return (float)sprintf(\"%.1f\", 1000*(microtime(true) - $this->startTime));\n }", "function getStartMicrotime();", "public static function timeSinceStart(): float\n {\n return \\microtime(true) - self::getRequestTime();\n }", "function timer()\n {\n return hrtime(true);\n }", "public function hasEndtime(){\n return $this->_has(8);\n }", "function mstime ()\r\n{\r\n\t$t = explode (' ', microtime ());\r\n\treturn (int) (($t[0] + $t[1]) * 1000);\r\n}", "public function has_time() {\n return in_array( $this->duration_unit, array( 'hour', 'minute' ) );\n }", "function still_on_time($extra_time = 15)\n{\n\tstatic $max_execution_time, $start_time;\n\n\t$time = explode(' ', microtime());\n\t$current_time = $time[0] + $time[1];\n\n\tif (empty($max_execution_time))\n\t{\n\t\t$max_execution_time = (function_exists('ini_get')) ? (int) @ini_get('max_execution_time') : (int) @get_cfg_var('max_execution_time');\n\n\t\t// If zero, then set to something higher to not let the user catch the ten seconds barrier.\n\t\tif ($max_execution_time === 0)\n\t\t{\n\t\t\t$max_execution_time = 50 + $extra_time;\n\t\t}\n\n\t\t$max_execution_time = min(max(10, ($max_execution_time - $extra_time)), 50);\n\n\t\t// For debugging purposes\n\t\t// $max_execution_time = 10;\n\n\t\tglobal $starttime;\n\t\t$start_time = (empty($starttime)) ? $current_time : $starttime;\n\t}\n\n\treturn (ceil($current_time - $start_time) < $max_execution_time) ? true : false;\n}", "function wpf_timer_start( $id = 0 ) {\n\tglobal $wpf_profiler;\n\n\t$mtime = explode( ' ', microtime() );\n\t$wpf_profiler[$id]['start'] = $mtime[1] + $mtime[0];\n\n\treturn true;\n}", "private function startTimer()\n\t{\n\t\t// Keep statistics\n\t\tself::$totalCallCount++;\n\n\t\t// Rough execution time\n\t\t$this->startMicroStamp = microtime(true);\n\t}", "function L_PageLoadTime() {\n\t\n\t/*\n\t\t$time = microtime();\n\t\t$time = explode(' ', $time);\n\t\t$time = $time[1] + $time[0];\n\t\t$finish = $time;\n\t\t$total_time = round(($finish - $start), 4);\n\t\t\n\t*/\n\t\n\t/*\n\t\t$end_time = microtime(TRUE);\n\t\t$time_taken = $end_time - $start_time;\n\t\t$time_taken = round($time_taken,5);\n\t\t\n\t*/\n\t\n\t\t// Start of code\n\t\t$time = microtime(true); // Gets microseconds\n\n\t\t// End of code\n\t\t$time_taken = (microtime(true) - $time);\n\t\t\n\t\treturn _e('Page generated in ' . $time_taken . ' seconds.','leonite');\n\n\t}", "public function __construct()\n {\n $this->startTime = microtime(true);\n parent::__construct();\n }", "public function hasStarted() {\n return (bool) $this->startedAt;\n }", "public function timeHi();", "function equals( &$time )\r\n {\r\n $ret = false;\r\n\r\n if ( is_a( $time, \"eZTime\" ) )\r\n {\r\n if ( $time->secondsElapsed() == $this->SecondsElapsed )\r\n {\r\n $ret = true;\r\n }\r\n }\r\n return $ret;\r\n }", "public function TimerStart()\r\n\t{\r\n\t\t$parts = explode( \" \", microtime() );\r\n\t\t$this->time_diff = 0;\r\n\t\t$this->time_start = $parts[1].substr( $parts[0],1 );\r\n\t}", "public static function getTimer()\n {\n return microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n }" ]
[ "0.743465", "0.742375", "0.7216836", "0.7012052", "0.6955496", "0.6895003", "0.6890472", "0.68487126", "0.67893535", "0.6758524", "0.673", "0.668206", "0.6679383", "0.66704965", "0.66228247", "0.66072387", "0.6539482", "0.6525673", "0.65109205", "0.6497634", "0.64783084", "0.6473042", "0.6472499", "0.6458661", "0.6424582", "0.6418238", "0.63969195", "0.63827324", "0.6380308", "0.63690954", "0.6368926", "0.636808", "0.6305593", "0.63024515", "0.630092", "0.6296387", "0.62803024", "0.6279021", "0.62782156", "0.6277071", "0.6257382", "0.6246009", "0.6242107", "0.62319523", "0.6230384", "0.62108886", "0.62009543", "0.6181104", "0.616463", "0.6161545", "0.6157711", "0.6134664", "0.6134297", "0.6117359", "0.6107713", "0.6097104", "0.6065086", "0.60598475", "0.60573643", "0.6054154", "0.60404867", "0.60368854", "0.60347825", "0.60333955", "0.6029793", "0.60286963", "0.6025617", "0.59658164", "0.5963642", "0.596018", "0.59553784", "0.5953151", "0.5950012", "0.59499156", "0.5949389", "0.5936631", "0.5920252", "0.5917568", "0.5915015", "0.59084547", "0.5897088", "0.5894753", "0.58874506", "0.58801436", "0.58791524", "0.5870998", "0.58680654", "0.5865789", "0.5863837", "0.5860822", "0.5840491", "0.58385056", "0.5834029", "0.58296347", "0.5818015", "0.5808281", "0.58080447", "0.5797029", "0.57787764", "0.5770958", "0.5764309" ]
0.0
-1
Prepare the closure and reflection objects for parsing
public function parse($closure) { $closure = $this->prepareClosure($closure); $reflection = $closure->getReflection(); // Find the closure defined in the AST $locator = $this->locateClosure($reflection); if (!($ast = $locator->getClosureNode())) { // @codeCoverageIgnoreStart throw new ClosureParsingException('The closure was not found within the abstract syntax tree.'); // @codeCoverageIgnoreEnd } // Do a second traversal through the closure's AST to apply additional transformations $location = $locator->getLocation(); if ($this->options[self::HANDLE_MAGIC_CONSTANTS]) { // Resolve additional nodes by making a second pass through just the closure's nodes $traverser = new \PhpParser\NodeTraverser(); $traverser->addVisitor(new MagicConstantVisitor($location)); $ast = $traverser->traverse(array($ast)); $ast = $ast[0]; } // Get and return closure context data $printer = new \PhpParser\PrettyPrinter\Standard(); $code = $printer->prettyPrint(array($ast)); $variables = $this->determineVariables($ast, $reflection); $binding = $this->options[self::HANDLE_CLOSURE_BINDINGS] ? $closure->getBinding() : null; return new AstClosureContext($code, $variables, $ast, $location, $binding); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initializeReflection() {}", "protected function setUp()\n {\n $this->aClosureObjectParser = new ClosureObjectParser ;\n }", "private function prepare(){\r\n \r\n $autoload = &$this->settings->autoload; \r\n \r\n if(isset($autoload)){\r\n \r\n foreach($autoload AS $key => $class){\r\n \r\n $settings = &$this->settings->{$key};\r\n \r\n if(isset($settings)){\r\n\r\n $this->{$key} = new $class($settings);\r\n }\r\n }\r\n }\r\n }", "protected function prepare()\n {\n $this->register('require', function($context, $path) {\n $context->requireAsset($path);\n });\n\n $this->register('depend_on', function($context, $path) {\n $context->dependOn($path);\n });\n\n $this->register('require_tree', function($context, $path) {\n $context->requireTree($path);\n });\n\n $this->body = $this->getData();\n\n if (preg_match(static::HEADER_PATTERN, $this->getData(), $matches)) {\n $this->header = $matches[0];\n $this->body = substr($this->getData(), strlen($matches[0])) ?: '';\n }\n\n $this->processed = array();\n }", "public function prepareParsing()\n {\n $this->saverHelper->createFirstSheet();\n }", "protected function init()\n {\n $classParser = $this->getContainer()->get('classParser');\n $classParser->setAllowedMethods( array($this->allowedMethod) );\n $this->data = $classParser->getData($this->paths, $this->cacheFile);\n }", "private function PREPARE_OBJECT_VARIABLE_METHOD()\r\r {\r\r if($this->_type === 'POST')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_POST[$key])?$_POST[$key]:false;\r\r } \r\r } \r\r else if($this->_type === 'GET')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_GET[$key])?$_GET[$key]:false;\r\r } \r\r } \r\r }", "function setUp() {\n\n $this->oResolver= new reflection\\ResolverByReflection(new reflection\\resolveInterfaceByName\\ResolveInterfaceByNameFirstLetter());\n $aMap=array();\n $oL0ClassOne=&new layer0\\ClassOne(\" <b>Text Passed to The Instance created manually layer0->ClassOne</b>\");\n $aMap['layer2\\ClassOne']=&$oL0ClassOne;\n //$this->oResolverWithMap= new reflection\\ResolverByReflection(new reflection\\resolveInterfaceByName\\ResolveInterfaceByNameFirstLetter(),);\n\n }", "function _prepare() {}", "private function buildClassMeta()\n {\n // Search meta informations before going to reflection and then, ast parsing\n foreach ($this->data as $line) {\n $line = trim($line);\n\n // Namespace search\n if (preg_match(self::NAMESPACE_PATTERN, $line, $matches) === 1) {\n $this->context->setCurrentNamespace(trim($matches[1]));\n continue;\n }\n\n // Class name\n if (preg_match(self::DEFINITION_PATTERN, $line, $matches) === 1) {\n $this->context->setClassName(trim($matches[1]));\n break; // Stop after class found, let the reflection do the next job\n }\n\n // Uses\n if (preg_match(self::USE_PATTERN, $line, $matches) === 1) {\n $this->context->addUse($matches[1]);\n continue;\n }\n }\n }", "public function init_objects() {\n $this->controller_oai = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Expose();\n $this->list_sets = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Sets();\n $this->list_metadata_formats = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Metadata_Formats();\n $this->list_records = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Records();\n $this->get_record = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Get_Record();\n $this->identify = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Identify();\n $this->identifiers = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Identifiers();\n }", "protected function setUp()\n\t{\n\t\t// $this->object = new SimplePhpParser(&$functions);\n\t\t$this->object = new SimplePhpParser();\n\t}", "public function prepare() {\n $this->customTaxonomies = [];\n\n // Get custom taxonomy with selectors\n $this->prepareCustomTaxonomyWithSelectors();\n\n // Get manually added custom post taxonomy\n $this->prepareManuallyAddedCustomTaxonomy();\n\n // If there is no custom taxonomy, stop.\n if(empty($this->customTaxonomies)) return;\n\n // Store it\n $this->bot->getPostData()->setCustomTaxonomies($this->customTaxonomies);\n }", "public function prepareElements()\n {\n // or a specification, from which the appropriate object\n // will be built.\n\n \n\n // We could also define the input filter here, or\n // lazy-create it in the getInputFilter() method.\n }", "protected function prepareJsonStructure(){\n\t\t\n\t}", "protected function constructScopes() {}", "protected function loadFromVariableHandlers()\n {\n foreach ($this->workflow->getVariableHandlers() as $variableName => $className) {\n $object = new $className;\n $this->setVariable($variableName, $object->load($this, $variableName));\n }\n }", "public function buildObject()\n {\n $object = $this->instanciator->build($this->class, $this->properties);\n $parameters = $this->instanciator->getParameters($this->class);\n\n //avoid injecting the properties already used in the constructor\n $properties = $this\n ->properties\n ->filter(function($value, $property) use ($parameters) {\n return !$parameters->contains($property);\n });\n $refl = new ReflectionObject(\n $object,\n $properties,\n $this->injectionStrategies\n );\n\n return $refl->buildObject();\n }", "private function init(): void {\n\t\t$this->required = $this->json['required'] ?? array();\n\t\t$this->additional_properties = $this->json['additionalProperties'] ?? false;\n\t\t$this->required = $this->json['required'] ?? array();\n\n\t\t$properties = $this->json['properties'] ?? array();\n\t\t$definitions = $this->json['definitions'] ?? array();\n\t\t$all_of = $this->json['allOf'] ?? array();\n\n\t\tforeach ( $definitions as $key => $definition ) {\n\t\t\t$this->definitions[ $key ] = self::from_json( $this->get_name() . '/definitions/' . $key, array( 'properties' => $definition ) );\n\t\t}\n\n\t\tforeach ( $properties as $key => $property ) {\n\t\t\t// If object, create a new schema.\n\t\t\tif ( 'object' === ( $property['type'] ?? '' ) ) {\n\t\t\t\t$this->properties[ $key ] = self::from_json( $this->get_name() . '/properties/' . $key, $property );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( self::REF__KEY === $key ) {\n\t\t\t\t$this->properties[ $key ] = $this->get_reference( $property );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->properties[ $key ] = Property::from_json( $this, $key, $property );\n\t\t}\n\n\t\tforeach ( $all_of as $one_key => $one_value ) {\n\t\t\t$key = array_key_first( $one_value );\n\t\t\t$value = $one_value[ $key ];\n\n\t\t\tswitch ( $key ) {\n\t\t\t\tcase self::REF__KEY:\n\t\t\t\t\t$reference = $this->get_reference( $value );\n\t\t\t\t\t$this->properties = array_merge( $this->properties, $reference->get_properties() );\n\t\t\t\t\t$this->required = array_merge( $this->required, $reference->get_required() );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'properties':\n\t\t\t\t\t$one_prop = self::from_json( $this->get_name() . '/oneof/' . $one_key, $one_value );\n\t\t\t\t\t$this->properties = array_merge( $this->properties, $one_prop->get_properties() );\n\t\t\t\t\t$this->required = array_merge( $this->required, $one_prop->get_required() );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function extract(): void\n {\n try {\n\n $reflectionClass = new \\ReflectionClass($this->class);\n $method = $reflectionClass->getMethod(\"extractData\");\n $extraData = $method->invokeArgs(null, []);\n if($extraData instanceof \\stdClass)\n {\n $this->extraData = $extraData;\n\n // Saves the generator name to the info.\n if(isset($this->extraData->generatorName))\n {\n $this->generatorName = $this->extraData->generatorName;\n }\n }\n\n } catch (\\Exception $e) {\n // TODO: Print stack.\n return;\n }\n }", "protected function initializePackageObjects() {}", "public function setReflection($reflection){\r\n\r\n $this->request = ClosureDispatcher::bind($reflection);\r\n }", "public function build(): void\n {\n $this->objectConfigurations = $this->objectManager->getObjectConfigurations();\n\n foreach ($this->objectConfigurations as $objectName => $objectConfiguration) {\n $className = $objectConfiguration->getClassName();\n if ($className === ''\n || $objectName !== $className\n || $this->compiler->hasCacheEntryForClass($className) === true\n || $this->reflectionService->isClassAbstract($className)\n ) {\n continue;\n }\n $proxyClass = $this->compiler->getProxyClass($className);\n if ($proxyClass === false) {\n continue;\n }\n $this->logger->debug(sprintf('Building dependency injection proxy for \"%s\"', $className), LogEnvironment::fromMethodName(__METHOD__));\n\n $constructor = $proxyClass->getConstructor();\n $constructor->addPreParentCallCode($this->buildSetInstanceCode($objectConfiguration));\n $constructor->addPreParentCallCode($this->buildConstructorInjectionCode($objectConfiguration));\n\n $sleepMethod = $proxyClass->getMethod('__sleep');\n $sleepMethod->setDocBlock(self::AUTOGENERATED_PROXY_METHOD_COMMENT);\n $sleepMethod->setReturnType('array');\n\n $wakeupMethod = $proxyClass->getMethod('__wakeup');\n $wakeupMethod->setDocBlock(self::AUTOGENERATED_PROXY_METHOD_COMMENT);\n\n $wakeupMethod->addPreParentCallCode($this->buildSetInstanceCode($objectConfiguration));\n\n $serializeRelatedEntitiesCode = $this->buildSerializeRelatedEntitiesCode($objectConfiguration);\n if ($serializeRelatedEntitiesCode !== '') {\n $proxyClass->addTraits(['\\\\' . ObjectSerializationTrait::class]);\n $sleepMethod->addPostParentCallCode($serializeRelatedEntitiesCode);\n $wakeupMethod->addPreParentCallCode($this->buildSetRelatedEntitiesCode());\n }\n\n $wakeupMethod->addPostParentCallCode($this->buildLifecycleInitializationCode($objectConfiguration, ObjectManagerInterface::INITIALIZATIONCAUSE_RECREATED));\n $wakeupMethod->addPostParentCallCode($this->buildLifecycleShutdownCode($objectConfiguration, ObjectManagerInterface::INITIALIZATIONCAUSE_RECREATED));\n\n $injectPropertiesCode = $this->buildPropertyInjectionCode($objectConfiguration);\n if ($injectPropertiesCode !== '') {\n $proxyClass->addTraits(['\\\\' . PropertyInjectionTrait::class]);\n $injectPropertiesMethod = $proxyClass->getMethod('Flow_Proxy_injectProperties');\n $injectPropertiesMethod->addPreParentCallCode($injectPropertiesCode);\n $injectPropertiesMethod->setVisibility(ProxyMethodGenerator::VISIBILITY_PRIVATE);\n $injectPropertiesMethod->setDocBlock(self::AUTOGENERATED_PROXY_METHOD_COMMENT);\n\n $wakeupMethod->addPreParentCallCode(\n <<<'PHP'\n $this->Flow_Proxy_injectProperties();\n PHP\n );\n $constructor->addPostParentCallCode(\n <<<PHP\n if ('{$className}' === get_class(\\$this)) {\n \\$this->Flow_Proxy_injectProperties();\n }\n PHP\n );\n }\n\n $constructor->addPostParentCallCode($this->buildLifecycleInitializationCode($objectConfiguration, ObjectManagerInterface::INITIALIZATIONCAUSE_CREATED));\n $constructor->addPostParentCallCode($this->buildLifecycleShutdownCode($objectConfiguration, ObjectManagerInterface::INITIALIZATIONCAUSE_CREATED));\n\n if ($this->objectManager->getContext()->isProduction() || $this->objectManager->getContext()->isTesting()) {\n $this->compileStaticMethods($className, $proxyClass);\n }\n }\n }", "protected function initializeValues(): void\n {\n foreach ($this->params as $name => $infos) {\n if (!$this->is_sub_object && isset($infos['subobject']) && $infos['subobject']) {\n if (isset($infos['multivalues']) && $infos['multivalues']) {\n $this->values[$name] = [];\n } else {\n $tmp = get_class($this);\n $parts = explode('\\\\', $tmp);\n array_pop($parts);\n $class_name = implode('\\\\', $parts) . '\\\\' . $infos['type'];\n $class_name = str_replace('Entity', 'Datatype', $class_name);\n if (!class_exists($class_name)) {\n $class_name = str_replace(['\\\\EU\\\\', '\\\\AP\\\\', '\\\\EA\\\\'], '\\\\AM\\\\', $class_name);\n }\n $this->values[$name] = new $class_name();\n }\n } else {\n $this->values[$name] = null;\n }\n }\n }", "protected function setUp() {\n $this->object = new Class_Doku_Php_Source_Reflection;\n }", "private function parseFields(): void\n {\n foreach ($this->reflect->getProperties() as $item) {\n $name = $item->getName();\n if (in_array($name, self::SKIP_FIELDS, true)) {\n continue;\n }\n\n $docblock = $item->getDocComment();\n $defType = $this->getFieldType($name, $docblock);\n $varType = $this->getVarType($name, $docblock);\n $isRequired = $this->isRequired($name, $docblock);\n $storage = &$this->fieldsBuffer[$defType];\n\n switch ($defType) {\n case self::FIELD_SIMPLE_TYPE:\n $storage[] = $this->processSimpleField($name, $varType, $isRequired);\n break;\n case self::FIELD_DATE_TYPE:\n $storage[] = $this->processDateField($name, $varType, $isRequired);\n break;\n case self::FIELD_MO_TYPE:\n $storage[] = $this->processManyToOneField($name, $varType, $isRequired);\n break;\n case self::FIELD_OM_TYPE:\n $storage[] = $this->processOneToManyField($name);\n break;\n }\n }\n\n unset($storage);\n }", "protected function initHookObjects() {}", "protected function initHookObjects() {}", "protected function initHookObjects() {}", "public function parse() {\n $pointers = apply_filters( 'bc-pointers-manager-pointers', $this->pointers );\n\n $this->pointers = array();\n\n foreach( $pointers as $i => $pointer ) {\n $pointer['id'] = \"{$this->prefix}{$this->version}_{$i}\";\n $this->pointers[ $pointer['id'] ] = (object) $pointer;\n }\n\n }", "private function init()\n\t{\n\t\tforeach (isLoadedClass() as $objName)\n\t\t{\n\t\t\t$this->$objName =& loadClass('', '', $objName);\n\t\t}\n\t}", "public function convert()\n {\n $cFunctionCallIndexes = array();\n\n $classMap = $this->getClassMap();\n\n $cSourceCodeMap = array();\n\n foreach($classMap as $className => $classInfo) {\n for ($index = $classInfo->startLine; $index <= $classInfo->endLine; $index++) {\n if (preg_match(\"/call_c_function\\(.*\\)/\", $this->codeLines[$index], $matches)) {\n if(count($matches) == 1) {\n $codeLine = str_replace(array(\"call_c_function\",\"(\",\")\",\";\",\"$\"),\"\",trim($this->codeLines[$index]));\n $lineComps = explode(\"=\",$codeLine);\n $lineCompsCount = count($lineComps);\n $resultVarName = \"\";\n if ($lineCompsCount == 1) { //this means we just call the c function and do not have a return variable\n $cFunctionCallComps = explode(\",\",$lineComps[0]);\n $cFunctionCallComps = explode(\",\",$lineComps[1]);\n foreach($cFunctionCallComps as $idx => $comp) {\n $cFunctionCallComps[$idx] = trim(str_replace(\"$\",\"\",$cFunctionCallComps[$idx]));\n }\n } else if ($lineCompsCount > 1) { //this means we call the c function and then store the result in a return variable \n $resultVarName = trim(str_replace(\"$\",\"\",$lineComps[0]));\n $cFunctionCallComps = explode(\",\",$lineComps[1]);\n foreach($cFunctionCallComps as $idx => $comp) {\n $cFunctionCallComps[$idx] = trim(str_replace(\"$\",\"\",$cFunctionCallComps[$idx]));\n }\n }\n\n if (count($cFunctionCallComps) > 0) {\n $firstComp = array_shift($cFunctionCallComps);\n $cSourceFile = str_replace(array(\"'\",'\"'),\"\",$firstComp);\n $secondComp = array_shift($cFunctionCallComps);\n $cFUnctionName = str_replace(array(\"'\",'\"'),\"\",$secondComp);\n $cFUnctionInputParamsStr = \"\";\n if (count($cFunctionCallComps) > 0) {\n $cFUnctionInputParamsStr = implode(\", \",$cFunctionCallComps); \n }\n\n $cFunctionCallCode = \"\";\n $cFunctionCallCode .= \"let $resultVarName = null;\\n\"; //initialize result var\n $cFunctionCallCode .= \"\\n%{\\n\";\n if (strlen($resultVarName) == 0) {\n $cFunctionCallCode .= $cFUnctionName.\"($cFUnctionInputParamsStr);\"; \n } else {\n $cFunctionCallCode .= \"$resultVarName = \".$cFUnctionName.\"($cFUnctionInputParamsStr);\";\n }\n $cFunctionCallCode .= \"\\n}%\\n\";\n\n $expectedZephirCode = 'let '.$resultVarName.' = call_c_function('.$firstComp.', '.$secondComp.', '.implode(\", \",$cFunctionCallComps).');';\n $this->postSearchAndReplace($expectedZephirCode,$cFunctionCallCode);\n\n //now, inject the c source code to the top of the class \n $namespace = $classInfo->namespace;\n $classPureName = array_pop(explode(\"\\\\\",$className));\n $originalCode = \"namespace $namespace;\\n\\n\".\"class $classPureName\\n\";\n if (!isset($cSourceCodeMap[$cSourceFile])) {\n $cSourceCode = file_get_contents($this->inputDir.\"/\".$cSourceFile);\n $cSourceCodeMap[$cSourceFile] = $cSourceCode;\n $withCSourceCode = \"%{\\n\".$cSourceCodeMap[$cSourceFile].\"\\n}%\\n\".$originalCode; \n $this->postSearchAndReplace($originalCode, $withCSourceCode);\n }\n }\n\n }\n\n }\n }\n\n }\n }", "public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\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}", "protected function preprocessData() {}", "private function initializeTransformers()\n {\n $this->transformers = [];\n\n foreach ($this->configuration->get(Configuration::KEY_TRANSFORMERS) as $transformerClass) {\n $this->transformers[$transformerClass] = new $transformerClass(\n ...$this->getTransformerDependencies($transformerClass)\n );\n }\n }", "private function prepare()\n {\n Debugger::setLogger(new DummyLogger());\n\n $container = new Container();\n $request = new Request(new UrlScript(), null, null, null, null, ['Origin' => 'http://example.org']);\n $response = new BufferResponse();\n $api = new Api($request, $response, $container);\n\n return [$api, $response, $container];\n }", "function _Parser($object)\n\t{\n\t\t$this->object = $object;\n\t}", "protected function _prepareLogData($data) {\n\n\t\tforeach ($data as $key => $value) {\n\t\t\tif ($value instanceof Closure) {\n\t\t\t\t$closure = new \\ReflectionFunction($value);\n\t\t\t\t$data[$key] = $closure->getFileName();\n\t\t\t\t$data['start_line'] = $closure->getStartLine();\n\t\t\t\t$data['end_line'] = $closure->getEndLine();\n\t\t\t} else if (is_object($value)) {\n\t\t\t\t$object = new \\ReflectionClass($value);\n\t\t\t\t$data[$key] = $object->getFileName();\n\t\t\t\t$data['start_line'] = $object->getStartLine();\n\t\t\t\t$data['end_line'] = $object->getEndLine();\n\t\t\t} else if (!is_string($value)) {\n\t\t\t\tunset($data[$key]);\n\t\t\t}\n\n\t\t}\n\n\t\treturn json_encode($data);\n\t}", "function __construct()\n {\n $this->_metaTags = new \\ArrayObject();\n $this->_scriptFiles = new \\ArrayObject();\n $this->_scriptText = new \\ArrayObject();\n $this->_cssFiles = new \\ArrayObject();\n $this->_cssText = new \\ArrayObject();\n }", "function initialize()\n\t{\n\t\t$this->strType = strtoupper($this->dom->getAttribute(\"type\"));\n\t\t$this->strValues = $this->dom->getAttribute(\"values\");\n\t\t\n\t\t$this->prepare();\n\t}", "private function initFunctions() {\n $this->wsdlFunctions = array();\n foreach ($this->src->getElementsByTagName(\"function\") as $entity) {\n $wsdlFunction = $this->factory->createFunction($entity);\n $this->wsdlFunctions[$wsdlFunction->getRawName()] = $wsdlFunction;\n }\n return $this;\n }", "protected function initializePointcutExpressionParser()\n {\n if ($this->pointcutExpressionParserInitialized) {\n return;\n }\n\n $this->pointcutExpressionParser->injectObjectManager($this->objectManager);\n $this->pointcutExpressionParser->injectReflectionService($this->reflectionService);\n $this->pointcutExpressionParser->injectProxyClassBuilder($this->proxyClassBuilder);\n $this->pointcutExpressionParserInitialized = true;\n }", "private function createExtractorDelegate()\n {\n return $this->extractorDelegate ?: $this->extractorDelegate = function () {\n return get_object_vars($this);\n };\n }", "protected function initializeExternalParsers() {}", "private function init()\n {\n // #41776, dwildt, 1-\n// $this->pObj->objFltr3x->get_tableFields( );\n // #52486, 131005, dwildt, 2+\n // Init radialsearch filter and object\n $this->init_radialsearch();\n\n // RETURN: if there isn't any filter array\n if ( !$this->init_boolIsFilter() )\n {\n return;\n }\n // RETURN: if there isn't any filter array\n // Evaluate TREEVIEW filter\n // #41753, 121012, dwildt, 1+\n $this->eval_treeview();\n\n // #41776, dwildt, 2+\n // Set the array consolidation and the ts property SELECT\n $this->init_consolidationAndSelect();\n\n // Init localisation\n $this->init_localisation();\n\n // Init calendar area\n $this->init_calendarArea();\n\n // Init class var $andWhereFilter\n $this->init_andWhereFilter();\n\n // Set class var markerArray\n $this->set_markerArray();\n\n // Init the data of the cObj\n $this->cObjData_init();\n\n return;\n }", "private function parseOpenGraphObjects()\n {\n foreach ($this->getOpenGraphObjectTypes() as $objectType => $objectTypeClass) {\n /** @var \\Illuminate\\Support\\Collection $tags */\n $tags = $this->getAllByNamespace($objectType);\n if ($tags->isEmpty()) {\n continue;\n }\n\n $this->openGraph['objects'][$objectType] = new $objectTypeClass($tags);\n }\n }", "function _prepare_filter_data () {\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Connect common used arrays\n\t\tif (file_exists(INCLUDE_PATH.\"common_code.php\")) {\n\t\t\tinclude (INCLUDE_PATH.\"common_code.php\");\n\t\t}\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"engine\",\n\t\t\t\"text\",\n\t\t);\n\t}", "private function prepareObjects() {\n // Prepare objects if its neaded\n foreach ($this->objects as $o => $object) {\n if ($object[\"type\"] == \"text\") {\n // Wrap text if it has width param\n if (isset($object[\"width\"])) {\n $object[\"text\"] = $this->wrapText($object[\"size\"], $object[\"path\"], $object[\"text\"], $object[\"width\"]);\n }\n\n $lines = explode(\"\\n\", $object[\"text\"]);\n\n $width = (isset($object[\"width\"]) ? $object[\"width\"] : $this->width);\n foreach ($lines as $ln => $line) {\n if (!$line) continue;\n\n // Add each not empty line as object\n $tmpObject = array_merge([], $object);\n $box = imagettfbbox($tmpObject[\"size\"], 0, $tmpObject[\"path\"], $line);\n // If aligment != left, calculate how element should be moved\n switch ($tmpObject[\"align\"]) {\n case \"center\":\n $left = round(($width - ($box[2] - $box[0])) / 2);\n break;\n case \"right\":\n $left = $width - ($box[2] - $box[0]);\n break;\n default:\n $left = 0;\n break;\n\n }\n $tmpObject[\"text\"] = $line;\n $tmpObject[\"left\"] += $left;\n $tmpObject[\"top\"] += $ln * $tmpObject[\"size\"];\n foreach ($tmpObject[\"animation\"] as $k => $animation) {\n // Change animation params\n if (isset($animation[\"left\"]))\n $tmpObject[\"animation\"][$k][\"left\"] += $left;\n if (isset($animation[\"top\"]))\n $tmpObject[\"animation\"][$k][\"top\"] += $ln * $tmpObject[\"size\"];\n }\n\n $this->addObject($tmpObject);\n }\n }else{\n $this->addObject($object);\n }\n }\n }", "private function packResolvers()\n {\n $this->builder->putVehicle($this->builder->createVehicle('xPDOScriptVehicle', [\n 'vehicle_class' => 'xPDOScriptVehicle',\n 'object' => ['source' => __DIR__ . '/resolvers/tables.php']\n ]));\n\n $this->builder->putVehicle($this->builder->createVehicle('xPDOScriptVehicle', [\n 'vehicle_class' => 'xPDOScriptVehicle',\n 'object' => ['source' => __DIR__ . '/resolvers/sources.php']\n ]));\n\n $this->builder->putVehicle($this->builder->createVehicle('xPDOScriptVehicle', [\n 'vehicle_class' => 'xPDOScriptVehicle',\n 'object' => ['source' => __DIR__ . '/resolvers/updater.php']\n ]));\n }", "function construct() {\n if (!$this->cacheGet()) {\n $this->prepare();\n $this->build();\n $this->expand();\n $this->populate();\n }\n }", "public function construct() {\n\n\t // Declare each ACF fields on the entity\n\t foreach (static::$acf_mapping as $fieldName => $fieldKey) {\n\t $this->set($fieldName, new LazyACFLoader($fieldKey, $fieldName, $this->ID));\n }\n\n\t}", "private function _parseClass()\n {\n // check which interfaces are implemented\n $interfaces = $this->_reflectionClass->getInterfaceNames();\n foreach ($interfaces as $i) {\n if ($i == 'Webiny\\Component\\Rest\\Interfaces\\AccessInterface') {\n $this->_parsedClass->accessInterface = true;\n }\n\n if ($i == 'Webiny\\Component\\Rest\\Interfaces\\CacheKeyInterface') {\n $this->_parsedClass->cacheKeyInterface = true;\n }\n }\n }", "protected function prepare() \n {\n $this->array = new ArrayNode;\n }", "private function resolve_dependencies($v){\n\n $Ref = new \\ReflectionClass($v);\n $con = $Ref->getConstructor();\n\n if(is_null($con)){\n return new $v;\n }//if\n\n $inject = Array();\n\n $ss = (string)$con;\n $ss = explode(\"\\n\",$ss);\n foreach($ss as $s){\n $s = trim($s);\n if(strpos($s,'Parameter #')!==false){\n $s = trim(explode('[',$s)[1]);\n $s = explode(' ',$s)[1];\n if(substr($s,0,1) != '$'){\n $inject[] = $this->with($s);\n }//if\n }//if\n }//foreach\n\n switch (count($inject)) {\n case 0:\n return new $v;\n break;\n case 1:\n return new $v($inject[0]);\n break;\n case 2:\n return new $v($inject[0],$inject[1]);\n break;\n case 3:\n return new $v($inject[0],$inject[1],$inject[2]);\n break;\n case 4:\n return new $v($inject[0],$inject[1],$inject[2],$inject[3]);\n break;\n case 5:\n return new $v($inject[0],$inject[1],$inject[2],$inject[3],$inject[4]);\n break;\n case 6:\n return new $v($inject[0],$inject[1],$inject[2],$inject[3],$inject[4],$inject[5]);\n break;\n default:\n return call_user_func_array(Array(new $v,'__construct'),$inject);\n break;\n }//switch\n\n }", "public function prepare()\n {\n $this->status = $this->response->getStatusCode();\n\n $rawResponseData = $this->response->getBody()->getContents();\n\n $this->body = $rawResponseData ? \\GuzzleHttp\\json_decode($rawResponseData, true) : '';\n\n $this->errors = isset($this->body['errors']) ? $this->body['errors'] : [];\n\n if ($this->throwException && (substr($this->status, 0, 1) != 2)) {\n $this->throwException($this->status, $this->errors);\n }\n\n //Set data\n if ($this->body) {\n //This happens when array was expected but it is empty\n if (empty($this->body['data'])) {\n $this->data = collect([]);\n } else {\n $document = Document::createFromArray($this->body);\n $hydrator = new ClassHydrator();\n $hydrated = $hydrator->hydrate($document);\n $this->data = is_array($hydrated) ? collect($hydrated) : $hydrated;\n }\n }\n\n //Set meta\n if (isset($this->body['meta'])) {\n $this->meta = $this->body['meta'];\n }\n }", "protected function setUp() {\n $this->object = new ReflectionClass();\n }", "abstract protected function _prepare();", "protected function initializeObject() {}", "protected function parse() {}", "public function __construct()\n {\n $this->blocksToProcess = get_object_vars(Mage::getConfig()->getNode('varnish/objects_to_tag')->children());\n $this->tagPrefixes = get_object_vars(Mage::getConfig()->getNode('varnish/tag_prefixes')->children());\n }", "final protected function buildDependencyMap() {\n\n\t\t$this->dependencyMap = array();\n\t\t$this->prioritiesHandlers = array();\n $p = new dummyPriorityhookHandler();\n\t\t$this->prioritiesHandlers[self::NORMAL] = $p;\n $this->priorityBased = array('min' => array(),'max' => array());\n\t\t//$this->priorityBased['min'][self::NORMAL][spl_object_hash($p)] = $p;\n\t\tforeach ($this->objects as $hash => $handler) {\n\t\t\t$this->priorityBased['min'][self::NORMAL][$hash] = $handler;\n\t\t\t$this->dependencyMap[$hash] = array('priority' => $this->prioritiesHandlers[self::NORMAL]);\n\t\t\t$this->priorityBased['max'][self::LATEST-1][$hash] = $handler;\n\t\t\t$handler->registerDependencies($this);\n\t\t}\n\t}", "protected function preprocessQueryObject() {\n\n $this->get = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);\n $this->post = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n $this->request = VTCore_Wordpress_Utility::arrayMergeRecursiveDistinct($this->post, $this->request);\n\n // Processing pager\n // this has to be linked with wppager to\n // work properly and both object context id\n // must be the same\n if ($this->getContext('id')\n && isset($this->get['paged-' . $this->getContext('id')])\n && is_numeric($this->get['paged-' . $this->getContext('id')])) {\n\n $this->getContext('query')->set('paged', $this->get['paged-' . $this->getContext('id')]);\n }\n\n\n // Processing WpTermList\n // This must be linked to WpTermLIst object\n // to get the term_id\n if (isset($this->get['term-' . $this->getContext('id')])\n && is_numeric($this->get['term-' . $this->getContext('id')])\n && !empty($this->get['term-' . $this->getContext('id')])\n && isset($this->get['tax-' . $this->getContext('id')])) {\n\n $this->taxQuery[] = array(\n 'taxonomy' => $this->get['tax-' . $this->getContext('id')],\n 'field' => 'term_id',\n 'terms' => (int) $this->get['term-' . $this->getContext('id')],\n );\n }\n\n return $this;\n }", "protected function setUp()\n\t{\n\t\t$this->object = new object('obj att');\n\n\t\t$this->sibling = new sibling('sibling att');\n\t\t$this->sibling2 = new sibling('sibling att2');\n\n\t\t$this->child = new child('child att');\n\t\t$this->child2 = new child('child att2');\n\n\t\t$this->parent_ = new parent_('parent_ att');\n\t}", "protected function init()\n {\n if ($this->regex) {\n return;\n }\n\n $this->regex = $this->path;\n $matches = [];\n\n if ($count = preg_match_all('@{([^A-Za-z]*([A-Za-z]+))([?]?)(?::([^}]+))?}@', $this->regex, $matches)) {\n $this->tokens = new \\SplFixedArray($count);\n\n foreach ($matches[1] as $index => $token) {\n $fullString = $matches[1][$index];\n $name = $matches[2][$index];\n $optional = !empty($matches[3][$index]);\n $constraint = empty($matches[4][$index]) ? '.*' : $matches[4][$index];\n\n if ($optional) {\n $replace = sprintf('(?:%s(?<%s>%s))?', str_replace($name, '', $fullString), $name, $constraint);\n } else {\n $replace = sprintf('(?<%s>%s)', $name, $constraint);\n }\n\n $this->regex = str_replace($matches[0][$index], $replace, $this->regex);\n\n $this->tokens[$index] = [$name, $optional];\n }\n }\n }", "public function prep_sf_obj( array $obj_arr )\n\t{\t\n\t\t$obj = new stdClass();\n\t\t\n\t\t// META\n\t\tif ( empty( $obj_arr['meta']['type'] ) )\n\t\t\treturn false;\n\t\t$prefix = empty( $obj_arr['meta']['prefix'] ) ? '' : ($obj_arr['meta']['prefix'] . '__');\n\t\t$custom = empty($obj_arr['meta']['custom']) ? '' : '__c';\n\t\t$obj->type = $prefix . $obj_arr['meta']['type'] . $custom;\n\t\tunset($obj_arr['meta']);\n\t\t\n\t\t// DATA\n\t\tforeach ( $obj_arr as $field => $arr ) {\n\t\t\tif ( empty ( $arr ) || ( is_array( $arr ) && !empty( $arr['ignore'] ) ) )\n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t// Complex fields use an array, simple fields are simple key => value pairs.\n\t\t\tif ( is_array( $arr ) ) {\n\t\t\t\tif ( !empty( $arr['custom'] ) )\n\t\t\t\t\t$field .= '__c';\n\t\t\t\tif ( !empty( $arr['prefix'] ) )\n\t\t\t\t\t$field = $prefix . $field;\n\t\t\t\t// Use callback to set value if supplied (args required to use callback)\n\t\t\t\tif ( !empty( $arr['callback'] ) && !empty( $arr['args'] ) ) {\n\t\t\t\t\t// If the callback is a one element array, set it to use $this.\n\t\t\t\t\t// If the callback is an array with > 2 elements, skip this field.\n\t\t\t\t\tif ( is_array( $arr['callback'] ) ) {\n\t\t\t\t\t\tif ( count( $arr['callback'] ) > 2 )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif ( count( $arr['callback'] ) == 1 )\n\t\t\t\t\t\t\t$arr['callback'] = array($this, array_shift($arr['callback']));\n\t\t\t\t\t}\n\t\t\t\t\t// Put args into array if they aren't already\n\t\t\t\t\t$arr['args'] = is_array($arr['args']) ? $arr['args'] : array($arr['args']);\n\t\t\t\t\t$arr['value'] = call_user_func_array($arr['callback'], $arr['args']);\n\t\t\t\t}\n\t\t\t\t$value = $arr['value'];\n\t\t\t} else {\n\t\t\t\t$value = $arr;\n\t\t\t}\n\t\t\t\n\t\t\t// Check that if the field is required, that it has a value\n\t\t\tif ( !empty( $arr['required'] ) && empty ( $value ) ) {\n\t\t\t\t$this->_error(new Exception(\"Value for $field field is required.\"));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t// Assign the property to the objects field property in the appropriate way\n\t\t\tif ( !empty( $value ) )\n\t\t\t\t$obj->fields[$field] = $value;\n\t\t}\n\t\t\n\t\treturn $obj;\n\t}", "protected function preparePrimitives()\n {\n /* Primitive collections */\n $this->aframeDomObj->appendEntities($this->childrens);\n /* Primitives which only one can be present */\n\n (! $this->sky) ?: $this->aframeDomObj->appendEntity($this->sky);\n (! $this->videosphere) ?: $this->aframeDomObj->appendEntity($this->videosphere);\n }", "protected function prepare_fields()\n {\n }", "public function __construct()\n {\n $this->properties = [];\n $this->methods = [];\n $this->comment = null;\n $this->interfaces = [];\n $this->name = null;\n $this->shortName = null;\n $this->signature = null;\n $this->reflectionClass = null;\n }", "public function __construct()\n {\n foreach (GeneralUtility::makeInstance(\\ReflectionClass::class, static::class)->getProperties() ?? [] as $reflection) {\n if (!$reflection->isProtected()) {\n $name = $reflection->getName();\n $value = $this->{$name};\n\n // Define parameter name of property\n $this->parameterMapping[$name] = GeneralUtility::camelCaseToLowerCaseUnderscored($name);\n\n // Map the type of properties\n $this->typeMapping[$name] = is_int($value) ? 'int' : (is_array($value) ? 'array' : (is_bool($value) ? 'bool' : (is_string($value) ? 'string' : null)));\n }\n }\n }", "private function mapElements(){\n $aux = '';\n if(!empty($this->category_list)){\n foreach($this->category_list as $c) {\n $category = new Category();\n $category->loadTaggedElement($c);\n $aux[] = $category; \n }\n $this->category_list = $aux;\n }\n $aux = '';\n if(!empty($this->user_category_list)) {\n foreach($this->user_category_list as $u) {\n $user_category = new Category();\n $user_category->loadTaggedElement($u);\n $aux[] = $user_category;\n }\n $this->user_category_list = $aux;\n } \n $aux = '';\n if(!empty($this->entity_list)){\n foreach($this->entity_list as $e) {\n $entity = new Entity();\n $entity->loadTaggedElement($e);\n $aux[] = $entity;\n }\n $this->entity_list = $aux;\n }\n $aux = '';\n if(!empty($this->concept_list)){\n foreach($this->concept_list as $c) {\n $concept = new Concept();\n $concept->loadTaggedElement($c);\n $aux[] = $concept;\n }\n $this->concept_list = $aux;\n }\n $aux = '';\n if(!empty($this->time_expression_list)){\n foreach($this->time_expression_list as $t)\n $aux[] = new TimeExpression($t);\n $this->time_expression_list = $aux;\n }\n $aux = '';\n if(!empty($this->money_expression_list)){\n foreach($this->money_expression_list as $m)\n $aux[] = new MoneyExpression($m);\n $this->money_expression_list = $aux;\n }\n $aux = '';\n if(!empty($this->uri_list)){\n foreach($this->uri_list as $u)\n $aux[] = new URI($u);\n $this->uri_list = $aux;\n }\n $aux = '';\n if(!empty($this->phone_expression_list)){\n foreach($this->phone_expression_list as $p)\n $aux[] = new PhoneExpression($p);\n $this->phone_expression_list = $aux;\n } \n $aux = '';\n if(!empty($this->quotation_list)){\n foreach($this->quotation_list as $p)\n $aux[] = new Quotation($p);\n $this->quotation_list = $aux;\n } \n $aux = '';\n if(!empty($this->issue_list)) {\n foreach($this->issue_list as $i)\n $aux[] = new Issue($i);\n $this->issue_list = $aux;\n }\n }", "protected function setUp()\n {\n $this->object = new LazyClassDefinition('\\stdClass');\n \n }", "private function prepareDynamicMapping() {\n foreach ($this->getFieldMaping() as $field_mapping) {\n if ($this->isTranslatableField($field_mapping)) {\n\n $default_language_source = NULL;\n foreach ($this->getLanguages() as $language) {\n if ($language == NexteuropaNewsroomHelper::getDefaultLanguageUppercase()) {\n $default_language_source = $this->getXpathString();\n }\n else {\n $this->addNewsroomDefaultValueTamper($default_language_source);\n }\n\n if (!empty($field_mapping['query'])) {\n $this->addTranslatableQuery($field_mapping['query'], $language);\n }\n\n $this->addMapper($field_mapping, $language);\n }\n\n }\n else {\n $this->addTampers($field_mapping);\n if (!empty($field_mapping['query'])) {\n $this->addQuery($field_mapping['query']);\n }\n\n $this->addMapper($field_mapping);\n }\n }\n\n }", "protected function createObjects() {\n\t\t$this->lblId = $this->mctHut->lblId_Create();\n\t\t$this->lstPosition = $this->mctHut->lstPosition_Create();\n\t\t$this->txtName = $this->mctHut->txtName_Create();\n\t}", "public function process() : void\n {\n // Filter all classes, before processing.\n $class_list = apply_filters(\\PC_Headless_Blog_1AA\\PinkCrab\\Core\\Application\\Hooks::APP_INIT_REGISTRATION_CLASS_LIST, $this->class_list);\n foreach ($this->middleware as $middleware) {\n // Pass each class to the middleware.\n foreach ($class_list as $class) {\n // Construct class using container,\n //if valid object process via current middleware\n $class_instance = $this->di_container->create($class);\n if (\\is_object($class_instance)) {\n $middleware->process($class_instance);\n }\n }\n }\n }", "protected function resolveChildren()\n {\n foreach ($this->unresolvedChildren as $name => $info) {\n $this->children[$name] = $this->create($name, $info['type'], $info['init_options'], $info['exec_options']);\n }\n\n $this->unresolvedChildren = array();\n }", "protected function buildPropertyInfoAlter() {\n }", "protected function processFilters()\n {\n $this->filters = [];\n foreach ($this->params as $key => $value) {\n $this->parser->setAlias('_' . $this->contentType);\n $filter = $this->parser->getFilter($key, $value);\n if ($filter) {\n $this->addFilter($filter);\n }\n }\n }", "private function construct() {\n\n\t\t$this->is_json_valid = [\n\t\t\t'amp' => true,\n\t\t\t'nonamp' => true,\n\t\t];\n\n\t\t$this->init();\n\t}", "protected function prepareOptions()\n {\n $options = $this->getOptions();\n $input = [];\n\n foreach($options as $option)\n {\n $input[] = $this->option($option[0]);\n }\n\n $larapath = $this->laravel['path'];\n $lastnsdelim = strrpos($input[1], '\\\\');\n\n $this->options[$options[0][0]] = $input[0] ?: substr($input[1], 0, $lastnsdelim);\n $this->options[$options[1][0]] = substr($input[1], $lastnsdelim);\n $this->options[$options[2][0]] = $input[2] ?: ExtStr::tableize($input[1]);\n $this->options[$options[3][0]] = $input[3] ?: $this->options[$options[1][0]].'Closure';\n $this->options[$options[4][0]] = $input[4] ?: ExtStr::tableize($input[1].'Closure');\n $this->options[$options[5][0]] = $input[5] ? $input[5] : $larapath . '/models';\n $this->options[$options[6][0]] = $input[6] ? $input[6] : $larapath . '/database/migrations';\n }", "function setUp() {\n\n $this->oResolverByName =new reflection\\resolveInterfaceByName\\ResolveInterfaceByNameFirstLetter();\n\n }", "function _dotgo_filter_prepare() {\n\n}", "function set_objects()\n {\n $this->state_census_analyser_object=new StateCensusAnalyser(); //Object of StateCensusAnalyser class\n $this->csv_state_census_object=new CSVStateCensus(); //Object of CSVStateCensus\n }", "public function prepareArguments() {}", "private function instantiateAll() {\n $this->Corporations = new Corporations($this);\n $this->MemberTracking = new MemberTracking($this);\n $this->Characters = new Characters($this);\n $this->Stations = new Stations($this);\n $this->Facilities = new Facilities($this);\n $this->Industry = new Industry($this);\n $this->Markets = new Markets($this);\n $this->Universe = new Universe($this);\n $this->Contracts = new Contracts($this);\n $this->Wallet = new Wallet($this);\n $this->Assets = new Assets($this);\n $this->Killmails = new Killmails($this);\n $this->Status = new Status($this);\n $this->Usage = new Usage($this);\n }", "public function init() {\n\t\tglobal $wpdb;\n\n\t\t$this->incrementor = new Incrementor();\n\n\t\t$this->file_locator = new File_Locator();\n\n\t\t$this->block_recognizer = new Block_Recognizer();\n\n\t\t$this->dependencies = new Dependencies();\n\n\t\t// @todo Pass options for verbosity, which filters to wrap, whether to output annotations that have no output, etc.\n\t\t$this->output_annotator = new Output_Annotator(\n\t\t\t$this->dependencies,\n\t\t\t$this->incrementor,\n\t\t\t$this->block_recognizer,\n\t\t\t[\n\t\t\t\t'can_show_queries_callback' => function() {\n\t\t\t\t\treturn current_user_can( $this->show_queries_cap );\n\t\t\t\t},\n\t\t\t]\n\t\t);\n\n\t\t$this->database = new Database( $wpdb );\n\n\t\t$this->hook_wrapper = new Hook_Wrapper();\n\n\t\t$this->invocation_watcher = new Invocation_Watcher(\n\t\t\t$this->file_locator,\n\t\t\t$this->output_annotator,\n\t\t\t$this->dependencies,\n\t\t\t$this->database,\n\t\t\t$this->incrementor,\n\t\t\t$this->hook_wrapper\n\t\t);\n\n\t\t$this->output_annotator->set_invocation_watcher( $this->invocation_watcher );\n\n\t\t$this->server_timing_headers = new Server_Timing_Headers( $this->invocation_watcher );\n\t}", "public function prepareObject() {\n\t\tforeach($this->tempData as $sem) {\n\t\t\t$s = new Semestar($sem);\n\t\t\t$this->semester[] = $s;\n\t\t}\n\t\tunset($this->tempData);\n\t}", "private function bootstrapParser()\n {\n $this->saxParser = xml_parser_create(\"UTF-8\");\n if(!xml_set_object($this->saxParser, $this)) {\n throw new RuntimeException(\"xml_set_object() failed\");\n }\n\n xml_set_element_handler($this->saxParser, [$this, '_xmlElementStart'], [$this, '_xmlElementEnd']);\n }", "public function init( $sanitizers ) {}", "public function processAnnotations()\n {\n foreach ($this->generatorRegistry->annotationManager->get(\"event\", true) as $tScanResult) {\n if ($tScanResult[AnnotationManager::LEVEL] !== \"staticMethods\") {\n continue;\n }\n\n foreach ($tScanResult[AnnotationManager::VALUE] as $tEvent) {\n $this->events->register(\n $tEvent[\"on\"],\n [$tScanResult[AnnotationManager::SOURCE], $tScanResult[AnnotationManager::MEMBER]],\n null,\n isset($tEvent[\"priority\"]) ? $tEvent[\"priority\"] : null\n );\n }\n }\n }", "protected function createObjects() {\n\t\t$this->txtId = $this->mctCity->txtId_Create();\n\t\t$this->txtCountryId = $this->mctCity->txtCountryId_Create();\n\t\t$this->txtPostalCode = $this->mctCity->txtPostalCode_Create();\n\t\t$this->txtName = $this->mctCity->txtName_Create();\n\t\t$this->txtAdminName1 = $this->mctCity->txtAdminName1_Create();\n\t\t$this->txtAdminCode1 = $this->mctCity->txtAdminCode1_Create();\n\t\t$this->txtAdminName2 = $this->mctCity->txtAdminName2_Create();\n\t\t$this->txtAdminCode2 = $this->mctCity->txtAdminCode2_Create();\n\t\t$this->txtAdminName3 = $this->mctCity->txtAdminName3_Create();\n\t\t$this->txtAdminCode3 = $this->mctCity->txtAdminCode3_Create();\n\t\t$this->txtLatitude = $this->mctCity->txtLatitude_Create();\n\t\t$this->txtLongitude = $this->mctCity->txtLongitude_Create();\n\t\t$this->txtAccuracy = $this->mctCity->txtAccuracy_Create();\n\t}", "public static function init() {\r\n\t\r\n\t\tforeach(self::$_classes as $var=>$class) {\r\n\t\t\t\t\r\n\t\t\t$$var = new $class();\r\n\t\t}\r\n\t}", "private function buildInjectors()\n\t{\n\t\t$container = $this;\n\n\t\t// Debug tracer\n\t\t$this->tracer = new Tracer;\n\n\t\t// Build provider injector\n\t\t$providerInjector =\n\t\t$this->providerInjector = new Injector(\n\t\t\t// Cache\n\t\t\t$this->providerCache, \n\t\t\t// Factory\n\t\t\tfunction($name) {\n\t\t\t\t$name = substr($name, 0, -8);\n\t\t\t\tthrow new LogicException(\"Provider for '$name' not found\\n\" . $this->tracer);\n\t\t\t}, \n\t\t\t// Debug tracer\n\t\t\t$this->tracer\n\t\t);\n\n\t\t// Build instance injector\n\t\t$this->instanceInjector = new Injector(\n\t\t\t// Cache\n\t\t\t$this->instanceCache, \n\t\t\t// Factory\n\t\t\tfunction($name) use ($providerInjector, $container) {\n\n\t\t\t\tif ($lazy = strpos($name, 'lazy::') === 0) {\n\t\t\t\t\t$name = substr($name, 6);\n\t\t\t\t}\n\n\t\t\t\t$this->tracer->request($name);\n\n\t\t\t\t$provider = $providerInjector->get($name . 'Provider');\n\t\t\t\t// Determin factory dependencies\n\t\t\t\t$factoryAndDependencies = Container::getDependencyArray($provider->getFactory());\n\t\t\t\t$instance = $lazy \n\t\t\t\t\t? function() use ($factoryAndDependencies){\n\t\t\t\t\t\treturn $this->invoke($factoryAndDependencies);\n\t\t\t\t\t} \n\t\t\t\t\t: $this->invoke($factoryAndDependencies);\n\n\t\t\t\t// Inject container\n\t\t\t\tif ($instance instanceof ContainerAwareInterface) {\n\t\t\t\t\t$instance->setContainer($container);\n\t\t\t\t}\n\n\t\t\t\t$this->tracer->received($name . ($lazy ? ' [lazy]' : ''));\n\n\t\t\t\treturn $instance;\n\t\t\t}, \n\t\t\t// Debug tracer\n\t\t\t$this->tracer\n\t\t);\n\n\t\t// Implement container as provider\n\t\t$this->provider('Container', new Provider([function(){\n\t\t\treturn $this;\n\t\t}]));\n\n\t\t// Implement instance injector as provider\n\t\t$this->provider('Injector', new Provider([function() {\n\t\t\treturn $this->instanceInjector;\n\t\t}]));\n\t}", "abstract protected function loadExposedObjects();", "public function __invoke()\n {\n $params = array_merge($this->params, func_get_args());\n $resolve = $this->resolver->resolve(\n $this->class,\n $params,\n $this->setters\n );\n\n $object = $resolve->reflection->newInstanceArgs($resolve->params);\n foreach ($resolve->setters as $method => $value) {\n $object->$method($value);\n }\n\n return $object;\n }", "public function __construct($value) {\r\n\t\tif ($value == 'lambda') { # allow anonymous typedefs\r\n\t\t\t$value = null;\r\n\t\t}\r\n\t\t\r\n\t\tparent::__construct($value);\r\n\t\t$this->outputFormatter = new HTMLFormatter();\r\n\t\t$this->directiveManager = new DirectiveManager($this);\r\n\t\t$this->directives = new DirectiveManifest();\r\n\t\t$this->context = Context::PHP;\r\n\t\t$this->owner = $this;\r\n\t\t$this->globals = GlobalCollection::instance();\r\n\t\t$this->errors = true; # fatal errors by default\r\n#\t\t$this->debugger = new StatGatherer($this);\r\n\t}", "abstract public function prepareFilters();", "public function _setupObjects()\n {\n if ((count ($this -> _mXoopsModules) == 0) && $handler = opendir (XOOPS_MODULE_PATH)) {\n while (($dir = readdir($handler)) !== false) {\n if (!in_array ($dir, $this -> _mExclusions, true) && is_dir(XOOPS_MODULE_PATH . '/' . $dir)) {\n $module =& $this->get($dir);\n if ($module !== false) {\n $this->_mXoopsModules[] =& $module;\n }\n unset($module);\n }\n }\n }\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'activityGroupNames' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setActivityGroupNames($val);\n },\n 'address' => fn(ParseNode $n) => $o->setAddress($n->getStringValue()),\n 'azureSubscriptionId' => fn(ParseNode $n) => $o->setAzureSubscriptionId($n->getStringValue()),\n 'azureTenantId' => fn(ParseNode $n) => $o->setAzureTenantId($n->getStringValue()),\n 'countHits' => fn(ParseNode $n) => $o->setCountHits($n->getIntegerValue()),\n 'countHosts' => fn(ParseNode $n) => $o->setCountHosts($n->getIntegerValue()),\n 'firstSeenDateTime' => fn(ParseNode $n) => $o->setFirstSeenDateTime($n->getDateTimeValue()),\n 'ipCategories' => fn(ParseNode $n) => $o->setIpCategories($n->getCollectionOfObjectValues([IpCategory::class, 'createFromDiscriminatorValue'])),\n 'ipReferenceData' => fn(ParseNode $n) => $o->setIpReferenceData($n->getCollectionOfObjectValues([IpReferenceData::class, 'createFromDiscriminatorValue'])),\n 'lastSeenDateTime' => fn(ParseNode $n) => $o->setLastSeenDateTime($n->getDateTimeValue()),\n 'riskScore' => fn(ParseNode $n) => $o->setRiskScore($n->getStringValue()),\n 'tags' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setTags($val);\n },\n 'vendorInformation' => fn(ParseNode $n) => $o->setVendorInformation($n->getObjectValue([SecurityVendorInformation::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function prepare(){\n\t\t$bson = null;\n\t\tif ( $this->modifications ){\n\t\t\tforeach ( $this->modifications as $modification ){\n\t\t\t if ( is_object( $modification ) && method_exists($modification, 'prepare'))\n\t\t\t\t $bson[]= $modification->prepare();\n else\n $bson[] = $modification;\n }\n\t\t}\n\t\treturn array( 'modifications' => $this->modifications );\n\t}" ]
[ "0.57958287", "0.56093675", "0.557424", "0.5516964", "0.5510695", "0.55039346", "0.5418327", "0.5366948", "0.53501725", "0.5193012", "0.51699954", "0.5133964", "0.51286083", "0.51243967", "0.5104854", "0.50821155", "0.5032322", "0.49820358", "0.4978707", "0.4957434", "0.4957205", "0.49407792", "0.4939306", "0.49369892", "0.49232534", "0.49186113", "0.49094546", "0.49094546", "0.49090907", "0.49069145", "0.48983094", "0.48922563", "0.48868465", "0.4884373", "0.48573843", "0.48525256", "0.48504236", "0.48366556", "0.47981635", "0.47807467", "0.4778955", "0.47784734", "0.47738767", "0.47684154", "0.47679165", "0.4757", "0.47293657", "0.47276372", "0.47243413", "0.47203174", "0.47175962", "0.47166643", "0.47001767", "0.46997476", "0.46856362", "0.46606463", "0.46601796", "0.46572727", "0.4653388", "0.46483243", "0.46392146", "0.4637694", "0.46373504", "0.46134812", "0.46065083", "0.45977497", "0.45779198", "0.45735332", "0.4565532", "0.45648834", "0.4563661", "0.4557507", "0.45506355", "0.4541708", "0.45409128", "0.45400593", "0.45255536", "0.45236328", "0.45197973", "0.4517104", "0.45164034", "0.4507967", "0.45061043", "0.44975996", "0.4494726", "0.4491102", "0.44897202", "0.4480224", "0.44796678", "0.44754338", "0.4472179", "0.44625708", "0.44563526", "0.44555736", "0.4451566", "0.44388062", "0.4435928", "0.4434231", "0.44287434", "0.44177398" ]
0.46420676
60
Loads the PHP file, parses the code, and produces an abstract syntax tree (AST) of the code
private function locateClosure(\ReflectionFunction $reflection) { try { $locator = new ClosureLocatorVisitor($reflection); $fileAst = $this->getFileAst($reflection); $fileTraverser = new \PhpParser\NodeTraverser(); if ($this->options[self::HANDLE_CLASS_NAMES]) { $fileTraverser->addVisitor(new \PhpParser\NodeVisitor\NameResolver); } $fileTraverser->addVisitor($locator); $fileTraverser->traverse($fileAst); } catch (\PhpParser\Error $e) { // @codeCoverageIgnoreStart throw new ClosureParsingException('There was an error parsing the file containing the closure.', 0, $e); // @codeCoverageIgnoreEnd } return $locator; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAst($file){\n $fileRes=fopen(\"fileRes.txt\",\"w\");\n $code=file_get_contents($file);\n $parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7);\n try {\n $ast = $parser->parse($code);\n } catch (Error $error) {\n echo \"Parse error: {$error->getMessage()}\\n\";\n return;\n }\n $dumper = new NodeDumper;\n echo $dumper->dump($ast) . \"\\n\";\n fwrite($fileRes, $dumper->dump($ast) . \"\\n\");\n fclose($fileRes);\n }", "function lapa_compiler_php_code($act, $parser)\n{\n if ($act == 1) {\n $buff = '';\n if (!isset(LapaEngineParser::$_plugins_property['php_code'])) {\n LapaEngineParser::$_plugins_property['php_code'] = array();\n }\n $attr = $parser->parseDirectiveAttributes();\n $name = isset($attr['name']) ? $attr['name']: 'default';\n $parser->newStackCommand(array('php_code', $name));\n $parser->_outputNew();\n }else {\n if ( (!$stack_commands = $parser->getStackCommand() ) || $stack_commands[0] != 'php_code' ) {\n throw new LapaEngineException('Неверный вызов \"/php_code\" cтрока %s.', $parser->templateLine());\n }\n /* вырезали буффер php кода, его надо еще вернуть */\n $buff = $parser->_outputGet();\n /* создаем переменную с значением */ \n LapaEngineParser::$_plugins_property['php_code'][$stack_commands[1]] = $stack_commands[1];\n $buff .= \"\\$_var_php_code['{$stack_commands[1]}'] = '\" . preg_replace(\"/(?!\\\\\\\\)\\\\'/\", '\\\\\\'','<?php ' . str_replace('\\\\', '\\\\\\\\',$buff) . ' ?>') . \"';\"; \n $parser->removeStackCommand(); \n LapaEngineParser::$_plugins_property['php_code'][$stack_commands[1]] = $stack_commands[1];\n }\n return $buff;\n}", "public function get_ast() {\n // Check if no AST is yet loaded\n if (empty($this->ast)) {\n try {\n $lexer = new \\PhpParser\\Lexer\\Emulative([\n \"usedAttributes\" => [\n \"comments\",\n \"startLine\", \"endLine\",\n \"startTokenPos\", \"endTokenPos\"\n ]\n ]);\n\n // Create a new PHP parser\n $parser = new \\PhpParser\\Parser\\Php7($lexer);\n\n // Try creating the AST parser\n $this->ast = $parser->parse($this->get_content());\n\n // Save the tokens\n $this->tokens = $lexer->getTokens();\n } catch(\\PhpParser\\Error $e) {\n \\Lily\\Console::error(\"An error ocurred while parsing an AST:\", $e->getMessage());\n return null;\n }\n }\n\n return $this->ast;\n }", "static function ParseCode($source) {\n\t\tglobal $phpTokens;\n\t\t\n\t\t$alltokens = token_get_all($source);\n\t\t$tokens = array();\n\t\t$interesting = array( \n\t\t\tT_DOC_COMMENT, T_FUNCTION, T_STRING, T_VARIABLE, T_CLASS, T_INCLUDE, T_INCLUDE_ONCE, T_REQUIRE, \n\t\t\tT_REQUIRE_ONCE, T_CONSTANT_ENCAPSED_STRING, T_DNUMBER,T_LNUMBER, T_SPECIAL_BRACKET, T_INTERFACE);\n\t\t$opentagfound = false;\n\t\tforeach($alltokens as $token) {\n\t\t\tif ($token[0] == T_OPEN_TAG) $opentagfound = true;\n\t\t\t\n\t\t\tif (!is_array($token) && $token != \")\") continue;\n\t\t\tif ($token == \")\") $token = array(T_SPECIAL_BRACKET, \")\", 0);\n\t\t\tif (!in_array($token[0], $interesting)) continue;\n\t\t\t$token[3] = @token_name($token[0]);\n\t\t\t$tokens[] = $token;\n\t\t}\n\t\t\n\t\t// NO open tag? there is no PHP code at all?\n\t\tif (!$opentagfound) return null;\n\t\t\n\t\t// Find Php Comment blocks\n\t\t$blocks = array();\n\t\t\n\t\t// Now, we have all interesting & consecutive tokens\n\t\t$pageDocBlock = null;\n\t\t$lines = preg_split(\"/((\\r?\\n)|(\\n?\\r))/\", $source);\n\t\t\n\t\t// Check all tokens\n\t\tfor($i=0; $i<count($tokens); $i++) {\n\t\t\t$token = $tokens[$i];\n\t\t\t$nextToken = $tokens[$i+1];\n\t\t\t$previousToken = $tokens[$i-1];\n\t\t\t\n\t\t\t\n\t\t\t// Trying to detect if there is a Page Docblock\n\t\t\t// First doc bloc should be a T_DOC_COMMENT. \n\t\t\t// It should contain @package\n\t\t\tif ($i == 0 && $token[0] == T_DOC_COMMENT) {\n\t\t\t\tif (stripos($token[1], \"@package\") !== FALSE) {\n\t\t\t\t\t// We found the page docblock!\n\t\t\t\t\t$block = new DocBlock($token[1], \"(Page DocBlock)\", BLOCK_PAGE);\n\t\t\t\t\t$block->line = $token[2];\n\t\t\t\t\t$block->docline = $token[2];\n\t\t\t\t\t$blocks[] = $block;\n\t\t\t\t\t$pageDocBlock = $block;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// So, what's this comment block for?\n\t\t\tif (!in_array($token[0],array(T_FUNCTION,T_CLASS,T_INTERFACE,T_STRING,T_INCLUDE,T_INCLUDE_ONCE,T_REQUIRE,T_REQUIRE_ONCE))) continue; // nothing of interest (bad syntax?) => continue...\n\t\t\tif ($token[0] == T_STRING && strtolower($token[1]) != \"define\") continue; // a string, but not \"define\"... not useful to us\n\t\t\t\n\t\t\t// Filter out elements we don't want to see\n\t\t\tif ($token[0] == T_FUNCTION && !$_POST['Dfunc']) continue;\n\t\t\telseif ($token[0] == T_CLASS && !$_POST['Dclas']) continue;\n\t\t\telseif ($token[0] == T_INTERFACE && !$_POST['Dinte']) continue;\n\t\t\telseif ($token[0] == T_STRING && !$_POST['Dcons']) continue;\n\t\t\telseif (in_array($token[0], array(T_INCLUDE,T_INCLUDE_ONCE,T_REQUIRE,T_REQUIRE_ONCE)) && !$_POST['Dincl']) continue;\n\t\t\t\n\t\t\t// Filter out anonymous functions (non anonymous functions have their name/T_STRING right after the keyword 'function')\n\t\t\tif ($token[0] == T_FUNCTION && $nextToken[0] != T_STRING) continue;\n\t\t\t\n\t\t\t// Do we have a docblock for this token?\n\t\t\t$relevantDocBlock = null;\n\t\t\tif ($previousToken[0] == T_DOC_COMMENT) {\n\t\t\t\t// Is it the page token?\n\t\t\t\tif ($i == 1 && $pageDocBlock) { // yup, it's the page token, no action\n\t\t\t\t\t//$relevantDocBlock = null;\n\t\t\t\t} else {\n\t\t\t\t\t// This is a doc block likely meant for the following object\n\t\t\t\t\t$relevantDocBlock = $previousToken;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Create empty docblock\n\t\t\tif (!$relevantDocBlock) {\n\t\t\t\t$relevantDocBlock = array(T_DOC_COMMENT,\"/**\\r\\n*\\r\\n*/\",0);\n\t\t\t}\n\t\t\t\n\t\t\t// Find out associated tokens, depending on the current token type\n\t\t\t$associatedCode = $lines[ $token[2]-1 ];\n\t\t\t$type = $token[3];\n\t\t\t\n\t\t\t$block = new DocBlock($relevantDocBlock[1],$associatedCode, $type);\n\t\t\t$block->line = $token[2];\n\t\t\t$block->docline = $relevantDocBlock[2];\n\t\t\t//echo \"<pre>\"; print_r(htmlentities($lines));die();\t\t\t\n\t\t\t$blocks[] = $block;\n\t\t}\n\t\t\n\t\treturn $blocks;\n\t}", "protected function compile()\n\t{\n\t\t$lexer = new Lexer($this->template->getEnvironment());\n\t\t$stream = $lexer->tokenize(file_get_contents($this->filename), basename($this->filename));\n\n\t\t// unique class based on the filename\n\t\t// @todo fix problem with '-' in classes\n\t\t$class = $this->template->getEnvironment()->getCacheFilename($this->filename);\n\t\t$class = 'S' . substr($class, 0, -8) . '_Template';\n\n\t\t// writer object which contains the parsed PHP code\n\t\t$writer = new Writer();\n\t\t$writer->write(\"<?php\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('namespace Spoon\\Template;' . \"\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('/* ' . $this->filename . ' */' . \"\\n\");\n\t\t$writer->write(\"class $class extends Renderer\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\t\t$writer->write('protected function display(array $context)' . \"\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\n\t\t$tags = $this->template->getEnvironment()->getTags();\n\n\t\t$token = $stream->getCurrent();\n\t\twhile(!$stream->isEof())\n\t\t{\n\t\t\tswitch($token->getType())\n\t\t\t{\n\t\t\t\tcase Token::TEXT:\n\t\t\t\t\t$text = new TextNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$text->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::VAR_START:\n\t\t\t\t\t$stream->next();\n\t\t\t\t\t$variable = new VariableNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$variable->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::BLOCK_START:\n\t\t\t\t\t$token = $stream->next();\n\n\t\t\t\t\t// validate tag existence\n\t\t\t\t\tif(!isset($tags[$token->getValue()]))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\tsprintf('There is no such template tag \"%s\"', $token->getValue()),\n\t\t\t\t\t\t\t$token->getLine(),\n\t\t\t\t\t\t\t$this->filename\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$node = new $tags[$token->getValue()]($stream, $this->template->getEnvironment());\n\t\t\t\t\t$node->compile($writer);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($token->getType() !== Token::EOF)\n\t\t\t{\n\t\t\t\t$token = $stream->next();\n\t\t\t}\n\n\t\t\telse break;\n\t\t}\n\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\treturn $writer->getSource();\n\t}", "public function getAST(): PhpParser\\Node\n {\n return $this->ast ?? ($this->ast = CompatibleParser::create()->parseSourceFile($this->contents));\n }", "public static function parse($file) {\n\t\tinclude $file;\n\t\tif (!isset($data)) {\n\t\t\tthrow new RuntimeException(\"Failed to parse php file `{$file}`\");\n\t\t}\n\t\treturn $data;\n\t}", "public function analyzeFile(\n CodeBase $code_base,\n string $file_path\n ) {\n // Convert the file to an Abstract Syntax Tree\n // before passing it on to the recursive version\n // of this method\n $node = \\ast\\parse_file(\n $file_path,\n Configuration::instance()->ast_version\n );\n\n // Set the file on the context\n $context =\n (new Context($code_base))->withFile($file_path);\n\n // Ensure we have some content\n if (empty($node)) {\n Log::err(\n Log::EUNDEF,\n \"Empty or missing file {$file_path}\",\n $file_path,\n 0\n );\n\n return $context;\n }\n\n // Start recursively analyzing the tree\n return $this->analyzeNodeInContext(\n $node,\n $context\n );\n }", "function astToCode($ast){\n $prettyPrinter = new PrettyPrinter\\Standard;\n echo $prettyPrinter->prettyPrintFile($ast);\n }", "public function testParsingPhpExpression()\n {\n $tokens = [\n new Token(TokenTypes::T_PHP_TAG_OPEN, '<?php', 1),\n new Token(TokenTypes::T_EXPRESSION, 'echo \"foo\";', 1),\n new Token(TokenTypes::T_PHP_TAG_CLOSE, '?>', 1)\n ];\n $this->ast->getCurrentNode()\n ->addChild(new ExpressionNode('<?php'))\n ->addChild(new ExpressionNode('echo \"foo\";'))\n ->addChild(new ExpressionNode('?>'));\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function evalFile(string $src): CompiledFile;", "public function parse($file);", "public function parse($file);", "public function insertPhpCode($code)\n {\n $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Tag($this, $code));\n }", "private function parse($fileName) {\n\n\t\tif (!$fileName) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$content = $this->getFileContent($fileName, $this->class->getStartLine());\n\t\t$namespace = str_replace('\\\\', '\\\\\\\\', $this->class->getNamespaceName());\n\t\t$content = preg_replace('/^.*?(\\bnamespace\\s+' . $namespace . '\\s*[;|{].*)$/s', '\\\\1', $content);\n\t\t$this->tokens = token_get_all('<?php ' . $content);\n\t\t$this->numTokens = count($this->tokens);\n\n\t\t$statements = $this->parseUseStatements();\n\n\t\treturn $statements;\n\t}", "function _phpCodeHandler($data)\r\n {\r\n if (preg_match('/\\s*^php:(.+)/', $data, $matches)) {\r\n $keys = array_keys($GLOBALS);\r\n foreach ($keys as $key) {\r\n $$key =& $GLOBALS[$key];\r\n }\r\n return (string) eval($matches[1].';');\r\n }\r\n return $data;\r\n }", "function compile($name, $code = false)\n {\n\t\tif (!$code)\n\t\t{\n\t\t\t$code = file_get_contents($this->template_dir.$name);\n\t\n\t\t\tif ($code === false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpreg_match_all('/\\<!--[ ]*(.*?) (.*?)?[ ]*--\\>/', $code, $tag_blocks);\n\t\t$content_blocks = preg_split('/\\<!--[ ]*(.*?) (.*?)?[ ]*--\\>/', $code);\n\n\t\t$size = count($content_blocks);\n\n\t\t$parse_content = $compile = true;\n\t\t$tag_holding = array();\n\t\t$line = 1;\n\r\n\t\tfor ($loop = 0; $loop < $size; $loop++)\r\n\t\t{\n\t\t\t$line += substr_count($content_blocks[$loop], \"\\n\");\n\n\t\t\tif (!$compile)\n\t\t\t{\n\t\t\t\tif (strtoupper(trim($tag_blocks[1][$loop])) == 'ENDIGNORE')\n\t\t\t\t{\n\t\t\t\t\t$compile = true;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($parse_content)\n\t\t\t{\n\t\t\t\t$content_blocks[$loop] = $this->_parse_content($content_blocks[$loop]);\n\t\t\t}\n\n\t\t\tif (empty($tag_blocks[1][$loop]))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (strtoupper(trim($tag_blocks[1][$loop])))\r\n\t\t\t{\n\t\t\t\tcase 'IF':\n\t\t\t\t\t$this->_tag_holding_add('IF', $line);\n\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_if($tag_blocks[2][$loop]);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ELSE':\n\t\t\t\t\t$last_tag = $this->_tag_holding_view();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'IF')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\r\n\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php } else { ?>';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ELSEIF':\n\t\t\t\t\t$last_tag = $this->_tag_holding_view();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'IF')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\r\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_if($tag_blocks[2][$loop], true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ENDIF':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'IF')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\r\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php } ?>';\r\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'LOOP':\n\t\t\t\t\t$this->_tag_holding_add('LOOP', $line);\n\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_loop($tag_blocks[2][$loop]);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'LOOPELSE':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'LOOP')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->_tag_holding_add('LOOPELSE', $line);\n\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php } } else { ?>';\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'ENDLOOP':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != ('LOOP' || 'LOOPELSE'))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_endloop($tag_blocks[2][$loop], $last_tag['name']);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'PHP':\n\t\t\t\t\t$this->_tag_holding_add('PHP', $line);\n\n\t\t\t\t\t$parse_content = false;\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php ';\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'ENDPHP':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\t\t\t\t\t\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'PHP')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\n\t\t\t\t\t$parse_content = true;\n\t\t\t\t\t$tag_blocks[0][$loop] = ' ?>';\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'INCLUDE':\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_include($tag_blocks[2][$loop]);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'DISPLAY_HEADER':\n\t\t\t\t\t$tag_blocks[0][$loop] = \"<?php echo \\$_CLASS['core_display']->display_header(); ?>\";\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'DISPLAY_FOOTER':\n\t\t\t\t\t$tag_blocks[0][$loop] = \"<?php echo \\$_CLASS['core_display']->display_footer(); ?>\";\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'IGNORE':\n\t\t\t\t\t$compile = false;\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'DEFINE':\r\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_define($tag_blocks[2][$loop]);\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'AREA':\r\n\t\t\t\t\t//$tag_blocks[0][$loop] = $this->_compile_tag_area($tag_blocks[2][$loop]);\r\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t//$tag_blocks[0][$loop] = '<!-- '.$tag_blocks[1][$loop].' '.$tag_blocks[2][$loop].' -->';\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\n\n\t\t$this->_compiled_code = '';\n\t\t$size = count($content_blocks);\n\n\t\tfor ($loop = 0; $loop < $size; $loop++)\n\t\t{\r\n\t\t\t$this->_compiled_code .= $content_blocks[$loop] . (isset($tag_blocks[0][$loop]) ? $tag_blocks[0][$loop] : '');\r\n\t\t}\n\n\t\treturn true;\n }", "function __construct($comment=\"\", $associatedCode=\"\", $blockType=\"\") {\n\t\t\n\t\tif (!$comment && !$associatedCode && !$blockType) return;\n\t\t\n\t\t// Figure out indent (for later output)\n\t\tif ( preg_match('@^([\\t\\040]*).*$@', $associatedCode, $matches) ) {\n\t\t\t$this->indent = $matches[1];\n\t\t}\n\t\t\n\t\t// Save tokens\n\t\t$this->comment = trim($comment);\n\t\t$this->associatedCode = $associatedCode;\n\t\t$this->associatedHlCode = @str_ireplace(\"&lt;?php&nbsp;\",\"\",@highlight_string(\"<?php \".trim($this->associatedCode),true));\n\t\t$this->type = $blockType;\n\t\t\n\t\t// What's the source?\n\t\t$source = $comment; // element 1 is the token source\n\t\t\n\t\t$source = trim($source);\n\t\t$source = str_replace(\"/**\",\"\",$source);\n\t\t$source = str_replace(\"*/\",\"\",$source);\n\t\t$lines = explode(\"\\n\", $source);\n\t\t$source = array();\n\t\tforeach($lines as $line) {\n\t\t\t$line = trim($line);\n\t\t\t$line = str_replace(\"\\r\", \"\", $line);\n\t\t\t// If the line doesn't start by *, we aren't interested\n\t\t\tif (substr($line,0,1) == \"*\" ) $source[] = trim(substr($line,1));\n\t\t}\n\t\tif (!count($source)) return false;\n\t\t \n\t\t// Short description?\n\t\tif (substr($source[0],0,1) != \"@\") {\n\t\t\t$this->shortDescription = $source[0];\n\t\t}\n\t\t \n\t\t// Long description?\n\t\tfor($i=1; $i<count($source); $i++) {\n\t\t\tif (substr($source[$i],0,1) == \"@\") break;\n\t\t\t$this->longDescription .= $source[$i].\"\\n\";\n\t\t}\n\t\t$this->longDescription = trim($this->longDescription);\n\t\t \n\t\t// Tags?\n\t\t$this->tags = array();\n\t\tfor($i=count($source)-1; $i>=0; $i--) {\n\t\t\tif (trim($source[$i]) == \"\") continue;\n\t\t\tif (substr($source[$i],0,1) != \"@\") break;\n\t\t\t$this->tags[] = $source[$i];\n\t\t}\n\t\t$this->tags = array_reverse($this->tags);\n\t\t$this->tags = implode(PHP_EOL,$this->tags);\n\t\t \n\t\t// There needs to be at least a short description, or a long description, or a tags section for the block to be valid\n\t\tif ($this->shortDescription || $this->longDescription || $this->tags) $this->valid = true;\n\t\t\n\t\t// Convert to UTF8\n\t\t$this->shortDescription = !isUtf8($this->shortDescription) ? utf8_encode($this->shortDescription) : $this->shortDescription;\n\t\t$this->longDescription = !isUtf8($this->longDescription) ? utf8_encode($this->longDescription) : $this->longDescription;\n\t\t$this->tags = !isUtf8($this->tags) ? utf8_encode($this->tags) : $this->tags;\n\t\t\n\t\treturn $this->valid;\n\t}", "function highlight_php_code($text)\r\n{\r\n\r\n \r\n while (strpos($text,'<phpcode>')!== false)\r\n {\r\n $tag_start = strpos($text,'<phpcode>');\r\n $tag_end = strpos($text,'</phpcode>'); \r\n\r\n if ($tag_end === false)\r\n {\r\n $tag_end=(strlen($text)); \r\n }\r\n \r\n $phpcode = substr($text,$tag_start+9,$tag_end-$tag_start-9);\r\n \r\n $text_before = substr($text,0,$tag_start);\r\n $text_after = substr($text,$tag_end+10);\r\n \r\n if (strpos($phpcode,'<?php')===false)\r\n {\r\n \r\n $phpcode = str_replace('&lt;?php','',highlight_string('<?php' . $phpcode,true)); \r\n }\r\n else\r\n {\r\n $phpcode = highlight_string($phpcode,true);\r\n }\r\n \r\n $text = $text_before . $phpcode . $text_after;\r\n \r\n }\r\n\r\n \r\n\r\n\r\n return $text;\r\n}", "function ReadPhp($filename) {\r\n\r\n$file=$this->ReadFile($filename);\t#READ PHP FILE\r\nif(!$file) {\r\nreturn FALSE;\t#IF WAS A ERROR THEN RETURN FALSE\r\n}\r\n\r\nreturn $this->phpParse($file);\t#PARSE AND RETURN INI HASH\r\n}", "public function __construct ($code) {\n $tokens = token_get_all(\"<?php \" . $code);\n // kick out whitespace tokens\n $this->tokens = array_filter($tokens, function ($token) {\n return (! is_array($token) || $token[0] !== T_WHITESPACE);\n });\n // remove start token (<?php)\n $this->pop();\n }", "public function parseFile(\n CodeBase $code_base,\n string $file_path\n ) : Context {\n\n // Convert the file to an Abstract Syntax Tree\n // before passing it on to the recursive version\n // of this method\n $node = \\ast\\parse_file(\n $file_path,\n Configuration::instance()->ast_version\n );\n\n $context =\n (new Context($code_base))->withFile($file_path);\n\n if (empty($node)) {\n Log::err(\n Log::EUNDEF,\n \"Empty or missing file {$file_path}\",\n $file_path,\n 0\n );\n return $context;\n }\n\n return $this->parseNodeInContext($node, $context);\n }", "function php_highlight(&$code)\n\n{\n\n if(preg_match('#^(\\s*)(\\<\\?(php|))#i', $code, $open_tag, PREG_OFFSET_CAPTURE))\n\n {\n\n $code = substr($code, strlen($open_tag[0][0]));\n\n $open_tag = $open_tag[1][0].'<span class=\"php_tag\">'.htmlspecialchars($open_tag[2][0]).'</span>';\n\n }\n\n if(preg_match('#(\\?\\>)(\\s*)$#', $code, $end_tag, PREG_OFFSET_CAPTURE))\n\n {\n\n $code = substr($code, 0, -strlen($end_tag[0][0]));\n\n $end_tag = '<span class=\"php_tag\">'.htmlspecialchars($end_tag[1][0]).'</span>'.$end_tag[2][0];\n\n }\n\n \n\n $blocks = array(\n\n array(\n\n 'pattern' => '#\\?\\>(.*?)(\\<\\?(php()|(\\s))|($()))#ise',\n\n 'replacement' => '\\'<span class=\"php_tag\">?&gt;</span>\\'.block_background(html_highlight(str_replace(\\'\\\\\\\\\\\\\\\\\"\\', \\'\"\\',\\'$1\\')), \\'php_html\\').\\'<span class=\"php_tag\">\\'.htmlspecialchars(\\'$2\\').\\'</span>\\'',\n\n 'keepsuffix' => 4\n\n ),\n\n array(\n\n 'pattern' => \"#'\".GENERAL_BACKSLASH_ESC_PREG.\"'#se\",\n\n 'replacement' => 'parse_php_string_simple(\\'$0\\')',\n\n //'prefix' => '<span class=\"php_string\">', \n\n //'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => '#\"'.GENERAL_BACKSLASH_ESC_PREG.'\"#se',\n\n 'replacement' => '\\'<span class=\"php_string_d\">&quot;\\'.parse_php_string(\\'$1\\').\\'&quot;</span>\\''\n\n ),\n\n array(\n\n 'pattern' => \"#\\<\\<\\<(.+?)([\\n\\r])(.*?)([\\n\\r]\\\\1)#se\",\n\n 'replacement' => '\\'<span class=\"php_string_h\">&lt;&lt;&lt;$1$2\\'.parse_php_string(\\'$3\\').\\'$4</span>\\''\n\n ),\n\n array(\n\n 'pattern' => \"#/\\\\*(.*?)\\\\*/#s\",\n\n 'prefix' => '<span class=\"php_blockcomment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => \"#//(.*?)[\\n\\r]#\",\n\n 'prefix' => '<span class=\"php_linecomment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n );\n\n \n\n $secondaries = array(\n\n array(\n\n 'pattern' => '#(\\W|^)(\\.?[0-9][0-9a-zA-Z.]*)#',\n\n 'replacement' => '<span class=\"php_number\">$2</span>',\n\n 'keepprefix' => 1\n\n ),\n\n array(\n\n 'pattern' => '#([,\\[\\]\\{\\};=\\+\\-!%\\^&\\*\\(\\)<>|@.~])#',\n\n 'prefix' => '<span class=\"php_symbol\">',\n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => '#\\$[a-zA-Z_][a-zA-Z0-9_]*#',\n\n 'prefix' => '<span class=\"php_var\">',\n\n 'suffix' => '</span>'\n\n )\n\n );\n\n \n\n $kw = array(\n\n array(\n\n 'prefix' => '<span '.get_placeholder(8).'=\"php_keyword\">',\n\n 'suffix' => '</span>',\n\n 'keywords' => array('and','or','xor','__file__','__line__','array','as','break','case','cfunction','class','const','continue','declare','default','die','do','echo','else','elseif','empty','enddeclare','endfor','endforeach','endif','endswitch','endwhile','eval','exit','extends','for','foreach','function','global','if','include','include_once','isset','list','new','old_function','print','require','require_once','return','static','switch','unset','use','var','while','__function__','__class__','php_version','php_os','default_include_path','pear_install_dir','pear_extension_dir','php_extension_dir','php_bindir','php_libdir','php_datadir','php_sysconfdir','php_localstatedir','php_config_file_path','php_output_handler_start','php_output_handler_cont','php_output_handler_end','e_error','e_warning','e_parse','e_notice','e_core_error','e_core_warning','e_compile_error','e_compile_warning','e_user_error','e_user_warning','e_user_notice','e_all','true','false','bool','boolean','int','integer','float','double','real','string','array','object','resource','null','class','extends','parent','stdclass','directory','__sleep','__wakeup','interface','implements','abstract','public','protected','private')\n\n )\n\n );\n\n $code = generic_highlight($code, $blocks, $secondaries, array(), $kw);\n\n // put back end/start tags if necessary\n\n if(isset($open_tag) && is_string($open_tag))\n\n $code = $open_tag.$code;\n\n if(isset($end_tag) && is_string($end_tag))\n\n $code .= $end_tag;\n\n \n\n return $code;\n\n}", "public function compile() { \n if (!count($this->loadedFiles)) return; \n $outputFile = $this->_options['includeFile']; \n $fp = fopen($outputFile, \"a+\"); \n if (flock($fp, LOCK_EX)) { \n if ($filesize = filesize($outputFile)) { \n fseek($fp, 0); \n $currentFile = fread($fp, $filesize); \n } else $currentFile = ''; \n \n if (!$currentFile) { \n $appendSource = \"<?php\\n\"; \n $existingClasses = array(); \n } else { \n $appendSource = ''; \n $existingClasses = $this->getClassesFromSource($currentFile); \n } \n \n for ($i = 0; $i < count($this->loadedFiles); $i++) { \n $filename = $this->loadedFiles[$i]; \n \n $f = @fopen($filename, \"r\", true); \n $fstat = fstat($f); \n $file = fread($f, $fstat['size']); \n fclose($f); \n $classes = $this->getClassesFromSource($file); \n \n if (!count(array_intersect($existingClasses, $classes))) { \n if (strpos($file, '__FILE__') === false) { \n $endFile = substr($file, -2) == '?>' ? -2 : null; \n $appendSource .= ($endFile === null ? substr($file, 5) : substr($file, 5, -2)); \n } else { \n $filePath = $this->realPath($filename); \n if ($filePath) { \n $file = str_replace('__FILE__', \"'$filePath'\", $file); \n $endFile = substr($file, -2) == '?>' ? -2 : null; \n $appendSource .= ($endFile === null ? substr($file, 5) : substr($file, 5, -2)); \n } \n } \n } else { \n $appendSource = ''; \n break; \n } \n } \n if ($appendSource) { \n fseek($fp, 0, SEEK_END); \n fwrite($fp, $appendSource); \n } \n flock($fp, LOCK_UN); \n } \n fclose($fp); \n }", "public function getAST($content)\n {\n try {\n return $this->parser->parse($content);\n } catch (Error $error) {\n echo \"Parse error: {$error->getMessage()}\\n\";\n return;\n }\n }", "protected function openPhp()\n\t{\n\t\tif ($this->in_php) {\n\t\t\treturn '';\n\t\t}\n\t\t$this->in_php = true;\n\t\treturn '<?php ';\n\t}", "public function loadLexerData()\n {\n\n }", "public function parseFile($file)\n {\n $ast = $this->getAST(\n $this->getContents($file)\n );\n return $this->converter->convert($ast);\n }", "function runphp($data, $filename) { \r\n\tglobal $config;\r\n\t$return=\"\";\r\n\t$reporting=error_reporting();\r\n\tif($config['debug']===false)\r\n\t\terror_reporting(0);\r\n\tif($config['writecodetofile']===true){\r\n\t\t@ob_start();\r\n\t\t//$filename = 'cache/tmp.inc.php';\r\n\t\t@unlink($filename);\r\n\t\twritetofile($filename,'w',$data);\t\t\t\t\r\n\t\tinclude($filename);\r\n\t\t@unlink($filename);\r\n\t\t$return=@ob_get_clean();\r\n\t} else {\r\n\t\t$offset=0;\r\n\t\t$pos=stripos($data,\"<?php\");\r\n\t\twhile ($pos>-1) {\t\r\n\t\t\t$return.=substr($data,$offset,$pos-$offset);\r\n\t\t\t$offset=stripos($data,\"?>\",$pos)+2;\r\n\t\t\t$php=substr($data,$pos+2,3);\r\n\t\t\t$code=substr($data,$pos+5);\r\n\t\t\tif(!($pos>-1)) { break; }\r\n\t\t\t$code=substr($code,0,stripos($code,\"?>\"));\r\n\t\t\t@ob_start();\r\n\t\t\tif($config['debug'])\r\n\t\t\t\teval($code);\r\n\t\t\telse\r\n\t\t\t\t@eval($code);\r\n\t\t\t$replace=@ob_get_clean();\r\n\t\t\t$return.= $replace;\r\n\t\t\t$pos=stripos($data,\"<?php\",$offset);\r\n\t\t}\t\r\n\t\t$return.=substr($data,$offset);\r\n\t}\r\n\terror_reporting($reporting);\r\n\treturn $return;\r\n}", "function visitPhpFile(\\SplFileInfo $file, MessageCatalogue $catalogue, array $ast)\r\n {\r\n // TODO: Implement visitPhpFile() method.\r\n }", "public function visitPhpCodeAstNode( ezcTemplatePhpCodeAstNode $code )\n {\n $this->write( $code->code );\n }", "static function AJAX_Analyze() {\n\t\t// Which file?\n\t\t$file = $_POST['File'];\n\t\t\n\t\t// Prevent loading illegal files\n\t\tif ( strpos($file,\":\") !== FALSE || strpos($file,\"..\") !== FALSE || strtolower(substr(pathinfo($file,PATHINFO_EXTENSION),0,3)) != \"php\") die(\"Invalid file\");\n\t\t\n\t\t// Does this file exist?\n\t\tif (!file_exists($file)) die(\"Error: file not found\");\n\t\t\n\t\t// File too big?\n\t\tif (filesize($file) > 4*1024*1024) die(\"Error: this file is over 4 megabytes, parsing would take too long.\");\n\t\t\n\t\t// Read file...\n\t\t$source = @file_get_contents($file);\n\t\tif (!$source) die(\"ERR3\");\n\t\t\n\t\t// Display\n\t\t$blocks = DocBlock::ParseCode($source);\n\t\tif ($blocks === null) {\n\t\t\techo \"This PHP script does not seem to contain any PHP code. It cannot be documented.\";\n\t\t} else {\n\t\t\n\t\t\t//echo \"<pre>\";\n\t\t\t$out = \"\n\t\t\t\t<table cellspacing=0 cellpadding=0 id='blocklist'>\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>&nbsp;</th>\n\t\t\t\t\t\t\t<th>Done</th>\n\t\t\t\t\t\t\t<th>Line</th>\n\t\t\t\t\t\t\t<th>Code</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t\t\";\n\t\t\t$pageblock = false;\n\t\t\t$complete = 0;\n\t\t\t$i = 0;\n\t\t\t$rows = \"\";\n\t\t\tforeach($blocks as $block) {\n\t\t\t\tif ($block->type == BLOCK_PAGE) $pageblock = true;\n\t\t\t\tif ($block->type == BLOCK_PAGE && !$_POST['Dpage']) continue;\n\t\t\t\t$jsoncomment = str_replace(\"\\n\",'',str_replace(\"\\r\",'',str_replace('\"','&quot;', strip_tags(implode('<br />',$block->Output(true)),\"<br>\"))));\n\t\t\t\t$state = $block->valid ? \"<span class='valid comment' title='Comment' data-comment=\\\"$jsoncomment\\\">Yes</span>\" : \"-<span class='todo'>No</span>-\";\n\t\t\t\t$jsonobj = json_encode($block);\n\t\t\t\t$rows .= \"\n\t\t\t\t\t<tr class='\".($i%2==1?\"odd\":\"\").\"'>\n\t\t\t\t\t\t<td><button data-index='$i' id='action$i' data-type='{$block->type}' data-obj=\\\"\". str_replace('\"','&quot;', $jsonobj).\"\\\" class='action'>Edit</button></td>\n\t\t\t\t\t\t<td align=center>$state</td>\n\t\t\t\t\t\t<td align=center><a href='#line\".$block->line.\"' style='text-decoration: none;' title='Jump to code (when &quot;Display Source&quot; option is enabled)'>\".$block->line.\"</a></td>\n\t\t\t\t\t\t<td>\".($block->type != BLOCK_PAGE ? $block->associatedHlCode : \"(Page DocBlock)\").\"</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\";\n\t\t\t\t$complete += $block->valid ? 1 : 0;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\tif (!$pageblock && $_POST['Dpage']) $rows = \"<tr class='dbmissing'><td><button data-stuff='' class='action'>Edit</button></td><td align=center colspan=3><span class=todo>Page DocBlock is missing</span></td></tr>\".$rows;\n\t\t\t$out .= $rows.\"</tbody></table>\";\n\t\t\t\n\t\t\t// Statistics\n\t\t\t$total = count($blocks);\n\t\t\tif (!$pageblock) $total++;\n\t\t\t$completion = round( $complete / $total * 100);\n\t\t\t$out .= \"<br />Current code commenting completion: <b>$completion%</b><br />\";\n\t\t\t\n\t\t\t// No rows at all?\n\t\t\tif (!$rows) $out = \"No code to document.\";\n\t\t} \n\t\t\n\t\t// Output\n\t\techo $out;\n\t\t\t\n\t\t// Do we show the source?\n\t\tif ($_POST['ShowSource']) {\n\t\t\techo \"<h2>Source Code</h2>\";\n\t\t\t$lines = preg_split(\"/((\\r?\\n)|(\\n?\\r))/\", $source);\n\t\t\techo highlight_php( isUtf8($source) ? implode(PHP_EOL,$lines) : utf8_encode(implode(PHP_EOL,$lines)),true);\n\t\t}\n\t\t\n\t\tdie();\t\n\t}", "function phan_output_ast_installation_instructions(): void\n{\n require_once __DIR__ . '/Library/StringUtil.php';\n $ini_path = php_ini_loaded_file() ?: '(php.ini path could not be determined - try creating one at ' . dirname(PHP_BINARY) . '\\\\php.ini as a new empty file, or one based on php.ini.development or php.ini.production)';\n $configured_extension_dir = ini_get('extension_dir');\n $extension_dir = StringUtil::isNonZeroLengthString($configured_extension_dir) ? $configured_extension_dir : '(extension directory could not be determined)';\n $extension_dir = \"'$extension_dir'\";\n $new_extension_dir = dirname(PHP_BINARY) . '\\\\ext';\n if (!is_dir((string)$configured_extension_dir)) {\n $extension_dir .= ' (extension directory does not exist and may need to be changed)';\n }\n if (DIRECTORY_SEPARATOR === '\\\\') {\n if (PHP_VERSION_ID >= 70300 && PHP_VERSION_ID < 80100 || !preg_match('/[a-zA-Z]/', PHP_VERSION)) {\n // e.g. https://windows.php.net/downloads/pecl/releases/ast/1.0.16/php_ast-1.0.16-8.0-nts-vs16-x64.zip for php 8.0, 64-bit non thread safe\n // e.g. https://windows.php.net/downloads/pecl/releases/ast/1.0.16/php_ast-1.0.16-7.4-ts-vc15-x86.zip for php 7.4, 32-bit thread safe\n fprintf(\n STDERR,\n PHP_EOL . \"Windows users can download php-ast from https://windows.php.net/downloads/pecl/releases/ast/%s/php_ast-%s-%s-%s-%s-%s.zip\" . PHP_EOL,\n LATEST_KNOWN_PHP_AST_VERSION,\n LATEST_KNOWN_PHP_AST_VERSION,\n PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION,\n PHP_ZTS ? 'ts' : 'nts',\n PHP_VERSION_ID >= 80000 ? 'vs16' : 'vc15',\n PHP_INT_SIZE == 4 ? 'x86' : 'x64'\n );\n fwrite(STDERR, \"(if that link doesn't work, check https://windows.php.net/downloads/pecl/releases/ast/ )\" . PHP_EOL);\n fwrite(STDERR, \"To install php-ast, add php_ast.dll from the zip to $extension_dir,\" . PHP_EOL);\n } else {\n if (PHP_VERSION_ID < 70300) {\n fwrite(STDERR, \"php-ast 1.0.11 is the minimum php-ast version needed for ast version 85. https://pecl.php.net/package/ast/1.0.11/windows does not supply dlls for php 7.2 because php-ast 1.0.11 was published after security support for php 7.2 was dropped\" . PHP_EOL);\n } else {\n fprintf(STDERR, \"Releases for php %s may not yet be available at https://windows.php.net/downloads/pecl/releases/ast/\" . PHP_EOL, PHP_VERSION);\n }\n fwrite(STDERR, \"To build php-ast from source for Windows, see https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2 and https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2#building_pecl_extensions\" . PHP_EOL);\n }\n fwrite(STDERR, \"Then, enable php-ast by adding the following lines to your php.ini file at '$ini_path'\" . PHP_EOL . PHP_EOL);\n if (!is_dir((string)$configured_extension_dir) && is_dir($new_extension_dir)) {\n fwrite(STDERR, \"extension_dir=$new_extension_dir\" . PHP_EOL);\n }\n fwrite(STDERR, \"extension=php_ast.dll\" . PHP_EOL . PHP_EOL);\n } else {\n fwrite(STDERR, <<<EOT\nphp-ast can be installed in the following ways:\n\n1. Unix (PECL): Run 'pecl install ast' and add extension=ast.so to your php.ini.\n\n2. Unix (Compile): Download https://github.com/nikic/php-ast then compile and install the extension as follows:\n\n cd path/to/php-ast\n phpize\n ./configure\n make\n sudo make install\n\n Additionally, add extension=ast.so to your php.ini file.\n\nEOT\n );\n }\n fwrite(STDERR, \"For more information, see https://github.com/phan/phan/wiki/Getting-Started#installing-dependencies\" . PHP_EOL);\n}", "function parse_php($string) {\n ob_start();\n eval('?>'.$string);\n $string = ob_get_contents();\n ob_end_clean();\n return $string;\n}", "public function testSimple()\n {\n //$tokenizer->tokenize(__FILE__);\n }", "function create_parser() {}", "private function add_php($p)\n\t{\n\t\tif ( !isset($this->loaded_phps[$p]) && is_file(self::vpath.$p) ){\n\t\t\t$this->loaded_phps[$p] = file_get_contents(self::vpath.$p);\n\t\t}\n\t\tif ( !isset($this->loaded_phps[$p]) ){\n\t\t\tdie(\"The template $p doesn't exist\");\n\t\t}\n\t\treturn $this->loaded_phps[$p];\n\t}", "public function parseFile($filename)\n {\n $this->lexer = new Lexer($filename, Lexer::T_FILE, $this->symbolsTable);\n\t\t\n\t\t// $exprList = array(); \n\t\twhile(($expr = $this->parseExpr()) != null)\n\t\t{\n\t\t\t// $exprList[] = $expr;\n\t\t\tif($expr->getType() != \\library\\ml\\analysis\\Lexer::TT_LAM)\t\n\t \t$expr->interpret($this->symbolsTable, $this->register);\n\t\t}\n\n\t\t//echo '<pre>'.print_r($this->symbolsTable, true).'</pre>';\n }", "function lang_xml2php($lang_code, $langdata_path)\n{\n\t$handle = fopen($langdata_path.$lang_code.\".php\", \"w\");\n\t$string_data = <<<EOF\n<?php\n\\$LANG_ARRAY = array (\n\nEOF;\n\tfwrite($handle, $string_data);\n\n\t$pages = simplexml_load_file($langdata_path.$lang_code.\".xml\");\n\n\t$page_count = 0;\n\tforeach($pages as $page)\n\t{\n\t\t$page_count++;\n\t\t$string_data = '\"'.$page['id'].'\" => array ( ';\n\t\tfwrite($handle, \"\\t\".$string_data.\"\\n\");\n\t\t$terms = $page->term;\n\t\t$term_count = 0;\n\t\tforeach($terms as $term)\n\t\t{\n\t\t\t$term_count++;\n\t\t\t$string_data = \"\\\"\".$term->key.\"\\\" => \\\"\".$term->value.\"\\\"\";\n\t\t\tif($term_count != count($terms))\n\t\t\t{\n\t\t\t\t$string_data .= \", \";\n\t\t\t}\n\t\t\tfwrite($handle, \"\\t\\t\".$string_data.\"\\n\");\n\t\t}\n\n\t\t$string_data = \") \";\n\t\tfwrite($handle, \"\\t\".$string_data);\n\t\tif($page_count < count($pages))\n\t\t{\n\t\t\t$string_data = \", \";\n\t\t\tfwrite($handle, $string_data.\"\\n\");\n\t\t}\n\t}\n\n\t$string_data = <<<EOF\n);\n\ninclude_once(__DIR__.\"/../lang/lang_util.php\");\n?>\nEOF;\n\tfwrite($handle, \"\\n\".$string_data);\n\tfclose($handle);\n}", "public function lex($file) {\n\t\t$this->_file = $file;\n\t\treturn $this->compileClass();\n\t}", "public static function markupToPHP($content) {\n\t\tif ($content instanceof phpQueryObject)\n\t\t\t$content = $content->markupOuter();\n\t\t/* <php>...</php> to <?php...? > */\n\t\t$content = preg_replace_callback(\n\t\t\t'@<php>\\s*<!--(.*?)-->\\s*</php>@s',\n//\t\t\tcreate_function('$m',\n//\t\t\t\t'return \"<'.'?php \".htmlspecialchars_decode($m[1]).\" ?'.'>\";'\n//\t\t\t),\n\t\t\tarray('phpQuery', '_markupToPHPCallback'),\n\t\t\t$content\n\t\t);\n\t\t/* <node attr='< ?php ? >'> extra space added to save highlighters */\n\t\t$regexes = array(\n\t\t\t'@(<(?!\\\\?)(?:[^>]|\\\\?>)+\\\\w+\\\\s*=\\\\s*)(\\')([^\\']*)(?:&lt;|%3C)\\\\?(?:php)?(.*?)(?:\\\\?(?:&gt;|%3E))([^\\']*)\\'@s',\n\t\t\t'@(<(?!\\\\?)(?:[^>]|\\\\?>)+\\\\w+\\\\s*=\\\\s*)(\")([^\"]*)(?:&lt;|%3C)\\\\?(?:php)?(.*?)(?:\\\\?(?:&gt;|%3E))([^\"]*)\"@s',\n\t\t);\n\t\tforeach($regexes as $regex)\n\t\t\twhile (preg_match($regex, $content))\n\t\t\t\t$content = preg_replace_callback(\n\t\t\t\t\t$regex,\n\t\t\t\t\tcreate_function('$m',\n\t\t\t\t\t\t'return $m[1].$m[2].$m[3].\"<?php \"\n\t\t\t\t\t\t\t.str_replace(\n\t\t\t\t\t\t\t\tarray(\"%20\", \"%3E\", \"%09\", \"&#10;\", \"&#9;\", \"%7B\", \"%24\", \"%7D\", \"%22\", \"%5B\", \"%5D\"),\n\t\t\t\t\t\t\t\tarray(\" \", \">\", \"\t\", \"\\n\", \"\t\", \"{\", \"$\", \"}\", \\'\"\\', \"[\", \"]\"),\n\t\t\t\t\t\t\t\thtmlspecialchars_decode($m[4])\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.\" ?>\".$m[5].$m[2];'\n\t\t\t\t\t),\n\t\t\t\t\t$content\n\t\t\t\t);\n\t\treturn $content;\n\t}", "function tidy_parse_file($filename, $config = null, $encoding = null, $use_include_path = false) {}", "public function getPHP()\n\t{\n\t\t//\n\t}", "public function compile($ast) {\n /* FILE HEADER */\n $this->_emitter\n ->emit(['<?php', '// EMITTER VERSION [' . self::VERSION . ']'])\n ->flush();\n\n /* FILE BODY */\n $this->_processStatementBlock($ast);\n\n /* FILE FOOTER */\n $this->_emitter\n ->emit(\"?>\")\n ->flush();\n return $ast;\n }", "private function parsePhp($contents, $file)\n {\n if (false == stripos($contents, 'return'))\n {\n throw new \\InvalidArgumentException(sprintf('Requested configuration \"%s\" of type \"PHP\" must return array.', $$this->file));\n }\n\n $result = include $file;\n return $result;\n }", "public function parse()\n {\n return include $this->filePath;\n }", "public function tokenize($code, $filename = null)\n\t{\n\t\tif ($code instanceof \\Twig_Source)\n\t\t{\n\t\t\t$source = $code;\n\t\t\t$code = $source->getCode();\n\t\t\t$filename = $source->getName();\n\t\t}\n\n\t\t// Our phpBB tags\n\t\t// Commented out tokens are handled separately from the main replace\n\t\t$phpbb_tags = array(\n\t\t\t/*'BEGIN',\n\t\t\t'BEGINELSE',\n\t\t\t'END',\n\t\t\t'IF',\n\t\t\t'ELSE',\n\t\t\t'ELSEIF',\n\t\t\t'ENDIF',\n\t\t\t'DEFINE',\n\t\t\t'UNDEFINE',*/\n\t\t\t'ENDDEFINE',\n\t\t\t'INCLUDE',\n\t\t\t'INCLUDEPHP',\n\t\t\t'INCLUDEJS',\n\t\t\t'INCLUDECSS',\n\t\t\t'PHP',\n\t\t\t'ENDPHP',\n\t\t\t'EVENT',\n\t\t);\n\n\t\t// Twig tag masks\n\t\t$twig_tags = array(\n\t\t\t'autoescape',\n\t\t\t'endautoescape',\n\t\t\t'if',\n\t\t\t'elseif',\n\t\t\t'else',\n\t\t\t'endif',\n\t\t\t'block',\n\t\t\t'endblock',\n\t\t\t'use',\n\t\t\t'extends',\n\t\t\t'embed',\n\t\t\t'filter',\n\t\t\t'endfilter',\n\t\t\t'flush',\n\t\t\t'for',\n\t\t\t'endfor',\n\t\t\t'macro',\n\t\t\t'endmacro',\n\t\t\t'import',\n\t\t\t'from',\n\t\t\t'sandbox',\n\t\t\t'endsandbox',\n\t\t\t'set',\n\t\t\t'endset',\n\t\t\t'spaceless',\n\t\t\t'endspaceless',\n\t\t\t'verbatim',\n\t\t\t'endverbatim',\n\t\t);\n\n\t\t// Fix tokens that may have inline variables (e.g. <!-- DEFINE $TEST = '{FOO}')\n\t\t$code = $this->strip_surrounding_quotes(array(\n\t\t\t'INCLUDE',\n\t\t\t'INCLUDEPHP',\n\t\t\t'INCLUDEJS',\n\t\t\t'INCLUDECSS',\n\t\t), $code);\n\t\t$code = $this->fix_inline_variable_tokens(array(\n\t\t\t'DEFINE \\$[a-zA-Z0-9_]+ =',\n\t\t\t'INCLUDE',\n\t\t\t'INCLUDEPHP',\n\t\t\t'INCLUDEJS',\n\t\t\t'INCLUDECSS',\n\t\t), $code);\n\t\t$code = $this->add_surrounding_quotes(array(\n\t\t\t'INCLUDE',\n\t\t\t'INCLUDEPHP',\n\t\t\t'INCLUDEJS',\n\t\t\t'INCLUDECSS',\n\t\t), $code);\n\n\t\t// Fix our BEGIN statements\n\t\t$code = $this->fix_begin_tokens($code);\n\n\t\t// Fix our IF tokens\n\t\t$code = $this->fix_if_tokens($code);\n\n\t\t// Fix our DEFINE tokens\n\t\t$code = $this->fix_define_tokens($code);\n\n\t\t// Replace all of our starting tokens, <!-- TOKEN --> with Twig style, {% TOKEN %}\n\t\t// This also strips outer parenthesis, <!-- IF (blah) --> becomes <!-- IF blah -->\n\t\t$code = preg_replace('#<!-- (' . implode('|', $phpbb_tags) . ')(?: (.*?) ?)?-->#', '{% $1 $2 %}', $code);\n\n\t\t// Replace all of our twig masks with Twig code (e.g. <!-- BLOCK .+ --> with {% block $1 %})\n\t\t$code = $this->replace_twig_tag_masks($code, $twig_tags);\n\n\t\t// Replace all of our language variables, {L_VARNAME}, with Twig style, {{ lang('NAME') }}\n\t\t// Appends any filters after lang()\n\t\t$code = preg_replace('#{L_([a-zA-Z0-9_\\.]+)(\\|[^}]+?)?}#', '{{ lang(\\'$1\\')$2 }}', $code);\n\n\t\t// Replace all of our escaped language variables, {LA_VARNAME}, with Twig style, {{ lang('NAME')|escape('js') }}\n\t\t// Appends any filters after lang(), but before escape('js')\n\t\t$code = preg_replace('#{LA_([a-zA-Z0-9_\\.]+)(\\|[^}]+?)?}#', '{{ lang(\\'$1\\')$2|escape(\\'js\\') }}', $code);\n\n\t\t// Replace all of our variables, {VARNAME}, with Twig style, {{ VARNAME }}\n\t\t// Appends any filters\n\t\t$code = preg_replace('#{([a-zA-Z0-9_\\.]+)(\\|[^}]+?)?}#', '{{ $1$2 }}', $code);\n\n\t\t// Tokenize \\Twig_Source instance\n\t\treturn parent::tokenize(new \\Twig_Source($code, $filename));\n\t}", "public function getCode()\n {\n if ( $this->isInternal() ) {\n $code = '/* ' . $this->getName() . ' is an internal function.'\n . ' Therefore the source code is not available. */';\n } else {\n $filename = $this->getFileName();\n\n $start = $this->getStartLine();\n $end = $this->getEndLine();\n\n $offset = $start - 1;\n $length = $end - $start + 1;\n \n $lines = array_slice( file( $filename ), $offset, $length );\n\n if ( strpos( trim( $lines[0] ), 'function' ) !== 0 ) {\n $lines[0] = substr( $lines[0], strpos( $lines[0], 'function' ) );\n }\n\n $code = implode( '', $lines );\n }\n return $code;\n }", "public function compile ();", "function printMyCode() {\n $lines = file($_SERVER['SCRIPT_FILENAME']);\n echo \"<pre class='mycode'><ol>\";\n foreach ($lines as $line)\n echo '<li>'.rtrim(htmlentities($line)).'</li>';\n echo '</ol></pre>';\n}", "function eval_inline_php($myContent,$onlyEval=false)\n// *************************************************\n{\n\t$rVal = \"\";\n\n\t// PHP INCLUDES\n\t$pos1 = strpos($myContent,\"<?php\");\n\n\tif (!($pos1===false))\n\t{\n\t\t$pos2 = strpos($myContent,\"?>\",$pos1);\n\n\t\t$rVal .= substr($myContent,0,$pos1);\n\n\t\t// BLOCK AUSWERTEN\n\t\t$evalTxt = substr($myContent,$pos1+5,($pos2)-($pos1+5));\n\t\teval($evalTxt);\n\n\t\t// RUECKGABE BLOCK DAVOR UND DANACH\n\t\tif (!$onlyEval) return $rVal.substr($myContent,$pos2+2);\n\t}\n\telse\n\t\treturn $myContent;\n\n\treturn \"\";\n}", "public function load($file);", "public function load($file);", "public function load($file);", "private function apply_node_instructions() {\n // Add a new node visitor to the traverser\n $this->get_traverser()->addVisitor(new class($this) extends \\PhpParser\\NodeVisitorAbstract {\n public function __construct($file) {\n $this->file = $file;\n }\n\n /**\n * Applies all instructions to a node for a given type\n *\n * @param string $type The instruction type to be applied\n * @param \\PhpParser\\Node $node The node to be actioned\n * @return \\PhpParser\\Node\n */\n private function apply_instructions(string $type, \\PhpParser\\Node $node): \\PhpParser\\Node {\n // Retrieve all instructions by type\n $instructions = $this->file->get_instructions($type);\n\n // Check if has no leave instructions\n if (empty($instructions)) {\n return $node;\n }\n\n // Iterate over all instructions\n foreach($instructions as $instruction) {\n // Get the node type\n $instruction_node = $instruction->node;\n\n // Check if it's not the same as the current node\n if (!($node instanceof $instruction_node)) {\n continue;\n }\n\n // Extract the parameters\n $if = (array) $instruction->if;\n $do = (array) $instruction->do;\n\n // Check for all instructions\n foreach($if as $index => $cnd) {\n // Variable that will later handle if the condition was met\n $condition = false;\n\n // Check if condition is a callback\n if (is_callable($cnd)) {\n // Try matching it with the current node\n $condition = call_user_func_array($cnd, [$node]);\n } else {\n // Retrieve the index value\n $node_index = $node->{$index};\n\n // Check if the condition value is a string, and node index has a toString() method\n if (is_string($cnd[1]) && is_callable([$node_index, \"toString\"])) {\n // Call it\n $node_index = $node_index->toString();\n }\n\n // Evaluate the condition\n eval(\"\\$condition = \\$node_index \" . $cnd[0] . \" \" . escapeshellarg($cnd[1]) . \";\");\n }\n\n // Check if the condition was not met\n if (!$condition) {\n // Assert the failed condition\n $instruction->do_assertion(File\\Instruction::ASSERT_FAILED_CONDITION_NOT_MET, null);\n\n // Break the instruction\n break 2;\n }\n }\n\n // Do all instructions\n foreach($do as $action) {\n // Check if it's callable\n if (is_callable($action)) {\n // Just call the action\n call_user_func_array($action, [$node]);\n continue;\n }\n\n // Extract the action name\n $action_name = $action[\"action\"];\n unset($action[\"action\"]);\n\n // Check if is settings variables\n if ($action_name === \"set\") {\n // Iterate over all variables\n foreach($action[\"vars\"] ?? $action[\"variables\"] as $var => $value) {\n // Set the node variable value\n $node->{$var} = $value;\n }\n }\n }\n }\n\n return $node;\n }\n\n public function leaveNode(\\PhpParser\\Node $node) {\n return $this->apply_instructions(\"leave\", $node);\n }\n\n public function enterNode(\\PhpParser\\Node $node) {\n return $this->apply_instructions(\"enter\", $node);\n }\n });\n }", "public function staticParse($file)\n {\n $source = file_get_contents($file);\n if( preg_match_all( '/(?:abstract\\s+class|class|interface)\\s+(\\w+)/i' ,$source, $matches ) ) {\n var_dump( $matches ); \n }\n }", "function yy_r7(){ $this->compiler->tag_nocache = true; $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo '<?xml';?>\", $this->compiler, true); }", "public function testParseClassMethod()\n {\n $file = '#test';\n $rule = [\n 'directive' => '~#test(\\s*\\(((.*))\\))?~',\n 'replace' => \\Caprice\\Directives\\PhpDirective::class,\n ];\n $extras = []; // extra needed parameters like paths \n\n $out = $this->parser->parse($file, $rule, $extras);\n\n $this->assertSame('<?php ', $out);\n }", "function parseHTML(){\n\t\t$code = preg_replace_callback('~(href|src|codebase|url|action)\\s*=\\s*([\\'\\\"])?(?(2) (.*?)\\\\2 | ([^\\s\\>]+))~isx',array('self','parseExtURL'),$this->source);\n\t\t$code = preg_replace_callback('~(<\\s*style.*>)(.*)<\\s*/\\s*style\\s*>~iUs',Array('self','parseCSS'),$code);\n\t\t$code = preg_replace_callback('~(style\\s*=\\s*)([\\'\\\"])(.*)\\2~iUs',Array('self','parseStyle'),$code);\n\t\t$code = preg_replace_callback('~<script(\\s*.*)>(.*)<\\s*/\\s*script>~iUs',Array('self','parseScriptTag'),$code);\n\t\t$this->output = $code;\n\t}", "public function parse($href) {\n\t\t// File init\n\t\t$file = new WTemplateFile($href, $this->baseDir, $this->compileDir);\n\n\t\t// Compilation (if needed)\n\t\t$code = $file->compile($this->compiler);\n\n\t\t// Buffer\n\t\tob_start();\n\n\t\t// Define a soft handler for undefined variables\n\t\tset_error_handler(function($errno, $errstr, $errfile, $errline) {\n\t\t\techo str_replace(array('Undefined index: ', 'Undefined variable: '), 'WT!', $errstr);\n\t\t}, E_NOTICE);\n\n\t\ttry { // Critical section\n\t\t\t// Adds the php close balise at the begining because it is a whole php file being evaluated\n\t\t\t$eval_result = eval('?>'.$code);\n\t\t} catch (Exception $e) {\n\t\t\t// Just stores the exception into $e to throw it later\n\t\t}\n\n\t\trestore_error_handler();\n\n\t\t$buffer = ob_get_contents();\n\t\tob_end_clean();\n\n\t\t// Throw exception if any\n\t\tif (!empty($e)) {\n\t\t\tthrow $e;\n\t\t} else if ($eval_result === false) {\n\t\t\tthrow new Exception(\"WTemplate::parse(): File $href encountered an error during evaluation :\".$buffer);\n\t\t}\n\n\t\treturn $buffer;\n\t}", "public function __construct($input) {\n\n // Shebang\n if (0 === strncmp($input, '#!', 2)) {\n $input= substr($input, strcspn($input, \"\\n\") + 1);\n }\n\n // PHP open tags\n if (0 === strncmp($input, '<?', 2)) {\n $input= substr($input, strcspn($input, \"\\r\\n\\t =\") + 1);\n }\n\n $this->fragment= trim($input, \"\\r\\n\\t ;\").';';\n $this->imports= [];\n while (0 === strncmp($this->fragment, 'use ', 4)) {\n $delim= strpos($this->fragment, ';');\n foreach ($this->importsIn(substr($this->fragment, 4, $delim - 4)) as $import) {\n $this->imports[]= $import;\n }\n $this->fragment= ltrim(substr($this->fragment, $delim + 1), ' ');\n }\n }", "public static function loader()\n\t{\n\t\treturn static::$_parser_loader;\n\t}", "public function parse(): PhpCss\\Ast\\Node {\n }", "public function createParser();", "function parse(&$reader, &$ctxt)\r\n\t{\r\n\t\t$parser =& new PhaseParser($reader, $ctxt);\r\n\t\t$output = '';\r\n\t\t\r\n\t\t// NOTE: this method provides an easy way to setup the tag libraries\r\n\t\t$parser->loadTagLibraries();\r\n\r\n\t\twhile ($reader->hasMoreInput())\r\n\t\t{\r\n\t\t\t$output .= $parser->parseElements();\r\n\t\t}\r\n\r\n\t\t// tack on the tag functions, wrapping them in the namespace\r\n\t\t// for this phase context\r\n\t\tif (count($parser->tagFunctions))\r\n\t\t{\r\n\t\t\t$output .= \r\n\t\t\t'<?php' . \"\\n\" .\r\n\t\t\t'class ' . $parser->namespace . ' {' . \"\\n\" .\r\n\t\t\timplode(\"\\n\", array_reverse($parser->tagFunctions)) . \"\\n\" .\r\n\t\t\t'}' . \"\\n\" .\r\n\t\t\t'?>' . \"\\n\";\t\r\n\t\t}\r\n\r\n\t\t// merge sections where php tags have become adjacent (no need for them)\r\n\t\t$output = preg_replace('; *\\?><\\?php *;', ' ', $output);\r\n\r\n\t\treturn $output;\r\n\t}", "static function sourceLinePhpToTht ($phpFilePath, $phpLineNum, $fnName) {\n\n $phpFilePath = Tht::normalizeWinPath($phpFilePath);\n\n $phpCode = file_get_contents($phpFilePath);\n\n // Reverse to make sure match is from bottom of file.\n $phpLines = array_reverse(\n explode(\"\\n\", $phpCode)\n );\n\n // Read the source map\n foreach ($phpLines as $l) {\n\n if (substr($l, 0, 2) === '/*') {\n\n $match = [];\n $sourceMapFound = preg_match('/SOURCE=(\\{.*})/', $l, $match);\n\n if ($sourceMapFound) {\n\n $sourceMap = json_decode($match[1], true);\n\n if ($fnName) {\n $phpLineNum = self::findRealSourceLineForFunctionCall($fnName, $phpLineNum, $phpLines);\n }\n\n // Go up the line numbers and find the nearest one with a mapping to THT\n $checkLineNum = $phpLineNum;\n while (true) {\n if (isset($sourceMap[$checkLineNum])) {\n return [\n 'lang' => 'tht',\n 'file' => $sourceMap['file'],\n 'lineNum' => $sourceMap[$checkLineNum],\n 'linePos' => null,\n 'lineSource' => '',\n ];\n }\n $checkLineNum -= 1;\n }\n\n break;\n }\n }\n }\n\n // Fall through to PHP frame\n return [\n 'lang' => 'php',\n 'lineNum' => $phpLineNum,\n 'file' => $phpFilePath,\n 'linePos' => -1,\n 'lineSource' => trim($phpLines[$phpLineNum]),\n ];\n }", "function get_php ($filename) {\n ob_start(); \n include($filename);\n $buf = ob_get_contents();\n ob_end_clean(); \n return $buf;\n}", "function compile ($src);", "public function process(File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n\n // We are only interested in function/class/interface doc block comments.\n $ignore = Tokens::$emptyTokens;\n if ($phpcsFile->tokenizerType === 'JS') {\n $ignore[] = T_EQUAL;\n $ignore[] = T_STRING;\n $ignore[] = T_OBJECT_OPERATOR;\n }\n\n $nextToken = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true);\n $ignore = [\n T_CLASS => true,\n T_INTERFACE => true,\n T_ENUM => true,\n T_ENUM_CASE => true,\n T_FUNCTION => true,\n T_PUBLIC => true,\n T_PRIVATE => true,\n T_PROTECTED => true,\n T_STATIC => true,\n T_ABSTRACT => true,\n T_PROPERTY => true,\n T_OBJECT => true,\n T_PROTOTYPE => true,\n T_VAR => true,\n T_READONLY => true,\n ];\n\n if ($nextToken === false || isset($ignore[$tokens[$nextToken]['code']]) === false) {\n // Could be a file comment.\n $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true);\n if ($tokens[$prevToken]['code'] !== T_OPEN_TAG) {\n return;\n }\n }\n\n // There must be one space after each star (unless it is an empty comment line)\n // and all the stars must be aligned correctly.\n $requiredColumn = ($tokens[$stackPtr]['column'] + 1);\n $endComment = $tokens[$stackPtr]['comment_closer'];\n for ($i = ($stackPtr + 1); $i <= $endComment; $i++) {\n if ($tokens[$i]['code'] !== T_DOC_COMMENT_STAR\n && $tokens[$i]['code'] !== T_DOC_COMMENT_CLOSE_TAG\n ) {\n continue;\n }\n\n if ($tokens[$i]['code'] === T_DOC_COMMENT_CLOSE_TAG) {\n if (trim($tokens[$i]['content']) === '') {\n // Don't process an unfinished docblock close tag during live coding.\n continue;\n }\n\n // Can't process the close tag if it is not the first thing on the line.\n $prev = $phpcsFile->findPrevious(T_DOC_COMMENT_WHITESPACE, ($i - 1), $stackPtr, true);\n if ($tokens[$prev]['line'] === $tokens[$i]['line']) {\n continue;\n }\n }\n\n if ($tokens[$i]['column'] !== $requiredColumn) {\n $error = 'Expected %s space(s) before asterisk; %s found';\n $data = [\n ($requiredColumn - 1),\n ($tokens[$i]['column'] - 1),\n ];\n $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeStar', $data);\n if ($fix === true) {\n $padding = str_repeat(' ', ($requiredColumn - 1));\n if ($tokens[$i]['column'] === 1) {\n $phpcsFile->fixer->addContentBefore($i, $padding);\n } else {\n $phpcsFile->fixer->replaceToken(($i - 1), $padding);\n }\n }\n }\n\n if ($tokens[$i]['code'] !== T_DOC_COMMENT_STAR) {\n continue;\n }\n\n if ($tokens[($i + 2)]['line'] !== $tokens[$i]['line']) {\n // Line is empty.\n continue;\n }\n\n if ($tokens[($i + 1)]['code'] !== T_DOC_COMMENT_WHITESPACE) {\n $error = 'Expected 1 space after asterisk; 0 found';\n $fix = $phpcsFile->addFixableError($error, $i, 'NoSpaceAfterStar');\n if ($fix === true) {\n $phpcsFile->fixer->addContent($i, ' ');\n }\n } else if ($tokens[($i + 2)]['code'] === T_DOC_COMMENT_TAG\n && $tokens[($i + 1)]['content'] !== ' '\n ) {\n $error = 'Expected 1 space after asterisk; %s found';\n $data = [$tokens[($i + 1)]['length']];\n $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterStar', $data);\n if ($fix === true) {\n $phpcsFile->fixer->replaceToken(($i + 1), ' ');\n }\n }\n }//end for\n\n }", "abstract public function load($filename);", "private function htmltidy_php() {\r\n\t\t$this->logMsg(\"=== htmltidy_php ===\");\r\n\t\tif(!is_callable('tidy_parse_string')) {\r\n\t\t\t$this->logMsg('tidy_parse_string() is not callable! Maybe the tidy extension is not installed.');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// added (2011-06-29)\r\n\t\tif($this->WET === \"WET\" || $this->config['WET'] === \"WET\") {\r\n\t\t\t$this->config['htmltidy']['anchor-as-name'] = 0;\r\n\t\t}\r\n\t\tReTidy::set_HTML5();\r\n\t\t//ReTidy::tidy_comments();\r\n\t\tReTidy::encode_character_entities_in_comments();\r\n\t\t$tidy = tidy_parse_string($this->code, $this->config['htmltidy'], $this->config['htmltidy']['input-encoding']);\r\n\t\t//var_dump($tidy); // tidy error reporting\r\n\t\tif(!$tidy) {\r\n\t\t\t$this->logMsg('tidy_parse_string() failed!');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(!$tidy->cleanRepair()) {\r\n\t\t\t$this->logMsg('$tidy->cleanRepair() failed!');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->logMsg('Status: '. $tidy->getStatus() . \"\\nErrors: \" . tidy_error_count($tidy) . \"\\nWarnings: \" . tidy_warning_count($tidy));\r\n\t\tif($this->config['show_tidy_errors']) {\r\n\t\t\t$this->logMsg(\"--- Error buffer --- \\n\" . $tidy->errorBuffer . \"\\n --- Error buffer end ---\");\r\n\t\t}\r\n\t\t$this->code = tidy_get_output($tidy);\r\n\t\tif(!$this->code) {\r\n\t\t\t$this->logMsg('Warning! HTML Tidy output is empty.');\r\n\t\t}\r\n\t\t// perhaps we should just say if not utf8?\r\n\t\tif(($this->config['encoding'] === \"iso-8859-1\" ||\r\n\t\t$this->config['encoding'] === \"us-ascii\" ||\r\n\t\t$this->config['encoding'] === \"windows-1252\") && $this->config['do_not_encode_character_entities'] !== true) {\r\n\t\t\tReTidy::encode_character_entities();\r\n\t\t}\r\n\t\t// HTML5 specific fix (tidy and basically everything else do not support HTML5)\r\n\t\t//var_dump($this->config['HTML5']);\r\n\t\t//var_dump($this->config);\r\n\t\t//var_dump(ReTidy::get_HTML5());\r\n\t\tif(ReTidy::get_HTML5()) {\r\n\t\t\t//print(\"here--4300--2\");\r\n\t\t\t$this->code = ReTidy::str_replace_first('<meta />', '<meta charset=\"' . $this->config['encoding'] . '\" />', $this->code);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function process(File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n\n $beginners = Tokens::$booleanOperators;\n $beginners[] = T_IF;\n $beginners[] = T_ELSEIF;\n\n $beginning = $phpcsFile->findPrevious($beginners, $stackPtr, null, false, null, true);\n\n $needsYoda = false;\n\n // Note: going backwards!\n for ($i = $stackPtr; $i > $beginning; $i--) {\n // Ignore whitespace.\n if (isset(Tokens::$emptyTokens[$tokens[$i]['code']])) {\n continue;\n }\n\n // If this is a variable or array, we've seen all we need to see.\n if (T_VARIABLE === $tokens[$i]['code'] || T_CLOSE_SQUARE_BRACKET === $tokens[$i]['code']) {\n $needsYoda = true;\n break;\n }\n\n // If this is a function call or something, we are OK.\n if (in_array(\n $tokens[$i]['code'],\n [T_CONSTANT_ENCAPSED_STRING, T_CLOSE_PARENTHESIS, T_OPEN_PARENTHESIS, T_RETURN],\n true\n )\n ) {\n return;\n }\n }\n\n if (!$needsYoda) {\n return;\n }\n\n // Check if this is a var to var comparison, e.g.: if ( $var1 == $var2 ).\n $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);\n\n if (isset(Tokens::$castTokens[$tokens[$nextNonEmpty]['code']])) {\n $nextNonEmpty = $phpcsFile->findNext(\n Tokens::$emptyTokens,\n ($nextNonEmpty + 1),\n null,\n true\n );\n }\n\n if (in_array($tokens[$nextNonEmpty]['code'], [T_SELF, T_PARENT, T_STATIC], true)) {\n $nextNonEmpty = $phpcsFile->findNext(\n array_merge(Tokens::$emptyTokens, [T_DOUBLE_COLON]),\n ($nextNonEmpty + 1),\n null,\n true\n );\n }\n\n if (T_VARIABLE === $tokens[$nextNonEmpty]['code']) {\n return;\n }\n\n $phpcsFile->addError('Use Yoda Condition checks, you must.', $stackPtr, 'NotYoda');\n }", "function runParser($filePath) {\n fileParser($filePath);\n\n fileNumberAdder();\n\n formatPrinter();\n}", "function yy_r8()\n {\n if ($this->php_handling == Smarty::PHP_PASSTHRU) {\n $this->compiler->template_code->php(\"echo '<?php';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_QUOTE) {\n $this->compiler->template_code->php(\"echo '&lt;?php';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_ALLOW) {\n if (! ($this->compiler->context->smarty instanceof Smarty_Smarty2BC)) {\n $this->compiler->error(self::Err3);\n }\n $this->text_is_php = true;\n }\n }", "private static function runCompile(string $path, $namespace)\n {\n // path was returned ?\n if (!is_null($path))\n {\n $filename = basename($path);\n\n $cachename = md5($path) . '.php';\n\n if (file_exists($path))\n {\n // yes we read its content.\n $content = file_get_contents($path);\n\n $default = $content;\n\n $continue = true;\n $json = read_json(__DIR__ . '/hyphe.paths.json', true);\n \n if (file_exists(self::$cacheDir . $cachename))\n {\n $_content = file_get_contents(self::$cacheDir . $cachename);\n\n $start = strstr($_content, 'public static function ___cacheData()');\n\n preg_match('/(return)\\s{1,}[\"](.*?)[\"]/', $start, $return);\n\n if (count($return) > 0)\n {\n $cached = $return[2];\n\n if ($cached == md5($default))\n {\n $continue = false;\n }\n }\n\n // clean up\n $_content = null;\n $return = null;\n }\n \n if ($continue)\n {\n $content = '<!doctype html><html><body>'.$content.'</body></html>';\n \n // read dom\n $html = new HTML5();\n $dom = $html->loadHTML($content);\n\n $replaces = [];\n $engine = new Engine();\n\n $cachesize = md5($default);\n\n foreach ($dom->getElementsByTagName('hy') as $hy)\n {\n if ($hy->hasAttribute('directive'))\n {\n $class = $hy->getAttribute('directive');\n // inner content\n $body = self::innerHTML($hy);\n\n $classMap = [];\n $classMap[] = '<?php';\n if ($namespace != '')\n {\n $classMap[] = 'namespace '.$namespace.';';\n }\n else\n {\n $namespace = rtrim($path, $filename);\n $namespace = preg_replace('/^(\\.\\/)/','',$namespace);\n $namespace = rtrim($namespace, '/');\n $namespace = str_ireplace('/static/', '/', $namespace);\n $namespace = str_replace(HOME, '', $namespace);\n $namespace = preg_replace('/[\\/]{2,}/', '/', $namespace);\n $namespace = str_replace('/', '\\\\', $namespace);\n $classMap[] = 'namespace '.$namespace.';';\n }\n \n $classMap[] = 'class '.ucfirst($class). ' extends \\Hyphe\\Engine {';\n $classMap[] = html_entity_decode($body);\n $classMap[] = 'public static function ___cacheData()';\n $classMap[] = '{';\n $classMap[] = ' return \"'.$cachesize.'\";';\n $classMap[] = '}';\n $classMap[] = '}';\n\n $replaces[] = [\n 'replace' => $dom->saveHTML($hy),\n 'with' => implode(\"\\n\\t\", $classMap)\n ];\n }\n else\n {\n $out = $dom->saveHTML($hy);\n $inner = self::innerHTML($hy);\n\n if ($hy->hasAttribute('func'))\n {\n $funcName = $hy->getAttribute('func');\n $access = $hy->hasAttribute('access') ? $hy->getAttribute('access') : 'public';\n $args = $hy->hasAttribute('args') ? $hy->getAttribute('args') : '';\n\n $func = [];\n $func[] = $access .' function '. $funcName . '('.$args.')';\n $func[] = '{';\n $func[] = html_entity_decode($inner);\n $func[] = '}'; \n\n $replaces[] = [\n 'replace' => html_entity_decode($out),\n 'with' => implode(\"\\n\\t\", $func)\n ];\n }\n else\n {\n if ($hy->hasAttribute('lang'))\n {\n $lang = $hy->getAttribute('lang');\n\n switch (strtolower($lang))\n {\n case 'html':\n\n // interpolate props and this\n $inner = preg_replace('/(props)[.]([a-zA-Z_]+)/', '$this->props->$2', $inner);\n $inner = preg_replace('/(this)[.]([a-zA-Z_]+)/', '$this->$2', $inner);\n\n $inner = html_entity_decode($inner);\n\n $engine->interpolateExternal($inner, $data);\n $return = [];\n $return[] = '$assets = $this->loadAssets();';\n $return[] = '?>';\n $return[] = $data;\n $return[] = '<?php';\n\n // add replace\n $replaces[] = [\n 'replace' => html_entity_decode($out),\n 'with' => implode(\"\\n\\t\", $return)\n ];\n break;\n }\n } \n }\n }\n }\n\n if (isset($replaces[0]))\n {\n $default = $replaces[0]['replace'];\n\n $count = count($replaces);\n\n $default = preg_replace('/(\\S+)(=\\s*)[\\'](.*?)[\\']/', '$1$2\"$3\"', $default);\n\n $default = self::removeClosingTags($default);\n\n for ($x = 0; $x != $count; $x++)\n {\n $replace = self::removeClosingTags($replaces[$x]['replace']);\n $with = self::removeClosingTags($replaces[$x]['with']);\n\n if ($x == 0)\n {\n $default = $with;\n }\n\n $default = str_replace($replace, $with, $default);\n }\n\n // interpolate props and this\n $default = preg_replace('/(props)[.]([a-zA-Z_]+)/', '$this->props->$2', $default);\n $default = preg_replace('/(this)[.]([a-zA-Z_]+)/', '$this->$2', $default);\n\n\n if (!is_dir(self::$cacheDir))\n {\n mkdir(self::$cacheDir);\n }\n\n // save cache file and return path\n file_put_contents(self::$cacheDir . $cachename, $default);\n\n // push to json\n $json[$cachename] = $namespace;\n save_json(__DIR__ . '/hyphe.paths.json', $json);\n }\n }\n }\n \n return self::$cacheDir . $cachename;\n }\n\n return null;\n }", "private function compile($content) { //was display function here\r\n\t\r\n\t\t\t//loop \r\n\t\t\t$content = preg_replace_callback('#{loop[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)(.*?)\\}(.*?){\\/loop\\}#is',array(&$this,'loop_bt'), $content);\r\n\t\t\t//if and her sisters\r\n\t\t\t$content = preg_replace_callback('#{(if|elseif)[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)[^>]([a-zA-Z\\=\\!\\>\\%\\&\\|\\</]{1,3})[^>](.*?)\\}#i',array(&$this,'if_expr'), $content);\r\n\r\n\t\t\t//matchs ..\r\n\t\t\t$matchs\t= array(\r\n\t\t\t\t\t\t\t\t'#{include_tpl[^>](.*?)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{include_script[^>](.*?)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{if[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{elseif[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{else\\}#i',\r\n\t\t\t\t\t\t\t\t'#{\\/if\\}#i',\r\n\t\t\t\t\t\t\t\t($this->php_compile == 'on') ? '#{php\\}(.*?){\\/php\\}#is' : '##',\r\n\t\t\t\t\t\t\t\t($this->global_vars == 'on') ? '#{([a-zA-Z0-9\\_\\-\\+\\./]+)}#' : '##',\r\n\t\t\t\t\t\t\t\t'#{assets[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)}#is',\r\n\t\t\t\t\t\t\t);\r\n\t\t\t//replaces\t\t\t\t\r\n\t\t\t$replaces = array ( \r\n\t\t\t\t\t\t\t\t\t'<?php $this->include_tpl(\\'\\\\1\\'); ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php include(\\'\\\\1\\'); ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php if($this->vars[\\'\\\\1\\']){ ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php } elseif(\\\\1){?>',\r\n\t\t\t\t\t\t\t\t\t'<?php } else { ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php } ?>',\r\n\t\t\t\t\t\t\t\t\t($this->php_compile == 'on') ? '<?php \\\\1 ?>' : '',\r\n\t\t\t\t\t\t\t\t\t($this->global_vars == 'on') ? '<?php print $this->vars[\\'\\\\1\\'];?>' : '',\r\n\t\t\t\t\t\t\t\t\t'<?php echo $this->assets(\\'\\\\1\\'); ?>',\r\n\t\t\t\t\t\t\t\t);\r\n\t\t//show time ..\r\n\t\t$content = preg_replace($matchs,$replaces, $content);\r\n\t\t\r\n\t\tif($this->global_vars != 'on'){ \r\n\t\t\t$content = preg_replace_callback('#{([a-zA-Z0-9\\_\\-\\+\\./]+)}#',array(&$this,'assign_if_global_off'), $content);\r\n\t\t}\r\n\t\t\r\n\t\treturn $content; \r\n }", "function code() {\n\t\t$code_issue_replace = false;\n\t\tif (in_array('replace', $this->args)) {\n\t\t\t$code_issue_replace = true;\n\t\t}\n\t\t$files = $this->files();\n\t\tforeach ( $files as $file ) {\n\t\t\t$code = file_get_contents($file);\n\t\t\t$issues = $this->code_issue_find($code);\n\t\t\tif (!empty($issues)) {\n\t\t\t\tif ($code_issue_replace) {\n\t\t\t\t\t$this->code_issue_replace($file, $code);\n\t\t\t\t} else {\n\t\t\t\t\t$this->out($file);\n\t\t\t\t\tprint_r($issues);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function process( File $phpcsFile, $stackPtr ) {\n\n\t\t$tokens = $phpcsFile->getTokens();\n\n\t\t$statements = [];\n\n\t\twhile ( ( $stackPtr = $phpcsFile->findNext( \\T_NAMESPACE, ( $stackPtr + 1 ) ) ) !== false ) {\n\n\t\t\t$next_non_empty = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true );\n\t\t\tif ( $next_non_empty === false ) {\n\t\t\t\t// Live coding or parse error.\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( $tokens[ $next_non_empty ]['code'] === \\T_NS_SEPARATOR ) {\n\t\t\t\t// Not a namespace declaration, but the use of the namespace keyword as operator.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// OK, found a namespace declaration.\n\t\t\t$statements[] = $stackPtr;\n\n\t\t\tif ( isset( $tokens[ $stackPtr ]['scope_condition'] )\n\t\t\t\t&& $tokens[ $stackPtr ]['scope_condition'] === $stackPtr\n\t\t\t) {\n\t\t\t\t// Scoped namespace declaration.\n\t\t\t\t$phpcsFile->addError(\n\t\t\t\t\t'Scoped namespace declarations are not allowed.',\n\t\t\t\t\t$stackPtr,\n\t\t\t\t\t'ScopedForbidden'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( $tokens[ $next_non_empty ]['code'] === \\T_SEMICOLON\n\t\t\t\t|| $tokens[ $next_non_empty ]['code'] === \\T_OPEN_CURLY_BRACKET\n\t\t\t) {\n\t\t\t\t// Namespace declaration without namespace name (= global namespace).\n\t\t\t\t$phpcsFile->addError(\n\t\t\t\t\t'Namespace declarations without a namespace name are not allowed.',\n\t\t\t\t\t$stackPtr,\n\t\t\t\t\t'NoNameForbidden'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$count = \\count( $statements );\n\t\tif ( $count > 1 ) {\n\t\t\t$data = [\n\t\t\t\t$count,\n\t\t\t\t$tokens[ $statements[0] ]['line'],\n\t\t\t];\n\n\t\t\tfor ( $i = 1; $i < $count; $i++ ) {\n\t\t\t\t$phpcsFile->addError(\n\t\t\t\t\t'There should be only one namespace declaration per file. Found %d namespace declarations. The first declaration was found on line %d',\n\t\t\t\t\t$statements[ $i ],\n\t\t\t\t\t'MultipleFound',\n\t\t\t\t\t$data\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn ( $phpcsFile->numTokens + 1 );\n\t}", "public function m4() {\n $project = $this->project;\n $sources = implode(\" \", $this->sources);\n $date = date(\"Y-m-d H:i:s\");\n $m4_alias = str_replace('_', '-', $this->code);\n ob_start();\n echo <<<M4\ndnl Koda compiler, {$date}.\n\nPHP_ARG_WITH({$this->code}, for {$project->name} support,\n[ --with-{$m4_alias} Include {$project->name} support])\nPHP_ARG_ENABLE({$m4_alias}-debug, whether to enable debugging support in {$project->name},\n[ --enable-{$m4_alias}-debug Enable debugging support in {$project->name}], no, no)\n\nif test \"\\$PHP_{$this->CODE}_DEBUG\" != \"no\"; then\n AC_DEFINE({$this->CODE}_DEBUG, 1, [Include debugging support in {$project->name}])\n AC_DEFINE(KODA_DEBUG, 1, [Include koda debugging])\n CFLAGS=\"\\$CFLAGS -Wall -g3 -ggdb -O0\"\nelse\ndnl todo: remove this\n CFLAGS=\"\\$CFLAGS -Wall -g3 -ggdb -O0\"\nfi\n\nif test \"\\$PHP_{$this->CODE}\" != \"no\"; then\n PHP_ADD_INCLUDE(.)\n PHP_SUBST({$this->CODE}_SHARED_LIBADD)\n PHP_NEW_EXTENSION({$this->code}, {$sources}, \\$ext_shared,, \\$CFLAGS)\nfi\nM4;\n return ob_get_clean();\n }", "public function AnalyzeInputFile(){\n\t\t\t\n\t\t\t$xml = new XMLGenerator();\n $this->LACheckHeader();\n\t\t\t$xml->generateHeader();\n $this->InstructionCounter = 0;\n\t\t\twhile(($instruction = $this->Getinstruction()) != \"EOF\"){\n $this->InstructionCounter +=1;\n switch($instruction->Opcode){\n // OPCODE <var> <symb>\n case \"MOVE\":\n case \"INT2CHAR\":\n case \"TYPE\":\n case \"STRLEN\":\n case \"NOT\":\n $this->LexemCountChecker($instruction,3);\n $this->isVar($instruction->Arg1, $instruction->Opcode);\n $this->isSymb($instruction->Arg2, $instruction->Opcode);\n break; \n\n // OPCODE\n case \"RETURN\":\n $this->statJumps();\n case \"CREATEFRAME\":\n case \"PUSHFRAME\":\n case \"POPFRAME\":\n case \"BREAK\":\n\n $this->LexemCountChecker($instruction,1);\n break;\n \n // OPCODE <var>\n case \"DEFVAR\":\n $this->LexemCountChecker($instruction,2);\n $this->isVar($instruction->Arg1, $instruction->Opcode);\n break;\n \n // OPCODE <label>\n case \"LABEL\":\n case \"CALL\":\n case \"JUMP\":\n \n if($instruction->Opcode == \"LABEL\"){\n $this->COUNTERS[LABELS] += 1;\n array_push($this->labels,$instruction->Arg1->Value);\n } \n else{\n $this->statJumps($instruction->Arg1->Value);\n }\n\n $this->LexemCountChecker($instruction,2);\n $this->isLabel($instruction->Arg1, $instruction->Opcode);\n break;\n \n\n // OPCODE <symb>\n case \"PUSHS\":\n case \"EXIT\":\n case \"DPRINT\":\n case \"WRITE\":\n $this->LexemCountChecker($instruction,2);\n $this->isSymb($instruction->Arg1, $instruction->Opcode);\n break;\n \n // OPCODE <var>\n case \"POPS\":\n $this->LexemCountChecker($instruction,2);\n $this->isVar($instruction->Arg1, $instruction->Opcode);\n break;\n \n // OPCODE <label> <symb> <symb>\n case \"JUMPIFNEQ\":\n case \"JUMPIFEQ\":\n $this->statJumps($instruction->Arg1->Value);\n $this->LexemCountChecker($instruction,4);\n $this->isLabel($instruction->Arg1,$instruction->Opcode);\n $this->isSymb($instruction->Arg2, $instruction->Opcode);\n $this->isSymb($instruction->Arg3, $instruction->Opcode);\n break;\n\n // OPCODE <var> <type>\n case \"READ\":\n $this->LexemCountChecker($instruction,3);\n $this->isVar($instruction->Arg1, $instruction->Opcode);\n $instruction->Arg2 = $this->isType($instruction->Arg2, $instruction->Opcode);\n break;\n \n // OPCODE <var> <symb> <symb>\n case \"ADD\":\n case \"SUB\":\n case \"MUL\":\n case \"IDIV\":\n case \"STRI2INT\":\n case \"CONCAT\":\n case \"GETCHAR\":\n case \"SETCHAR\":\n case \"LT\":\n case \"GT\":\n case \"EQ\":\n case \"AND\":\n case \"OR\":\n $this->LexemCountChecker($instruction,4);\n $this->isVar($instruction->Arg1, $instruction->Opcode);\n $this->isSymb($instruction->Arg2, $instruction->Opcode);\n $this->isSymb($instruction->Arg3, $instruction->Opcode);\n break;\n\n default:\n $this->Error(ERROR_WRONG_OPCODE,\"Used unknown instruction \".$instruction->Opcode.\"\\n\");\n }\n $xml->Generateinstruction($instruction);\n\t\t\t}\n\t\t\t$xml->SendToSTDOUT();\n $this->PrintStats();\n\t\t}", "public static function fromFile($file, $c= __CLASS__) {\n $parser= new XMLParser();\n $tree= new $c();\n \n $parser->setCallback($tree);\n $parser->parse(FileUtil::getContents($file));\n\n // Fetch actual encoding from parser\n $tree->setEncoding($parser->getEncoding());\n\n delete($parser);\n return $tree;\n }", "function test363() : int {\n return ast\\parse_code(22, []);\n}", "public function process(File $phpcsFile, $stackPtr)\n {\n if (UseStatements::isImportUse($phpcsFile, $stackPtr) === \\false) {\n // Trait or closure use statement.\n return;\n }\n $endOfStatement = $phpcsFile->findNext([\\T_SEMICOLON, \\T_CLOSE_TAG, \\T_OPEN_USE_GROUP], $stackPtr + 1);\n if ($endOfStatement === \\false) {\n // Live coding or parse error.\n return;\n }\n $tokens = $phpcsFile->getTokens();\n $current = $stackPtr;\n do {\n $continue = $this->processImport($phpcsFile, $current, $endOfStatement);\n if ($continue === \\false) {\n break;\n }\n // Move the stackPtr forward to the next part of the use statement, if any.\n $current = $phpcsFile->findNext(\\T_COMMA, $current + 1, $endOfStatement);\n } while ($current !== \\false);\n if ($tokens[$endOfStatement]['code'] !== \\T_OPEN_USE_GROUP) {\n // Finished the statement.\n return;\n }\n $current = $endOfStatement;\n // Group open brace.\n $endOfStatement = $phpcsFile->findNext([\\T_CLOSE_USE_GROUP], $endOfStatement + 1);\n if ($endOfStatement === \\false) {\n // Live coding or parse error.\n return;\n }\n do {\n $continue = $this->processImport($phpcsFile, $current, $endOfStatement, \\true);\n if ($continue === \\false) {\n break;\n }\n // Move the stackPtr forward to the next part of the use statement, if any.\n $current = $phpcsFile->findNext(\\T_COMMA, $current + 1, $endOfStatement);\n } while ($current !== \\false);\n }", "protected function sourceParserByFile($file)\n {\n if (!is_string($file)) {\n throw new InvalidArgumentException('The file must be a string.');\n }\n\n $type = pathinfo($file, PATHINFO_EXTENSION);\n\n return $this->sourceParser(strtolower($type));\n }", "protected static function compile($file) {\n\n\t\t$content = file_get_contents($file);\n\t\t\n\t\tforeach( BP_Parser::$parts as $part ) {\n\t\t\t$content = call_user_func(\"BP_Parser::handle_$part\", $content, dirname($file) );\n\t\t}\n\n\t\treturn $content;\n\n\t}", "private function analyse()\n\t{\n\t\t// If we end up with an empty page, bail out.\n\t\t// The type is already set to NULL by default.\n\t\tif ( empty($this->raw) || ($this->raw==null) )\n\t\t\treturn;\n\t\t\t\n\t\t// If we got here, then it means there is\n\t\t// at least something on the page\n\t\t// The Default page type: \"PHP only\"\n\t\t$this->type = RUNPHPCLASS_PHPONLY;\n\n\t\t// Assume for now the code is the whole page\n\t\t// without any <php> tags for wrapping it.\n\t\t$this->phpsection = $this->raw;\n\n\t\t// Now, let's look if we can find some more\n\t\t// information affecting our verdict.\n\t\t// If we find a <php> code </php> section,\n\t\t// then it cannot be a PHP only page\n\t\t// BUT it can also be a COMPOSITE type...\n\t\tif ( $this->extractPHPsection() )\n\t\t{\n\t\t\t$this->type = RUNPHPCLASS_PHPSECTION;\n\t\t\t$this->phpsectionfound = true;\n\t\t}\n\t\t\t\n\t\t// Test for page type \"Composite\" i.e. with Wikitext\n\t\t// ==============================\n\t\tif ($this->extractCompositeTag())\n\t\t\t$this->type |= RUNPHPCLASS_COMPOSITE;\n\t\n\t\t// Try and extract any JS lying around.\n\t\tif ($this->extractJSsection())\n\t\t\t$this->type |= RUNPHPCLASS_JSSECTION;\t\t\n\t}", "public function getTreeSource();", "static function php_compiler ($space, $html)\n {\n return \"<?php\\n$space$html?>\";\n }", "private function getToken()\n {\n static $srcpos = 0; // current position in the source stream\n static $srclen; // the length of the source stream\n\n $statement = '';\n $token = null;\n if (empty($srclen)) {\n $srclen = strlen($this->source);\n }\n while (is_null($token) && $srcpos < $srclen) {\n $c = $this->source[$srcpos++];\n switch ($c) {\n case self::BEGIN_COMMENT:\n if (substr($this->source, $srcpos - 1, strlen(self::BEGIN_SL_COMMENT)) === self::BEGIN_SL_COMMENT) {\n $statement = self::BEGIN_SL_COMMENT;\n while ($this->source[$srcpos++] !== \"\\n\") {\n $statement .= $this->source[$srcpos];\n }\n $token = $this->createToken($statement);\n } elseif (substr($this->source, $srcpos - 1, strlen(self::BEGIN_ML_COMMENT))\n === self::BEGIN_ML_COMMENT) {\n if (ltrim($statement)) {\n throw new \\Exception('Invalid comment');\n }\n $statement .= $c.$this->source[$srcpos++];\n while (substr($this->source, $srcpos, strlen(self::END_ML_COMMENT))\n !== self::END_ML_COMMENT) {\n $statement .= $this->source[$srcpos++];\n }\n $srcpos += strlen(self::END_ML_COMMENT);\n $token = $this->createToken($statement.self::END_ML_COMMENT);\n } else {\n $statement .= $c;\n }\n break;\n case self::DOUBLE_QUOTE:\n case self::SINGLE_QUOTE:\n $statement .= $c;\n while ($this->source[$srcpos] !== $c) {\n $statement .= $this->source[$srcpos++];\n }\n $statement .= $this->source[$srcpos++];\n break;\n case self::BEGIN_INTERPOLATION:\n $statement .= $c;\n if (substr($this->source, $srcpos - 1, strlen(self::BEGIN_INTERPOLATION_BLOCK))\n === self::BEGIN_INTERPOLATION_BLOCK) {\n while ($this->source[$srcpos] !== self::END_BLOCK) {\n $statement .= $this->source[$srcpos++];\n }\n $statement .= $this->source[$srcpos++];\n }\n break;\n case self::BEGIN_BLOCK:\n case self::END_BLOCK:\n case self::END_STATEMENT:\n $token = $this->createToken($statement.$c);\n if (is_null($token)) {\n $statement = '';\n }\n break;\n default:\n $statement .= $c;\n break;\n }\n }\n\n if (is_null($token)) {\n $srclen = $srcpos = 0;\n }\n\n return $token;\n }", "private function getVisitorCode(ReflectionClass $class): CodeVisitor\n {\n $traverser = new NodeTraverser();\n $visitor = new CodeVisitor();\n $traverser->addVisitor($visitor);\n $fileName = $class->getFileName();\n if (is_bool($fileName)) {\n throw new InvalidSourceClassException(get_class($class));\n }\n\n $file = file_get_contents($fileName);\n if ($file === false) {\n throw new RuntimeException($fileName); // @codeCoverageIgnore\n }\n\n $stmts = $this->parser->parse($file);\n if (is_array($stmts)) {\n $traverser->traverse($stmts);\n }\n\n return $visitor;\n }", "function mgd_preparse($code)\n{\n // Get style elements\n $code = preg_replace_callback(\"/<\\\\(([a-zA-Z0-9 _-]+)\\\\)>/\", 'mgd_element', $code);\n // Echo variables\n $code = preg_replace_callback(\"%&\\(([^)]*)\\);%i\", 'mgd_variable', $code);\n return $code;\n}", "private function is_code_file( $file ) {\n\t\tif ( stristr( $file, '.php' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( stristr( $file, '.js' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( stristr( $file, '.css' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( stristr( $file, '.json' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( stristr( $file, '.md' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function compile(Compiler $compiler, Node $node);", "public function core($file)\n {\n\t\t//echo self::$base_path.'/luser/src/'.$file .'.php';\n if (file_exists( self::$framework . DIRECTORY_SEPARATOR . $file . '.php')) {\n require self::$framework . DIRECTORY_SEPARATOR . $file . '.php';\n\t\t\t\t //echo \"success load ->\".self::$framework . DIRECTORY_SEPARATOR . $file . '.php'.\"<br>\";\n } \n }", "public function loadFromFile($file)\n {\n \n }", "public function parse($file){\n $this->fileReader->open($file);\n $this->registerCallback();\n $this->fileReader->parse($file);\n $this->fileReader->close($file);\n }", "function remarks_xml2php($langdata_path)\n{\n\t# Converts updated XML file to corresponding PHP list\n\t# TODO:\n\t$handle = fopen($langdata_path.\"remarks.php\", \"w\");\n\t$string_data = <<<EOF\n<?php\n\\$REMARKS_ARRAY = array (\n\nEOF;\n\tfwrite($handle, $string_data);\n\n\t$measures = simplexml_load_file($langdata_path.\"remarks.xml\");\n\n\t$measure_count = 0;\n\tforeach($measures as $measure)\n\t{\n\t\t$measure_count++;\n\t\t$string_data = '\"'.$measure['id'].'\" => array ( ';\n\t\tfwrite($handle, \"\\t\".$string_data.\"\\n\");\n\t\t$ranges = $measure->range;\n\t\t$range_count = 0;\n\t\tforeach($ranges as $range)\n\t\t{\n\t\t\t$range_count++;\n\t\t\t$string_data = \"\\\"\".$range->key.\"\\\" => \\\"\".$range->value.\"\\\"\";\n\t\t\tif($range_count != count($ranges))\n\t\t\t{\n\t\t\t\t$string_data .= \", \";\n\t\t\t}\n\t\t\tfwrite($handle, \"\\t\\t\".$string_data.\"\\n\");\n\t\t}\n\n\t\t$string_data = \") \";\n\t\tfwrite($handle, \"\\t\".$string_data);\n\t\tif($measure_count < count($measures))\n\t\t{\n\t\t\t$string_data = \", \";\n\t\t\tfwrite($handle, $string_data.\"\\n\");\n\t\t}\n\t}\n\t$string_data = <<<EOF\n);\n\ninclude_once(\"../lang/lang_util.php\");\n?>\nEOF;\n\tfwrite($handle, \"\\n\".$string_data);\n\tfclose($handle);\n}", "function parseFile ($this_filename)\n{\n // returns $num_defines\n global $file_data;\n global $defines;\n\n $fh = fopen ($this_filename, \"rb\");\n\n $file_data ['handle'] = $fh;\n $file_data ['filename'] = $this_filename;\n $file_data ['line'] = 0;\n $file_data ['eof'] = 0;\n $file_data ['len'] = 0;\n $file_data ['idx'] = 0;\n $file_data ['last'] = 0;\n\n // Create the state table\n\n // read the define portion\n $state [0] = array ( 'string' => \"define('\",\n 'eatall' => 0,\n 'data' => '',\n 'sidx' => 0);\n\n // save all data upto the apostrophe\n $state [1] = array ( 'string' => \"'\",\n 'eatall' => 1,\n 'data' => '',\n 'sidx' => 0);\n\n // read till the comma\n $state [2] = array ( 'string' => \",\",\n 'eatall' => 0,\n 'data' => '',\n 'sidx' => 0);\n\n // State's 3 and 4 are too complex to anaylze in the normal way\n //\n // In state 3 we will read until we find the first non-whitespace\n //\n // In state 4 we will read and eat until we find an unquoted, unescaped\n // close paren.\n //\n // Then we will determine what to do about the quotes and such\n //\n\n // read till the first non-whitespace\n $state [3] = array ( 'string' => \"\",\n 'eatall' => 0,\n 'data' => '',\n 'sidx' => 0);\n\n // eat until we find a close paren\n $state [4] = array ( 'string' => \"\",\n 'eatall' => 1,\n 'data' => '',\n 'sidx' => 0);\n\n // After state's 3 and 4 we need to find the closing semi colon\n\n // read till the semicolon\n $state [5] = array ( 'string' => \";\",\n 'eatall' => 0,\n 'data' => '',\n 'sidx' => 0);\n\n $the_state = 0;\n $num_defines = 0;\n\n // keep reading characters till we reach the end of file\n\n while ($file_data ['eof'] == 0)\n {\n // get the next character\n\n getChar ();\n\n $cc = $file_data ['current'];\n $cc1 = $file_data ['last'];\n\n // we ignore white space, unless we are in the eatall states\n\n if (!isset($eatall) && ($cc == ' ' || $cc == '\\t'))\n {\n continue;\n }\n\n $idx = $state [$the_state]['sidx'];\n $schar = substr ($state [$the_state]['string'], $idx, 1);\n $eatall = $state [$the_state]['eatall'];\n \n // a special case when state is 3 and 4\n // in state 3 we read until we find a non-whitespace\n\n if ($the_state == 3)\n {\n if (strcmp ($cc, \" \") &&\n strcmp ($cc, \"\\t\"))\n {\n // ok when we get to a non-white space let's\n // transition to state 4\n\n $state [$the_state]['sidx'] = 0;\n $the_state ++;\n\n $in_quote = 0;\n $quote_type = \"'\";\n $dequoted = 0;\n\n if (!strcmp ($cc, \"'\") ||\n !strcmp ($cc, '\"'))\n {\n $in_quote = 1;\n $quote_type = $cc;\n }\n\n // put this character into the new state data\n\n $state[$the_state]['data'] = $cc;\n }\n\n continue;\n }\n\n // in state 4 we eat until we find an unquoted, unescaped\n // paren\n\n if ($the_state == 4)\n {\n if ($cc == ')' &&\n $cc1 != '\\\\' &&\n $in_quote == 0)\n {\n // we have completed state 4\n // call process_data to determine if we should\n // remove the starting and ending quotes if they\n // exist\n\n $state [$the_state]['data'] = process_data (\n $state [$the_state]['data']);\n\n $state [$the_state]['sidx'] = 0;\n\n $the_state++;\n\n continue;\n }\n\n // ok we need to check our quote status\n\n if ($in_quote == 1 &&\n !strcmp ($cc, $quote_type) &&\n strcmp ($cc1, \"\\\\\")) // make sure not escaped\n {\n // ok we have been dequoted\n\n $dequote = 1;\n $in_quote = 0;\n\n // if we pass an eol, append a newline\n\n if ($file_data ['eol'] == 1)\n $state [$the_state]['data'] .= \"\\n\";\n\n // save the quote\n\n $state [$the_state]['data'] .= $cc;\n\n continue;\n }\n\n // ok are we being quoted\n\n if ($in_quote == 0 &&\n (!strcmp ($cc, '\"') ||\n !strcmp ($cc, \"'\") ||\n !strcmp ($cc, '('))) // consider nonquoted, nonescaped\n // interior parens as quotes\n {\n // ok we are quoted again\n\n $in_quote = 1;\n $quote_type = $cc;\n\n // if we are quoted by parens, change the quote type \n // to be the close paren, to make the if statement\n // easier\n\n if (!strcmp ($cc, '('))\n $quote_type = ')';\n }\n\n // if we pass an eol, append a newline\n\n if ($file_data ['eol'] == 1)\n {\n $state [$the_state]['data'] .= \"\\n\";\n }\n\n // eat the character\n $state [$the_state]['data'] .= $cc;\n continue;\n }\n\n // normal states are here\n\n // eatall == 1, means we eat all characters till the one\n // in we are looking for, otherwise we skip characters till\n // we find the character\n\n if ($eatall == 0)\n {\n // ok we failed to finish the state machine,\n // we will restart the state machine\n\n if (strcmp ($cc, $schar))\n {\n // reset the states\n for ($i = 0; $i < 7; ++$i)\n {\n $state [$i]['sidx'] = 0;\n $state [$i]['data'] = '';\n }\n\n $the_state = 0;\n\n continue;\n }\n }\n else\n {\n if (strcmp ($cc, $schar) ||\n !strcmp ($cc1, '\\\\'))\n {\n // ok we eatall till we find our char\n\n if ($file_data ['eol'] == 1)\n $state [$the_state]['data'] .= \"\\n\";\n $state [$the_state]['data'] .= $cc;\n\n continue;\n }\n }\n\n // ok advance the state\n\n $len = strlen ($state [$the_state]['string']);\n $sidx = $state [$the_state]['sidx'];\n $sidx ++;\n $state [$the_state]['sidx'] = $sidx;\n\n // only use this code on a non eatall\n\n if ($eatall == 0)\n {\n if ($file_data ['eol'] == 1)\n $state [$the_state]['data'] .= \"\\n\";\n $state [$the_state]['data'] .= $cc;\n }\n\n // special case when we find the d in define\n\n if ($the_state == 0 && $sidx == 1)\n {\n // we have found the first character\n //\n // I want to store the starting and ending line numbers\n // so that when we rebuild the file, it will make the\n // assembly much easier.\n //\n\n $start_line = $file_data ['line'];\n }\n\n // check to see if we can advance the state\n\n if ($sidx >= $len)\n {\n // advance the state\n\n $state [$the_state]['sidx'] = 0;\n $the_state ++;\n\n if ($the_state == 6)\n {\n // bingo we have found a complete define statement\n\n $end_line = $file_data ['line'];\n\n // before aeembly, we need to see if we can handle this data\n \n if ( preg_match( \"/'\\s*.\\s*\\w+\\s*.\\s*'/\", $state[4]['data'], $pattern_match) ) $data_disable = true;\n else $data_disable = false;\n \n // ok assemble an array\n\n $this_define =\n array (\n 'name' => $state [1]['data'],\n 'data' => $state [4]['data'],\n 'start_line' => $start_line,\n 'end_line' => $end_line,\n 'disable' => $data_disable);\n\n // now save this\n\n $defines [$num_defines] = $this_define;\n $num_defines++;\n\n // reset the states\n for ($i = 0; $i < 7; ++$i)\n {\n $state [$i]['sidx'] = 0;\n $state [$i]['data'] = '';\n }\n\n $the_state = 0;\n }\n }\n }\n // ok we are done with the file\n\n fclose ($file_data ['handle']);\n\n /**********************************************/\n $fh = fopen ($this_filename, \"rb\");\n\n $file_data ['handle'] = $fh;\n $file_data ['filename'] = $this_filename;\n $file_data ['line'] = 0;\n $file_data ['eof'] = 0;\n $file_data ['len'] = 0;\n $file_data ['idx'] = 0;\n $file_data ['last'] = 0;\n\n // Create the state table\n\n // read the define portion\n $state [0] = array ( 'string' => \"define(\\\"\",\n 'eatall' => 0,\n 'data' => '',\n 'sidx' => 0);\n\n // save all data upto the apostrophe\n $state [1] = array ( 'string' => \"\\\"\",\n 'eatall' => 1,\n 'data' => '',\n 'sidx' => 0);\n\n // read till the comma\n $state [2] = array ( 'string' => \",\",\n 'eatall' => 0,\n 'data' => '',\n 'sidx' => 0);\n\n // State's 3 and 4 are too complex to anaylze in the normal way\n //\n // In state 3 we will read until we find the first non-whitespace\n //\n // In state 4 we will read and eat until we find an unquoted, unescaped\n // close paren.\n //\n // Then we will determine what to do about the quotes and such\n //\n\n // read till the first non-whitespace\n $state [3] = array ( 'string' => \"\",\n 'eatall' => 0,\n 'data' => '',\n 'sidx' => 0);\n\n // eat until we find a close paren\n $state [4] = array ( 'string' => \"\",\n 'eatall' => 1,\n 'data' => '',\n 'sidx' => 0);\n\n // After state's 3 and 4 we need to find the closing semi colon\n\n // read till the semicolon\n $state [5] = array ( 'string' => \";\",\n 'eatall' => 0,\n 'data' => '',\n 'sidx' => 0);\n\n $the_state = 0;\n //$num_defines = 0;\n\n // keep reading characters till we reach the end of file\n\n while ($file_data ['eof'] == 0)\n {\n // get the next character\n\n getChar ();\n\n $cc = $file_data ['current'];\n $cc1 = $file_data ['last'];\n\n // we ignore white space, unless we are in the eatall states\n\n if (!isset($eatall) && ($cc == ' ' || $cc == '\\t'))\n {\n continue;\n }\n\n $idx = $state [$the_state]['sidx'];\n $schar = substr ($state [$the_state]['string'], $idx, 1);\n $eatall = $state [$the_state]['eatall'];\n \n // a special case when state is 3 and 4\n // in state 3 we read until we find a non-whitespace\n\n if ($the_state == 3)\n {\n if (strcmp ($cc, \" \") &&\n strcmp ($cc, \"\\t\"))\n {\n // ok when we get to a non-white space let's\n // transition to state 4\n\n $state [$the_state]['sidx'] = 0;\n $the_state ++;\n\n $in_quote = 0;\n $quote_type = \"\\\"\";\n $dequoted = 0;\n\n if (!strcmp ($cc, \"'\") ||\n !strcmp ($cc, '\"'))\n {\n $in_quote = 1;\n $quote_type = $cc;\n }\n\n // put this character into the new state data\n\n $state[$the_state]['data'] = $cc;\n }\n\n continue;\n }\n\n // in state 4 we eat until we find an unquoted, unescaped\n // paren\n\n if ($the_state == 4)\n {\n if ($cc == ')' &&\n $cc1 != '\\\\' &&\n $in_quote == 0)\n {\n // we have completed state 4\n // call process_data to determine if we should\n // remove the starting and ending quotes if they\n // exist\n\n $state [$the_state]['data'] = process_data (\n $state [$the_state]['data']);\n\n $state [$the_state]['sidx'] = 0;\n\n $the_state++;\n\n continue;\n }\n\n // ok we need to check our quote status\n\n if ($in_quote == 1 &&\n !strcmp ($cc, $quote_type) &&\n strcmp ($cc1, \"\\\\\")) // make sure not escaped\n {\n // ok we have been dequoted\n\n $dequote = 1;\n $in_quote = 0;\n\n // if we pass an eol, append a newline\n\n if ($file_data ['eol'] == 1)\n $state [$the_state]['data'] .= \"\\n\";\n\n // save the quote\n\n $state [$the_state]['data'] .= $cc;\n\n continue;\n }\n\n // ok are we being quoted\n\n if ($in_quote == 0 &&\n (!strcmp ($cc, '\"') ||\n !strcmp ($cc, \"'\") ||\n !strcmp ($cc, '('))) // consider nonquoted, nonescaped\n // interior parens as quotes\n {\n // ok we are quoted again\n\n $in_quote = 1;\n $quote_type = $cc;\n\n // if we are quoted by parens, change the quote type \n // to be the close paren, to make the if statement\n // easier\n\n if (!strcmp ($cc, '('))\n $quote_type = ')';\n }\n\n // if we pass an eol, append a newline\n\n if ($file_data ['eol'] == 1)\n {\n $state [$the_state]['data'] .= \"\\n\";\n }\n\n // eat the character\n $state [$the_state]['data'] .= $cc;\n continue;\n }\n\n // normal states are here\n\n // eatall == 1, means we eat all characters till the one\n // in we are looking for, otherwise we skip characters till\n // we find the character\n\n if ($eatall == 0)\n {\n // ok we failed to finish the state machine,\n // we will restart the state machine\n\n if (strcmp ($cc, $schar))\n {\n // reset the states\n for ($i = 0; $i < 7; ++$i)\n {\n $state [$i]['sidx'] = 0;\n $state [$i]['data'] = '';\n }\n\n $the_state = 0;\n\n continue;\n }\n }\n else\n {\n if (strcmp ($cc, $schar) ||\n !strcmp ($cc1, '\\\\'))\n {\n // ok we eatall till we find our char\n\n if ($file_data ['eol'] == 1)\n $state [$the_state]['data'] .= \"\\n\";\n $state [$the_state]['data'] .= $cc;\n\n continue;\n }\n }\n\n // ok advance the state\n\n $len = strlen ($state [$the_state]['string']);\n $sidx = $state [$the_state]['sidx'];\n $sidx ++;\n $state [$the_state]['sidx'] = $sidx;\n\n // only use this code on a non eatall\n\n if ($eatall == 0)\n {\n if ($file_data ['eol'] == 1)\n $state [$the_state]['data'] .= \"\\n\";\n $state [$the_state]['data'] .= $cc;\n }\n\n // special case when we find the d in define\n\n if ($the_state == 0 && $sidx == 1)\n {\n // we have found the first character\n //\n // I want to store the starting and ending line numbers\n // so that when we rebuild the file, it will make the\n // assembly much easier.\n //\n\n $start_line = $file_data ['line'];\n }\n\n // check to see if we can advance the state\n\n if ($sidx >= $len)\n {\n // advance the state\n\n $state [$the_state]['sidx'] = 0;\n $the_state ++;\n\n if ($the_state == 6)\n {\n // bingo we have found a complete define statement\n\n $end_line = $file_data ['line'];\n\n // before aeembly, we need to see if we can handle this data\n \n if ( preg_match( \"/'\\s*.\\s*\\w+\\s*.\\s*'/\", $state[4]['data'], $pattern_match) ) $data_disable = true;\n else $data_disable = false;\n \n // ok assemble an array\n\n $this_define =\n array (\n 'name' => $state [1]['data'],\n 'data' => $state [4]['data'],\n 'start_line' => $start_line,\n 'end_line' => $end_line,\n 'disable' => $data_disable);\n\n // now save this\n\n $defines [$num_defines] = $this_define;\n $num_defines++;\n\n // reset the states\n for ($i = 0; $i < 7; ++$i)\n {\n $state [$i]['sidx'] = 0;\n $state [$i]['data'] = '';\n }\n\n $the_state = 0;\n }\n }\n }\n // ok we are done with the file\n\n fclose ($file_data ['handle']);\n /**********************************************/\n\n return $num_defines;\n}", "protected function findIdentifier($file)\n {\n\n $code = file_get_contents($file);\n\n // if we could not open the file tell them\n if ($code === false) {\n throw new ParserException(sprintf('Could not open file %s for type inspection.', $file));\n }\n\n // some variables we will need\n $namespace = '';\n $type = '';\n $stuctureName = '';\n\n // get the tokens and their count\n $tokens = @token_get_all($code);\n $count = count($tokens);\n\n // iterate over the current set of tokens and filter out what we found\n for ($i = 0; $i < $count; $i++) {\n if ($tokens[$i][0] == T_NAMESPACE) {\n // we passed the namespace token, lets collect the name\n for ($j = $i; $j < $count; $j++) {\n if ($tokens[$j][0] === T_STRING) {\n // collect all strings and connect them\n $namespace .= '\\\\' . $tokens[$j][1];\n\n } elseif ($tokens[$j] === '{' || $tokens[$j] === ';') {\n // break if we clearly reached the end of the namespace declaration\n break;\n }\n }\n continue;\n\n } elseif ($i > 1\n && $tokens[$i - 2][0] === T_CLASS\n && $tokens[$i - 1][0] === T_WHITESPACE\n && $tokens[$i][0] === T_STRING\n ) {\n if ($this->findAnnotations($file, array(Aspect::ANNOTATION))) {\n $type = 'aspect';\n\n } else {\n $type = 'class';\n }\n\n $stuctureName = $tokens[$i][1];\n break;\n\n } elseif ($i > 1\n && $tokens[$i - 2][0] === T_TRAIT\n && $tokens[$i - 1][0] === T_WHITESPACE\n && $tokens[$i][0] === T_STRING\n ) {\n $type = 'trait';\n $stuctureName = $tokens[$i][1];\n break;\n\n } elseif ($i > 1\n && $tokens[$i - 2][0] === T_INTERFACE\n && $tokens[$i - 1][0] === T_WHITESPACE\n && $tokens[$i][0] === T_STRING\n ) {\n $type = 'interface';\n $stuctureName = $tokens[$i][1];\n break;\n }\n }\n\n // Check what we got and return it accordingly. We will return an ugly array of the sort\n // array(<STRUCTURE_TYPE>, <STRUCTURE_NAME>).\n if (empty($stuctureName)) {\n return false;\n\n } elseif (empty($namespace)) {\n // We got no namespace, so just use the structure name\n return array($type, $stuctureName);\n\n } else {\n // We got both, so combine it.\n return array($type, ltrim($namespace . '\\\\' . $stuctureName, '\\\\'));\n }\n }", "public function parse()\n {\n $latest_comment = false;\n $in_func = false;\n\n foreach ($this->_tokens as $token) {\n $id = $text = null;\n\n if (is_array($token)) {\n list($id, $text, $line) = $token;\n }\n if (T_WHITESPACE == $id) {\n continue;\n }\n\n if (T_STRING == $id && in_array($text, $this->_functionNames) && !$in_func) {\n $in_func = true;\n $paren_level = -1;\n $args = array();\n $func_name = $text;\n $func_line = $line;\n $func_comment = $latest_comment ? $latest_comment : '';\n\n $just_got_into_func = true;\n $latest_comment = false;\n continue;\n }\n\n if (!$in_func) {\n continue;\n }\n\n if ('(' == $token) {\n $paren_level++;\n\n if (0 == $paren_level) { // start of first argument\n $just_got_into_func = false;\n $current_argument = null;\n $current_argument_is_just_literal = true;\n }\n continue;\n }\n\n if ($just_got_into_func) {\n // there wasn't a opening paren just after the function name -- this means it is not a function\n $in_func = false;\n $just_got_into_func = false;\n }\n\n if (')' == $token) {\n if (0 == $paren_level) {\n $in_func = false;\n $args[] = $current_argument;\n $call = array('name' => $func_name, 'args' => $args, 'line' => $func_line);\n if ($func_comment) {\n $call['comment'] = $func_comment;\n }\n\n $fCall = new FunctionCallMeta($func_name, $args, $func_line, $this->getFilePath());\n $this->add($fCall);\n }\n\n $paren_level--;\n continue;\n }\n\n if (',' == $token && 0 == $paren_level) {\n $args[] = $current_argument;\n $current_argument = null;\n $current_argument_is_just_literal = true;\n continue;\n }\n\n if ((T_CONSTANT_ENCAPSED_STRING == $id || T_LNUMBER == $id || $id == T_DNUMBER || strtolower(\n $text\n ) == 'true' || strtolower($text) == 'false') && $current_argument_is_just_literal\n ) {\n // we can use eval safely, because we are sure $text is just a string literal\n eval('$current_argument = ' . $text . ';');\n continue;\n }\n\n if (strtolower($text) == 'null') {\n $current_argument = 'null';\n $current_argument_is_just_literal = true;\n continue;\n }\n\n $current_argument_is_just_literal = false;\n $current_argument = '{{complex}}';\n }\n }", "function load($input) {\n\t// See what type of input we're talking about\n\t// If it's not a file, assume it's a string\n\tif (!empty($input) && (strpos($input, \"\\n\") === false)\n\t\t&& file_exists($input)) {\n\t\t$yaml = file($input);\n\t} else {\n\t\t$yaml = explode(\"\\n\",$input);\n\t}\n\t// Initiate some objects and values\n\t$base = new YAMLNode (1);\n\t$base->indent = 0;\n\t$this->_lastIndent = 0;\n\t$this->_lastNode = $base->id;\n\t$this->_inBlock = false;\n\t$this->_isInline = false;\n\t$this->_nodeId = 2;\n\n\tforeach ($yaml as $linenum => $line) {\n\t\t$ifchk = trim($line);\n\n\t\t// If the line starts with a tab (instead of a space), throw a fit.\n\t\tif (preg_match('/^(\\t)+(\\w+)/', $line)) {\n\t\t$err = 'ERROR: Line '. ($linenum + 1) .' in your input YAML begins'.\n\t\t\t\t' with a tab. YAML only recognizes spaces. Please reformat.';\n\t\tdie($err);\n\t\t}\n\n\t\tif ($this->_inBlock === false && empty($ifchk)) {\n\t\tcontinue;\n\t\t} elseif ($this->_inBlock == true && empty($ifchk)) {\n\t\t$last =& $this->_allNodes[$this->_lastNode];\n\t\t$last->data[key($last->data)] .= \"\\n\";\n\t\t} elseif ($ifchk{0} != '#' && substr($ifchk,0,3) != '---') {\n\t\t// Create a new node and get its indent\n\t\t$node = new YAMLNode ($this->_nodeId);\n\t\t$this->_nodeId++;\n\n\t\t$node->indent = $this->_getIndent($line);\n\n\t\t// Check where the node lies in the hierarchy\n\t\tif ($this->_lastIndent == $node->indent) {\n\t\t\t// If we're in a block, add the text to the parent's data\n\t\t\tif ($this->_inBlock === true) {\n\t\t\t$parent =& $this->_allNodes[$this->_lastNode];\n\t\t\t$parent->data[key($parent->data)] .= trim($line).$this->_blockEnd;\n\t\t\t} else {\n\t\t\t// The current node's parent is the same as the previous node's\n\t\t\tif (isset($this->_allNodes[$this->_lastNode])) {\n\t\t\t\t$node->parent = $this->_allNodes[$this->_lastNode]->parent;\n\t\t\t}\n\t\t\t}\n\t\t} elseif ($this->_lastIndent < $node->indent) {\n\t\t\tif ($this->_inBlock === true) {\n\t\t\t$parent =& $this->_allNodes[$this->_lastNode];\n\t\t\t$parent->data[key($parent->data)] .= trim($line).$this->_blockEnd;\n\t\t\t} elseif ($this->_inBlock === false) {\n\t\t\t// The current node's parent is the previous node\n\t\t\t$node->parent = $this->_lastNode;\n\n\t\t\t// If the value of the last node's data was > or | we need to\n\t\t\t// start blocking i.e. taking in all lines as a text value until\n\t\t\t// we drop our indent.\n\t\t\t$parent =& $this->_allNodes[$node->parent];\n\t\t\t$this->_allNodes[$node->parent]->children = true;\n\t\t\tif (is_array($parent->data)) {\n\t\t\t\t$chk = '';\n\t\t\t\tif (isset ($parent->data[key($parent->data)]))\n\t\t\t\t\t$chk = $parent->data[key($parent->data)];\n\t\t\t\tif ($chk === '>') {\n\t\t\t\t$this->_inBlock = true;\n\t\t\t\t$this->_blockEnd = ' ';\n\t\t\t\t$parent->data[key($parent->data)] =\n\t\t\t\t\t\tstr_replace('>','',$parent->data[key($parent->data)]);\n\t\t\t\t$parent->data[key($parent->data)] .= trim($line).' ';\n\t\t\t\t$this->_allNodes[$node->parent]->children = false;\n\t\t\t\t$this->_lastIndent = $node->indent;\n\t\t\t\t} elseif ($chk === '|') {\n\t\t\t\t$this->_inBlock = true;\n\t\t\t\t$this->_blockEnd = \"\\n\";\n\t\t\t\t$parent->data[key($parent->data)] =\n\t\t\t\t\t\tstr_replace('|','',$parent->data[key($parent->data)]);\n\t\t\t\t$parent->data[key($parent->data)] .= trim($line).\"\\n\";\n\t\t\t\t$this->_allNodes[$node->parent]->children = false;\n\t\t\t\t$this->_lastIndent = $node->indent;\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t} elseif ($this->_lastIndent > $node->indent) {\n\t\t\t// Any block we had going is dead now\n\t\t\tif ($this->_inBlock === true) {\n\t\t\t$this->_inBlock = false;\n\t\t\tif ($this->_blockEnd = \"\\n\") {\n\t\t\t\t$last =& $this->_allNodes[$this->_lastNode];\n\t\t\t\t$last->data[key($last->data)] =\n\t\t\t\t\ttrim($last->data[key($last->data)]);\n\t\t\t}\n\t\t\t}\n\n\t\t\t// We don't know the parent of the node so we have to find it\n\t\t\t// foreach ($this->_allNodes as $n) {\n\t\t\tforeach ($this->_indentSort[$node->indent] as $n) {\n\t\t\tif ($n->indent == $node->indent) {\n\t\t\t\t$node->parent = $n->parent;\n\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($this->_inBlock === false) {\n\t\t\t// Set these properties with information from our current node\n\t\t\t$this->_lastIndent = $node->indent;\n\t\t\t// Set the last node\n\t\t\t$this->_lastNode = $node->id;\n\t\t\t// Parse the YAML line and return its data\n\t\t\t$node->data = $this->_parseLine($line);\n\t\t\t// Add the node to the master list\n\t\t\t$this->_allNodes[$node->id] = $node;\n\t\t\t// Add a reference to the parent list\n\t\t\t$this->_allParent[intval($node->parent)][] = $node->id;\n\t\t\t// Add a reference to the node in an indent array\n\t\t\t$this->_indentSort[$node->indent][] =& $this->_allNodes[$node->id];\n\t\t\t// Add a reference to the node in a References array if this node\n\t\t\t// has a YAML reference in it.\n\t\t\tif (\n\t\t\t( (is_array($node->data)) &&\n\t\t\t\tisset($node->data[key($node->data)]) &&\n\t\t\t\t(!is_array($node->data[key($node->data)])) )\n\t\t\t&&\n\t\t\t( (preg_match('/^&([^ ]+)/',$node->data[key($node->data)]))\n\t\t\t\t||\n\t\t\t\t(preg_match('/^\\*([^ ]+)/',$node->data[key($node->data)])) )\n\t\t\t) {\n\t\t\t\t$this->_haveRefs[] =& $this->_allNodes[$node->id];\n\t\t\t} elseif (\n\t\t\t( (is_array($node->data)) &&\n\t\t\t\tisset($node->data[key($node->data)]) &&\n\t\t\t\t(is_array($node->data[key($node->data)])) )\n\t\t\t) {\n\t\t\t// Incomplete reference making code. Ugly, needs cleaned up.\n\t\t\tforeach ($node->data[key($node->data)] as $d) {\n\t\t\t\tif ( !is_array($d) &&\n\t\t\t\t( (preg_match('/^&([^ ]+)/',$d))\n\t\t\t\t\t||\n\t\t\t\t\t(preg_match('/^\\*([^ ]+)/',$d)) )\n\t\t\t\t) {\n\t\t\t\t\t$this->_haveRefs[] =& $this->_allNodes[$node->id];\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t}\n\t}\n\tunset($node);\n\n\t// Here we travel through node-space and pick out references (& and *)\n\t$this->_linkReferences();\n\n\t// Build the PHP array out of node-space\n\t$trunk = $this->_buildArray();\n\treturn $trunk;\n\t}" ]
[ "0.64947814", "0.6165132", "0.59894264", "0.59831554", "0.59117085", "0.5755105", "0.5579643", "0.5512406", "0.5478728", "0.5472912", "0.5437964", "0.5394494", "0.5394494", "0.5348277", "0.5317204", "0.52958345", "0.5268488", "0.52516586", "0.5250226", "0.52483153", "0.5243938", "0.5241535", "0.5228378", "0.52271", "0.52246416", "0.5192747", "0.5189459", "0.5176012", "0.5172475", "0.51513284", "0.51082253", "0.5093256", "0.5073735", "0.5045551", "0.50251526", "0.5019229", "0.5013572", "0.5008593", "0.49671447", "0.4967128", "0.4961571", "0.49614316", "0.49613336", "0.4937996", "0.49277896", "0.49242583", "0.49134016", "0.49080193", "0.4899678", "0.4897497", "0.48898953", "0.48846498", "0.48846498", "0.48846498", "0.4870993", "0.48624173", "0.48600227", "0.48560652", "0.483472", "0.48283103", "0.48276445", "0.48273298", "0.48265687", "0.48238575", "0.48154217", "0.48084253", "0.47976497", "0.47955248", "0.4795008", "0.47878045", "0.47851872", "0.47805235", "0.47781304", "0.47778353", "0.47743776", "0.47720385", "0.47649133", "0.47553077", "0.4749762", "0.4732737", "0.4730838", "0.47286353", "0.4721403", "0.47196427", "0.47142613", "0.46922827", "0.4677804", "0.46666342", "0.4660854", "0.46551266", "0.46471003", "0.4639892", "0.46319085", "0.46315372", "0.4622774", "0.46222192", "0.46193832", "0.4611219", "0.46100554", "0.4609998", "0.4609385" ]
0.0
-1
Returns the variables that in the "use" clause of the closure definition. These are referred to as the "used variables", "static variables", or "closed upon variables", "context" of the closure.
private function determineVariables(ClosureAst $closureAst, \ReflectionFunction $reflection) { // Get the variable names defined in the AST $varNames = array_map(function ($varNode) { return $varNode->var; }, $closureAst->uses); // Get the variable names and values using reflection $varValues = $reflection->getStaticVariables(); // Combine the names and values to create the canonical set of variables $vars = array(); foreach ($varNames as $name) { if (isset($varValues[$name])) { $vars[$name] = $varValues[$name]; } } return $vars; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStaticVariables() {\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n return $this->reflectionSource->getStaticVariables();\n } else {\n return parent::getStaticVariables();\n }\n }", "public function getVars()\n {\n return $this->_variables;\n }", "public function &getVars()\n\t{\n\t\treturn $this->_vars;\n\t}", "protected function context() {\n return ArrayHelper::filter($GLOBALS, $this->logVars);\n }", "public function getVars()\n\t{\n\t\treturn $this->vars;\n\t}", "public function getAssignedVars()\n {\n return $this->_vars;\n }", "public function getVariables() {\n\t\treturn $this->variables;\n\t}", "public function vars()\n\t{\n\t\treturn $this->vars;\n\t}", "public function getVariables()\n {\n return $this->variables;\n }", "public function getVariables()\n {\n return $this->variables;\n }", "public function getVariables()\n {\n return $this->variables;\n }", "public function getVars() {\n\t\treturn $this->vars;\n\t}", "public function getVars() {\n\t\treturn $this->vars;\n\t}", "public function getVars() {\r\n return $this->VARS;\r\n }", "public function getGlobals()\n {\n return [\n 'cache' => $this->flextype['cache'],\n ];\n }", "public function &getVars() {\n return $this->app->getVars();\n }", "public function getVariables()\n {\n \treturn isset($this->all['variables']) ? $this->all['variables'] : array();\n }", "public function getVars()\n {\n return $this->vars;\n }", "public function getVars()\n {\n return $this->vars;\n }", "public function getVars()\n {\n return $this->vars;\n }", "public function getBoundVariables() {}", "public function getGlobals()\n {\n return self::$globalsCache;\n }", "private function _getVariableStore()\n {\n return $this->_vars;\n }", "protected function getVars()\n {\n if (!$this->vars) {\n $this->loadVarsByObjectType();\n }\n\n return $this->vars;\n }", "public function getVars() {\n return array();\n }", "public function vars()\n {\n return $this->vars;\n }", "public function getVariables()\n {\n preg_match_all('/\\$\\{(.*?)}/i', $this->_documentXML, $matches);\n return $matches[1];\n }", "function getVars() {\n return $this->vars;\n }", "public function getUseStatements() {\n\n\t\tif ($this->useStatements === null) {\n\t\t\t$this->useStatements = $this->parse($this->class->getFileName());\n\t\t}\n\n\t\treturn $this->useStatements;\n\t}", "public function getUseStatements()\n {\n $this->parse();\n\n return $this->useStatements;\n }", "protected function getLocalVars() {\r\n\t\treturn [\r\n\t\t\t'model' => & $this->model,\r\n\t\t\t'log' => & $this->log,\r\n\t\t];\r\n\t}", "public function variables() : Variables {\n return $this->_variables;\n }", "public function vars()\n {\n $v = &$this->vars;\n return $v;\n }", "public function getVars()\r\n {\r\n return $this->_smarty->getTemplateVars();\r\n }", "public function getVars()\n\t{\n\t\treturn $this->requestVars;\n\t}", "public function getVariablesList() {\n return $this->_get(4);\n }", "public function getVariablesList() {\n return $this->_get(2);\n }", "function _getJavascriptVar() {\r\n return $this->_name . \"_ctx\";\r\n }", "public static function getVars()\n {\n if (is_null(static::$vars)) {\n static::$vars = static::buildRepository(true);\n }\n\n return static::$vars;\n }", "protected function _scope()\n\t{\n\t\treturn $this->_meta['scope'];\n\t}", "public function getVars()\n {\n return [\n 'get' => $this->get,\n 'session' => $this->session,\n ];\n }", "public function getVariables()\n {\n $variables = $this->getVariablesForPart($this->tempDocumentMainPart);\n\n foreach ($this->tempDocumentHeaders as $headerXML) {\n $variables = array_merge($variables, $this->getVariablesForPart($headerXML));\n }\n\n foreach ($this->tempDocumentFooters as $footerXML) {\n $variables = array_merge($variables, $this->getVariablesForPart($footerXML));\n }\n\n return array_unique($variables);\n }", "function get_assigned_variables() {\n\n $assigns = array();\n $protected = get_class_vars(get_class($this));\n\n foreach (get_object_vars($this) as $var => $value) {\n if (!array_key_exists($var, $protected)) {\n $assigns[$var] =& $this->$var;\n }\n }\n\n $assigns['controller'] = $this;\n\n return $assigns;\n }", "protected function variables()\n {\n $this->variables['grid'] = $this;\n\n return $this->variables;\n }", "public function getVars() : array {\n\n\t\t\treturn $this->variables;\n\t\t}", "public function getJavascriptVars()\n\t{\n\t\treturn $this->js_vars;\n\t}", "public function get_count_variables() {\r\n\t\treturn array( $this->where, $this->values );\r\n\t}", "public function getGlobals();", "public function getGlobals();", "public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }", "protected function getReactVariables()\n {\n $variables = [\n 'module' => $this->getModuleName(),\n ];\n\n return $variables;\n }", "public function getVars()\n {\n return $this->_contents;\n }", "public function varsNames()\n {\n return $this->varsNames;\n }", "public function getVariables ()\n {\n /**\n * Specification:\n * - itemkey used to identify variable in your other functions\n * - type text, textarea, yesno, password, hidden (type hidden are variables used by CE and are required)\n * - description description of the variable, displayed in ClientExec\n * - encryptable used to indicate the variable's value must be encrypted in the database\n */\n $variables = array(\n lang('Name') => array(\n 'type' => 'hidden',\n 'description' => lang('Used by ClientExec to display plugin. It must match the action function name(s).'),\n 'value' => 'InterWorx-CP'\n ),\n lang('Description') => array (\n 'type' => 'hidden',\n 'description' => lang('Description viewable by admin in server settings'),\n 'value' => lang('InterWorx-CP integration.')\n ),\n lang('Access Key') => array (\n 'type' => 'textarea',\n 'description' => lang('Access key used to authenticate to server.'),\n 'value' => '',\n 'encryptable' => true\n ),\n lang('Actions') => array (\n 'type' => 'hidden',\n 'description' => lang('Actions currently available for this plugin.'),\n 'value' => 'Create,Delete,Suspend,UnSuspend'\n )\n );\n\n return $variables;\n }", "private function parseUseStatements() {\n\n\t\t$statements = array();\n\t\twhile (($token = $this->next())) {\n\t\t\tif ($token[0] === T_USE) {\n\t\t\t\t$statements = array_merge($statements, $this->parseUseStatement());\n\t\t\t\tcontinue;\n\t\t\t} else if ($token[0] !== T_NAMESPACE || $this->parseNamespace() != $this->class->getNamespaceName()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get fresh array for new namespace. This is to prevent the parser to collect the use statements\n\t\t\t// for a previous namespace with the same name. This is the case if a namespace is defined twice\n\t\t\t// or if a namespace with the same name is commented out.\n\t\t\t$statements = array();\n\t\t}\n\n\t\treturn $statements;\n\t}", "function getBindVariableName() ;", "public function getGetVariables();", "public function getVars(){\n return $this->getClassVars()->getValues();\n }", "public function GetVariables()\n {\n $variables = '';\n if(count($this->variables)) {\n $vlist = array();\n foreach($this->variables as $name => $value) {\n $var = $name;\n if(is_array($value)) {\n if(isset($value[0]) && isset($value[count($value)-1])) {\n $var .= '=[' . implode(',', $value) . ']';\n } else {\n $vs = array();\n foreach($value as $k => $v)\n if($k)\n $vs[] = \"$k:$v\";\n\n $var .= '={' . implode(',', $vs) . '}';\n }\n } elseif(!is_null($value)) {\n $var .= \"=$value\";\n }\n $vlist[] = $var;\n }\n $variables = \"var \" . implode(', ', $vlist) . \";\";\n }\n // comments can be stuck with the variables\n if(count($this->comments)) {\n foreach($this->comments as $c) {\n if(!is_string($c))\n $c = print_r($c, TRUE);\n $variables .= \"\\n// \" . str_replace(\"\\n\", \"\\n// \", $c);\n }\n }\n return $variables;\n }", "public function getGetVariables() {}", "public function getGlobals()\n {\n }", "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}", "public function get_var() {\r\n\t\treturn $this->header_vars;\r\n\t}", "public function getTemplateVariables()\n {\n return self::$templateVariables;\n }", "public function getGlobals() {\r\n\t\treturn [\r\n 'REQUEST' => [\r\n\t\t\t\t'url' => Response::$url\r\n\t\t\t],\r\n 'SESSION' => (isset($_SESSION)) ? $_SESSION : [],\r\n 'SERVER' => $_SERVER,\r\n 'INPUT' => App::$input,\r\n 'ENV' => App::$env\r\n ];\r\n }", "function getPackageVariables(): array\n {\n return $this->compiler->getPackageVariables();\n }", "public function getUsedByVariance()\n\t{\n\t\treturn $this->usedByVariance;\n\t}", "public function getBindVariableName() {}", "function getVariableContainer() ;", "public function context()\n {\n return $this->setRightOperand(PVar::CONTEXT);\n }", "function &GetTemplateVars($name=null)\n {\n return $this->_smarty->get_template_vars($name);\n }", "public function variables(): array;", "public function variables(): array;", "public function getGlobals()\n {\n return [\n 'snippets' => new SnippetsTwig($this->flextype)\n ];\n }", "public function getReqVars()\n\t{\n\t\treturn $this->_requestVars;\n\t}", "public static function get($_name) {\n\t\tif (!$_name) {\n\t\t\ttrigger_error(self::TEXT_Variable);\n\t\t\treturn array(FALSE,NULL);\n\t\t}\n\t\t$_name=self::resolve($_name);\n\t\t$_hash='var.'.self::hashCode(self::remix($_name));\n\t\t$_cached=Cache::cached($_hash);\n\t\tif ($_cached)\n\t\t\treturn unserialize(gzinflate(Cache::fetch($_hash)));\n\t\tif (preg_match('/^('.self::PHP_Globals.')\\b/',$_name,$_match)) {\n\t\t\t// Synchronize PHP and framework globals\n\t\t\tif (substr($_name,0,7)=='SESSION' && !strlen(session_id()))\n\t\t\t\tsession_start();\n\t\t\tself::$global[$_match[1]]=&$GLOBALS['_'.$_match[1]];\n\t\t}\n\t\treturn self::ref($_name);\n\t}", "function getExtraVars()\n\t{\n\t\treturn $this->keys;\n\t}", "public function getUsedNamespaces();", "public function getUse() {\n if (isset($this->use)) {\n return $this->use;\n } else return $this->getDefaultUse();\n }", "public function getGlobals()\n {\n if (!$this->runtimeInitialized && !$this->extensionInitialized) {\n return $this->initGlobals();\n }\n if (null === $this->globals) {\n $this->globals = $this->initGlobals();\n }\n return $this->globals;\n }", "public function getGlobals()\n\t{\n\t\treturn array(\n\t\t\t'uri' => $this->app->get('uri'),\n\t\t\t'uri.base.path' => $this->app->get('uri.base.path')\n\t\t);\n\t}", "protected function getSchemaVars() {\n\t\tif ( $this->mSchemaVars ) {\n\t\t\treturn $this->mSchemaVars;\n\t\t} else {\n\t\t\treturn $this->getDefaultSchemaVars();\n\t\t}\n\t}", "public function getClassVars(){\n if ($this->_classVars instanceof Vars) {\n return $this->_classVars;\n }\n\n $this->_setClassVars();\n return $this->_classVars;\n }", "public function getBindVariableName();", "public function getGlobals()\n {\n return array();\n }", "public function getGlobals()\n {\n return array();\n }", "public function getUse()\n {\n return $this->use;\n }", "public function getUse()\n {\n return $this->use;\n }", "public static function getRequestVars() {\n return self::$_request_vars;\n }", "public function getProblematicVars() {\n\t\t$names = array();\n\t\tforeach ($this->_vars as $key => $var) {\n\t\t\tif ($var->required && ($var->isDefined() === false)) {\n\t\t\t\t$names[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $names;\n\t}", "public function getVarNames() {\n\t\treturn array_keys($this->_vars);\n\t}", "final public function GetVariableName() { return $this->varName; }", "final public function GetVariableName() { return $this->varName; }", "static public function getScope()\r\n {\r\n return self::$_scope;\r\n }", "function globals_count()\n {\n return count($this->mGlobalAssignArray);\n }", "protected function getVars()\n {\n return array_merge(parent::getVars(),get_object_vars($this));\n }", "public function getItemVarSetVars()\n {\n return $this->item_var_set_vars;\n }", "public function getClosureParams() : array {\n return $this->closureParams;\n }", "public function getCapturedVariables() /*: Vector<IVariable>*/ {\n if ($this->capturedVariables === null) {\n $this->capturedVariables = Vector {};\n }\n return $this->capturedVariables;\n }", "public function getVariableContainer() {}" ]
[ "0.6252688", "0.6148432", "0.6132887", "0.6088516", "0.5998841", "0.59978366", "0.59801424", "0.59461564", "0.5943696", "0.5943696", "0.5943696", "0.59240055", "0.59240055", "0.59207034", "0.5894506", "0.5881555", "0.583649", "0.5824974", "0.5806611", "0.5806611", "0.5745272", "0.5742244", "0.57410693", "0.5734056", "0.57258654", "0.5722669", "0.5707049", "0.5704682", "0.5695166", "0.56797016", "0.5668989", "0.5656308", "0.5629552", "0.56103325", "0.560611", "0.5582067", "0.55809027", "0.55751276", "0.5574883", "0.5539848", "0.5534028", "0.55085033", "0.5502054", "0.54792523", "0.5468671", "0.5464063", "0.5452786", "0.5447041", "0.5447041", "0.54289967", "0.5427401", "0.5422445", "0.54183716", "0.5409529", "0.5407464", "0.5394586", "0.53863144", "0.53765833", "0.53754544", "0.5367321", "0.5338137", "0.53292966", "0.5318495", "0.53175133", "0.5313877", "0.5300321", "0.5263742", "0.52472544", "0.52451843", "0.52344", "0.5227882", "0.5212026", "0.5212026", "0.51869106", "0.51844835", "0.5180023", "0.5175078", "0.5172447", "0.51641405", "0.5161001", "0.51587266", "0.5146165", "0.5134703", "0.5125187", "0.5120684", "0.5120684", "0.51202136", "0.51202136", "0.5111394", "0.510924", "0.5107851", "0.51055247", "0.51055247", "0.51043105", "0.5090762", "0.50875026", "0.50742227", "0.5057315", "0.505443", "0.50459015" ]
0.59997725
4
Converts a byte number into a human readable format Examples: ```php echo Conversions::bytesToHuman(100); // Outputs: "100B" echo Conversions::bytesToHuman(1024); // Outputs: "1KB" echo Conversions::bytesToHuman(1050); // Outputs: "1.02KB" ```
public static function bytesToHuman($bytes, $decimals = 2) { $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(self::KILOBYTE)); $pow = min($pow, count(self::$byte_units) - 1); $bytes /= pow(self::KILOBYTE, $pow); return self::numberFormat($bytes, $decimals) . self::$byte_units[$pow]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bytes_to_human($bytes)\n {\n $base = log($bytes) / log(1024);\n\n $suffix = ['', 'KB', 'MB', 'GB', 'TB'];\n\n $f_base = floor($base);\n\n return round(pow(1024, $base - floor($base)), 1).$suffix[$f_base];\n }", "public function bytesToHuman($bytes, $precision = 2)\n {\n $units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n $bytes = max($bytes, 0);\n $pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n $pow = min($pow, count($units) - 1);\n $bytes /= (1 << (10 * $pow));\n return round($bytes, $precision) . ' ' . $units[$pow];\n }", "function number_to_human_size($bytes){\n\t$border = 1024 * 1.5;\n\tif ($bytes < $border)\n\t\treturn sprintf('%u Byte', $bytes);\n\t\n\t$bytes /= 1024;\n\tif ($bytes < $border)\n\t\treturn sprintf('%u KiByte', $bytes);\n\t\n\t$bytes /= 1024;\n\treturn sprintf('%.1f MiByte', $bytes);\n}", "function bytesToHumanReadable (int $size, int $decimals = 2): string {\n\tif ($size >= 1 << 40)\n\t\treturn number_format($size / (1 << 40), $decimals).\"TB\";\n\tif ($size >= 1 << 30)\n\t\treturn number_format($size / (1 << 30), $decimals).\"GB\";\n\tif ($size >= 1 << 20)\n\t\treturn number_format($size / (1 << 20), $decimals).\"MB\";\n\tif ($size >= 1 << 10)\n\t\treturn number_format($size / (1 << 10), $decimals).\"KB\";\n\treturn number_format($size, $decimals).\"B\";\n}", "function readable_bytes($bytes) {\n\t$units = array(\"B\", \"KiB\", \"MiB\", \"GiB\");\n\tfor ($i = (count($units) - 1) * 10; $i >= 0; $i -= 10) {\n\t\tif (!$i || $bytes >> $i) {\n\t\t\treturn round($bytes / (1 << $i), 2).\" \".$units[$i/10];\n\t\t}\n\t}\n}", "function formatBytes($bytes) {\n\t\tif ($bytes < 1024) return $bytes.' B';\n\t\telseif ($bytes < 1048576) return round($bytes / 1024, 2).' KB';\n\t\telseif ($bytes < 1073741824) return round($bytes / 1048576, 2).' MB';\n\t\telseif ($bytes < 1099511627776) return round($bytes / 1073741824, 2).' GB';\n\t\telse return round($bytes / 1099511627776, 2).' TB';\n\t}", "public static function byte($bytes)\n {\n $kb = 1024;\n $mb = $kb * 1024;\n $gb = $mb * 1024;\n $tb = $gb * 1024;\n\n if(($bytes >= 0) && ($bytes < $kb))\n return $bytes . ' B';\n elseif(($bytes >= $kb) && ($bytes < $mb))\n return round($bytes / $kb) . ' KB';\n elseif(($bytes >= $mb) && ($bytes < $gb))\n return round($bytes / $mb) . ' MB';\n elseif(($bytes >= $gb) && ($bytes < $tb))\n return round($bytes / $gb) . ' GB';\n elseif($bytes >= $tb)\n return round($bytes / $tb) . ' TB';\n else\n return $bytes . ' B';\n }", "protected function readableBytesString($bytes)\n\t{\n\t\t$kb = 1024;\n\t\t$mb = $kb * $kb;\n\t\t$gb = $kb * $mb;\n\t\t$tb = $kb * $gb;\n\t\tif ($bytes < $kb) {\n\t\t\treturn $bytes . 'B';\n\t\t} else if ($bytes < $mb) {\n\t\t\treturn round($bytes / $kb, 1) . 'KB';\n\t\t} else if ($bytes < $gb) {\n\t\t\treturn round($bytes / $mb, 1) . 'MB';\n\t\t} else if ($bytes < $tb) {\n\t\t\treturn round($bytes / $gb, 1) . 'GB';\n\t\t} else {\n\t\t\treturn round($bytes / $tb, 1) . 'TB';\n\t\t}\n\t}", "function humanize_filesize($bytes, $dec = 2)\n{\n $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n $factor = floor((strlen($bytes) - 1) / 3);\n\n return sprintf(\"%.{$dec}f\", $bytes / pow(1024, $factor)) . @$size[$factor];\n}", "function human_filesize($bytes, $decimals = 2, $decimalSeparator = null, $thousandSeparator = null)\n{\n $decimalSeparator = $decimalSeparator ?? (localeconv()['decimal_point'] ?? '.');\n $thousandSeparator = $thousandSeparator ?? (localeconv()['thousands_sep'] ?? ',');\n $size = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n $factor = min(floor((strlen($bytes) - 1) / 3), count($size) - 1);\n return number_format($bytes / pow(1024, $factor), $decimals, $decimalSeparator, $thousandSeparator) . $size[$factor];\n}", "function format_bytes($a_bytes) {\n if ($a_bytes < 1024) {\n return $a_bytes .' B';\n } elseif ($a_bytes < 1048576) {\n return round($a_bytes / 1024, 2) .' Kb';\n } elseif ($a_bytes < 1073741824) {\n return round($a_bytes / 1048576, 2) . ' Mb';\n } elseif ($a_bytes < 1099511627776) {\n return round($a_bytes / 1073741824, 2) . ' Gb';\n } elseif ($a_bytes < 1125899906842624) {\n return round($a_bytes / 1099511627776, 2) .' Tb';\n } elseif ($a_bytes < 1152921504606846976) {\n return round($a_bytes / 1125899906842624, 2) .' Pb';\n } elseif ($a_bytes < 1180591620717411303424) {\n return round($a_bytes / 1152921504606846976, 2) .' Eb';\n } elseif ($a_bytes < 1208925819614629174706176) {\n return round($a_bytes / 1180591620717411303424, 2) .' Zb';\n } else {\n return round($a_bytes / 1208925819614629174706176, 2) .' Yb';\n }\n}", "function convertToNotation(int $bytes) {\n\n\t$units = array('B', 'KB', 'MB', 'GB', 'TB'); \n\n\t$bytes = max($bytes, 0); \n\t$pow = floor(($bytes ? log($bytes) : 0) / log(1024)); \n\t$pow = min($pow, count($units) - 1);\n\t$bytes /= pow(1024, $pow);\n\n return round($bytes, 2).$units[$pow]; \n\n}", "function bytes_to_human_size($size, $decimals = 1)\n {\n $suffix = array('Bytes','KB','MB','GB','TB','PB','EB','ZB','YB','NB','DB');\n $i = 0;\n\n while ($size >= 1024 && ($i < count($suffix) - 1)) {\n $size /= 1024;\n $i++;\n }\n\n return round($size, $decimals) . ' ' . $suffix[$i];\n }", "function human_filesize($bytes, $decimals = 0)\n{\n $size = ['B','KB','MB','GB','TB','PB','EB','ZB','YB'];\n $factor = floor((strlen($bytes) - 1) / 3);\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)) . @$size[$factor];\n}", "function sizeForHumans ($bytes, $decimals = 2)\n {\n $size = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n $factor = floor((strlen($bytes) - 1) / 3);\n\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)) . @$size[$factor];\n }", "function human_filesize($bytes, $decimals = 2)\n {\n $size = trans('file.size');\n $factor = floor((strlen($bytes) - 1) / 3);\n\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)).@$size[$factor];\n }", "private function convert_bytes($byte) {\r\n $bz = array(\" B\", \" kB\", \" MB\", \" GB\", \" TB\");\r\n $count = 0;\r\n while ($byte > 1024) {\r\n $byte /= 1024;\r\n $count++;\r\n }\r\n return number_format($byte, 2, ',', '.') . $bz[$count];\r\n }", "function bytes($bytes) {\n\n $symbol = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n $exp = 0;\n $value = 0;\n\n if ($bytes) {\n $exp = floor(log($bytes) / log(1024));\n $value = ($bytes / pow(1024, floor($exp)));\n }\n\n return sprintf('%.2f ' . $symbol[$exp], $value);\n}", "function human_to_bytes($str)\n {\n $str = trim($str);\n\n $num = (float) $str;\n\n if (strtoupper(substr($str, -1)) == 'B') {\n $str = substr($str, 0, -1);\n }\n\n switch (strtoupper(substr($str, -1))) {\n case 'P':\n $num *= 1024;\n case 'T':\n $num *= 1024;\n case 'G':\n $num *= 1024;\n case 'M':\n $num *= 1024;\n case 'K':\n $num *= 1024;\n }\n\n return $num;\n }", "function show_bytes($bytes)\n{\n if ($bytes > 1073741824)\n {\n $gb = $bytes/1073741824;\n $str = sprintf($gb>=10 ? \"%d \" : \"%.1f \", $gb) . crystal_label('GB');\n }\n else if ($bytes > 1048576)\n {\n $mb = $bytes/1048576;\n $str = sprintf($mb>=10 ? \"%d \" : \"%.1f \", $mb) . crystal_label('MB');\n }\n else if ($bytes > 1024)\n $str = sprintf(\"%d \", round($bytes/1024)) . crystal_label('KB');\n else\n $str = sprintf('%d ', $bytes) . crystal_label('B');\n\n return $str;\n}", "public function format_bytes($bytes) {\n if ($bytes < 1024) {\n return $bytes .' B';\n } elseif ($bytes < 1048576) {\n return round($bytes / 1024, 2) .' KiB';\n } elseif ($bytes < 1073741824) {\n return round($bytes / 1048576, 2) . ' MiB';\n } elseif ($bytes < 1099511627776) {\n return round($bytes / 1073741824, 2) . ' GiB';\n } elseif ($bytes < 1125899906842624) {\n return round($bytes / 1099511627776, 2) .' TiB';\n } elseif ($bytes < 1152921504606846976) {\n return round($bytes / 1125899906842624, 2) .' PiB';\n } elseif ($bytes < 1180591620717411303424) {\n return round($bytes / 1152921504606846976, 2) .' EiB';\n } elseif ($bytes < 1208925819614629174706176) {\n return round($bytes / 1180591620717411303424, 2) .' ZiB';\n } else {\n return round($bytes / 1208925819614629174706176, 2) .' YiB';\n }\n }", "public static function bytesToString($bytes) {\n $bytes = intval($bytes);\n if ($bytes < 1024) {\n return $bytes .' b';\n }\n\n $kb = $bytes / 1024;\n if ($kb <= 1024) return number_format($kb, 0) .' kb';\n\n $mb = $kb / 1024;\n if ($mb <= 1024) return number_format($mb, 1) .' MB';\n\n $gb = $mb / 1024;\n return number_format($gb, 2) .' GB';\n }", "private function bytesToString(int $bytes): string\n {\n $units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];\n\n if ($bytes === 0) {\n return '0 B';\n }\n\n $index = min(count($units) -1, floor(log($bytes, 1024)));\n $size = round($bytes / pow(1024, $index), 2);\n\n return $size . ' ' . $units[$index];\n }", "static public function int_b2h($bytes) {\n\t\tif ( $bytes < ( 1 << 10 ) ) return $bytes . ' B';\n\t\tif ( $bytes < ( 1 << 20 ) ) return self::int_b2k( $bytes ) . ' KiB';\n\t\tif ( $bytes < ( 1 << 30 ) ) return self::int_b2m( $bytes ) . ' MiB';\n\t\treturn self::int_b2g( $bytes ) . ' GiB';\n\t}", "function human_filesize($bytes, $decimals = 2) {\n $sz = 'BKMGTP';\n $factor = floor((strlen($bytes) - 1) / 3);\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)) . @$sz[$factor];\n}", "protected function _formatHumanFileSize($iBytes) {\n $sz = 'BKMGTP';\n $factor = floor((strlen($iBytes) - 1) / 3);\n return str_replace(array('B', 'K', 'M', 'G', 'T', 'P'), array('Byte', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb'), sprintf(\"%.2f\", $iBytes / pow(1024, $factor)).' '.@$sz[intval($factor)]);\n }", "private static function toFormattedBytes(int $bytes) : string\n {\n $precision = 2;\n $base = log($bytes, 1024);\n $suffixes = array('', 'K', 'M', 'G', 'T');\n\n return round(1024 ** ($base - floor($base)), $precision) . $suffixes[floor($base)];\n }", "function byteSize($bytes){\n $size = $bytes / 1024;\n if($size < 1024){\n $size = number_format($size, 2);\n $size .= ' KB';\n }else{\n if($size / 1024 < 1024){\n $size = number_format($size / 1024, 2);\n $size .= ' MB';\n }else \n \tif ($size / 1024 / 1024 < 1024){\n \t$size = number_format($size / 1024 / 1024, 2);\n \t$size .= ' GB';\n }else\n \tif ($size / 1024 / 1024 / 1024 < 1024){\n \t$size = number_format($size / 1024 / 1024 / 1024, 2);\n \t$size .= ' TB';\n \t} \n }\n return $size;\n}", "function humanReadableToBytes (string $size): int {\n\t$unitIndex = 0;\n\n\t$chars = str_split($size);\n\t$charsLen = count($chars);\n\n\t$multipliers =\n\t\t[\n\t\t\t'B' => 1,\n\t\t\t'KB' => 1 << 10,\n\t\t\t'MB' => 1 << 20,\n\t\t\t'GB' => 1 << 30,\n\t\t\t'TB' => 1 << 40\n\t\t];\n\n\tfor ($i = 0; $i < $charsLen; $i++) {\n\t\tif (!is_numeric($size[$i]) and $size[$i] != '.') {\n\t\t\t$unitIndex = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$sizeN = floatval(substr($size, 0, $unitIndex));\n\t$sizeU = substr($size, $unitIndex, $charsLen - $unitIndex);\n\n\treturn round($sizeN * $multipliers[$sizeU]);\n}", "function formatBytes( $bytes, $precision = 2 )\n{\n $units = array('b', 'Kb', 'Mb', 'Gb', 'Tb');\n $bytes = max($bytes, 0);\n $pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n $pow = min($pow, count($units) - 1);\n $bytes /= pow(1024, $pow);\n return round($bytes, $precision) . ' ' . $units[$pow];\n}", "function format_bytes($bytes, $round=1) {\n\tswitch($bytes) {\n\t\tcase $bytes < 1024:\n\t\t\treturn $bytes .' B';\n\t\tbreak;\n\t\tcase $bytes < 1048576:\n\t\t\t return round($bytes / 1024, $round) .' KB';\n\t\tbreak;\n\t\tcase $bytes < 1073741824:\n\t\t\treturn round($bytes / 1048576, $round) . ' MB';\n\t\tbreak;\t\t\n\t}\n}", "protected function formatBytes($bytes)\n {\n if ((int)$bytes < 1) {\n return '';\n }\n\n $units = ['B', 'K', 'M', 'G']; // G since PHP 5.1.x so we are good!\n\n $bytes = (int)$bytes;\n $base = log($bytes) / log(1000);\n $pow = pow(1000, $base - floor($base));\n\n return round($pow, 0) . $units[(int)floor($base)];\n }", "function convertMegaBytes($bytes) {\n return number_format($bytes / 1048576, 2);\n}", "function large_images_human_filesize($bytes, $decimals = 2) {\n $sz = 'BKMGTP';\n $factor = floor((strlen($bytes) - 1) / 3);\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)) . @$sz[$factor];\n}", "function byteSizeConvert($size){\n $unit=array('b','kb','mb','gb','tb','pb');\n return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];\n}", "protected function formatBytes($bytes)\n {\n $size = (integer) $bytes;\n\n if ( ! $this->useFormatting) {\n return $size;\n }\n\n $units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n\n return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2) . ' ' . $units[$i];\n }", "function formatBytes($bytes, $precision = 2) { \n $units = array('B', 'KB', 'MB', 'GB', 'TB'); \n $bytes = max($bytes, 0); \n $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); \n $pow = min($pow, count($units) - 1); \n $bytes /= pow(1024, $pow); \n return round($bytes, $precision) . ' ' . $units[$pow]; \n }", "public static function displayBytes($bytes,$precision = 2,$units = 'AUTO') \r\n {\r\n $byte_str = '0B';\r\n if(is_numeric($bytes) and $bytes > 0) {\r\n $base = log($bytes)/log(1024);\r\n //NB: position in array is vital\r\n $units_arr = array('B', 'KB', 'MB', 'GB', 'TB','PB'); \r\n \r\n if($units === 'AUTO') {\r\n $byte_str = round(pow(1024,$base-floor($base)),$precision).$units_arr[floor($base)]; \r\n } else {\r\n if(!in_array($units,$units_arr)) $units = 'MB';\r\n $key = array_search($units,$units_arr);\r\n $div = pow(1024,$key);\r\n $byte_str = round($bytes/$div,$precision).$units;\r\n } \r\n }\r\n return $byte_str;\r\n }", "protected function formatBytes($bytes){\n\t\t$return = '';\n\t\tif( $bytes < 1024 ){ $return = sprintf('%.2f',$bytes).' B'; }\n\t\telseif( $bytes < 1024*1000 ){ $return = sprintf('%.2f',$bytes/1024).' KB'; }\n\t\telseif( $bytes < 1024*1000*1000 ){ $return = sprintf('%.2f',$bytes/1024/1024).' MB'; }\n\t\telseif( $bytes < 1024*1000*1000*1000 ){ $return = sprintf('%.2f',$bytes/1024/1024/1024).' GB'; }\n\t\telseif( $bytes < 1024*1000*1000*1000*1000 ){ $return = sprintf('%.2f',$bytes/1024/1024/1024/1024).' TB'; }\n\n\t\treturn str_pad($return,15,' ', STR_PAD_LEFT);\n\t}", "function getHumanSize($precision=1)\n {\n $bytes = $this->getSize();\n if ($bytes>1048576) {\n return round($bytes/1048576,$precision).'MB';\n } elseif ($bytes>1024) {\n return round($bytes/1024,$precision).'KB';\n } else {\n return round($bytes,$precision).'B';\n }\n }", "function formatRawSize($bytes) {\n if(!empty($bytes)) {\n\n $s = array('bytes', 'kb', 'MB', 'GB', 'TB', 'PB');\n $e = floor(log($bytes)/log(1024));\n\n $output = sprintf('%.2f '.$s[$e], ($bytes/pow(1024, floor($e))));\n\n return $output;\n }\n}", "function size_format($bytes=\"\")\n\t{\n\t\t$retval = \"\";\n\t\t\n\t\tif ($bytes >= 1048576)\n\t\t{\n\t\t\t$retval = round($bytes / 1048576 * 100 ) / 100 . $this->lang['sf_mb'];\n\t\t}\n\t\telse if ($bytes >= 1024)\n\t\t{\n\t\t\t$retval = round($bytes / 1024 * 100 ) / 100 . $this->lang['sf_k'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$retval = $bytes . $this->lang['sf_bytes'];\n\t\t}\n\t\t\n\t\treturn $retval;\n\t}", "function formatBytes($bytes, int $precision = 2): string\n {\n $units = array('B', 'KB', 'MB', 'GB', 'TB');\n $bytes = max($bytes, 0);\n $pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n $pow = min($pow, count($units) - 1);\n $bytes /= pow(1024, $pow);\n return round($bytes, $precision) . ' ' . $units[$pow];\n }", "public static function byte_convert($bytes, $exp_max = null)\n {\n $symbols = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n\n $exp = 0;\n\n if($exp_max === null)\n {\n $exp_max = count($symbols)-1;\n }\n\n $converted_value = 0;\n\n if($bytes > 0)\n {\n $exp = floor( log($bytes)/log(1024) );\n\n if( $exp > $exp_max )\n $exp = $exp_max;\n\n $converted_value = ( $bytes/pow(1024,$exp) );\n }\n\n return number_format($converted_value,2,',','.').' '.$symbols[$exp];\n }", "protected function formatBytes($bytes) {\n\t\tif ($bytes > 1024*1024*1024) {\n\t\t\t$bytes = $bytes/(float)(1024*1024*1024);\n\t\t\treturn sprintf('%.1f GB', $bytes);\n\t\t} elseif ($bytes > 1024*1024) {\n\t\t\t$bytes = $bytes/(float)(1024*1024);\n\t\t\treturn sprintf('%.1f MB', $bytes);\n\t\t} elseif ($bytes > 1024) {\n\t\t\t$bytes = $bytes/(float)(1024);\n\t\t\treturn sprintf('%.1f kB', $bytes);\n\t\t}\n\t\treturn $bytes. ' bytes';\n\t}", "function format_bytes ( $size ) {\n\t\tswitch ( $size ) {\n\t\t\tcase $size > 1000000:\n\t\t\t\treturn number_format(ceil($size / 1000000)) . \"mb\";\n\t\t\t\tbreak;\n\t\t\tcase $size > 1000:\n\t\t\t\treturn number_format(ceil($size / 1000)) . \"k\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn number_format($size) . \"b\";\n\t\t\t\tbreak;\n\t\t}\n\t}", "function cs_format_bytes($bytes, $decimals = 2)\r\n{\r\n\tif ($bytes < 1024)\r\n\t{\r\n\t\treturn sprintf('%d Bytes', $bytes);\r\n\t}\r\n\t$bytes /= 1024.0;\r\n\tif ($bytes < 1024)\r\n\t{\r\n\t\treturn sprintf('%.'.$decimals.'f KiB', $bytes);\r\n\t}\r\n\t$bytes /= 1024.0;\r\n\tif ($bytes < 1024)\r\n\t{\r\n\t\treturn sprintf('%.'.$decimals.'f MiB', $bytes);\r\n\t}\r\n\t$bytes /= 1024.0;\r\n\tif ($bytes < 1024)\r\n\t{\r\n\t\treturn sprintf('%.'.$decimals.'f GiB', $bytes);\r\n\t}\r\n\t$bytes /= 1024.0;\r\n\treturn sprintf('%.'.$decimals.'f TiB', $bytes);\r\n}", "public function formatBytes(int $size): string\n {\n $units = ['B', 'KB', 'MB', 'GB', 'TB'];\n $base = \\log($size) / \\log(1024);\n\n return \\round(1024 ** ($base - \\floor($base)), 1) . ' ' . $units[(int)\\floor($base)];\n }", "function format_toSizeInBytes_shortForm($size_in_bytes) {\n\t\t//\n\t\t// Data sizes are normally specified in KB - powers of 1024, so return KB rather than kB\n\n\t\tif ($size_in_bytes < (1024 * 1024)) {\n\t\t\t$unit = \"K\";\n\t\t\t$unitSize = $size_in_bytes / 1024;\n\t\t} else if ($size_in_bytes < (1024 * 1024 * 1024)) {\n\t\t\t$unit = \"M\";\n\t\t\t$unitSize = $size_in_bytes / (1024 * 1024);\n\t\t} else {\n\t\t\t$unit = \"G\";\n\t\t\t$unitSize = $size_in_bytes / (1024 * 1024 * 1024);\n\t\t}\n\n\t\t$showDecimalPlace = $unitSize < 10 && round($unitSize, 1) != round($unitSize);\n\n\t\treturn sprintf($showDecimalPlace ? \"%1.1f\" : \"%1.0f\", $unitSize) . $unit;\n\t}", "protected static function _convertBytes($value)\n {\n if( is_numeric( $value ) )\n {\n return $value;\n }\n else\n {\n $value_length = strlen( $value );\n $qty = substr( $value, 0, $value_length - 1 );\n $unit = strtolower( substr( $value, $value_length - 1 ) );\n switch ( $unit )\n {\n case 'k':\n $qty *= 1024;\n break;\n case 'm':\n $qty *= 1048576;\n break;\n case 'g':\n $qty *= 1073741824;\n break;\n }\n return $qty;\n }\n }", "public static function formatBytes(int $bytes, int $precision = 2): string\n {\n $units = ['B', 'KB', 'MB', 'GB', 'TB'];\n\n $bytes = max($bytes, 0);\n $pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n $pow = (int) min($pow, count($units) - 1);\n\n $bytes /= 1024 ** $pow;\n\n return round($bytes, $precision) . ' ' . $units[$pow];\n }", "function formatBytes($size) {\n $units = array(' B', ' KB', ' MB', ' GB', ' TB');\n for ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024;\n return round($size, 2).$units[$i];\n}", "function convertToBytes(String $value) {\n\n\t$number = substr($value, 0, -2);\n\n\tswitch(strtoupper(substr($value, -2))) {\n\t\tcase 'KB': return $number*1024;\n\t\tcase 'MB': return $number*pow(1024, 2);\n\t\tcase 'GB': return $number*pow(1024, 3);\n\t\tcase 'TB': return $number*pow(1024, 4);\n\t\tdefault: return false;\n\t}\n\n}", "function formatBytes($bytes, $precision = 2) {\n $bytes = round($bytes, 0);\n\n $units = array('B', 'KB', 'MB', 'GB', 'TB');\n $short_units = array('B', 'K', 'M', 'G', 'T');\n\n // Don't allow minus bytes\n $bytes = max($bytes, 0);\n $pow = floor(($bytes ? log($bytes) : 0) / log(1000));\n $pow = min($pow, count($units) - 1);\n\n // Adjust the bytes to MB, GB, etc\n $bytes /= pow(1000, $pow);\n\n // If we're using TB then allow for one more DP\n if ($pow == 4) $precision += 1;\n\n // Format it to the correct dp\n $number = number_format($bytes, $precision);\n\n return $number . $short_units[$pow];\n}", "function size_text($bytes=0) {\n $unit = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n $i = 0;\n $size = $bytes;\n while ($size >= 1000) {\n $size /= 1000;\n $i++;\n }\n return round($size, 2) . $unit[$i];\n}", "public static function GetHumanReadableFileSize($fileSize)\n {\n $returnVal = 0;\n if (!empty($fileSize)) {\n if (is_numeric($fileSize)) {\n if ($fileSize <= 1024) {\n $returnVal = '1 kb';\n } else {\n $returnVal = round($fileSize / 1024); // kilobytes\n\n if (strlen($returnVal) >= 4) {\n $nachkomma = round(mb_substr($returnVal, -3) / 100);\n $vorkomma = mb_substr($returnVal, 0, -3);\n $returnVal = $vorkomma.','.$nachkomma.' MB';\n } else {\n $returnVal = round($returnVal).' kb';\n }\n }\n } else { // is string and has MB or kb info\n $returnVal = $fileSize;\n }\n }\n\n return $returnVal;\n }", "function formatSizeUnits($bytes) {\n if ($bytes >= 1073741824) {\n $bytes = number_format($bytes / 1073741824, 2) . ' GB';\n } elseif ($bytes >= 1048576) {\n $bytes = number_format($bytes / 1048576, 2) . ' MB';\n } elseif ($bytes >= 1024) {\n $bytes = number_format($bytes / 1024, 2) . ' KB';\n } elseif ($bytes > 1) {\n $bytes = $bytes . ' bytes';\n } elseif ($bytes == 1) {\n $bytes = $bytes . ' byte';\n } else {\n $bytes = '0 bytes';\n }\n return $bytes;\n}", "function sizeFormat($b = 0){\r\n\t\tif($b < 1024){\r\n\t\t\treturn $b . 'bytes';\r\n\t\t}elseif($b < 1048576){\r\n\t\t\treturn round($b / 1024 * 100 ) / 100 . 'KB';\r\n\t\t}elseif($b < 130023424){\r\n\t\t\treturn round($b / 1048576 * 100 ) / 100 . 'MB';\r\n\t\t}elseif($b < 133143986176){\r\n\t\t\treturn round($b / 130023424 * 100) / 100 . 'GB';\r\n\t\t}else{\r\n\t\t\treturn round($b / 133143986176 * 100) / 100 . 'TB';\r\n\t\t}\r\n\t}", "public function formatSizeFromBytes($bytes){\n\n return round($bytes/1000000, 2).\" MB\";\n\n }", "function human_filesize($size,$unit=\"\") {\n if( (!$unit && $size >= 1<<30) || $unit == \"GB\")\n return number_format($size/(1<<30),2).\"GB\";\n if( (!$unit && $size >= 1<<20) || $unit == \"MB\")\n return number_format($size/(1<<20),2).\"MB\";\n if( (!$unit && $size >= 1<<10) || $unit == \"KB\")\n return number_format($size/(1<<10),2).\"KB\";\n return number_format($size).\" bytes\";\n}", "function format_bytes($megabytes)\n{\n return Metric::megabytes($megabytes)->numberOfBytes();\n}", "public function formatBytes($bytes, $precision = 2) {\n\t\t $units = array('B', 'KB', 'MB', 'GB', 'TB');\n\t\t $bytes = max($bytes, 0);\n\t\t $pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n\n\t\t $pow = min($pow, count($units) - 1);\n\t\t $bytes /= pow(1024, $pow);\n\n\t\t return round($bytes, $precision) . ' ' . $units[$pow];\n\t\t}", "public function formatBytes($bytes) {\n // JEDEC memory standard\n $units = array(\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\");\n\n // 0 bytes - doh!\n if ($bytes == 0) {\n return $bytes . \" \" . $units[0];\n }\n\n // Temporary value\n $i = (int)\\floor(\\log($bytes) / \\log(1024));\n\n // Return space usage in good format + prefix\n return \\round($bytes / \\pow(1024, $i), 2) . \" \" . $units[$i];\n }", "function humanFileSize($size,$unit=\"\") \n {\n if( (!$unit && $size >= 1<<30) || $unit == \"GB\")\n return number_format($size/(1<<30),2).\"GB\";\n if( (!$unit && $size >= 1<<20) || $unit == \"MB\")\n return number_format($size/(1<<20),2).\"MB\";\n if( (!$unit && $size >= 1<<10) || $unit == \"KB\")\n return number_format($size/(1<<10),2).\"KB\";\n return number_format($size).\" bytes\";\n }", "function formatSizeUnits($bytes)\n {\n if ($bytes >= 1073741824)\n\t {\n\t $bytes = number_format($bytes / 1073741824, 2) . ' GB';\n }\n elseif ($bytes >= 1048576)\n {\n $bytes = number_format($bytes / 1048576, 2) . ' MB';\n\t }\n elseif ($bytes >= 1024)\n {\n $bytes = number_format($bytes / 1024, 2) . ' KB';\n }\n elseif ($bytes > 1)\n {\n $bytes = $bytes . ' bytes';\n }\n\t elseif ($bytes == 1)\n {\n\t $bytes = $bytes . ' byte';\n }\n else\n {\n $bytes = '0 bytes';\n\t }\n\n return $bytes;\n}", "function formatBytes($intSize) {\n\t\treturn sprintf('%0.2f', ($intSize/1000)). ' Kb';\n\t}", "public static function ByteSize($bytes)\r\n\t{\r\n\t\t$size = $bytes / 1024;\r\n\t\tif($size < 1024)\r\n\t\t{\r\n\t\t\t$size = number_format($size, 2);\r\n\t\t\t$size .= ' KB';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif($size / 1024 < 1024)\r\n\t\t\t{\r\n\t\t\t\t$size = number_format($size / 1024, 2);\r\n\t\t\t\t$size .= ' MB';\r\n\t\t\t}\r\n\t\t\telse if ($size / 1024 / 1024 < 1024)\r\n\t\t\t{\r\n\t\t\t\t$size = number_format($size / 1024 / 1024, 2);\r\n\t\t\t\t$size .= ' GB';\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $size;\r\n\t}", "function fileSizeConvert($bytes)\n{\n $bytes = floatval($bytes);\n $arBytes = array(\n 0 => array(\n \"UNIT\" => \"tb\",\n \"VALUE\" => pow(1024, 4)\n ),\n 1 => array(\n \"UNIT\" => \"gb\",\n \"VALUE\" => pow(1024, 3)\n ),\n 2 => array(\n \"UNIT\" => \"mb\",\n \"VALUE\" => pow(1024, 2)\n ),\n 3 => array(\n \"UNIT\" => \"kb\",\n \"VALUE\" => 1024\n ),\n 4 => array(\n \"UNIT\" => \"b\",\n \"VALUE\" => 1\n ),\n );\n\n foreach ($arBytes as $arItem) {\n if ($bytes >= $arItem[\"VALUE\"]) {\n $result = $bytes / $arItem[\"VALUE\"];\n $result = str_replace(\n \".\", \n \".\", \n strval(round($result, 0))\n ).$arItem[\"UNIT\"];\n break;\n }\n }\n return $result;\n}", "public function formatBytes(int $bytes, int $precision = 2) : string {\n $base = log($bytes, 1024);\n $suffixes = ['', 'KB', 'MB', 'GB', 'TB'];\n return round(pow(1024, $base - floor($base)), $precision) .' '. $suffixes[(int) floor($base)];\n }", "public static function human_number( $number ) {\n\n\t\tif ( ! is_numeric( $number ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$negative = '';\n\t\tif ( abs( $number ) != $number ) {\n\t\t\t$negative = '-';\n\t\t\t$number = abs( $number );\n\t\t}\n\n\t\tif ( $number < 1000 ) {\n\t\t\treturn $negative ? -1 * $number : $number;\n\t\t}\n\n\t\t$unit = intval( log( $number, 1000 ) );\n\t\t$units = array( '', 'K', 'M', 'B', 'T', 'Q' );\n\n\t\tif ( array_key_exists( $unit, $units ) ) {\n\t\t\treturn sprintf( '%s%s%s', $negative, rtrim( number_format( $number / pow( 1000, $unit ), 1 ), '.0' ), $units[ $unit ] );\n\t\t}\n\n\t\treturn $number;\n\t}", "function human_filesize($size, $precision = 2) {\n $units = array('B','kB','MB','GB','TB','PB','EB','ZB','YB');\n $step = 1024;\n $i = 0;\n while (($size / $step) > 0.9) {\n $size = $size / $step;\n $i++;\n }\n return round($size, $precision).$units[$i];\n}", "function transByte($size){\n\t$arr = array(\"B\",\"KB\",\"MB\",\"GB\",\"TB\",\"EB\");\n\t$i = 0;\n\twhile($size>1024){\n\t\t$size/=1024;\n\t\t$i++;\n\t}\n\treturn round($size,2).$arr[$i];\n}", "public static function unformat_bytes($value) {\n if (preg_match('/^([0-9]+) *([[:alpha:]]+)$/', $value, $matches)) {\n $value = $matches[1];\n $unit = strtolower(substr($matches[2], 0, 1));\n }\n else {\n return $value;\n }\n\n switch($unit) {\n case 'p':\n $value *= 1024;\n case 't':\n $value *= 1024;\n case 'g':\n $value *= 1024;\n case 'm':\n $value *= 1024;\n case 'k':\n $value *= 1024;\n }\n\n return $value;\n }", "public function getSizeForHuman()\n {\n return File::format_size($this->Size);\n }", "public static function humanFileSize($size, $unit = '')\n {\n if (self::isHumanFilesizeUnitGb($size, $unit)) {\n return number_format($size / (1 << 30), 2) . 'GB';\n }\n if (self::isHumanFilesizeUnitMb($size, $unit)) {\n return number_format($size / (1 << 20), 2) . 'MB';\n }\n if (self::isHumanFilesizeUnitKb($size, $unit)) {\n return number_format($size / (1 << 10), 2) . 'KB';\n }\n\n return number_format($size) . ' bytes';\n }", "function byteConvert($size, $round = 0) {\n \t/* La size deve essere espressa in Bytes */\n \t$sizes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n \tfor ($i=0; $size > 1024 && $i < count($sizes) - 1; $i++) $size /= 1024;\n \t\n \treturn round($size,$round).\" \".$sizes[$i];\n\t}", "public static function toReadableSize($bytes, $decimals = 1, $system = 'metric')\n {\n $mod = ($system === 'binary') ? 1024 : 1000;\n\n $units = [\n 'binary' => [\n 'B',\n 'KiB',\n 'MiB',\n 'GiB',\n 'TiB',\n 'PiB',\n 'EiB',\n 'ZiB',\n 'YiB',\n ],\n 'metric' => [\n 'B',\n 'kB',\n 'MB',\n 'GB',\n 'TB',\n 'PB',\n 'EB',\n 'ZB',\n 'YB',\n ],\n ];\n\n $factor = floor((strlen($bytes) - 1) / 3);\n\n return sprintf(\"%.{$decimals}f %s\", $bytes / pow($mod, $factor), $units[$system][$factor]);\n }", "public static function humanSize(int $size, ?string $unit = null): string\n {\n if (($unit === null && $size >= 1 << 30) || $unit === 'GB') {\n return number_format($size / (1 << 30), 2) . 'GB';\n }\n\n if (($unit === null && $size >= 1 << 20) || $unit === 'MB') {\n return number_format($size / (1 << 20), 2) . 'MB';\n }\n\n if (($unit === null && $size >= 1 << 10) || $unit === 'KB') {\n return number_format($size / (1 << 10), 2) . 'KB';\n }\n\n return number_format($size) . ' bytes';\n }", "public function bytesAbbr($bytes, $precision = 2)\n {\n $bytes = max(0.0, (float) $bytes);\n $precision = max(0, (int) $precision);\n $units = ['bytes', 'kbs', 'MB', 'GB', 'TB'];\n\n $power = floor(($bytes ? log($bytes) : 0) / log(1024));\n $abbr_bytes = round($bytes / pow(1024, $power), $precision);\n $abbr = $units[min($power, count($units) - 1)];\n\n if ($abbr_bytes === (float) 1 && $abbr === 'bytes') {\n $abbr = 'byte'; // Quick fix.\n } elseif ($abbr_bytes === (float) 1 && $abbr === 'kbs') {\n $abbr = 'kb'; // Quick fix.\n }\n return $abbr_bytes.' '.$abbr;\n }", "function convertToBytes($from){\n $number=substr($from,0,-1);\n switch(strtoupper(substr($from,-1))){\n case \"K\":\n return $number*1024;\n case \"M\":\n return $number*pow(1024,2);\n case \"G\":\n return $number*pow(1024,3);\n default:\n return $from;\n }\n}", "public function bytesToSize($bytes, $precision = 2) {\n $kilobyte = 1024;\n $megabyte = $kilobyte * 1024;\n $gigabyte = $megabyte * 1024;\n $terabyte = $gigabyte * 1024;\n\n if (($bytes >= 0) && ($bytes < $kilobyte)) {\n return $bytes . ' B';\n } elseif (($bytes >= $kilobyte) && ($bytes < $megabyte)) {\n return round($bytes / $kilobyte, $precision) . ' KB';\n } elseif (($bytes >= $megabyte) && ($bytes < $gigabyte)) {\n return round($bytes / $megabyte, $precision) . ' MB';\n } elseif (($bytes >= $gigabyte) && ($bytes < $terabyte)) {\n return round($bytes / $gigabyte, $precision) . ' GB';\n } elseif ($bytes >= $terabyte) {\n return round($bytes / $gigabyte, $precision) . ' TB';\n } else {\n return $bytes . ' B';\n }\n }", "public function formatSize($bytes, $precision = 2)\n {\n if ((int)$bytes < 1) {\n return '';\n }\n\n $units = ['B', \"KB\", \"MB\", \"GB\", \"TB\"];\n\n $bytes = (int)$bytes;\n $base = log($bytes) / log(1000); // 1024 would be for MiB KiB etc\n $pow = pow(1000, $base - floor($base)); // Same rule for 1000\n\n return round($pow, $precision) . ' ' . $units[(int)floor($base)];\n }", "private function normalize(string $byte): string\n {\n if ($byte < '0') {\n return '';\n }\n if ($byte > 'z') {\n return '';\n }\n if ($byte <= '9') {\n return $byte;\n }\n if ($byte >= 'a') {\n return $byte;\n }\n if (($byte >= 'A') && ($byte <= 'Z')) {\n return strtolower($byte);\n }\n\n return '';\n }", "public static function format_bytes($value, $precision = 2) {\n $pass = 0;\n while (strlen(floor($value)) > 3) {\n $value /= 1024;\n $pass++;\n }\n\n switch ($pass) {\n case 1: $unit = 'kB'; break;\n case 2: $unit = 'MB'; break;\n case 3: $unit = 'GB'; break;\n case 4: $unit = 'TB'; break;\n case 5: $unit = 'PB'; break;\n default: $unit = 'B'; break;\n }\n\n return round($value, $precision) . ' ' . $unit;\n }", "function formatMBytes( $bytes, $precision = 2 )\n{\n $units = array('Mb', 'Gb', 'Tb');\n $bytes = max($bytes, 0);\n $pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n $pow = min($pow, count($units) - 1);\n $bytes /= pow(1024, $pow);\n return round($bytes, $precision) . ' ' . $units[$pow];\n}", "protected static function humanReadableSize(float $sizeInBytes): string\n {\n return Format::humanReadableSize($sizeInBytes);\n }", "function convert_file_size($bytes)\n {\n $result = 0;\n\n $bytes = floatval($bytes);\n $arBytes = array(\n 0 => array(\n \"UNIT\" => \"TB\",\n \"VALUE\" => pow(1024, 4)\n ),\n 1 => array(\n \"UNIT\" => \"GB\",\n \"VALUE\" => pow(1024, 3)\n ),\n 2 => array(\n \"UNIT\" => \"MB\",\n \"VALUE\" => pow(1024, 2)\n ),\n 3 => array(\n \"UNIT\" => \"KB\",\n \"VALUE\" => 1024\n ),\n 4 => array(\n \"UNIT\" => \"B\",\n \"VALUE\" => 1\n ),\n );\n\n foreach($arBytes as $arItem)\n {\n if($bytes >= $arItem[\"VALUE\"])\n {\n $result = $bytes / $arItem[\"VALUE\"];\n $result = str_replace(\".\", \",\" , strval(round($result, 2))).\" \".$arItem[\"UNIT\"];\n break;\n }\n }\n return $result;\n }", "function convert_to_bytes($unit, $value)\n{\n\t$value = (int) $value;\n\n\tswitch (strtolower($unit)) {\n\t\tcase 'g':\n\t\t\treturn $value * pow(1024, 3);\n\t\tcase 'm':\n\t\t\treturn $value * pow(1024, 2);\n\t\tcase 'k':\n\t\t\treturn $value * 1024;\n\t\tdefault:\n\t\t\treturn $value;\n\t}\n}", "function mb_to_bytes($mb) {\n\treturn $mb*1048576;\n}", "function return_bytes($size){\n\tswitch(strtolower(substr ($size, -2))) {\n\t\tcase 'kb': return (int)$size * 1024;\n\t\tcase 'mb': return (int)$size * 1048576;\n\t\tcase 'gb': return (int)$size * 1073741824;\n\t\tdefault: return $size;\n\t}\n}", "public static function resizeBytes($bytes)\n {\n static $units = ['b', 'kb', 'mb', 'gb', 'tb', 'pb'];\n\n /** @noinspection PhpIllegalArrayKeyTypeInspection */\n\n return @round($bytes / pow(1024, ($i = floor(log($bytes, 1024)))), 2) . $units[$i];\n }", "function bytes_to_gigabytes($value)\n{\n return round($value/1000**4, 2) . \"GB\";\n}", "function formatBytes($size, $precision = 1)\n{\n $base = log($size, 1024);\n $suffixes = array('B', 'KB', 'MB', 'GB', 'TB');\n return round(pow(1024, $base - floor($base)), $precision) . ' ' . $suffixes[floor($base)];\n}", "public function convertFileSize($fileSize)\n\t{\n\t\tif ($fileSize < 1024)\n\t\t{\n\t\t\treturn $fileSize .' B';\n\t\t}\n\t\telse if ($fileSize < 1048576)\n\t\t{\n\t\t\treturn round($fileSize / 1024, 2) .' KB';\n\t\t}\n\t\telse if ($fileSize < 1073741824)\n\t\t{\n\t\t\treturn round($fileSize / 1048576, 2) . ' MB';\n\t\t}\n\t\telse if ($fileSize < 1099511627776)\n\t\t{\n\t\t\treturn round($fileSize / 1073741824, 2) . ' GB';\n\t\t}\n\t\telse if ($fileSize < 1125899906842624)\n\t\t{\n\t\t\treturn round($fileSize / 1099511627776, 2) .' TB';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn round($fileSize / 1125899906842624, 2) .' PB';\n\t\t}\n\t}", "public static function bytesToSI($bytes): string\n {\n if (empty($bytes)) {\n return '0';\n }\n $prefix = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n $base = 1024;\n $class = min((int)log($bytes, $base), count($prefix) - 1);\n return \\Safe\\sprintf('%1.1f', $bytes / pow($base, $class)) . $prefix[$class];\n }", "function convert($size)\n {\n $unit=array('b','kb','mb','gb','tb','pb');\n return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];\n }", "function size_tobytes(&$size, $onerror) {\n \t $arr_uploaded = explode(' ', $size); //[0] nr [1] mb/gb/tb\n \t if (count($arr_uploaded) != 2 || !is_numeric($arr_uploaded[0]) || $arr_uploaded[0] <= 0 || strlen($arr_uploaded[1]) != 2) return $onerror;\n \t $amount = $arr_uploaded[0];\n \t $masure = $arr_uploaded[1];\n \t if ($masure == 'MB') return ceil($amount * 1048576);\n \t if ($masure == 'GB') return ceil($amount * 1073741824);\n \t if ($masure == 'TB') return ceil($amount * 1099511627776);\n \t return $onerror;\n }", "public function size($size)\n {\n $kb = 1024;\n $mb = 1048576;\n $gb = 1073741824;\n $tb = 1099511627776;\n if (!$size) {\n return '0 B';\n } elseif ($size < $kb) {\n return $size.' B';\n } elseif ($size < $mb) {\n return round($size / $kb, 2).' KB';\n } elseif ($size < $gb) {\n return round($size / $mb, 2).' MB';\n } elseif ($size < $tb) {\n return round($size / $gb, 2).' GB';\n } else {\n return round($size / $tb, 2).' TB';\n }\n }", "public function getFormattedSize() {\r\n\t\r\n\t $bytes = $this->getSize();\r\n\t\r\n\t if ($bytes >= 1073741824)\r\n\t {\r\n\t\t$bytes = number_format($bytes / 1073741824, 2) . ' GB';\r\n\t }\r\n\t elseif ($bytes >= 1048576)\r\n\t {\r\n\t\t$bytes = number_format($bytes / 1048576, 2) . ' MB';\r\n\t }\r\n\t elseif ($bytes >= 1024)\r\n\t {\r\n\t\t$bytes = number_format($bytes / 1024, 2) . ' KB';\r\n\t }\r\n\t elseif ($bytes > 1)\r\n\t {\r\n\t\t$bytes = $bytes . ' bytes';\r\n\t }\r\n\t elseif ($bytes == 1)\r\n\t {\r\n\t\t$bytes = $bytes . ' byte';\r\n\t }\r\n\t else\r\n\t {\r\n\t\t$bytes = '0 bytes';\r\n\t }\r\n\r\n\t return $bytes;\r\n\t \r\n }", "static public function getReadableBytes( $nBytes ) {\n $_aUnits = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' );\n $_nLog = log( $nBytes, 1024 );\n $_iPower = ( int ) $_nLog;\n $_iSize = pow( 1024, $_nLog - $_iPower );\n return $_iSize . $_aUnits[ $_iPower ];\n }" ]
[ "0.8265522", "0.7977584", "0.7741816", "0.7310399", "0.7150558", "0.7083132", "0.7081738", "0.70778286", "0.7025095", "0.697673", "0.69443953", "0.68866515", "0.68749595", "0.6867081", "0.68639344", "0.6821851", "0.6795617", "0.67312694", "0.66963583", "0.6688382", "0.6685926", "0.66759354", "0.66627073", "0.66394764", "0.6639126", "0.65874356", "0.6557291", "0.6515245", "0.6503281", "0.64991254", "0.6468199", "0.6461445", "0.6430001", "0.6384638", "0.6369325", "0.63589936", "0.6353472", "0.6343794", "0.6335498", "0.6326349", "0.63219905", "0.6292777", "0.6290845", "0.62827164", "0.6280686", "0.6275712", "0.62620443", "0.615176", "0.613178", "0.6130733", "0.6127929", "0.6121383", "0.6116878", "0.6087918", "0.6073175", "0.6068093", "0.60551816", "0.60545444", "0.6013713", "0.597415", "0.5968386", "0.5965575", "0.5963354", "0.595901", "0.59461105", "0.5920324", "0.591463", "0.5911664", "0.58721673", "0.58648133", "0.5864763", "0.5859893", "0.5846722", "0.58460695", "0.5816742", "0.5797898", "0.579218", "0.57913953", "0.5769182", "0.5760022", "0.57519484", "0.57484317", "0.57372576", "0.5734615", "0.57340026", "0.5728635", "0.5713741", "0.5709458", "0.5698501", "0.56898946", "0.56721604", "0.56693774", "0.56630874", "0.56542635", "0.5631364", "0.5626763", "0.5609889", "0.5599855", "0.5586583", "0.558003" ]
0.762057
3
Format a number Works exactly like the number_format() function. However, this method does not add decimal places to whole numbers, and trailing 0 are removed. Examples: ```php echo Conversions::numberFormat(1024); // Output: "1,024" echo Conversions::numberFormat(1024.23); // Outputs: "1,024.23" ```
public static function numberFormat($num, $dec_max = 2, $dec_point = ".", $thousands_sep = ",") { if (floor($num) != $num) { $num = trim( number_format($num, $dec_max, $dec_point, $thousands_sep), "0" ); } else { $num = number_format((double)$num, 0, $dec_point, $thousands_sep); } return $num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function formatNumber($number);", "function do_number_format($number)\n\t{\n\t\tif ( $this->vars['number_format'] != 'none' )\n\t\t{ \n\t\t\treturn number_format($number , 0, '', $this->num_format);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $number;\n\t\t}\n\t}", "private function formatNumber($number)\n {\n return number_format($number, 0, ',', '.');\n }", "public static function numberFormat($number)\n {\n return number_format($number,2,'.','');\n }", "function format_number($value=0)\n{\n\tif ((is_numeric( $value ) AND floor( $value ) != $value)) {\n\t\treturn number_format($value, 2, '.', ',');\n\t} else {\n\t\treturn number_format($value);\n\t}\n}", "public static function formatNumber($num){\r\n\t\treturn number_format($num, 0, '', '.');\r\n\t}", "protected function formatNumber(string $number, NumberFormat $numberFormat, array $options = []): string\n {\n $parsedPattern = $this->getParsedPattern($numberFormat, $options['style']);\n // Start by rounding the number, if rounding is enabled.\n if (is_int($options['rounding_mode'])) {\n $number = Calculator::round($number, $options['maximum_fraction_digits'], $options['rounding_mode']);\n }\n $negative = (Calculator::compare('0', $number, 12) == 1);\n // Ensure that the value is positive and has the right number of digits.\n $signMultiplier = $negative ? '-1' : '1';\n $number = bcdiv($number, $signMultiplier, $options['maximum_fraction_digits']);\n // Split the number into major and minor digits.\n $numberParts = explode('.', $number);\n $majorDigits = $numberParts[0];\n // Account for maximumFractionDigits = 0, where the number won't\n // have a decimal point, and $numberParts[1] won't be set.\n $minorDigits = isset($numberParts[1]) ? $numberParts[1] : '';\n\n if ($options['use_grouping'] && $parsedPattern->isGroupingUsed()) {\n // Reverse the major digits, since they are grouped from the right.\n $majorDigits = array_reverse(str_split($majorDigits));\n // Group the major digits.\n $groups = [];\n $groups[] = array_splice($majorDigits, 0, $parsedPattern->getPrimaryGroupSize());\n while (!empty($majorDigits)) {\n $groups[] = array_splice($majorDigits, 0, $parsedPattern->getSecondaryGroupSize());\n }\n // Reverse the groups and the digits inside of them.\n $groups = array_reverse($groups);\n foreach ($groups as &$group) {\n $group = implode(array_reverse($group));\n }\n // Reconstruct the major digits.\n $majorDigits = implode(',', $groups);\n }\n\n if ($options['minimum_fraction_digits'] < $options['maximum_fraction_digits']) {\n // Strip any trailing zeroes.\n $minorDigits = rtrim($minorDigits, '0');\n if (strlen($minorDigits) < $options['minimum_fraction_digits']) {\n // Now there are too few digits, re-add trailing zeroes\n // until the desired length is reached.\n $neededZeroes = $options['minimum_fraction_digits'] - strlen($minorDigits);\n $minorDigits .= str_repeat('0', $neededZeroes);\n }\n }\n\n // Assemble the final number and insert it into the pattern.\n $number = strlen($minorDigits) ? $majorDigits . '.' . $minorDigits : $majorDigits;\n $pattern = $negative ? $parsedPattern->getNegativePattern() : $parsedPattern->getPositivePattern();\n $number = preg_replace('/#(?:[\\.,]#+)*0(?:[,\\.][0#]+)*/', $number, $pattern);\n $number = $this->localizeNumber($number, $numberFormat);\n\n return $number;\n }", "function FormatNumber($number, $decimals = 0)\n{\n if (is_numeric($number)) {\n return number_format($number, $decimals, ',', '.');\n } else {\n return number_format(0, $decimals, ',', '.');\n }\n}", "protected function numberFormat($number)\n {\n return number_format($number, 2, $this->t('decimalSeparator'), $this->t('thousandsSeparator'));\n }", "function format( $number , $format=null )\n {\n if( $format == null ){\n $format = $this->getFormat();\n }\n\n // handle custom formats too\n if ($format >= I18N_CUSTOM_FORMATS_OFFSET) {\n if (isset($this->_customFormats[$format])) {\n $numberFormat = $this->_customFormats[$format];\n }\n } else {\n $numberFormat = $this->_localeObj->numberFormat[$format]; \n }\n return call_user_func_array( 'number_format' , array_merge( array($number),$numberFormat) );\n }", "private static function numberFormat($number)\r\n {\r\n if (!is_string($number))\r\n return number_format($number, 2, ',', ' ');\r\n else\r\n return $number;\r\n }", "public function formatNumber($value)\n {\n $decimal = Configuration::first()->decimal;\n return number_format($value, $decimal, \".\", \"\");\n }", "public function formatNumber($value)\n\t{\n\t\treturn $value;\n\t}", "protected function numberFormatter($n) {\r\n $n = (0+str_replace(\",\",\"\",$n));\r\n\r\n // is this a number?\r\n if(!is_numeric($n)) return false;\r\n\r\n // now filter it;\r\n if($n>1000000000000) return round(($n/1000000000000),1).' trillion';\r\n else if($n>1000000000) return round(($n/1000000000),1).' milliarder';\r\n else if($n>1000000) return round(($n/1000000),1).' millioner';\r\n else if($n>1000) return round(($n/1000),1).' tusind';\r\n\r\n return number_format($n);\r\n }", "function number_format_i18n($number, $decimals = 0)\n {\n }", "function number_format($number, $type = _NUM_TYPE)\n\t{\n\t\tswitch ($type) {\n\t\t\tcase \"figure\":\n\t\t\t\treturn XoopsLocaleJalali::Convertnumber2farsi($number);\n\t\t\t\tbreak;\n\t\t\tcase \"word\":\n\t\t\t\treturn ($number > 0) ? self::num2Words($number) : _NUMWORDS_ZERO;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn $number;\n\t\t\t\tbreak;\n\t\t}\t\n\t}", "function numberformat( $num ) {\n\tglobal $lang;\n\tif ( $lang == 'www' || $lang == 'meta' || $lang == 'commons' || $lang == 'en' || $lang == 'incubator' ) {\n\t\treturn number_format($num);\n\t}\n\telseif ( $lang == 'fr' ) {\n\t\treturn number_format($num, 0, ',', ' ');\n\t}\n\telse {\n\t\treturn number_format($num);\n\t}\n}", "private function _formatConvert($number)\n {\n if ($this->round) {\n $n = floor($number);\n $fraction = ($number - $n);\n if ($fraction != 0) {\n $step = 1 / $this->round;\n $decimal = (((int)($fraction / $step) + 1) * $step);\n $number = $n + $decimal;\n }\n }\n $number = number_format($number, $this->decimal);\n\n return number_format($number, $this->decimal);\n }", "function number_format( $price, $decimals = 2 ) {\n return number_format_i18n( floatval($price), $decimals );\n }", "function format_number(int|float|string $input, int|bool|null $decimals = 0, string $decimal_separator = null, string $thousand_separator = null): string|null\n{\n if (is_string($input)) {\n if (!is_numeric($input)) {\n trigger_error(sprintf('%s(): Invalid non-numeric input', __function__));\n return null;\n }\n\n $input += 0;\n }\n\n $export = var_export($input, true);\n\n // Auto-detect decimals.\n if (is_true($decimals)) {\n $decimals = strlen(stracut($export, '.'));\n }\n\n // Prevent corruptions.\n if ($decimals > PRECISION) {\n $decimals = PRECISION;\n }\n\n $ret = number_format($input, (int) $decimals, $decimal_separator, $thousand_separator);\n\n // Append \".0\" for eg: 1.0 & upper NAN/INF.\n if (!$decimals && !is_int($input) && strlen($export) == 1) {\n $ret .= '.0';\n } elseif ($ret == 'inf' || $ret == 'nan') {\n $ret = strtoupper($ret);\n }\n\n return $ret;\n}", "function formatNumber($number)\n {\n $stringLength = strlen($number);\n\n if ($stringLength > 5) {\n return round($number / 1000, 2).'K';\n }\n return $number;\n }", "private function _formatNumber($number)\n {\n if ($number == '')\n {\n \treturn FALSE;\n }\n return number_format($number, 2, '.', ',');\n }", "function numberFormat($amount) {\n try {\n return number_format($amount);\n } catch (Exception $e) {\n return $amount;\n }\n }", "private function numberFormat($value, $decimals, $decimalPoint, $thousandSeperator)\n {\n if(is_null($decimals)){\n $decimals = is_null(config('cart.format.decimals')) ? 2 : config('cart.format.decimals');\n }\n if(is_null($decimalPoint)){\n $decimalPoint = is_null(config('cart.format.decimal_point')) ? '.' : config('cart.format.decimal_point');\n }\n if(is_null($thousandSeperator)){\n $thousandSeperator = is_null(config('cart.format.thousand_seperator')) ? ',' : config('cart.format.thousand_seperator');\n }\n\n return number_format($value, $decimals, $decimalPoint, $thousandSeperator);\n }", "function format($number) {\r\n\t$number = bcdiv($number, 100000000, 8);\r\n\t$point = strpos($number,\".\");\r\n\tif($point != -1) {\r\n\t\t$after = substr($number,$point+1);\r\n\t\t$after = strlen($after);\r\n\t\t$after = 8-$after;\r\n\t\tfor($i=0;$i<$after;$i++) {\r\n\t\t\t$number .= \"0\";\r\n\t\t}\r\n\t} else {\r\n\t\t$number .= \".00000000\";\r\n\t}\r\n\treturn($number);\r\n}", "public static function nice_number($number){\n\t\treturn number_format($number,0,'',',');\n\t}", "function formatAmountSimply($v,$t=1){\n return number_format($v,2,'.',',');\n}", "public function numberFormatByValue($value) {\n\n if ($value < 0)\n $value = '(' . number_format($value, 2) . ')';\n else\n $value = number_format($value, 2);\n\n return str_replace(\"-\", \"\", $value);\n }", "function format($val) {\r\n //setlocale(LC_MONETARY, 'en_US');\r\n return number_format(money_format('%i', $val), 2);\r\n }", "public static function format($num, $config = array())\n {\n if (!preg_match('/^([+-]?(\\d+(\\.\\d*)?)|(\\.\\d+))$/', $num)) {\n throw new \\Exception('Number is expecting 1 parameters to be a number.');\n }\n\n $config = array_replace_recursive(static::$config, $config);\n\n $broken_number = explode('.', $num . '');\n if (count($broken_number) != 2) {\n $broken_number[1] = str_pad('', $config['precision'], '0', STR_PAD_RIGHT);\n } else {\n $broken_number[1] = str_pad($broken_number[1], $config['precision'], '0', STR_PAD_RIGHT);\n }\n\n if ($config['round']) {\n if ($config['precision'] < strlen($broken_number[1])) {\n $pre = substr($broken_number[1], $config['precision'], 1);\n $broken_number[1] = substr($broken_number[1], 0, $config['precision']);\n if ($pre >= 5) {\n $broken_number[1] += 1;\n }\n $broken_number[1] = str_pad($broken_number[1], $config['precision'], '0', STR_PAD_LEFT);\n }\n }\n\n return implode('.', $broken_number);\n }", "function format_number(float $num, int $precision = 1, ?string $locale = null, array $options = []): string\n {\n // If locale is not passed, get from the default locale that is set from our config file\n // or set by HTTP content negotiation.\n $locale ??= Locale::getDefault();\n\n // Type can be any of the NumberFormatter options, but provide a default.\n $type = (int) ($options['type'] ?? NumberFormatter::DECIMAL);\n\n $formatter = new NumberFormatter($locale, $type);\n\n // Try to format it per the locale\n if ($type === NumberFormatter::CURRENCY) {\n $formatter->setAttribute(NumberFormatter::FRACTION_DIGITS, $options['fraction']);\n $output = $formatter->formatCurrency($num, $options['currency']);\n } else {\n // In order to specify a precision, we'll have to modify\n // the pattern used by NumberFormatter.\n $pattern = '#,##0.' . str_repeat('#', $precision);\n\n $formatter->setPattern($pattern);\n $output = $formatter->format($num);\n }\n\n // This might lead a trailing period if $precision == 0\n $output = trim($output, '. ');\n\n if (intl_is_failure($formatter->getErrorCode())) {\n throw new BadFunctionCallException($formatter->getErrorMessage());\n }\n\n // Add on any before/after text.\n if (isset($options['before']) && is_string($options['before'])) {\n $output = $options['before'] . $output;\n }\n\n if (isset($options['after']) && is_string($options['after'])) {\n $output .= $options['after'];\n }\n\n return $output;\n }", "function tfnm_format_number( $number, $decimal_places ){\n\n\t// Checking it is in fact a number before formatting to be safe.\n\tif( is_int( $number ) || is_float( $number ) ){\n\t\treturn number_format( $number, $decimal_places, '.', ',' );\n\t}\n\n\t// Just return what was inputted if it fails the checks above.\n\treturn $number;\n}", "public static function format($number, $decimals = 2, $dec_point = \",\", $thousands_sep = \".\")\n {\n return self::decimal($number, $decimals, $dec_point, $thousands_sep);\n }", "static function format($number, $decimals = 2, $culture = null, $style = [])\n {\n $style = ['minimum_fraction_digits' => $decimals, 'maximum_fraction_digits' => $decimals] + $style;\n if ($culture)\n {\n return number()->usingLocale($culture, function($num) use ($decimals, $number, $style) {\n return $num->format($number, $style);\n });\n }\n return number()->format($number, $style);\n }", "function money_format($format, $number) {\r\n\t\tif (function_exists('money_format')) {\r\n\t\t\treturn money_format($format, $number);\r\n\t\t}\r\n\t\tif (setlocale(LC_MONETARY, 0) == 'C') {\r\n\t\t\tsetlocale(LC_MONETARY, '');\r\n\t\t\t//return number_format($number, 2);\r\n\t\t}\r\n\r\n\t\t$locale = localeconv();\r\n\r\n\t\t$regex = '/%((?:[\\^!\\-]|\\+|\\(|\\=.)*)([0-9]+)?'\r\n\t\t\t\t. '(?:#([0-9]+))?(?:\\.([0-9]+))?([in%])/';\r\n\r\n\t\tpreg_match_all($regex, $format, $matches, PREG_SET_ORDER);\r\n\r\n\t\tforeach ($matches as $fmatch) {\r\n\t\t\t$value = floatval($number);\r\n\t\t\t$flags = array(\r\n\t\t\t\t\t'fillchar' => preg_match('/\\=(.)/', $fmatch[1], $match) ? $match[1]\r\n\t\t\t\t\t\t\t: ' ',\r\n\t\t\t\t\t'nogroup' => preg_match('/\\^/', $fmatch[1]) > 0,\r\n\t\t\t\t\t'usesignal' => preg_match('/\\+|\\(/', $fmatch[1], $match) ? $match[0]\r\n\t\t\t\t\t\t\t: '+',\r\n\t\t\t\t\t'nosimbol' => preg_match('/\\!/', $fmatch[1]) > 0,\r\n\t\t\t\t\t'isleft' => preg_match('/\\-/', $fmatch[1]) > 0);\r\n\t\t\t$width = trim($fmatch[2]) ? (int) $fmatch[2] : 0;\r\n\t\t\t$left = trim($fmatch[3]) ? (int) $fmatch[3] : 0;\r\n\t\t\t$right = trim($fmatch[4]) ? (int) $fmatch[4]\r\n\t\t\t\t\t: $locale['int_frac_digits'];\r\n\t\t\t$conversion = $fmatch[5];\r\n\r\n\t\t\t$positive = true;\r\n\t\t\tif ($value < 0) {\r\n\t\t\t\t$positive = false;\r\n\t\t\t\t$value *= -1;\r\n\t\t\t}\r\n\t\t\t$letter = $positive ? 'p' : 'n';\r\n\r\n\t\t\t$prefix = $suffix = $cprefix = $csuffix = $signal = '';\r\n\r\n\t\t\t$signal = $positive ? $locale['positive_sign']\r\n\t\t\t\t\t: $locale['negative_sign'];\r\n\t\t\tswitch (true) {\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 1\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$prefix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 2\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$suffix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 3\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$cprefix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 4\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$csuffix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $flags['usesignal'] == '(':\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 0:\r\n\t\t\t\t$prefix = '(';\r\n\t\t\t\t$suffix = ')';\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (!$flags['nosimbol']) {\r\n\t\t\t\t$currency = $cprefix\r\n\t\t\t\t\t\t. ($conversion == 'i' ? $locale['int_curr_symbol']\r\n\t\t\t\t\t\t\t\t: $locale['currency_symbol']) . $csuffix;\r\n\t\t\t} else {\r\n\t\t\t\t$currency = '';\r\n\t\t\t}\r\n\t\t\t$space = $locale[\"{$letter}_sep_by_space\"] ? ' ' : '';\r\n\r\n\t\t\t$value = number_format($value, $right,\r\n\t\t\t\t\t$locale['mon_decimal_point'],\r\n\t\t\t\t\t$flags['nogroup'] ? '' : $locale['mon_thousands_sep']);\r\n\t\t\t$value = @explode($locale['mon_decimal_point'], $value);\r\n\r\n\t\t\t$n = strlen($prefix) + strlen($currency) + strlen($value[0]);\r\n\t\t\tif ($left > 0 && $left > $n) {\r\n\t\t\t\t$value[0] = str_repeat($flags['fillchar'], $left - $n)\r\n\t\t\t\t\t\t. $value[0];\r\n\t\t\t}\r\n\t\t\t$value = implode($locale['mon_decimal_point'], $value);\r\n\t\t\tif ($locale[\"{$letter}_cs_precedes\"]) {\r\n\t\t\t\t$value = $prefix . $currency . $space . $value . $suffix;\r\n\t\t\t} else {\r\n\t\t\t\t$value = $prefix . $value . $space . $currency . $suffix;\r\n\t\t\t}\r\n\t\t\tif ($width > 0) {\r\n\t\t\t\t$value = str_pad($value, $width, $flags['fillchar'],\r\n\t\t\t\t\t\t$flags['isleft'] ? STR_PAD_RIGHT : STR_PAD_LEFT);\r\n\t\t\t}\r\n\r\n\t\t\t$format = str_replace($fmatch[0], $value, $format);\r\n\t\t}\r\n\t\treturn $format;\r\n\t}", "public static function number($number, $options = '')\n\t{\n\n\t\t// Handle specific values AND types (this makes sure to allow '0' as a string and 0 as an integer)\n\t\tif ($number === '' || $number === false || $number === null) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$formatted_number = false;\n\n\t\t/** Define the default argument array. */\n\t\t$defaults = array(\n\t\t\t'add_commas' => true,\n\t\t\t'add_currency_sign' => true,\n\t\t\t'abbreviate' => true\n\t\t);\n\n\t\t/** Merge the arguments with the defaults. */\n\t\t$options = wp_parse_args($options, $defaults);\n\n\t\t//given a number, properly insert commas. \n\t\tif ($options['add_commas']) {\n\t\t\t$formatted_number = number_format($number);\n\t\t}\n\n\t\tif ($options['abbreviate']) {\n\t\t\t$formatted_number = self::abbreviate_number($formatted_number);\n\t\t}\n\n\t\t//insert $ sign.\n\t\tif ($options['add_currency_sign']) {\n\t\t\t$formatted_number = pls_get_currency_symbol() . $formatted_number;\n\t\t}\n\n\t\treturn $formatted_number;\n\n\t}", "function mgl_instagram_instagram_format_number($number ) {\n // Set divisor divisor and short letter by number\n if( $number < 1000 ) {\n // If number is less than 1000 do nothing\n return $number;\n\n }else if ($number > 1000 && $number < 1000000) {\n // Anything between 1000 and a million\n $divisor = 1000;\n $letter = 'k';\n\n } else if ($number > 1000000 && $number < 1000000000) {\n // Anything between a million and a billion\n $divisor = 1000000;\n $letter = 'm';\n\n } else {\n // Anything greater than a billion\n $divisor = 1000000000;\n $letter = 'G';\n }\n\n // Set a decimal precision to 1\n $precision = 1;\n // Set dec point to ','\n // TODO: translate dec point by language\n $dec_point = ',';\n // Set thousand sep to '.'\n // TODO: translate thousand sep by language\n $thousand_sep = '.';\n // Remove extra decimals. Trick because of number_format below also always round up and causes weird results\n // More information: http://php.net/manual/es/function.number-format.php#88424\n $short_number = bcdiv( ( $number / $divisor ), 1, 1 );\n // Get formatted number\n $n_format = trim(number_format( $short_number, $precision, $dec_point, $thousand_sep), 0 . $dec_point) . $letter;\n\n return $n_format;\n}", "function money_format($n)\n {\n $n = (0 + str_replace(\",\", \"\", $n));\n\n // is this a number?\n if (!is_numeric($n)) return false;\n\n // now filter it;\n if ($n > 1000000000000) return round(($n / 1000000000000), 1) . ' nghìn tỷ';\n else if ($n > 1000000000) return round(($n / 1000000000), 1) . ' tỷ';\n else if ($n > 1000000) return round(($n / 1000000), 1) . ' triệu';\n else if ($n > 1000) return round(($n / 1000), 1) . ' nghìn';\n\n return number_format($n);\n }", "function formatNumbers($inputID)\n\t{\n\t\t$number_format = number_format($inputID);\n\t\t\n\t\techo $number_format;\n\t}", "public function format($number, $decimals = 2, $decimalPoint = ',', $thousandsSeparator = '.')\n\t{\n\t\treturn number_format($number, $decimals, $decimalPoint, $thousandsSeparator) . ' ' . $this->code;\n\t}", "function formatNumberToDisplayInMillions($number, $fullFormat=FALSE)\n{\tif(!is_numeric($number)) return false;\n\n\t// now filter it;\n\tif($number>=1000000000000) return round(($number/1000000000000),0). (($fullFormat)? ' Trillion':' T');\n\telse if($number>=1000000000) return round(($number/1000000000),0).(($fullFormat)? ' Billion':' B');\n\telse if($number>=1000000) return round(($number/1000000),0).(($fullFormat)? ' Million':' M');\n\telse if($number>=1000) return round(($number/1000),0).(($fullFormat)? ' Thousand':' K');\n\n\treturn number_format($number, 0, '.', ',');\n}", "private function numberFormat($value): string\n\t{\n\t\treturn number_format(\n\t\t\t(float) $value,\n\t\t\tRSFormProHelper::getConfig('payment.nodecimals'),\n\t\t\tRSFormProHelper::getConfig('payment.decimal'),\n\t\t\tRSFormProHelper::getConfig('payment.thousands')\n\t\t);\n\t}", "function add_commas($number, $number_of_decimals)\n{\n\t# Default to zero if the number is not set\n\tif(!isset($number) || $number == \"\" || $number <= 0)\n\t{\n\t\t$number = \"0\";\n\t} \n\t\n\treturn number_format($number, $number_of_decimals, '.', ',');\n}", "public static function formatNumber($number, $decimalPlaces = 2)\n {\n if (floor($number) != $number) {\n $number = number_format($number, $decimalPlaces, '.', '');\n }\n\n return $number;\n }", "function dokan_number_format( $number ) {\n $threshold = 10000;\n\n if ( $number > $threshold ) {\n return number_format( $number/1000, 0, '.', '' ) . ' K';\n }\n\n return $number;\n}", "function format_number($number, $divider = ',') {\n\t$number = intval(trim($number)) . '';\n\t$return = '';\n\t$len = strlen($number);\n\tfor($i = $len - 1, $j = 1; $i >= 0; $i--, $j++) {\n\t\t$return = ($j % 3 == 0 && $j != $len ? $divider : '') . $number[$i] . $return;\n\t}\n\treturn $return;\n}", "function carton_format_decimal( $number, $dp = '' ) {\n\tif ( $dp == '' )\n\t\t$dp = intval( get_option( 'carton_price_num_decimals' ) );\n\n\t$number = number_format( (float) $number, (int) $dp, '.', '' );\n\n\tif ( strstr( $number, '.' ) )\n\t\t$number = rtrim( rtrim( $number, '0' ), '.' );\n\n\treturn $number;\n}", "public static function numberFormat($number, $decimalPlaces = 0, $minimal = true)\r\n\t{\r\n\t\tif($minimal && $decimalPlaces > 0)\r\n\t\t{\r\n\t\t\twhile($decimalPlaces > 0 && numbers::round($number,$decimalPlaces - 1) == $number)\r\n\t\t\t{\r\n\t\t\t\t$decimalPlaces--;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ipsRegistry::getClass('class_localization')->formatNumber($number, $decimalPlaces);\r\n\t}", "function formatCurrency($number, $decimals = 2, $currency = 'Ksh')\n{\n return $currency . \" \" . format_num($number, $decimals, '.', ',');\n}", "function yourls_number_format_i18n( $number, $decimals = 0 ) {\n\tglobal $yourls_locale_formats;\n\tif( !isset( $yourls_locale_formats ) )\n\t\t$yourls_locale_formats = new YOURLS_Locale_Formats();\n\n\t$formatted = number_format( $number, abs( intval( $decimals ) ), $yourls_locale_formats->number_format['decimal_point'], $yourls_locale_formats->number_format['thousands_sep'] );\n\treturn yourls_apply_filter( 'number_format_i18n', $formatted );\n}", "function number_format_short( $n, $precision = 1 ) {\r\n\tif ($n < 900) {\r\n\t\t// 0 - 900\r\n\t\t$n_format = number_format($n, $precision);\r\n\t\t$suffix = '';\r\n\t} else if ($n < 900000) {\r\n\t\t// 0.9k-850k\r\n\t\t$n_format = number_format($n / 1000, $precision);\r\n\t\t$suffix = 'K';\r\n\t} else if ($n < 900000000) {\r\n\t\t// 0.9m-850m\r\n\t\t$n_format = number_format($n / 1000000, $precision);\r\n\t\t$suffix = 'M';\r\n\t} else if ($n < 900000000000) {\r\n\t\t// 0.9b-850b\r\n\t\t$n_format = number_format($n / 1000000000, $precision);\r\n\t\t$suffix = 'B';\r\n\t} else {\r\n\t\t// 0.9t+\r\n\t\t$n_format = number_format($n / 1000000000000, $precision);\r\n\t\t$suffix = 'T';\r\n\t}\r\n\t// Remove unecessary zeroes after decimal. \"1.0\" -> \"1\"; \"1.00\" -> \"1\"\r\n\t// Intentionally does not affect partials, eg \"1.50\" -> \"1.50\"\r\n\tif ( $precision > 0 ) {\r\n\t\t$dotzero = '.' . str_repeat( '0', $precision );\r\n\t\t$n_format = str_replace( $dotzero, '', $n_format );\r\n\t}\r\n\treturn $n_format . $suffix;\r\n}", "function international_num_format($input, $decimals = 2)\n\t{\n\t\tglobal $config;\n\n\t\tswitch ($config['number_format_style']) {\n\t\t\tcase '2': // spain, germany\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', '.');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', '.');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '3': // estonia\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, '.', ' ');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, '.', ' ');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '4': // france, norway\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', ' ');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', ' ');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '5': // switzerland\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, \",\", \"'\");\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, \",\", \"'\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '6': // kazahistan\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', '.');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', '.');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, '.', ',');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, '.', ',');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t} // end switch\n\t\treturn $output;\n\t}", "function format_price($number)\n{\n return number_format($number, 0, '', '&thinsp;');\n}", "function erp_number_format_i18n( $number ) {\n // cast as string\n $number = (string) $number;\n\n // check if . exist\n if ( strpos( $number, '.' ) !== false ) {\n $extract = explode( '.', $number );\n if ( isset( $extract[1] ) && absint( $extract[1] > 0 ) ) {\n return number_format_i18n( $number, 1 );\n }\n }\n return number_format_i18n( $number );\n}", "function add_commas($number)\n{\n $parts = explode('.', $number);\n $parts[0] = number_format($number);\n $number = implode('.', $parts);\n return $number;\n}", "public function formatAmount ($number) {\n return (float) number_format($number, 2, '.', '');\n }", "function carton_format_total( $number ) {\n\treturn number_format( (float) $number, (int) get_option( 'carton_price_num_decimals' ), '.', '' );\n}", "function nice_number($n) {\r\n // first strip any formatting;\r\n $n = (0+str_replace(\",\",\"\",$n));\r\n\r\n // is this a number?\r\n if(!is_numeric($n)) return false;\r\n\r\n // now filter it;\r\n if($n>1000000000000) return round(($n/1000000000000),2).' trillion';\r\n else if($n>1000000000) return round(($n/1000000000),2).' billion';\r\n else if($n>1000000) return round(($n/1000000),2).' million';\r\n else if($n>1000) return round(($n/1000),2).' thousand';\r\n\r\n return number_format($n);\r\n}", "public function moneyFormat($number) {\n $tenHundred = intval($number / 10000);\n if ($tenHundred > 0) {\n $overbalance = $number % 10000;\n $result = $tenHundred . '万';\n $result .= $overbalance? number_format($overbalance): '';\n } else {\n $result = $number;\n }\n\n $result .= '円';\n return $result;\n }", "public function number($value, $decimals = 0, $dec_point = '.', $thousands_sep = ',')\n {\n return is_numeric($value) ? number_format($value, $decimals, $dec_point, $thousands_sep) : $value;\n }", "protected function format($number)\r\n\t{\r\n\t\treturn number_format($number, $this->decimalPlaces).\" seconds\";\r\n\t}", "private function format(float $number) : float\n {\n return number_format($number, self::DIGITS);\n }", "public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace('&#160;', ' ', $separator));\n }", "public static function format($number, $precision = 2)\n {\n return Format::DOLLAR($number, $precision);\n }", "function formatInIndianStyle($num){\n\t $pos = strpos((string)$num, \".\");\n\t if ($pos === false) { $decimalpart=\"00\";}\n\t else { $decimalpart= substr($num, $pos+1, 2); $num = substr($num,0,$pos); }\n\n\t if(strlen($num)>3 & strlen($num) <= 12){\n\t\t\t\t $last3digits = substr($num, -3 );\n\t\t\t\t $numexceptlastdigits = substr($num, 0, -3 );\n\t\t\t\t $formatted = makecomma($numexceptlastdigits);\n\t\t\t\t $stringtoreturn = $formatted.\",\".$last3digits.\".\".$decimalpart ;\n\t }elseif(strlen($num)<=3){\n\t\t\t\t $stringtoreturn = $num.\".\".$decimalpart ;\n\t }elseif(strlen($num)>12){\n\t\t\t\t $stringtoreturn = number_format($num, 2);\n\t }\n\n\t if(substr($stringtoreturn,0,2)==\"-,\"){$stringtoreturn = \"-\".substr($stringtoreturn,2 );}\n\t return $stringtoreturn;\n\t}", "static function currency_format($value) {\n $value = number_format($value, 2, ',', '.');\n $value = str_replace(',00', '', $value);\n return $value;\n }", "public function format(float $number, ?int $decimals = 0, ?string $dec_point = \".\", ?string $thousands_sep = \",\"): string\n {\n return number_format($number, $decimals, $dec_point, $thousands_sep);\n }", "function smarty_modifier_number_format($string, $places=2, $dec=\",\", $thoussep=\" \")\n{\n if (!$string) return $string;\n return number_format($string, $places, $dec, $thoussep);\n}", "function Formato1($val){\r\n return number_format($val,0,\",\",\".\");\r\n }", "public static function formatMoney($value)\n {\n return number_format($value, 4, '.', '');\n }", "function iu_format_number($input){\n\t$suffixes = array('', 'k', 'M', 'B');\n\t$suffixIndex = 0;\n\n\twhile(abs($input) >= 1000 && $suffixIndex < sizeof($suffixes)){\n\t\t$suffixIndex++;\n\t\t$input /= 1000;\n\t}\n\treturn round(floatval($input / pow(10, 0)),1).$suffixes[$suffixIndex];\n}", "public function nice_number($n) {\r\n $n = (0+str_replace(\",\", \"\", $n));\r\n\r\n // is this a number?\r\n if (!is_numeric($n)) return false;\r\n\r\n // now filter it;\r\n if ($n > 1000000000000) return round(($n/1000000000000), 2).' T'; //trillion\r\n elseif ($n > 1000000000) return round(($n/1000000000), 2).' B'; //billion\r\n elseif ($n > 1000000) return round(($n/1000000), 2).' M';//million\r\n elseif ($n > 1000) return round(($n/1000), 2).' TH'; //thousand\r\n\r\n return number_format($n);\r\n}", "function money_format($format, $number)\n{\n $regex = '/%((?:[\\^!\\-]|\\+|\\(|\\=.)*)([0-9]+)?'.\n '(?:#([0-9]+))?(?:\\.([0-9]+))?([in%])/';\n if (setlocale(LC_MONETARY, 0) == 'C') {\n setlocale(LC_MONETARY, '');\n }\n $locale = localeconv();\n preg_match_all($regex, $format, $matches, PREG_SET_ORDER);\n foreach ($matches as $fmatch) {\n $value = floatval($number);\n $flags = array(\n 'fillchar' => preg_match('/\\=(.)/', $fmatch[1], $match) ?\n $match[1] : ' ',\n 'nogroup' => preg_match('/\\^/', $fmatch[1]) > 0,\n 'usesignal' => preg_match('/\\+|\\(/', $fmatch[1], $match) ?\n $match[0] : '+',\n 'nosimbol' => preg_match('/\\!/', $fmatch[1]) > 0,\n 'isleft' => preg_match('/\\-/', $fmatch[1]) > 0\n );\n $width = trim($fmatch[2]) ? (int)$fmatch[2] : 0;\n $left = trim($fmatch[3]) ? (int)$fmatch[3] : 0;\n $right = trim($fmatch[4]) ? (int)$fmatch[4] : $locale['int_frac_digits'];\n $conversion = $fmatch[5];\n\n $positive = true;\n if ($value < 0) {\n $positive = false;\n $value *= -1;\n }\n $letter = $positive ? 'p' : 'n';\n\n $prefix = $suffix = $cprefix = $csuffix = $signal = '';\n\n $signal = $positive ? $locale['positive_sign'] : $locale['negative_sign'];\n switch (true) {\n case $locale[\"{$letter}_sign_posn\"] == 1 && $flags['usesignal'] == '+':\n $prefix = $signal;\n break;\n case $locale[\"{$letter}_sign_posn\"] == 2 && $flags['usesignal'] == '+':\n $suffix = $signal;\n break;\n case $locale[\"{$letter}_sign_posn\"] == 3 && $flags['usesignal'] == '+':\n $cprefix = $signal;\n break;\n case $locale[\"{$letter}_sign_posn\"] == 4 && $flags['usesignal'] == '+':\n $csuffix = $signal;\n break;\n case $flags['usesignal'] == '(':\n case $locale[\"{$letter}_sign_posn\"] == 0:\n $prefix = '(';\n $suffix = ')';\n break;\n }\n if (!$flags['nosimbol']) {\n $currency = $cprefix .\n ($conversion == 'i' ? $locale['int_curr_symbol'] : $locale['currency_symbol']) .\n $csuffix;\n } else {\n $currency = '';\n }\n $space = $locale[\"{$letter}_sep_by_space\"] ? ' ' : '';\n\n $value = number_format($value, $right, $locale['mon_decimal_point'],\n $flags['nogroup'] ? '' : $locale['mon_thousands_sep']);\n $value = @explode($locale['mon_decimal_point'], $value);\n\n $n = strlen($prefix) + strlen($currency) + strlen($value[0]);\n if ($left > 0 && $left > $n) {\n $value[0] = str_repeat($flags['fillchar'], $left - $n) . $value[0];\n }\n $value = implode($locale['mon_decimal_point'], $value);\n if ($locale[\"{$letter}_cs_precedes\"]) {\n $value = $prefix . $currency . $space . $value . $suffix;\n } else {\n $value = $prefix . $value . $space . $currency . $suffix;\n }\n if ($width > 0) {\n $value = str_pad($value, $width, $flags['fillchar'], $flags['isleft'] ?\n STR_PAD_RIGHT : STR_PAD_LEFT);\n }\n\n $format = str_replace($fmatch[0], $value, $format);\n }\n return $format;\n}", "function format_number_in_french($number)\n {\n return number_format($number, 2, ',', ' ');\n }", "function getFormatNumericDecimal( $n, $p=2 )\n{\n // $r = round( $n, $p );\n $r = number_format($n, 2, '.', '');\n if( $r == '' or $r == 0 or $r == 0.00 )\n {\n $r = '0.00';\n }\n return $r;\n}", "function formatTotal($input,$decimal=2){\n return number_format($input,1,'.','');\n }", "public static function GetMoneyFormat($number){\n setlocale(LC_MONETARY, 'en_US');\n $FormatAmt = money_format('%!i', $number) . \"\\n\";\n \n return $FormatAmt;\n \n }", "private function numberFormat($value) : float\n {\n return round($value, 2);\n }", "function formatPrice($number)\n {\n $price = number_format($number, 2, '.', ',') . \"\";\n $parts = explode('.', $price);\n return $parts[0] . \"<sup>\" . $parts[1] . \"</sup>\";\n }", "public function testFormatNumber()\n {\n $target_value = 1.67583978;\n $initial_value = 1.675839781223232323223232323;\n \n $this->assertEquals($target_value, format_number($initial_value));\n }", "static function currency_format_en($value) {\n $value = number_format($value, 2, '.', ',');\n $value = str_replace('.00', '', $value);\n return $value;\n }", "public function getFormatted($number, $decimals = 2)\n {\n return number_format($number, $decimals);\n }", "function currency_format($amount) {\n\t$amount_ok = number_format($amount,2,',','.');\n\treturn $amount_ok;\n}", "public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n $decimal_value = $this->getDecimalValue($this->object->getValue());\n\n if (setting_value('visiosoft.field_type.decimal::showDecimalMaxPrice') < intval($this->object->getValue()) and $decimal_value == 0) {\n if (!setting_value('visiosoft.field_type.decimal::showDecimal')) {\n $decimals = 0;\n }\n }\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace('&#160;', ' ', $separator));\n }", "public function formatNumber($number, $decimals = -1, $round = false)\n {\n if (!is_numeric($number)) {\n return $number;\n }\n\n // decimals from Alfred config are returned as strings\n if (gettype($decimals) === 'string') {\n $decimals = floatval($decimals);\n }\n\n // Check if number is then parse as float value of that\n preg_match('/([-+]?[0-9]*\\.?[0-9]+)([eE][-+]?[0-9]+)/s', $number, $matches);\n if (!empty($matches) && isset($matches[2])) {\n $number = floatval($number);\n }\n\n $output_format = $this->getSetting('number_output_format', 'comma_dot');\n\n switch ($output_format) {\n case 'dot_comma':\n $thousands_sep = '.';\n $decimal_point = ',';\n break;\n case 'space_comma':\n $thousands_sep = ' ';\n $decimal_point = ',';\n break;\n default:\n $thousands_sep = ',';\n $decimal_point = '.';\n break;\n }\n\n //if decimals are .00 remove them\n if (fmod($number, 1) === 0.00) {\n $decimals = 0;\n }\n\n // handle numbers with a lot of decimals like\n // 0.00035486302682 to bypass the decimals configured by the user\n $data = explode('.', $number . '');\n $decimals_in_number = end($data);\n $total_decimals_in_number = strlen($decimals_in_number);\n\n if (str_starts_with($decimals_in_number, '0')) {\n preg_match('/^(0+)([1-9]{1,})/', $decimals_in_number, $matches);\n if (!empty($matches) && !empty($matches[1]) && !empty($matches[2])) {\n if (strlen($matches[2]) > $decimals) {\n $decimals = strlen($matches[1]) + $decimals;\n } else {\n $decimals = strlen($matches[1]) + strlen($matches[2]);\n }\n }\n }\n\n if ($decimals == -1) {\n $decimals = $total_decimals_in_number;\n }\n\n $negation = ($number < 0) ? (-1) : 1;\n $coefficient = 10 ** $decimals;\n $number = $negation * floor((string)(abs($number) * $coefficient)) / $coefficient;\n\n if ($number > 1 && $decimals > $total_decimals_in_number) {\n $decimals = $total_decimals_in_number;\n }\n if ($decimals > 8) {\n $decimals = 8;\n }\n\n return number_format($number, $decimals, $decimal_point, $thousands_sep);\n }", "function nice_number( $n ) {\n\t$n = (0 + str_replace( ',', '', $n ) );\n\t// is this a number? (o yes, almost certain - but...)\n\tif ( ! is_numeric( $n ) ) return false;\n\t// now filter it;\n\tif ( $n > 1000000000000 ) return round( ($n / 1000000000000), 1 ) . 't';\n\telse if ( $n > 1000000000 ) return round( ($n / 1000000000), 1 ) . 'b';\n\telse if ( $n > 1000000 ) return round( ($n / 1000000), 1 ) . 'm';\n\telse if ( $n > 1000 ) return round( ($n / 1000), 1 ) . 'k';\n\treturn number_format( $n );\n}", "function convertNum($x){\n\treturn number_format($x, 2, '.', ',');\n}", "function convertNum($x){\n\treturn number_format($x, 2, '.', ',');\n}", "function twig_number_format_filter(Twig_Environment $env, $number, $decimal = null, $decimalPoint = null, $thousandSep = null)\n{\n $defaults = $env->getExtension('core')->getNumberFormat();\n if (null === $decimal) {\n $decimal = $defaults[0];\n }\n if (null === $decimalPoint) {\n $decimalPoint = $defaults[1];\n }\n if (null === $thousandSep) {\n $thousandSep = $defaults[2];\n }\n return number_format((float) $number, $decimal, $decimalPoint, $thousandSep);\n}", "public function format(TechDivision_Lang_Integer $integer);", "function bd_nice_number($n) {\n // Strip any formatting;\n $n = (0+str_replace(\",\",\"\",$n));\n \n // Check if it's a num\n if(!is_numeric($n)) return false;\n \n // Filter through trillions, billions, and millions\n if($n>1000000000000) return round(($n/1000000000000),2).'T';\n else if($n>1000000000) return round(($n/1000000000),2).'B';\n else if($n>1000000) return round(($n/1000000),2).'M';\n \n return number_format($n);\n}", "public static function formatCurrency($number) {\n $aCountryList = DI::getDefault()->get('config')->countryList;\n $sSymbol = $aCountryList[$aCountryList['currentCountry']]['currency'];\n $sType = $aCountryList[$aCountryList['currentCountry']]['currencyType'];\n switch ($sType) {\n case 'prefix':\n return $sSymbol.' '.number_format($number, 0, '.', '.');\n break;\n case 'suffix':\n return number_format($number, 0, '.', '.').' '.$sSymbol;\n break;\n default: break;\n }\n return \"\";\n }", "function convert_number($n) {\r\r\n if($n != ''){\r\r\n $n = (0+str_replace(\",\", \"\", $n));\r\r\n }\r\r\n\r\r\n //if (!is_numeric($n)) return false;\r\r\n\r\r\n if ($n > 1000000000000) return round(($n/1000000000000), 2).'T';\r\r\n elseif ($n > 1000000000) return round(($n/1000000000), 2).'B';\r\r\n elseif ($n > 1000000) return round(($n/1000000), 2).'M';\r\r\n elseif ($n > 1000) return round(($n/1000), 2).'Th';\r\r\n \r\r\n return number_format($n);\r\r\n }", "public static function thousandsCurrencyFormat($num) {\n $exp = 0;\n while($num > 1000) {\n $exp++;\n $num/= 1000;\n }\n\n $suffixes = array('', 'K', 'M', 'G', 'T');\n $suffix = $suffixes[$exp];\n\n $num_digits = floor(log10($num + 0.01));\n $num = round($num, 2 - $num_digits);\n\n $converted = $num . \" \" . $suffix;\n\n return $converted;\n }", "public static function invoiceNumberFormat($settings, $number)\n {\n //return '#' . sprintf(\"%05d\", $number);\n return $settings[\"invoice_prefix\"] . sprintf(\"%05d\", $number);\n }", "function wolf_share_format_number( $n = 0 ) {\n\n\t$s = array( 'K', 'M', 'G', 'T' );\n\t$out = '';\n\twhile ( $n >= 1000 && count( $s ) > 0) {\n\t\t$n = $n / 1000.0;\n\t\t$out = array_shift( $s );\n\t}\n\treturn round( $n, max( 0, 3 - strlen( (int)$n ) ) ) .\" $out\";\n}", "function numberformat($qwe,$asd)\r\n{\r\n if($qwe==0)$zxc='0'; \r\n else{\r\n $zxc=number_format($qwe,$asd);\r\n }\r\n return $zxc;\r\n}", "function filterNumber($num)\n{\n return number_format(floatval($num), 2, '.', ',');\n}", "public static function formatValue($value, $currency) :string\n {\n $value = floatval($value);\n\n $thousand = $currency->thousand_separator;\n $decimal = $currency->decimal_separator;\n $precision = $currency->precision;\n\n return number_format($value, $precision, $decimal, $thousand);\n }", "public static function asNumber($value): string\n {\n $v = round($value, 2);\n\n return number_format(\n $value,\n max(0, strlen(strrchr($v, '.')) - 1),\n self::$formats[self::P_DECIMAL_CHAR],\n self::$formats[self::P_THOUSANDS_CHAR]\n );\n }" ]
[ "0.7953258", "0.76451147", "0.74006146", "0.73969805", "0.7356879", "0.72887635", "0.7238511", "0.72229624", "0.71826625", "0.71171105", "0.7104316", "0.7057417", "0.6995231", "0.69218785", "0.6871963", "0.67797023", "0.6663895", "0.6637502", "0.6625402", "0.65992945", "0.65896237", "0.6572403", "0.65670705", "0.6566852", "0.65619314", "0.6541386", "0.65115696", "0.6471107", "0.6434781", "0.64312935", "0.6430916", "0.6426618", "0.642247", "0.64196146", "0.6411998", "0.6404112", "0.6371808", "0.6356546", "0.63396525", "0.6336698", "0.6333487", "0.6331971", "0.63268447", "0.63183284", "0.6315431", "0.6298118", "0.6295576", "0.62806773", "0.62773454", "0.62601733", "0.6238845", "0.6234792", "0.6181901", "0.61776125", "0.6175074", "0.6158575", "0.6146916", "0.61373377", "0.6130022", "0.6124248", "0.60912275", "0.60573137", "0.60560757", "0.60538334", "0.6039883", "0.60306656", "0.602793", "0.60278016", "0.60119355", "0.6010335", "0.5997645", "0.5994029", "0.5970929", "0.596578", "0.5948924", "0.59488773", "0.59326124", "0.5931377", "0.5930451", "0.59246576", "0.59158605", "0.5913026", "0.59034216", "0.5897476", "0.5879109", "0.58674544", "0.58492464", "0.58492464", "0.5834846", "0.58236194", "0.58221334", "0.58150107", "0.579917", "0.5784745", "0.5777396", "0.5768834", "0.5767836", "0.5766545", "0.5765236", "0.5758304" ]
0.64737904
27
/ Creating a function to create widget
function wpdocs_theme_slug_widgets_init() { register_sidebar( array( 'name' => __( 'footer 2', 'wordpress' ), 'id' => 'sidebar-1', 'description' => __( 'Widgets in this area will be shown on all posts and pages.', 'wordpress' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addWidget()\r\n {\r\n }", "public function getWidget();", "public static function a_widget_init() {\n\t\t\treturn register_widget(__CLASS__);\n\t\t}", "function register_widget_control($name, $control_callback, $width = '', $height = '', ...$params)\n {\n }", "public function get_widget_control($args)\n {\n }", "abstract public function getWidget() : string;", "public function widget( $args, $instance ){}", "function register_widget($widget)\n {\n }", "abstract public function widget_markup( $args, $instance );", "function comanche_widget($name,$args = null) {\n\t$a = get_app();\n\t$func = 'widget_' . trim($name);\n\tif(function_exists($func))\n\t\treturn $func($args);\n}", "function suhv_widgets()\n{\n register_widget( 'Suhv_Widgets' );\n}", "static function register_widget() {\n\t\t\t$classname = get_called_class();\n\t\t\tregister_widget( $classname );\n\t\t}", "protected function makeJqWidget()\n {\n parent::makeJqWidget();\n Application::executeJsFunction('qc.dialog', $this->getJqControlId(), Application::PRIORITY_HIGH);\n }", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public static function create( $name = null, array $options = array() )\n\t{\n\t\t//\tAllow shifted arguments...\n\t\tif ( is_array( $name ) && array() === $options )\n\t\t{\n\t\t\t$options = $name;\n\t\t\t$name = null;\n\t\t}\n\n\t\t//\tInstantiate...\n\t\t$_name = CPSHelperBase::nvl( $name, ( version_compare( PHP_VERSION, '5.3.0' ) >= 0 ) ? get_called_class() : $name );\n\t\t$_class = CPSHelperBase::o( $options, 'class', ( version_compare( PHP_VERSION, '5.3.0' ) >= 0 ) ? get_called_class() : $_name, true );\n\t\t$_widget = new $_class;\n\t\t$_widget->widgetName = $_name;\n\t\t$_widget->id = $_widget->name = CPSHelperBase::o( $options, 'id', $_name );\n\t\t$_widget->name = CPSHelperBase::o( $options, 'name', $_widget->id );\n\n\t\t//\tPush any optional scripts\n\t\tforeach ( CPSHelperBase::o( $options, '_scripts', array(), true ) as $_script )\n\t\t\t$_widget->pushScriptFile( $_widget->baseUrl . $_script );\n\n\t\t//\tAnd CSS\n\t\tforeach ( CPSHelperBase::o( $options, '_cssFiles', array(), true ) as $_css )\n\t\t\t$_widget->pushCssFile( $_widget->baseUrl . $_css );\n\n\t\t//\tNow process the rest of the options...\n\t\t$_widget->addOptions( $options );\n\n\t\t//\tInitialize our widget\n\t\t$_widget->init();\n\n\t\t//\tAnd run it...\n\t\tif ( $_widget->autoRun )\n\t\t\t$_widget->run();\n\n\t\t//\tAnd return...\n\t\treturn $_widget;\n\t}", "function &buildWidget(&$record, &$field, &$form, $formFieldName, $new=false){\n\t\t\n\t\t$widget =& $field['widget'];\n\t\t$factory =& Dataface_FormTool::factory();\n\t\t$el =& $factory->addElement('calendar', $formFieldName, $widget['label']);\n\t\t$el->setProperties($widget);\n\t\n\t\treturn $el;\n\t}", "private function initializeWidgetIdentifier() {}", "function wp_render_widget_control($id)\n {\n }", "public function MyWidget() {\n\t\t// Instantiate the parent object\n\t\t\n\t\tparent::__construct(\n\t\t\t'show_base_value', // Base ID\n\t\t\t__( 'Visualizza info base', 'Widget che visualizza informazioni base dell\\'azienda' ), // Name\n\t\t\tarray( 'description' => __( 'Visualizza info base', 'Una bella descrizione del mio piccolo widget' ), ) // Args\n\t\t);\n\t\n\t}", "function add_new_widget(){\n\t\t?>\n\t\t<div id=\"ww-add-new-widget\">\n\t\t\t<h2><?php _e('Add Widget', 'widgetwrangler'); ?></h2>\n\t\t\t<div class=\"ww-inner\">\n\t\t\t\t<select id=\"ww-add-new-widget-widget\">\n\t\t\t\t\t<option value=\"0\">-- <?php _e('Select a Widget', 'widgetwrangler'); ?> --</option>\n\t\t\t\t\t<?php foreach ( $this->all_widgets as $widget ){ ?>\n\t\t\t\t\t\t<option value=\"<?php print esc_attr( $widget->ID ); ?>\"><?php print $widget->post_title; ?></option>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</select>\n\t\t\t\t<select id=\"ww-add-new-widget-corral\">\n\t\t\t\t\t<option value=\"0\">-- <?php _e('Select a Corral', 'widgetwrangler'); ?> --</option>\n\t\t\t\t\t<?php foreach($this->all_corrals as $corral_slug => $corral_name) { ?>\n\t\t\t\t\t\t<option value=\"<?php print esc_attr( $corral_slug ); ?>\"><?php print $corral_name; ?></option>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</select>\n\t\t\t\t<span id=\"ww-add-new-widget-button\" class=\"button button-large\"><?php _e('Add Widget to Corral', 'widgetwrangler'); ?></span>\n\t\t\t</div>\n\t\t\t<p class=\"description ww-inner\"><?php _e('Select a widget you would like to add, and the corral where you would like to add it. Click the button Add Widget to Corral.', 'widgetwrangler'); ?></p>\n\n\t\t\t<script type=\"text/html\" id=\"tmpl-add-widget\">\n\t\t\t\t<?php\n\t\t\t\t$tmpl_widget = array(\n\t\t\t\t\t'weight' => '__widget-weight__',\n\t\t\t\t\t'id' => '__widget-ID__',\n\t\t\t\t\t'title' => '__widget-post_title__',\n\t\t\t\t\t'corral' => array(\n\t\t\t\t\t\t'slug' => '__widget-corral_slug__',\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\tprint $this->sortable_corral_item( $tmpl_widget, '__ROW-INDEX__' );\n\t\t\t\t?>\n\t\t\t</script>\n\t\t</div>\n\t\t<?php\n\t\t//\n\t}", "function create_triout_widget( $data ) {\n\t\t\t\t\t\t\n\t\t\t$frame .= \"<iframe src='http://trioutnc.com/u/\" . $data['widgettype'] . \".php?user=\" . $data['uid'] . \"&history=\" . $data['number'] . \"&nav=\" . $data['nav'] . \"' \";\n\t\t\t$frame .= \"width='\" . $data['width'] . \"' height='\" . $data['height'] . \"' frameborder='0' style='border:1px solid #\" . $data['border'] . \";' ></iframe>\";\n\t\t\t$frame .= \"<p style='font-family:Arial;font-size: small;padding-top:0;margin-top: 3px;'><a href='http://TriOutNC.com/u/\" . $data['uid'] . \"' target='new' style='text-decoration: none;color: #ED000F;'>Find Me</a> on <a href='http://TriOutNC.com/' target='new' style='text-decoration: none;color: #ED000F;'>TriOut!</a></p>\";\n\t\t\t\n\t\t\treturn $frame;\n\t\t}", "function ftagementor_description_Widget() {\r\r\n register_widget( 'ftagementor_description_Widget' );\r\r\n}", "public function getWidget($name){\n\t\t\t$class = null;\n\t\t\tif(is_file($this->config['widgetFolder'].$name.'.widget.php')){\n\t\t\t\trequire_once($this->config['widgetFolder'].$name.'.widget.php');\n\t\t\t\t$name = 'UIW_'.$name;\n\t\t\t\t$class = new $name();\n\t\t\t} \n\t\t\treturn $class;\n\t\t}", "function fr_s_Blog_Widget() {\n\t\t$widget_ops = array( 'classname' => 'fr_s_blog_widget', 'description' => __('Sidebar or Footer widget that displays your latest posts with a thumbnail and a short excerpt.', 'twok') );\n\t\t$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'fr_s_blog_widget' );\n\t\tparent::__construct( 'fr_s_blog_widget', __('TWOK - Recent Posts Widget (Sidebar)', 'twok'), $widget_ops, $control_ops );\n}", "public function register_widget() {\n register_widget( 'WPP_Widget' );\n }", "public function add_widget_box() {\n\t\t\t$nonce = wp_create_nonce ( 'delete-wprt-widget_area-nonce' ); ?>\n\t\t\t <script type=\"text/html\" id=\"wprt-add-widget-template\">\n\t\t\t\t<div id=\"wprt-add-widget\" class=\"widgets-holder-wrap\">\n\t\t\t\t <div class=\"\">\n\t\t\t\t <input type=\"hidden\" name=\"wprt-nonce\" value=\"<?php echo esc_attr( $nonce ); ?>\" />\n\t\t\t\t <div class=\"sidebar-name\">\n\t\t\t\t <h3><?php esc_html_e( 'Create a Widget Area', 'fundrize' ); ?> <span class=\"spinner\"></span></h3>\n\t\t\t\t </div>\n\t\t\t\t <div class=\"sidebar-description\">\n\t\t\t\t\t<form id=\"addWidgetAreaForm\" action=\"\" method=\"post\">\n\t\t\t\t\t <div class=\"widget-content\">\n\t\t\t\t\t\t<input id=\"wprt-add-widget-input\" name=\"wprt-add-widget-input\" type=\"text\" class=\"regular-text\" title=\"<?php esc_attr_e( 'Name', 'fundrize' ); ?>\" placeholder=\"<?php esc_attr_e( 'Name', 'fundrize' ); ?>\" />\n\t\t\t\t\t </div>\n\t\t\t\t\t <div class=\"widget-control-actions\">\n\t\t\t\t\t\t<div class=\"aligncenter\">\n\t\t\t\t\t\t <input class=\"addWidgetArea-button button-primary\" type=\"submit\" value=\"<?php esc_attr_e( 'Create Widget Area', 'fundrize' ); ?>\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<br class=\"clear\">\n\t\t\t\t\t </div>\n\t\t\t\t\t</form>\n\t\t\t\t </div>\n\t\t\t\t </div>\n\t\t\t\t</div>\n\t\t\t </script>\n\t\t\t<?php\n\t\t}", "function abc_load_widget()\n{\n register_widget('awesome_bmi_widget');\n}", "function register_service_box()\n{\n register_widget( 'CtaWidget' );\n}", "function register_zijcareebuilderjobswidget() {\n register_widget( 'ZijCareerBuilderJobs' );\n}", "function add_dashboard_widget_function() {\n\t// Entering the text between the quotes\n\techo \"<p>CUSTOM HTML WIDGET HERE</p>\";\n}", "function buildWidgets(&$table,$row) {\n //print_r($this);\n $this->table = &$table;\n $widgets = array(\n // format:\n //name display, width, pos , span , \n 'name' => array(null, 1 , 1),\n 'type' => array(null, 2 , 1),\n 'length' => array(null, 3 , 1),\n 'notnull' => array('n', 4 , 1),\n 'isIndex' => array('I', 5 , 1),\n 'sequence' => array('+', 6 , 1),\n 'unique' => array('u', 7 , 1),\n 'default' => array(null, 8 , 2)\n \n );\n \n foreach ($widgets as $string=>$config) {\n \n switch($string) {\n \n case 'name':\n case 'length':\n case 'default':\n $this->widgets[$string] = &new GtkEntry;\n $this->widgets[$string]->set_text((string) $this->$string);\n $this->widgets[$string]->connect('changed',array(&$this,'callbackSetValue'),$string);\n $this->widgets[$string]->connect('leave-notify-event', array(&$this->table->database,'save'));\n if ($string == 'name') {\n $this->widgets[$string]->connect_after('drag_begin',array(&$this,'callbackNamePressed'));\n $this->widgets[$string]->connect_after('drag-end',array(&$this,'callbackNameReleased'));\n $this->widgets[$string]->show();\n //$this->widgets[$string]->show();\n // $this->widgets[$string]->realize();\n $this->widgets[$string]->connect('drag_data_get', array(&$this,'callbackDropAsk'));\n $this->widgets[$string]->drag_source_set(\n GDK_BUTTON1_MASK|GDK_BUTTON3_MASK, \n array(array('text/plain', 0, -1)),\n GDK_ACTION_COPY\n );\n $this->widgets[$string]->connect('drag_data_received', array(&$this,'callbackDropReceived'));\n $this->widgets[$string]->drag_dest_set(\n GTK_DEST_DEFAULT_ALL, \n array(array('text/plain', 0, -1)) ,\n GDK_ACTION_COPY);\n\n }\n break;\n \n case 'type':\n $this->widgets[$string] = &new GtkEntry;\n $this->widgets[$string]->set_text((string) $this->$string);\n $this->widgets[$string]->connect('button-press-event',array(&$this,'callbackTypePressed'),$string);\n $this->widgets[$string]->set_editable(false); \n break;\n case 'notnull':\n case 'isIndex':\n case 'sequence':\n case 'unique':\n $this->widgets[$string] = &new GtkToggleButton($config[0]);\n $this->widgets[$string]->set_active((int) $this->$string);\n $this->widgets[$string]->connect('toggled',array(&$this,'callbackSetValue'),$string);\n \n break;\n case 'delete':\n $this->widgets[$string] = &new GtkButton('X');\n $this->widgets[$string]->connect('pressed',array(&$this,'callbackRowDelete'));\n break;\n \n } \n \n \n $this->table->addCell($this->widgets[$string],$config[1],$row, $config[2], GTK_EXPAND|GTK_FILL);\n $this->widgets[$string]->show();\n }\n $this->setSizes();\n \n $this->deleteMenuItem = &new GtkMenuItem($this->name);\n $this->deleteMenuItem->show();\n $this->deleteMenuItem->connect('activate',array(&$this,'callbackRowDelete'));\n $this->table->deleteMenu->add( $this->deleteMenuItem);\n $this->setVisable();\n \n \n \n }", "public function getUiComponentFactory();", "public function _register_widgets()\n {\n }", "function Dojo_create() \n{\n return html('dojo/create.html.php');\n}", "function wf_template_widget($retData=false) {\n\t\tglobal $post;\n\t\t\n\t\t$error = 'Error while adding the widget, please report to <a href=\"http://blog.wanderfly.com/wordpress-plugin/\">http://blog.wanderfly.com/wordpress-plugin/</a>.';\n\t\t$widgetHTML = false;\n\t\t\n\t\tif($post) {\n\t\t\t//Get the Destination ID from the post's metas,\n\t\t\t$wf_meta = get_post_meta($post->ID, \"wf_destination\", true);\n\t\t\t\n\t\t\t//Display the wanderfly widget,\n\t\t\tif($wf_meta) {\n\t\t\t\t$wf_metas = explode(':', $wf_meta);\n\t\t\t\t$widgetHTML = wf_widget($wf_metas[0]);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//Echo the widget,\n\t\tif($widgetHTML !== false) {\n\t\t\tif($retData) { return $widgetHTML; }\n\t\t\telse { echo $widgetHTML; }\n\t\t}\n\t\t//Return the widget's HTML,\n\t\telse {\n\t\t\tif($retData) { return $widgetHTML; }\n\t\t\telse { echo $error; }\n\t\t}\n\t\t\n\t}", "function register_broker_widget() {\n register_widget( 'Broker_Widget' );\n}", "public function WidgetClass(){\r\n\t\tYii::import(\"application.GWidgets.\".\".W\".$this->widget);\r\n\t\t$cname='W'.$this->widget;\r\n\t\t$widget=new $cname($this->GTemp,$this);\r\n\t\treturn $widget;\r\n\t}", "public function __construct()\n {\n $widget_ops = array(\n 'classname' => 'cs_widget',\n 'description' => 'CSWidget is awesome',\n );\n parent::__construct('cs_widget', 'CS Widget', $widget_ops);\n }", "function box_widget(){\n\t$CI=& get_instance();\n\treturn $CI->parser->parse('layout/ddi/box_widget.html', $CI->data,true);\n}", "function widget_wrap()\n{\n\tregister_widget('ag_pag_familie_w');\n\tregister_widget('ag_social_widget_container');\n\tregister_widget('ag_agenda_widget');\n}", "public function widget_instance($params) {\n if ($params['widget'] == 'admindelegation' && $this->_userCanViewWidget('admindelegation')) {\n include_once 'AdminDelegation_UserWidget.class.php';\n $params['instance'] = new AdminDelegation_UserWidget($this);\n }\n if ($params['widget'] == 'admindelegation_projects' && $this->_userCanViewWidget('admindelegation_projects')) {\n include_once 'AdminDelegation_ShowProjectWidget.class.php';\n $params['instance'] = new AdminDelegation_ShowProjectWidget($this);\n }\n \n }", "public function __construct($_name)\n { \n\t\t$this->widget_name = $_name;\n }", "public function __construct() {\r\n parent::__construct(\r\n 'gallery_widget', //base ID\r\n __('Gallery', 'text_domain'), //name\r\n array( 'description' => __( 'A gallery widget', 'text_domain' ), ) //argumanets to pass\r\n );\r\n}", "function register_ib_act_widget() {\n\tregister_widget( 'IB_Act_Widget_Widget' );\n}", "function parquesWidgets()\n{\n\t//add classes\n\tinclude_once(TEMPLATEPATH.'/widgets/widgettexto.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-social.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-home.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-progreso.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-categorias.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-banner.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-timelines.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-flickr.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/nav-menu-narrativas.php');\n\n\t//add widget\n \tregister_widget( 'Widget_Texto' );\n \tregister_widget( 'Widget_Social' );\n \tregister_widget( 'Widget_Home' );\n \tregister_widget( 'Widget_Progreso' );\n \tregister_widget( 'Widget_Categorias' );\n \tregister_widget( 'Widget_Banner' );\n \tregister_widget( 'Widget_Timelines' );\n \tregister_widget( 'Widget_Flickr' );\n \tregister_widget( 'Widget_Narrativas' );\n\n\n}", "public function __construct() {\n parent::__construct(\n 'gymfitness_widget', // Base ID\n 'Gym Fitness Clases Widget', // Name\n array( 'description' => __( 'Texto ejemplo', 'text_domain' ), ) // Args\n );\n }", "function dl_widget_init() {\n\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Página de Contacto',\n\t\t'id'\t\t\t=> 'contact-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Barra Lateral',\n\t\t'id'\t\t\t=> 'sidebar-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Search Menu',\n\t\t'id'\t\t\t=> 'menu-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\n}", "function wpb_load_widget() {\n\t\tregister_widget( 'dmv_widget' );\n\t}", "function registerBBwidget(){\r\n\tregister_widget('BbWidgetArea');\r\n\t\r\n\t}", "function cwcg_load_widget() {\n register_widget( 'cwcg_test_grid_widget' );\n}", "public static function register() {\n\t register_widget( __CLASS__ );\n\t}", "function ApontadorWidget() {\n $widget_ops = array('classname' => 'apontador_widget', 'description' => __( \"Display your reviews from Apontador\", \"wp-apontador\") );\n $control_ops = array('width' => 300, 'height' => 300);\n $this->WP_Widget('apontador', __('Apontador Reviews', \"wp-apontador\"), $widget_ops, $control_ops);\n\n }", "public function createComponent()\n {\n return $this->createEmotionComponent(array(\n 'name' => 'Bilder',\n 'xtype' => 'emotion-media-widget',\n 'template' => 'image_widget',\n 'cls' => 'emotion-image-widget',\n 'description' => 'Einfaches Einkaufswelten-Element für Bilder' \n ));\n }", "function ccac_2020_new_widgets_init() {\n /* Pinegrow generated Register Sidebars Begin */\n\n /* Pinegrow generated Register Sidebars End */\n}", "function __construct() {\n\n\t\t$widget_ops = array( 'classname' => $this->css_class );\n\t\t$this->WP_Widget( $this->css_class, __( 'PROPER TEMPLATE', 'proper-widgets' ) , $widget_ops );\n\n\t\t// Widget options\n\t\t$this->widget_fields = array(\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Title', 'proper-widgets' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'id' => 'title',\n\t\t\t\t'description' => __( 'Title for this widget or leave blank for none', 'proper-widgets' ),\n\t\t\t\t'default' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Body text', 'proper-widgets' ),\n\t\t\t\t'type' => 'textarea',\n\t\t\t\t'id' => 'body_text',\n\t\t\t\t'default' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => __( 'A number', 'proper-widgets' ),\n\t\t\t\t'type' => 'number',\n\t\t\t\t'id' => 'number',\n\t\t\t\t'default' => 5\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Some select options', 'proper-widgets' ),\n\t\t\t\t'type' => 'select_assoc',\n\t\t\t\t'id' => 'select_option',\n\t\t\t\t'default' => '1',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'1' => __( 'One', 'proper-widgets' ),\n\t\t\t\t\t'2' => __( 'Two', 'proper-widgets' ),\n\t\t\t\t\t'3' => __( 'Three', 'proper-widgets' ),\n\t\t\t\t\t'4' => __( 'Four', 'proper-widgets' ),\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Yes or no?', 'proper-widgets' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'id' => 'yesno',\n\t\t\t\t'default' => 1\n\t\t\t),\n\n\t\t);\n\n\t}", "function anipics_add_widget_area(){\n register_sidebar(array(\n 'id' => 'projet',\n 'name' => 'Photo gallery',\n 'description' => ' Apparait au centre',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h1>',\n 'after_title' => '</h1>'\n ));\n register_sidebar(array(\n 'id' => 'footer',\n 'name' => 'footer',\n 'description' => ' Apparait bas',\n 'before_widget' => '<div class=\"col s4\" style=\"margin: 0 18em 0 3em \" >',\n 'after_widget' => '</div>',\n 'before_title' => '<h1>',\n 'after_title' => '</h1>'\n ));\n register_sidebar(array(\n 'id' => 'footer2',\n 'name' => 'footer2',\n 'description' => ' Apparait bas',\n 'before_widget' => '<div class=\"col s6\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h1>',\n 'after_title' => '</h1>'\n ));\n}", "function CreateChildControls() {\n }", "function __construct() {\n $widget_ops = array( 'classname' => 'wplms_line_break', 'description' => __('Line Widget for Dashboard', 'wplms-dashboard') );\n $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'wplms_line_break' );\n $this->WP_Widget( 'wplms_line_break', __(' DASHBOARD : Line Break', 'wplms-dashboard'), $widget_ops, $control_ops );\n }", "protected function get_widgets()\n {\n }", "function cb_CLIENT_Widget() {\n\n\t// Widget settings\n\t$widget_ops = array(\n\t\t'classname' => 'cb_client_widget',\n\t\t'description' => __('A widget that displays clients list.', 'cleanbusiness')\n\t);\n\n\t// Widget control settings\n\t$control_ops = array(\n\t\t'width' => 300,\n\t\t'height' => 50,\n\t\t'id_base' => 'cb_client_widget'\n\t);\n\n\t// Create the widget\n\t$this->WP_Widget( 'cb_client_widget', __('Featured Clients', 'cleanbusiness'), $widget_ops, $control_ops );\n\t\n}", "abstract function buildShowLayout(): void;", "public function renderCreateButton()\n {\n return new Tools\\CreateButton($this);\n }", "function duende_load_widget() {\n\tregister_widget( 'duende_widget' );\n}", "function createWidgetConfig() {\n // Add the emotion Komponent\n $component = $this->createEmotionComponent(\n array(\n 'name' => 'Social Media Widget',\n 'template' => 'emotion_socialmedia',\n 'description' => 'Bindet Socialmedia Buttons als Widget in den Einkaufswelten ein. Die URLs werden in der Pluginkonfiguration hinterlegt (Pluginmanager)'\n )\n );\n $component->createCheckboxField(\n array(\n 'name' => 'additional_styles',\n 'fieldLabel' => 'Border Box',\n 'supportText' => 'Zusätzliche Styles hinzufügen?',\n 'helpTitle' => 'Border Box',\n 'helpText' => 'Hier können sie dem widget einen optischen Rand verpassen um es optisch an das SW5 Responsive Theme anzupassen',\n 'defaultValue' => true\n ) \n );\n $component->createCheckboxField(\n array(\n 'name' => 'icons_round',\n 'fieldLabel' => 'Runde Icons',\n 'supportText' => 'Icons rund oder Eckig?',\n 'helpTitle' => 'Runde Icons',\n 'helpText' => 'Hier legen sie die Form der Socialmedia Icons fest: Rund oder Eckig',\n 'defaultValue' => true\n ) \n );\n // Facebook\n $component->createCheckboxField(\n array(\n 'name' => 'facebook_active',\n 'fieldLabel' => 'Facebook',\n 'supportText' => 'Facebook Button anzeigen',\n 'defaultValue' => false\n )\n );\n\n // Google Plus\n $component->createCheckboxField(\n array(\n 'name' => 'google_active',\n 'fieldLabel' => 'GooglePlus',\n 'supportText' => 'GooglePlus Button anzeigen',\n 'defaultValue' => false\n )\n );\n\n // Twitter\n $component->createCheckboxField(\n array(\n 'name' => 'twitter_active',\n 'fieldLabel' => 'Twitter',\n 'supportText' => 'Twitter Button anzeigen',\n 'defaultValue' => false\n )\n );\n\n // Youtube\n $component->createCheckboxField(\n array(\n 'name' => 'youtube_active',\n 'fieldLabel' => 'YouTube',\n 'supportText' => 'YouTube Button anzeigen',\n 'defaultValue' => false\n )\n );\n }", "public static function widget() {\n require_once( 'includes/widget.php' );\n }", "function gymfitness_widgets(){\n register_sidebar( array(\n 'name'=>'Sidebar 1',\n 'id' => 'sidebar_1',\n 'before-widget' => '<div class=\"widget\">', \n 'after-widget' => '</div>', \n 'before_title' => '<h3 class=\"text-center texto-primario\">',\n 'after_title' => '</h3>'\n\n\n ));\n register_sidebar( array(\n 'name'=>'Sidebar 2',\n 'id' => 'sidebar_2',\n 'before-widget' => '<div class=\"widget\">', \n 'after-widget' => '</div>', \n 'before_title' => '<h3 class=\"text-center texto-primario\">',\n 'after_title' => '</h3>'\n\n\n ));\n}", "function example_load_widgets()\n{\n\tregister_widget('GuildNews_Widget');\n}", "function widget_registration($name, $id, $description, $beforeWidget, $afterWidget, $beforeTitle, $afterTitle) {\n register_sidebar(\n array(\n 'name' => $name,\n 'id' => $id,\n 'description' => $description,\n 'before_widget' => $beforeWidget,\n 'after_widget' => $afterWidget,\n 'before_title' => $beforeTitle,\n 'after_title' => $afterTitle,\n )\n );\n}", "function nc__dlg__create($src, $attrs){\n\n\t\t//output function name\n\t\tnc__util__func('class', 'nc__dlg__create');\n\n\t\t//start dialog\n\t\t$tmpDlgId = nc__dlg__start($attrs);\n\n\t\t//start iframe for showing dialog content\n\t\techo \"<iframe src='\" . $src . \"' style='padding: 10px 20px;'></iframe>\";\n\n\t\t//end dialog\n\t\tnc__dlg__end();\n\n\t\t//return dialog id\n\t\treturn $tmpDlgId;\n\n\t}", "public function __construct() {\n parent::__construct( 'Test_Widget', 'Widget Test', [\n 'classname' => 'Test_Widget',\n 'description' => 'Test Widget is awesome'\n ] );\n }", "public function __construct() {\n $widget_ops = array(\n 'classname' => 'undergram-box',\n 'description' => 'Exibe as últimas fotos de qualquer perfil do Instagram.',\n );\n\n parent::__construct( 'undergram_widget', 'Instagram Box', $widget_ops );\n}", "abstract public function createForm();", "abstract public function createForm();", "function WeblizarTwitterWidget() {\r\n\tregister_widget( 'WeblizarTwitter' );\r\n}", "function widget($args, $inst)\n {\n// $title = apply_filters( 'widget_title', $instance['title'] );\n// $title_color = apply_filters( 'widget_title', $instance['title_color'] );\n $image_about = $this->getVal( $inst, 'image_about' );\n $title_color = $this->getVal( $inst, 'title_color' );\n $title = $this->getVal( $inst, 'title' );\n $desc = $this->getVal( $inst, 'desc' );\n ?>\n <section class=\"ftco-section services-section\" id=\"about\">\n <div class=\"container\">\n <div class=\"row no-gutters\">\n <div class=\"col-md-6 p-md-5 img img-2 d-flex justify-content-center align-items-center\" style=\"background-image: url(<?php echo $image_about; ?>);\">\n </div>\n <div class=\"col-md-6 wrap-about py-md-5 ftco-animate\">\n <div class=\"heading-section mb-5 pl-md-5\">\n <span class=\"subheading\"><?php echo $title_color; ?></span>\n <h2 class=\"mb-4\"><?php echo $title; ?></h2>\n <p><?php echo $desc; ?></p>\n </div>\n </div>\n </div>\n </div>\n </section>\n<?php\n }", "protected function Form_Create() {\n\t\t\t$this->txtValue1 = new QTextBox($this);\n\t\t\t\n\t\t\t$this->txtValue2 = new QTextBox($this);\n\t\t\t\n\t\t\t$this->lstOperation = new QListBox($this);\n\t\t\t$this->lstOperation->AddItem('+', 'add');\n\t\t\t$this->lstOperation->AddItem('-', 'subtract');\n\t\t\t$this->lstOperation->AddItem('*', 'multiply');\n\t\t\t$this->lstOperation->AddItem('/', 'divide');\n\t\t\t\n\t\t\t$this->btnCalculate = new QButton($this);\n\t\t\t$this->btnCalculate->Text = 'Calculate';\n\t\t\t$this->btnCalculate->AddAction(new QClickEvent(), new QServerAction('btnCalculate_Click'));\n\t\t\t\n\t\t\t$this->lblResult = new QLabel($this);\n\t\t\t$this->lblResult->HtmlEntities = false;\n\t\t}", "function SetWidget() {\n\t\t\n\t\t\tif ( !function_exists('register_sidebar_widget') ) \n\t\t\treturn;\n\t\t\t\n\t\t\t// This registers our widget so it appears with the other available\n\t\t\t// widgets and can be dragged and dropped into any active sidebars.\n\t\t\tregister_sidebar_widget(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteo'));\n\t\t\n\t\t\t// This registers our optional widget control form.\n\t\t\tregister_widget_control(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteoControl'), 450, 325);\n\t\t}", "function gymfitness_widgets(){\n\n register_sidebar(array(\n 'name' => 'Sidebar 1', \n 'id' => 'sidebar_1',\n 'before_widget' => '<div class=\"\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"widget-title\">',\n 'after_title' => '</h2>'\n ));\n register_sidebar(array(\n 'name' => 'Sidebar 2', \n 'id' => 'sidebar_2',\n 'before_widget' => '<div class=\"\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"widget-title\">',\n 'after_title' => '</h2>'\n ));\n\n}", "function cxense_recommend_widget($id, $width, $height, $template=false, $resize_content=true) {\n static $num_widgets = 1;\n ?>\n <div id=\"cxense-widget-<?php echo $num_widgets ?>\"></div>\n <script>\n var cX = cX || {}; cX.callQueue = cX.callQueue || [];\n cX.callQueue.push(['insertWidget',{\n widgetId: '<?php echo $id ?>',\n insertBeforeElementId: 'cxense-widget-<?php echo $num_widgets ?>',\n renderTemplateUrl: '<?php echo $template ? $template : CXENSE_PLUGIN_URL.'/templates/recommend-widgets/default-widget.html' ?>',\n resizeToContentSize : <?php echo $resize_content ? 'true':'false' ?>,\n width: <?php echo $width ?>,\n height: <?php echo $height ?>\n }]);\n </script>\n <?php\n $num_widgets++;\n}", "function widget_init() {\n if ( function_exists('register_sidebar') )\n \n register_sidebar(\n array(\n 'name' => 'Footer',\n 'before_widget' => '<div class = \"footer\">',\n 'after_widget' => '</div>',\n 'before_title' => '',\n 'after_title' => '',\n ));\n\n register_sidebar(\n array(\n 'name' => 'Event Navigation',\n 'before_widget' => '<div class=\"custom-widget top-round card slight-shadow card_container flex-column-reverse\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"card_title\">',\n 'after_title' => '</div>',\n ));\n\n register_sidebar(\n array(\n 'name' => 'Frontpage News',\n 'before_widget' => '<div class=\"custom-widget card top-round slight-shadow card_container flex-column-reverse\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"card_title\">',\n 'after_title' => '</div>',\n ));\n\n }", "protected function registerWidget()\n {\n\t\t$id = $this->options['id'];\n $gridSelector = $this->gridSelector;\n\t\t\n\t\t$view = $this->getView();\n\t\t\n IsotopeAsset::register($view);\n $js = [];\n \n $options = Json::encode($this->clientOptions);\n $js[] = \"var isotopeContainer$id = $('$gridSelector');\";\n $js[] = \"var isotope$id = isotopeContainer$id.isotope($options);\";\n\n $view->registerJs(implode(\"\\n\", $js),$view::POS_READY);\n\t\t\n\t\tif (!empty($this->cssFile)) {\n\t\t\tcall_user_func_array([$view, \"registerCssFile\"], $this->cssFile);\n\t\t} \t\t\n }", "function register_service_widget() {\n register_widget( 'Services_Widget' );\n}", "function gp_get_default_widget_params() {\n return array(\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n //'before_title' => '<div class=\"decoration\"></div><h1 class=\"widget-title\">',\n 'before_title' => '<h1 class=\"widget-title\">',\n 'after_title' => '</h1>'\n );\n}", "function pramble_widget_setup() {\n\t\t /**\n\t\t\t* Creates a sidebar\n\t\t\t* @param string|array Builds Sidebar based off of 'name' and 'id' values.\n\t\t\t*/\n\t\t\t$args = array(\n\t\t\t\t'name' => 'Sidebar',\n\t\t\t\t'id' => 'sidebar-1',\n\t\t\t\t'description' => 'standard sidebar',\n\t\t\t\t'class' => 'custom',\n\t\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t\t'after_widget' => '</aside>',\n\t\t\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t\t\t'after_title' => '</h2>',\n\t\t\t);\n\t\t\n\t\t\tregister_sidebar( $args );\n\t\n\t\t\t}", "function cm_load_widget_r() {\n\tregister_widget( 'cm_widget_r' );\n}", "function edit_widget($widget, $return, $instance)\n {\n }", "public function create_widgets () {\n wp_enqueue_style( 'wedevs-latest-post-style' );\n\n add_action( 'wp_dashboard_setup', [ $this, 'add_dashboard_widgets' ] );\n }", "function wpb_load_widget() {\n register_widget( 'lrq_widget' );\n }", "function __construct() {\n $widget_ops = array( 'classname' => 'wplms_dash_mymodules', 'description' => __('My Courses, Units, Quizzes, Assignments, Finished Courses widget for Dashboard', 'wplms-dashboard') );\n $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'wplms_dash_mymodules' );\n parent::__construct( 'wplms_dash_mymodules', __(' DASHBOARD : My Modules Widget', 'wplms-dashboard'), $widget_ops, $control_ops );\n }", "public static function ui() {\n return Yii::createObject(NotifyToolWidget::className()); //, [get_called_class()]\n }", "public function widget($hArgs, $hInstance)\n {\n echo $this->generateWidget($hArgs, $hInstance);\n\t}", "function widgets_init_now() {\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Текст вверху шапки'\n\t\t\t,'id' => 'header_top'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Несколько виджетов будут расположены в строчку. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок для виджета рассылки в подвале'\n\t\t\t,'id' => 'footer_mailings'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок контактов в подвале'\n\t\t\t,'id' => 'footer_contacts'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Подробнее о системе обучения в Linguamore'\n\t\t\t,'id' => 'homepage_education-feats'\n\t\t\t,'description' => 'Блок, расположенный на странице \"Преимущества\". Добавьте сюда виджет \"Rich Text\" из левой части страницы. Иконки можно добавить кнопкой \"Add Media\". Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t}", "private function createButton() {\n $fv = new filterVars;\n $phpSelf = $fv->phpSelf();\n\t$addButton = \"<A HREF='$phpSelf?action=crf'><button title='Create Row'>Create Row</button></A>\"; \n return $addButton; \n }", "public function create_visual_editor( $params ) {\n\n\t\t\t$innerHtml = '<div class=\"oxo_iconbox textblock_element textblock_element_style\">';\n\t\t\t$innerHtml .= '<div class=\"bilder_icon_container\"><span class=\"oxo_iconbox_icon\"><i class=\"oxoa-tag\"></i><sub class=\"sub\">' . __( 'Events', 'oxo-core' ) . '</sub></span></div>';\n\t\t\t$innerHtml .= '</div>';\n\t\t\t$this->config['innerHtml'] = $innerHtml;\n\t\t}", "function tw_blog_widget() {\n parent::__construct(false, $name = 'Wunder Blog Widget');\n }", "function drawButtonsDefault() {\r\n global $objectClass, $planningType, $showListFilter;\r\n ?>\r\n <table style=\"width:10px\">\r\n <tr>\r\n <?php \r\n if ($planningType=='planning' or $planningType=='resource' or $planningType=='global' or $planningType=='version') {?>\r\n <td colspan=\"1\" width=\"51px\" style=\"<?php if (isNewGui()) echo 'padding-right: 5px;';?>\">\r\n <?php // ================================================================= NEW ?>\r\n <?php if ($planningType=='version') {?><div id =\"addNewActivity\" style=\"visibility:<?php echo ($showListFilter=='true')?'visible':'hidden';?>;\"><?php } ?>\r\n <div dojoType=\"dijit.form.DropDownButton\"\r\n class=\"comboButton\" \r\n id=\"planningNewItem\" jsId=\"planningNewItem\" name=\"planningNewItem\" \r\n showlabel=\"false\" class=\"\" iconClass=\"dijitButtonIcon dijitButtonIconNew\"\r\n title=\"<?php echo i18n('comboNewButton');?>\">\r\n <span>title</span>\r\n <div dojoType=\"dijit.TooltipDialog\" class=\"white\" style=\"width:200px;\"> \r\n <div style=\"font-weight:bold; height:25px;text-align:center\"><?php echo i18n('comboNewButton');?> </div>\r\n <?php \r\n $arrayItems=array('Project','Activity','Milestone','Meeting','PeriodicMeeting','TestSession');\r\n if ($planningType=='resource' or $planningType=='version') $arrayItems=array('Activity');\r\n if ($planningType=='global') $arrayItems=array_merge($arrayItems,array('Ticket','Action','Decision','Delivery','Risk','Issue','Opportunity','Question'));\r\n foreach($arrayItems as $item) {\r\n $canCreate=securityGetAccessRightYesNo('menu' . $item,'create');\r\n if ($canCreate=='YES') {\r\n if (! securityCheckDisplayMenu(null,$item) ) {\r\n $canCreate='NO';\r\n }\r\n }\r\n if ($canCreate=='YES') {?>\r\n <div style=\"vertical-align:top;cursor:pointer;\" class=\"newGuiIconText\"\r\n onClick=\"addNewItem('<?php echo $item;?>');\" >\r\n <table width:\"100%\"><tr style=\"height:22px\" >\r\n <td style=\"vertical-align:top; width: 30px;padding-left:5px\"><?php echo formatIcon($item, 22, null, false);;?></td> \r\n <td style=\"vertical-align:top;padding-top:2px\"><?php echo i18n($item)?></td>\r\n </tr></table> \r\n </div>\r\n <div style=\"height:5px;\"></div>\r\n <?php \r\n } \r\n }?>\r\n </div>\r\n </div>\r\n <?php if ($planningType=='version') {?></div><?php } ?> \r\n </td> \r\n <?php\r\n } \r\n if ($planningType=='global') {?>\r\n <td colspan=\"1\" width=\"51px\" style=\"<?php if (isNewGui()) echo 'padding-right: 5px;';?>\">\r\n <?php drawGlobalItemsSelector();?>\r\n </td> \r\n <?php \r\n } \r\n $activeFilter=false;\r\n if (is_array(getSessionUser()->_arrayFilters)) {\r\n if (array_key_exists('Planning', getSessionUser()->_arrayFilters)) {\r\n if (count(getSessionUser()->_arrayFilters['Planning'])>0) {\r\n \t foreach (getSessionUser()->_arrayFilters['Planning'] as $filter) {\r\n \t\t if (!isset($filter['isDynamic']) or $filter['isDynamic']==\"0\") {\r\n \t\t\t $activeFilter=true;\r\n \t\t }\r\n \t }\r\n }\r\n }\r\n }\r\n ?>\r\n <?php \r\n if ($planningType=='planning' or $planningType=='resource' or $planningType=='version') {?>\r\n <td colspan=\"1\" width=\"55px\" style=\"padding-left:1px\";>\r\n <?php // ================================================================= FILTER ?>\r\n <?php if ($planningType=='version') {?><div id=\"listFilterAdvanced\" style=\"visibility:<?php echo ($showListFilter=='true')?'visible':'hidden';?>;\"><?php }?>\r\n <button title=\"<?php echo i18n('advancedFilter')?>\" \r\n class=\"comboButton\"\r\n dojoType=\"dijit.form.DropDownButton\" \r\n id=\"listFilterFilter\" name=\"listFilterFilter\"\r\n iconClass=\"dijitButtonIcon icon<?php echo($activeFilter)?'Active':'';?>Filter\" showLabel=\"false\">\r\n <?php \r\n if(!isNewGui()){?>\r\n <script type=\"dojo/connect\" event=\"onClick\" args=\"evt\">\r\n showFilterDialog();\r\n </script>\r\n <script type=\"dojo/method\" event=\"onMouseEnter\" args=\"evt\">\r\n clearTimeout(closeFilterListTimeout);\r\n clearTimeout(openFilterListTimeout);\r\n openFilterListTimeout=setTimeout(\"dijit.byId('listFilterFilter').openDropDown();\",popupOpenDelay);\r\n </script>\r\n <script type=\"dojo/method\" event=\"onMouseLeave\" args=\"evt\">\r\n clearTimeout(openFilterListTimeout);\r\n closeFilterListTimeout=setTimeout(\"dijit.byId('listFilterFilter').closeDropDown();\",2000);\r\n </script>\r\n <?php \r\n }?>\r\n <div dojoType=\"dijit.TooltipDialog\" id=\"directFilterList\" style=\"z-index: 999999;<!-- display:none; --> position: absolute;\">\r\n <?php \r\n $objectClass='Planning';\r\n $dontDisplay=true;\r\n if(isNewGui())include \"../tool/displayQuickFilterList.php\";\r\n include \"../tool/displayFilterList.php\";\r\n if(!isNewGui()){?>\r\n <script type=\"dojo/method\" event=\"onMouseEnter\" args=\"evt\">\r\n clearTimeout(closeFilterListTimeout);\r\n clearTimeout(openFilterListTimeout);\r\n </script>\r\n <script type=\"dojo/method\" event=\"onMouseLeave\" args=\"evt\">\r\n dijit.byId('listFilterFilter').closeDropDown();\r\n </script>\r\n <?php \r\n }?>\r\n </div> \r\n </button>\r\n <?php if ($planningType=='version') {?></div><?php }?>\r\n </td>\r\n <?php \r\n }?> \r\n <td colspan=\"1\">\r\n <?php // ================================================================= COLUMNS SELECTOR ?> \r\n <div dojoType=\"dijit.form.DropDownButton\"\r\n id=\"planningColumnSelector\" jsId=\"planningColumnSelector\" name=\"planningColumnSelector\" \r\n showlabel=\"false\" class=\"comboButton\" iconClass=\"dijitButtonIcon dijitButtonIconColumn\" \r\n title=\"<?php echo i18n('columnSelector');?>\">\r\n <span>title</span>\r\n <?php \r\n $screenHeight=getSessionValue('screenHeight','1080');\r\n $columnSelectHeight=intval($screenHeight*0.6);?>\r\n <div dojoType=\"dijit.TooltipDialog\" id=\"planningColumnSelectorDialog\" class=\"white\" style=\"width:300px;\"> \r\n <script type=\"dojo/connect\" event=\"onHide\" data-dojo-args=\"evt\">\r\n if (dndMoveInProgress) { setTimeout('dijit.byId(\"planningColumnSelector\").openDropDown();',1); }\r\n </script>\r\n <div id=\"dndPlanningColumnSelector\" jsId=\"dndPlanningColumnSelector\" dojotype=\"dojo.dnd.Source\" \r\n dndType=\"column\" style=\"overflow-y:auto; max-height:<?php echo $columnSelectHeight;?>px; position:relative\"\r\n withhandles=\"true\" class=\"container\"> \r\n <?php \r\n if ($planningType=='portfolio') $portfolioPlanning=true;\r\n if ($planningType=='contract') $contractGantt=true;\r\n if ($planningType=='version') $versionPlanning=true;\r\n include('../tool/planningColumnSelector.php');?>\r\n </div>\r\n <div style=\"height:5px;\"></div> \r\n <div style=\"text-align: center;\"> \r\n <button title=\"\" dojoType=\"dijit.form.Button\" \r\n id=\"\" name=\"\" showLabel=\"true\"><?php echo i18n('buttonOK');?>\r\n <script type=\"dojo/connect\" event=\"onClick\" args=\"evt\">\r\n validatePlanningColumn();\r\n </script>\r\n </button>\r\n </div> \r\n </div>\r\n </div>\r\n </td>\r\n </tr>\r\n </table>\r\n<?php \r\n}", "function __construct() {\n\t\n\t\t/* Widget settings. */\n\t\t$widget_ops = array( 'classname' => 'hb_google_widget', 'description' => __('A widget that displays Google+ like box.', 'hbthemes') );\n\t\t$control_ops = array ();\n\t\t/* Create the widget. */\n\t\tparent::__construct( 'hb_google_widget', __('[HB-Themes] Google+ Box','hbthemes'), $widget_ops, $control_ops );\n\t}", "function __construct() {parent::__construct ('featured_news_widget', __('Featured News', 'linnet'), array ('description' => __('This widget displays a featured news', 'linnet'), ));}", "public function makeInputButton() {}", "function register_dc_widget() {\n\t\tregister_widget( 'dc_linked_image' );\n\t\tregister_widget( 'dc_widget_link_text' );\n\t}" ]
[ "0.7290929", "0.7172733", "0.7070885", "0.69416255", "0.66966385", "0.6663961", "0.66550684", "0.65991414", "0.6563856", "0.6480386", "0.64480805", "0.6398212", "0.63896704", "0.6377068", "0.6377068", "0.63644826", "0.63225794", "0.6297266", "0.62712485", "0.62569016", "0.62416995", "0.6239284", "0.6233667", "0.62213", "0.6207454", "0.61988336", "0.6194842", "0.61770076", "0.61532706", "0.6129508", "0.6100078", "0.6096906", "0.6088289", "0.6084241", "0.60779184", "0.60769576", "0.6062895", "0.60627085", "0.60483795", "0.60467345", "0.6035278", "0.603154", "0.60231197", "0.6021745", "0.6020744", "0.6016513", "0.5993074", "0.5981926", "0.59785527", "0.596985", "0.5968161", "0.59671307", "0.59537077", "0.59400374", "0.5921422", "0.5917335", "0.591598", "0.59141517", "0.5909604", "0.590676", "0.5897709", "0.5893641", "0.5889496", "0.5885502", "0.58800566", "0.5880034", "0.58764976", "0.5871863", "0.58710766", "0.5859132", "0.58559024", "0.5855347", "0.5843511", "0.5843511", "0.5840894", "0.5832832", "0.5828012", "0.5825598", "0.5824937", "0.5819273", "0.5814344", "0.58010393", "0.57999784", "0.5798189", "0.5792756", "0.57905215", "0.5790288", "0.578937", "0.5787153", "0.5786428", "0.57792175", "0.57747394", "0.5771037", "0.5767591", "0.5766507", "0.57649016", "0.5762918", "0.5762316", "0.57588476", "0.5756081", "0.57491565" ]
0.0
-1
/ Creating a function to create our slider
function slider_post_type() { $labels = array( 'name' => _x( 'slider', 'Post Type General Name', 'resturant' ), 'singular_name' => _x( 'slider', 'Post Type Singular Name', 'resturant' ), 'menu_name' => __( 'slider', 'resturant' ), 'parent_item_colon' => __( 'Parent slider', 'resturant' ), 'all_items' => __( 'All slider', 'resturant' ), 'view_item' => __( 'View slider', 'resturant' ), 'add_new_item' => __( 'Add New slider', 'resturant' ), 'add_new' => __( 'Add New', 'resturant' ), 'edit_item' => __( 'Edit slider', 'resturant' ), 'update_item' => __( 'Update slider', 'resturant' ), 'search_items' => __( 'Search slider', 'resturant' ), 'not_found' => __( 'Not Found', 'resturant' ), 'not_found_in_trash' => __( 'Not found in Trash', 'resturant' ), ); $args = array( 'label' => __( 'slider', 'resturant' ), 'description' => __( 'slider news and reviews', 'resturant' ), 'labels' => $labels, 'menu_icon' => 'dashicons-slides ', 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', ), 'taxonomies' => array( 'genres' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 5, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'page', 'taxonomies' => array( 'category' ), ); register_post_type( 'slider', $args ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lumo_slider(){\n\t\t$slides = new Lumo_Slider_Query();\n\n\t\tif( $slides->have_posts() ) :\n\t\t\t$display = \"\";\n\t\t\techo '<ul id=\"lumo-slider\">';\n\t\t\twhile( $slides->have_posts() ) : $slides->the_post();\n\t\t\t\t$slide_image = get_the_post_thumbnail(get_the_ID(), 'home-slider-image-lowrez');\n\t\t\t\t$slide_image_url = wp_get_attachment_url( get_post_thumbnail_id(get_the_ID(), 'home-slider-image') );\n\n\t\t\t\t$set_width_fullrez = sprintf('width=\"100%%\" data-fullrez=\"%s\"', esc_url($slide_image_url) );\n\n\t\t\t\t$slide_image = preg_replace('/width=\"\\d+\" +height=\"\\d+\"/', $set_width_fullrez, $slide_image);\n\n\t\t\t\techo '<li class=\"lumo-slide\" style=\"'.$display.'\">';\n\t\t\t\t\techo $slide_image;\n\t\t\t\t\techo '<div class=\"hero-placeholder\"></div>';\n\t\t\t\t\techo '<div class=\"hero\">';\n\t\t\t\t\t\t\techo '<h4 class=\"hero\">'.get_the_title().'</h4>';\n\t\t\t\t\t\t\tthe_content();\n\t\t\t\t\techo '</div>';\n\t\t\t\techo '</li>';\n\t\t\t\t$display = \" display:none; \";\n\t\t\tendwhile;\n\t\t\twp_reset_postdata();\n\t\t\techo '</ul>';\n\t\tendif;\n\t}", "function etheme_create_slider($args, $title = false, $image_width = 215, $image_height = 215, $crop = false, $enable_slider_from = 4, $last_offset = 3){\n\tglobal $wpdb;\n\n\t$product_per_row = etheme_get_option('prodcuts_per_row');\n\t$box_id = rand(1000,10000);\n\t$multislides = new WP_Query( $args );\n\n\tif ( $multislides->have_posts() ) :\n\t\tif ($title) {\n\t\t\t$title_output = '<h4 class=\"slider-title\">'.$title.'</h4>';\n\t\t}\n\t\techo '<div class=\"home-product-grid slider\">';\n\t\t\techo $title_output;\n\t\t\techo '<div>';\n\n\t\t\t$_i=0;\n\n\t\t\twhile ($multislides->have_posts()) : $multislides->the_post();\n\t\t\t\t\t$_i++;\n\n\t\t\t\t\tif(class_exists('Woocommerce')) {\n\t\t\t\t\t\t\tglobal $product;\n\t\t\t\t\t\t\tif (!$product->is_visible()) continue;\n\t\t\t\t\t\t\twoocommerce_get_template_part( 'content', 'product' );\n\t\t\t\t\t}\n\t\t\tendwhile;\n\n\t\t\techo '</div><!-- carousel -->';\n\n\t\t\tif($_i > $enable_slider_from):\n\t\t\t\techo '<div class=\"prev arrow'.$box_id.'\" style=\"cursor: pointer; \">&nbsp;</div>';\n\t\t\t\techo '<div class=\"next arrow'.$box_id.'\" style=\"cursor: pointer; \">&nbsp;</div>';\n\t\t\tendif;\n\t\techo '</div><!-- product-slider -->';\n\tendif;\n\n\twp_reset_query();\n\n\tif ($_i>$enable_slider_from) {\n\n\t\tif(etheme_get_option('touch_carusels')) {\n\t\t\t\t$desktopClickDrag = 'true';\n\t\t} else {\n\t\t\t\t$desktopClickDrag = 'false';\n\t\t}\n\n\t\techo '\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\tjQuery(document).ready(function(){\n\t\t\t\t\t\t\t\tjQuery(\".arrow'.$box_id.'.prev\").addClass(\"disabled\");\n\t\t\t\t\t\t\t\tjQuery(\".slider-'.$box_id.'\").iosSlider({\n\t\t\t\t\t\t\t\t\t\tdesktopClickDrag: '.$desktopClickDrag.',\n\t\t\t\t\t\t\t\t\t\tsnapToChildren: true,\n\t\t\t\t\t\t\t\t\t\tinfiniteSlider: false,\n\t\t\t\t\t\t\t\t\t\tnavNextSelector: \".arrow'.$box_id.'.next\",\n\t\t\t\t\t\t\t\t\t\tnavPrevSelector: \".arrow'.$box_id.'.prev\",\n\t\t\t\t\t\t\t\t\t\tlastSlideOffset: '.$last_offset.',\n\t\t\t\t\t\t\t\t\t\tonFirstSlideComplete: function(){\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery(\".arrow'.$box_id.'.prev\").addClass(\"disabled\");\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonLastSlideComplete: function(){\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery(\".arrow'.$box_id.'.next\").addClass(\"disabled\");\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonSlideChange: function(){\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery(\".arrow'.$box_id.'.next\").removeClass(\"disabled\");\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery(\".arrow'.$box_id.'.prev\").removeClass(\"disabled\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t';\n\t}\n}", "function get_slider_view()\r\n\t{\r\n\t\t$sort = get_option('sort'); if(empty($sort)){\r\n\t\t\t$sort = \"post_date\";\r\n\t\t}\r\n\t\t$order = get_option('order'); if(empty($order)){\r\n\t\t\t$order = \"DESC\";\r\n\t\t} // Non utilise\r\n\t\t$limit = get_option('limit'); if(empty($limit)){\r\n\t\t\t$limit = 350;\r\n\t\t} // Non utilise\r\n\t\t$points = get_option('points'); if(empty($points)){\r\n\t\t\t$points = \"...\";\r\n\t\t}\r\n\t\t$post_limit = get_option('limit_posts'); if(empty($limit_posts)){\r\n\t\t\t$limit_posts = \"-1\";\r\n\t\t}\r\n\t\t$auto_switch = get_option('auto_switch'); if(empty($auto_switch)){\r\n\t\t\t$auto_switch = \"1\";\r\n\t\t} // 1 = true, 0 = false\r\n\t\t$timeout = get_option('timeout'); if(empty($timeout)){\r\n\t\t\t$timeout = 5000;\r\n\t\t} // temps de transition par defaut\r\n\r\n\t\t$img_width = get_option('img_width');\r\n\t\tif(empty($img_width)) {\r\n\t\t\t$img_width = 580;\r\n\t\t}\r\n\r\n\t\t$img_height = get_option('img_height');\r\n\t\tif(empty($img_height)) {\r\n\t\t\t$img_height = 300;\r\n\t\t}\r\n\r\n\t\t// Get the slider content\r\n\t\tglobal $wpdb;\r\n\t\tglobal $post;\r\n\r\n\t\t$args = array( 'meta_key' => 'fading_slider',\r\n\t\t\t\t'meta_value'=> '1', // Seulement les objets dont la case est cochée dans le back\r\n\t\t\t\t'suppress_filters' => 0,\r\n\t\t\t\t'post_type' => array('post', 'page'),\r\n\t\t\t\t'orderby' => $sort,\r\n\t\t\t\t'order' => 'DESC', \t// DESC = Show last post first\r\n\t\t\t\t'numberposts'=> 4); // HTML Markup only allows 4 slides\r\n\r\n\t\t$myposts = get_posts( $args );\r\n\r\n\t\tif (function_exists('add_image_size')) {\r\n\t\t\tadd_image_size( 'fading_slider', $img_width, $img_height, true ); // Miniatures des archives\r\n\t\t}\r\n\r\n\t\t/* PHP Generated Styles here */\r\n\t\t?>\r\n\t\t<style type=\"text/css\">\r\n\r\n\t\t\t#fading_slider {\r\n\t\t\t\tbackground-color: #<?php $bg = get_option('fading_slider_bg'); if(!empty($bg)) {echo $bg;} else {echo \"FFF\";}?>;\r\n\t\t\t\tborder: 8px solid #<?php $border = get_option('fading_slider_border'); if(!empty($border)) {echo $border;} else {echo \"CCC\";}?>;\r\n\t\t\t\twidth: <?php $width = get_option('fading_slider_width'); if(!empty($width)) {echo $width;} else {echo \"580\";}?>px;\r\n\t\t\t}\r\n\t\t<?php\r\n\r\n\t\t\t$i = 1;\r\n\t\t\tforeach( $myposts as $post ) : setup_postdata($post);\r\n\r\n\t\t\t\t$custom = get_post_custom($post->ID);\r\n\t\t\t\techo \"/* ID POST : \" . $post->ID . \"*/\";\r\n\t\t\t\t$thumb = $this->get_wp_generated_thumb( get_the_post_thumbnail( $post->ID ) );\r\n\t\t\t\t// $thumb = $this->get_wp_generated_thumb( get_the_post_thumbnail($post->ID, \"fading_slider\") );\r\n\r\n\t\t\t\techo \".cr-container input.cr-selector-img-\".$i.\":checked ~ .cr-bgimg,\r\n\t\t.cr-bgimg div span:nth-child(\".$i.\"){\r\n\t\t background-image: url(\".$thumb.\");\r\n\t\t}\\n\";\r\n\r\n\t\t\t\t$i++;\r\n\t\t\tendforeach; wp_reset_postdata();\r\n\r\n\t\t?>\r\n\t\t</style>\r\n\r\n\t\t<div id=\"fading_slider\">\r\n\r\n <section class=\"cr-container\">\r\n\r\n <!-- boutons cliquables -->\r\n <input id=\"select-img-1\" name=\"radio-set-1\" type=\"radio\" class=\"cr-selector-img-1 current\" checked/>\r\n <label for=\"select-img-1\" class=\"cr-label-img-1\">1</label>\r\n\r\n \t<input id=\"select-img-2\" name=\"radio-set-1\" type=\"radio\" class=\"cr-selector-img-2\" />\r\n <label for=\"select-img-2\" class=\"cr-label-img-2\">2</label>\r\n\r\n \t<input id=\"select-img-3\" name=\"radio-set-1\" type=\"radio\" class=\"cr-selector-img-3\" />\r\n <label for=\"select-img-3\" class=\"cr-label-img-3\">3</label>\r\n\r\n \t<input id=\"select-img-4\" name=\"radio-set-1\" type=\"radio\" class=\"cr-selector-img-4\" />\r\n <label for=\"select-img-4\" class=\"cr-label-img-4\">4</label>\r\n\r\n\t <div class=\"clr\"></div>\r\n\r\n\t\t<!-- images (tranches) -->\r\n\t\t<div class=\"cr-bgimg\">\r\n\t\t\t<div>\r\n\t\t\t\t<span>Tranche 1 - Image 1</span>\r\n\t\t\t\t<span>Tranche 1 - Image 2</span>\r\n\t\t\t\t<span>Tranche 1 - Image 3</span>\r\n\t\t\t\t<span>Tranche 1 - Image 4</span>\r\n\t\t\t</div>\r\n\t\t\t<div>\r\n\t\t\t\t<span>Tranche 2 - Image 1</span>\r\n\t\t\t\t<span>Tranche 2 - Image 2</span>\r\n\t\t\t\t<span>Tranche 2 - Image 3</span>\r\n\t\t\t\t<span>Tranche 2 - Image 4</span>\r\n\t\t\t</div>\r\n\t\t\t<div>\r\n\t\t\t\t<span>Tranche 3 - Image 1</span>\r\n\t\t\t\t<span>Tranche 3 - Image 2</span>\r\n\t\t\t\t<span>Tranche 3 - Image 3</span>\r\n\t\t\t\t<span>Tranche 3 - Image 4</span>\r\n\t\t\t</div>\r\n\t\t\t<div>\r\n\t\t\t\t<span>Tranche 4 - Image 1</span>\r\n\t\t\t\t<span>Tranche 4 - Image 2</span>\r\n\t\t\t\t<span>Tranche 4 - Image 3</span>\r\n\t\t\t\t<span>Tranche 4 - Image 4</span>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\r\n\t\t<!-- titles -->\r\n\t\t<div class=\"cr-titles\">\r\n\r\n<?php\r\n\t$i = 1;\r\n\tforeach( $myposts as $post ) :\tsetup_postdata($post);\r\n\r\n\t\t\t// $custom = get_post_custom($post->ID);\r\n\t\t\t$thumb = $this->get_wp_generated_thumb( get_the_post_thumbnail($post->ID, \"fading_slider\") );\r\n?>\r\n\r\n\t\t\t<h3>\r\n\t\t\t\t<?php\r\n\t\t\t\t\t$category = get_the_category();\r\n\t\t\t\t\techo \"<span>\".$category[0]->cat_name.\"</span>\\n\";\r\n\t\t\t\t?>\r\n\t\t\t\t<span><a class=\"lienArticle\" href=\"<?php the_permalink();?>\" title=\"<?php _e(\"Read post\", \"wp-fading-content-slider-locale\");?>\"><?php the_title();?></a></span>\r\n \t<a class=\"lienImage\" href=\"<?php the_permalink();?>\" title=\"<?php _e(\"Read post\", \"wp-fading-content-slider-locale\");?>\"></a>\r\n\t\t\t</h3>\r\n\r\n<?php\r\n\t$i++;\r\n\tendforeach; wp_reset_postdata();\r\n?>\r\n\r\n </div>\r\n\r\n </section>\r\n\r\n</div>\r\n\r\n<script type=\"text/javascript\">\r\n\tvar $j = jQuery.noConflict();\r\n\tvar i = 2; // premier switch vers image 2\r\n\r\n\tfunction switchImage()\r\n\t{\r\n\t\t$j(\".current\").removeAttr('checked');\r\n\t\t$j(\".current\").removeClass('current');\r\n\r\n\t\t$j(\"#select-img-\"+i).addClass('current');\r\n\t\t$j(\"#select-img-\"+i).attr('checked', true);\r\n\r\n\t\tif (i==4)\r\n\t\t{\r\n\t\t\ti=1; // retour au debut sur image 1\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ti++; // image suivante\r\n\t\t}\r\n\t}\r\n\r\n\t$j(document).ready(function(){ //on lance l'annimation en boucle toute les 5 secondes (5000 miliseconde)\r\n\t\t<?php if ($auto_switch == \"1\") echo \"setInterval('switchImage();', \".$timeout.\");\\n\"; ?>\r\n\t});\r\n\r\n</script>\r\n\r\n\t\t<?php\r\n\r\n\t\t// TODO This should be prettier in the next version\r\n\t\t// include ( plugins_url() . '/wp-fading-content-slider/views/display.php' );\r\n\t}", "function create_slider() {\n $labels = array(\n 'name' => 'Slides',\n 'singular_name' => 'Slide',\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Slide',\n 'edit_item' => 'Edit Slide',\n 'new_item' => 'New Slide',\n 'all_items' => 'All Slides',\n 'view_item' => 'View Slide',\n 'search_items' => 'Search Slides',\n 'not_found' => 'No Slides found',\n 'not_found_in_trash' => 'No Slides found in Trash',\n 'parent_item_colon' => '',\n 'menu_name' => 'Slider'\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'slides' ),\n 'capability_type' => 'post',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'menu_position' => null,\n 'yarpp_support' => true,\n 'supports' => array( 'title', 'thumbnail' )\n );\n\n register_post_type( 'slide', $args );\n}", "function lucid_slider( $id ) {\n\t$slider = new Lucid_Slider( $id );\n\t$slider->display_slider();\n}", "public function slide(){\r\n\t\t\r\n\t}", "public function create()\n {\n return view('panel.slider.create');\n }", "function tfuse_slideshow($atts, $content) {\n global $slide;\n $slide = array();\n extract(shortcode_atts(array('type_size' => ''), $atts));\n $get_slideshow = do_shortcode($content);\n $uniq = rand(1, 400);\n $i = 0;\n $output = '<div class=\"slider slider_'.$type_size.'\">\n <div class=\"slider_container clearfix\" id=\"slider'.$uniq.'\">';\n while (isset($slide['type'][$i])) {\n if( $slide['type'][$i]=='image' )\n {\n if($type_size=='medium'){\n $width = 600;\n $height = 338;\n }\n elseif($type_size=='small'){\n $width = 430;\n $height = 242;\n }\n else{\n $width = 240;\n $height = 135;\n }\n $getimage = new TF_GET_IMAGE();\n $img = $getimage->width($width)->height($height)->src($slide['content'][$i])->get_img();\n $output .= '<div class=\"slider-item\">'.$img .'</div>';\n }\n else $output .= ' <div class=\"slider-item\"><div class=\"inner\">'.$slide['content'][$i].'</div></div>';\n $i++;\n }\n $output .= '</div>\n <div class=\"slider_pagination\" id=\"slider'.$uniq.'_pag\"></div>\n </div>\n <script>\n jQuery(document).ready(function($) {\n $(\"#slider'.$uniq.'\").carouFredSel({\n pagination : \"#slider'.$uniq.'_pag\",\n infinite: false,\n auto: false,\n height: \"auto\",\n items: 1,\n scroll: {\n fx: \"fade\",\n duration: 200\n }\n });\n });\n </script>';\n return $output;\n}", "function display_slider($args) {\n\t\tglobal $post_id;\n\t\t\n\t\tif(isset($args['ids'])) : //Shortcode based on IDs\n\t\t\t$ids = $args['ids'];\n\t\t\t$images = explode(',',$ids);\n\t\t\t\n\t\t\tif(is_admin()) :\n\t\t\t\tif(!isset($_POST['action']) || $_POST['action'] != 'tw_update_slider') :\n\t\t\t\t\t//A slider is displayed in the back-end. Create the right image sizes.\n\t\t\t\t\t$width = $args['width'];\n\t\t\t\t\t$height = $args['height'];\n\t\t\t\t\tif(!$width) $width = get_option('tw-sliders-image-width');\n\t\t\t\t\tif(!$height) $height = get_option('tw-sliders-image-height');\n\t\t\t\t\t\n\t\t\t\t\tforeach($images as $image_id) :\n\t\t\t\t\t\t$url = wp_get_attachment_url($image_id);\t\t\t\t\t\t\n\t\t\t\t\t\t$this->create_image($url,$width,$height);\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t//Init variables\n\t\t\t\t$shortcode_args = $args;\n\t\t\t\tunset($shortcode_args['ids']);\n\t\t\t\t$shortcode_args['post_id'] = $post_id;\n\t\t\t\t\n\t\t\t\t//Back-end\n\t\t\t\tob_start();\n\t\t\t\tinclude('assets/views/admin-slider.php');\n\t\t\t\treturn ob_get_clean();\n\t\t\telse :\n\t\t\t\t//Init variables\t\t\t\t\n\t\t\t\t$transition = $args['transition'];\n\t\t\t\tif(!$transition || $transition == 'inherit') $transition = get_option('tw-sliders-transition');\n\t\t\t\t\n\t\t\t\t$speed = $args['speed'];\n\t\t\t\tif(!$speed) $speed = get_option('tw-sliders-speed');\n\t\t\t\t\n\t\t\t\t$timeout = $args['timeout'];\n\t\t\t\tif(!$timeout) $timeout = get_option('tw-sliders-timeout');\n\t\t\t\t\n\t\t\t\t$navigation = $args['navigation'];\n\t\t\t\tif(!$navigation || $navigation == 'inherit') $navigation = get_option('tw-sliders-navigation');\n\t\t\t\t\n\t\t\t\t//Image sizes\n\t\t\t\t$width = $args['width'];\n\t\t\t\t$height = $args['height'];\n\t\t\t\tif(!$width) $width = get_option('tw-sliders-image-width');\n\t\t\t\tif(!$height) $height = get_option('tw-sliders-image-height');\n\t\t\t\t\n\t\t\t\t//Collect images\n\t\t\t\t$args['images'] = array();\n\t\t\t\tforeach(explode(',',$ids) as $id) :\n\t\t\t\t\t$image = wp_get_attachment_image_src( $id, 'full');\n\t\t\t\t\t$args['images'][$id] = $this->get_image($image[0],$width,$height);\n\t\t\t\tendforeach;\n\n\t\t\t\t$images = $args['images'];\n\n\t\t\t\textract( apply_filters( 'tw-sliders-args', compact( 'transition', 'speed', 'timeout', 'navigation', 'images' ) ) );\n\n\t\t\t\t$args['images' ] = $images;\n\t\t\t\t\n\t\t\t\t//Front-end\n\t\t\t\tob_start();\n\t\t\t\tinclude('assets/views/slider.php');\n\t\t\t\treturn apply_filters('tw-sliders-output',ob_get_clean(),$args);\n\t\t\tendif;\n\t\telseif($uid = $args['uid']) : //Shortcode based on UID\n\t\t\tif($post_id = $args['post_id']) :\n\t\t\t\t$sliders = get_post_meta($post_id,'_tw-sliders',true);\n\t\t\t\t\n\t\t\t\tif($slider = $sliders[$uid]) return do_shortcode($slider);\n\t\t\tendif;\n\t\tendif;\n\t}", "function nirvana_ppslider_output( $slides ) {\n\t$nirvanas = nirvana_get_theme_options();\n\textract($nirvanas);\n\n\tif (count($slides)>0): ?>\n\t<div class=\"slider-wrapper theme-default <?php if($nirvana_fpsliderarrows==\"Visible on Hover\") echo \"slider-navhover\"; ?> slider-<?php echo preg_replace(\"/[^a-z0-9]/i\",\"\", strtolower($nirvana_fpslidernav)); ?>\">\n\t\t <div class=\"ribbon\"></div>\n\t\t <div id=\"slider\" class=\"nivoSlider\">\n\t\t<?php foreach( $slides as $id => $slide ):\n\t\t\t\tif ( $slide['image'] ) { ?>\n\t\t\t\t<a href=\"<?php echo ($slide['link'] ? $slide['link'] : '#'); ?>\">\n\t\t\t\t\t<img src=\"<?php echo $slide['image']; ?>\" data-thumb=\"<?php echo $slide['image']; ?>\" alt=\"<?php echo ( $slide['title'] ? esc_attr($slide['title']) : '' ); ?>\" <?php if ($slide['title'] || $slide['text']) : ?>title=\"#caption<?php echo $id;?>\" <?php endif; ?> />\n\t\t\t\t</a><?php } ?>\n\t\t <?php endforeach; ?>\n\t\t </div>\n\t\t <?php foreach( $slides as $id => $slide ): ?>\n\t\t\t\t<div id=\"caption<?php echo $id;?>\" class=\"nivo-html-caption\">\n\t\t\t\t\t<h2> <?php echo $slide['title'] ?></h2>\n\t\t\t\t\t<div class=\"slider-text-separator\"></div>\n\t\t\t\t\t<div class=\"slide-text\"> <div class=\"inline-slide-text\"> <?php echo $slide['text'] ?></div> </div>\n\t\t\t\t\t<?php if($nirvana_slidereadmore && $slide['link'] ) { ?>\n\t\t\t\t\t<div class=\"readmore\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url($slide['link']) ?>\"><?php echo esc_attr($nirvana_slidereadmore) ?> <i class=\"column-arrow\"></i> </a>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</div>\n\n\t\t<?php endforeach; ?>\n\t\t </div>\n\t<?php endif;\n}", "function auxin_metabox_fields_general_slider(){\n $slider_ids = array( 'none' => __( 'Choose ..', 'phlox') );\n\n $args = array(\n 'post_type' => 'slider',\n 'orderby' => \"date\",\n 'post_status' => 'publish',\n 'posts_per_page' => -1\n );\n\n $th_query = null;\n $th_query = new WP_Query( $args );\n if( $th_query->have_posts() ): while ( $th_query->have_posts() ) : $th_query->the_post();\n $opts = get_post_meta( $th_query->post->ID, 'slider-data', true );\n if( ! isset( $opts ) || ! is_array( $opts ) ) continue;\n $type = $opts[\"type\"];\n $slider_ids[ $th_query->post->ID ] = '['.$type.' ] '. get_the_title();\n unset( $args, $opts, $type );\n endwhile; endif;\n wp_reset_postdata();\n\n\n // Get all revslider aliases----------------------------------------\n\n if ( class_exists('RevSlider') ) { // if revSlider is active\n\n $slider = new RevSlider();\n $arrSliders = $slider->getArrSliders();\n\n foreach ($arrSliders as $slider) {\n $slider_ids[ $slider->getAlias() ] = '[revo ] '.$slider->getTitle();\n }\n\n unset( $slider, $arrSliders );\n }\n\n // Get all layeslider items ----------------------------------------\n\n // Check if the file is available to prevent warnings\n if( class_exists('LS_Sliders') ) {\n\n // Get WPDB Object\n global $wpdb;\n\n // Table name\n $table_name = $wpdb->prefix . \"layerslider\";\n\n // Get sliders\n $sliders = $wpdb->get_results( \"SELECT * FROM $table_name\n WHERE flag_hidden = '0' AND flag_deleted = '0'\n ORDER BY date_c ASC LIMIT 100\" );\n\n // Iterate over the sliders\n foreach($sliders as $key => $item) {\n $slider_ids['ls_'.$item->id] = '[layer] '. $item->name;\n }\n\n }\n\n // Get all cute slider items ---------------------------------------\n\n // Check if the file is available to prevent warnings\n if( function_exists('cuteslider_init') ) {\n\n // Get WPDB Object\n global $wpdb;\n\n // Table name\n $table_name = $wpdb->prefix . \"cuteslider\";\n\n // Get sliders\n $sliders = $wpdb->get_results( \"SELECT * FROM $table_name\n WHERE flag_hidden = '0' AND flag_deleted = '0'\n ORDER BY date_c ASC LIMIT 100\" );\n\n // Iterate over the sliders\n foreach($sliders as $key => $item) {\n $slider_ids['cs_'.$item->id] = '[cute ] '. $item->name;\n }\n\n }\n\n if ( defined( 'MSWP_AVERTA_VERSION' ) ) {\n\n $ms_sliders = get_masterslider_names( true );\n foreach ($ms_sliders as $ms_id => $ms_label ) {\n $slider_ids['ms_'.$ms_id] = '[Master] '. $ms_label;\n }\n }\n\n $slider_ids = apply_filters( 'auxin_page_header_slider_ids', $slider_ids );\n\n /*==================================================================================================\n\n Add Page Option meta box\n\n *=================================================================================================*/\n\n $model = new Auxin_Metabox_Model();\n $model->title = __( 'Slider Options', 'phlox');\n $model->type = array('page');\n $model->fields= array(\n\n array(\n 'title' => __('Page Slider', 'phlox'),\n 'description' => __('Please select the slider you want to display at top of the page.', 'phlox'),\n 'id' => 'top_slider_id',\n 'id_deprecated' => 'top_slider_id',\n 'type' => 'select',\n 'choices' => $slider_ids\n ),\n array(\n 'title' => __('Slider top margin', 'phlox'),\n 'description' => __('The height of empty space above page slider in pixel.', 'phlox'),\n 'id' => 'top_slider_margin_top',\n 'type' => 'text',\n 'default' =>''\n ),\n array(\n 'title' => __('Slider bottom margin', 'phlox'),\n 'description' => __('The height of empty space below page slider in pixel.', 'phlox'),\n 'id' => 'top_slider_margin_bottom',\n 'type' => 'text',\n 'default' =>''\n )\n // array(\n // 'title' => __('Slider Width', 'phlox'),\n // 'description' => __('If you choose \"Full\", the slider fits to the page width.<br/>', 'phlox'),\n // 'id' => 'top_slider_width',\n // 'id_deprecated' => 'top_slider_width',\n // 'type' => 'select',\n // 'default' => 'full',\n // 'choices' => array(\n // 'full' => __('Full' , 'phlox'),\n // 'boxed' => __('Boxed', 'phlox')\n // )\n // ),\n );\n\n return $model;\n}", "public function createSlider() {\r\n $centerId = $this->centerId;\r\n $sliderSectionsId = 1;\r\n $query = \"SELECT id FROM centers_content_details WHERE center_id=$centerId AND section_id=$sliderSectionsId\";\r\n $sliderContentIdQuery = mysql_query($query, $this->connection);\r\n if (mysql_num_rows($sliderContentIdQuery) > 0) {\r\n $asso = mysql_fetch_assoc($sliderContentIdQuery);\r\n $id = $asso['id'];\r\n $sectionsContent = ' <section class=\"content\">\r\n <section class=\"clearfix\" id=\"homeCorpo\">\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"span12\">\r\n <div class=\"flexslider flexFullScreen mb40 \">\r\n <ul class=\"slides\">';\r\n $masterQuery = \"SELECT * FROM slider_content_list WHERE slider_id=$id ORDER BY slidePriority\";\r\n $slides = mysql_query($masterQuery, $this->connection);\r\n if (mysql_num_rows($slides) > 0) {\r\n $slideNumber = mysql_num_rows($slides);\r\n if ($slideNumber > 0) {\r\n for ($i = 0; $i <= $slideNumber; $i++) {\r\n while ($sectionResult = mysql_fetch_assoc($slides)) {\r\n\r\n\r\n $j = $i + 1;\r\n $k = $j + 1;\r\n $sectionsContent .=\"<li class='slideN$i'>\r\n <img src='./images/slider/super/$sectionResult[slide_img_Title]' alt='$sectionResult[slide_img_alt]' style='width:100%;height: 420px; padding-bottom: 1px;'/>\r\n <div class='caption $sectionResult[caption]'>\r\n <div class='element$j-$j' data-animation='$sectionResult[animatingTypeBig]'>\r\n <h1>$sectionResult[slide_big_title]</h1>\r\n </div>\r\n <div class='element$j-$k' data-animation='$sectionResult[animatingTypeSmall]'>\r\n <h2>$sectionResult[slide_small_title]</h2>\r\n </div>\r\n </li> \";\r\n $i++;\r\n }\r\n }\r\n\r\n $sectionsContent .='</ul> ';\r\n }\r\n\r\n return $sectionsContent .='</div>\r\n </div>\r\n </div>\r\n </div></section>';\r\n }\r\n }\r\n }", "function setSlider($slider=7){\n\t\t\t$this->slider = $slider;\n\t\t}", "function slider_settings(){\n?>\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[use_slider]\">Use slider in homepage?</label><br />\n <select name=\"calibrefx-settings[use_slider]\" id=\"calibrefx-settings[use_slider]\">\n <option value=\"0\"<?php selected(0, calibrefx_get_option('use_slider')); ?>><?php _e('No', 'calibrefx'); ?></option>\n <option value=\"1\"<?php selected(1, calibrefx_get_option('use_slider')); ?>><?php _e('Yes', 'calibrefx'); ?></option>\n </select>\n <p class=\"description\"><?php _e(\"Please select 'Yes' if you want to include slider in homepage. The slider will be placed under primary menu. Leave it to 'No' if you dont want to include slider or want to include slider manually.\"); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[slider_category]\">Slider Category</label><br />\n <select name=\"calibrefx-settings[slider_category]\" id=\"calibrefx-settings[slider_category]\">\n <option value=\"\"><?php _e('All Categories', 'calibrefx'); ?></option>\n <?php\n $terms = get_terms('slidercat', 'hide_empty=0');\n\n foreach($terms as $term){\n echo '<option value=\"'.$term->term_id.'\"'.selected($term->term_id, calibrefx_get_option('slider_category'), false).'>'.$term->name.'</option>';\n }\n ?>\n </select>\n <p class=\"description\"><?php _e(\"This will display slider based on a category. Leave it 'All' if you want to display all slider items.\"); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[slider_num]\">Number of Slider Images</label><br />\n <input type=\"text\" name=\"calibrefx-settings[slider_num]\" id=\"calibrefx-settings[slider_num]\" value=\"<?php echo esc_attr(calibrefx_get_option('slider_num')); ?>\" />\n <p class=\"description\"><?php _e('Please enter number of slider images to be displayed. Enter -1 if you want to display all slider images.'); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[slider_speed]\">Slide Speed</label><br />\n <input type=\"text\" name=\"calibrefx-settings[slider_speed]\" id=\"calibrefx-settings[slider_speed]\" value=\"<?php echo esc_attr(calibrefx_get_option('slider_speed')); ?>\" />\n <p class=\"description\"><?php _e('Please enter your slideshow speed, eg. 700'); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[slider_pause]\">Slide Interval</label><br />\n <input type=\"text\" name=\"calibrefx-settings[slider_pause]\" id=\"calibrefx-settings[slider_pause]\" value=\"<?php echo esc_attr(calibrefx_get_option('slider_pause')); ?>\" />\n <p class=\"description\"><?php _e('The duration between each slide transition'); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[slider_effect]\">Slide Effect</label><br />\n <select name=\"calibrefx-settings[slider_effect]\" id=\"calibrefx-settings[slider_effect]\">\n <?php \n $order_params = array(\n 'fade' => __('Fade', 'calibrefx'),\n 'fadeOut' => __('Fade Out', 'calibrefx'),\n 'scrollHorz' => __('Scroll Horizontal', 'calibrefx'),\n 'none' => __('None', 'calibrefx'),\n );\n\n foreach ($order_params as $value => $name)\n echo '<option value=\"' . esc_attr($value) . '\"' . selected(calibrefx_get_option('slider_effect'), esc_attr($value), false) . '>' . esc_html($name) . '</option>' . \"\\n\";\n ?>\n </select>\n <p class=\"description\"><?php _e('Please select transition types for your slideshow translation effect.'); ?></p>\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[use_paging]\">Use pagination?</label><br />\n <select name=\"calibrefx-settings[use_paging]\" id=\"calibrefx-settings[use_paging]\">\n <option value=\"0\"<?php selected(0, calibrefx_get_option('use_paging')); ?>><?php _e('No', 'calibrefx'); ?></option>\n <option value=\"1\"<?php selected(1, calibrefx_get_option('use_paging')); ?>><?php _e('Yes', 'calibrefx'); ?></option>\n </select>\n <p class=\"description\"><?php _e(\"Select 'Yes' if you want to include paging in your slider.\"); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[use_nav]\">Use navigation?</label><br />\n <select name=\"calibrefx-settings[use_nav]\" id=\"calibrefx-settings[use_nav]\">\n <option value=\"0\"<?php selected(0, calibrefx_get_option('use_nav')); ?>><?php _e('No', 'calibrefx'); ?></option>\n <option value=\"1\"<?php selected(1, calibrefx_get_option('use_nav')); ?>><?php _e('Yes', 'calibrefx'); ?></option>\n </select>\n <p class=\"description\"><?php _e(\"Select 'Yes' if you want to include previous & next navigation in your slider.\"); ?></p>\n <hr class=\"div\" />\n</div>\n\n<div class=\"row-options\">\n <label for=\"calibrefx-settings[use_caption]\">Use caption?</label><br />\n <select name=\"calibrefx-settings[use_caption]\" id=\"calibrefx-settings[use_caption]\">\n <option value=\"0\"<?php selected(0, calibrefx_get_option('use_caption')); ?>><?php _e('No', 'calibrefx'); ?></option>\n <option value=\"1\"<?php selected(1, calibrefx_get_option('use_caption')); ?>><?php _e('Yes', 'calibrefx'); ?></option>\n </select>\n <p class=\"description\"><?php _e(\"Select 'Yes' if you want to include caption in your slider.\"); ?></p>\n</div>\n<?php \n}", "function fa_post_type_slider(){\n\tglobal $fa_pro;\n\treturn $fa_pro->post_type_slider();\n}", "public function create()\n {\n return view('pages.manageSlider.slider_create');\n }", "function show_slider(){\n ?>\n <section \n id=\"featured\" \n class=\"cycle-slideshow\" \n data-cycle-slides=\"div\"\n data-cycle-fx=\"fade\"\n data-cycle-manual-speed=\"200\" \n data-pause-on-hover=\"true\">\n <?php civ_slider(); ?>\n </section>\n <?php\n}", "function mySlider(){\n\t// $slider['images'] = ['glavnii' => [\n\t// ['img' => '1.jpg', 'title' => 'Праздник дня рождения', 'text' => 'Веселые ребята и их родители с нашими аниматорами'],\n\t// ['img' => '2.jpg', 'title' => 'Праздник дня рождения', 'text' => 'Веселые ребята и их родители с нашими аниматорами'],\n\t// ['img' => '3.jpg', 'title' => 'Праздник дня рождения', 'text' => 'Веселые ребята и их родители с нашими аниматорами'],\n\t// ]];\n\t// setOption('MySliders', $slider, true);\n\tinclude 'settings.php';\n}", "function rps_activate()\n{\n $width = '460';\n $height = '470';\n $post_per_slide = '1';\n $total_posts = '8';\n $slider_content = '3';\n rps_post_img_thumb();\n}", "function __construct() {\r\n parent::__construct(\r\n 'st_slider', // Base ID\r\n esc_html__( 'WPCoupon Slider', 'wp-coupon' ), // Name\r\n array(\r\n 'description' => esc_html__( 'Display a Slider', 'wp-coupon' ),\r\n 'classname' => 'st-slider-widget'\r\n ), // Args\r\n array(\r\n 'width' => 530\r\n )\r\n );\r\n }", "function wpsight_sylt_image_slider( $post_id = '', $args = array() ) {\n\techo wpsight_sylt_get_image_slider( $post_id, $args );\n}", "public function create()\n {\n return view('slider.create', compact('sliders'));\n }", "function jdi_slider() {\n\treturn Jet_Data_Importer_Slider::get_instance();\n}", "private function fill_slider(){\n\t\tglobal $DB;\n\t\t$slides= \"SELECT * FROM {theme_archaius} ORDER BY position ASC\";\n\t $slides= $DB->get_records_sql($slides);\n\t return $slides;\n\t}", "function _cute_slider($options)\n\t{\n\t\tglobal $meta_fields;\n\t\n\t\tif ( isset ( $options['ww_header_style'] ) && !empty ( $options['ww_header_style'] ) ) { \n\t\t\t$style = 'uh_'.$options['ww_header_style'];\n\t\t} else { \n\t\t\t$style = '';\n\t\t}\n\n\t?>\n\t\t<div id=\"slideshow\" class=\"<?php echo $style; ?>\">\n\t\t\t<div class=\"bgback\"></div>\n\t\t\t\n\t\t\t<div data-images=\"<?php echo IMAGES_URL; ?>/\" id=\"sparkles\"></div>\n\t\t\t\t<div class=\"container zn_slideshow\">\n\t\t\t\t\t<?php echo do_shortcode('[cuteslider id=\"'.$options['cuteslider_id'].'\"]'); ?>\n\t\t\t\t</div>\n\t\t\t<div class=\"zn_header_bottom_style\"></div>\n\t\t</div><!-- end page_header -->\n\t<?php\t\n\t}", "function add_slider_settings() {\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tw-sliders-gallery-settings\">\n\t\t\t<div class=\"tw-sliders-slider-settings\">\n\t\t\t\t<h3><?php _e('Slider Settings','tw-sliders'); ?></h3>\n\t\t\t\t\n\t\t\t\t<label class=\"setting\">\t\t\t\t\t\n\t\t\t\t\t<input type=\"hidden\" class=\"uid\" data-setting=\"uid\" value=\"0\" />\n\t\t\t\t</label>\n\t\t\t\t\n\t\t\t\t<label class=\"setting\">\n\t\t\t\t\t<span><?php _e('Image width','tw-sliders'); ?></span>\n\t\t\t\t\t<input type=\"text\" class=\"width\" data-setting=\"width\" />\n\t\t\t\t\t<p class=\"description\"><?php _e('Leave empty to inherit','tw-sliders'); ?> (<?php echo get_option('tw-sliders-image-width'); ?>)</p>\n\t\t\t\t</label>\n\t\t\t\t\n\t\t\t\t<label class=\"setting\">\n\t\t\t\t\t<span><?php _e('Image height','tw-sliders'); ?></span>\n\t\t\t\t\t<input type=\"text\" class=\"height\" data-setting=\"height\" />\n\t\t\t\t\t<p class=\"description\"><?php _e('Leave empty to inherit','tw-sliders'); ?> (<?php echo get_option('tw-sliders-image-height'); ?>)</p>\n\t\t\t\t</label>\n\t\t\t\t\n\t\t\t\t<?php if($this->transitions) { ?>\n\t\t\t\t\t<label class=\"setting\">\n\n\t\t\t\t\t\t<span><?php _e('Transition','tw-sliders'); ?></span>\n\n\t\t\t\t\t\t<select class=\"transition\" data-setting=\"transition\">\n\t\t\t\t\t\t\t<option value=\"inherit\" selected><?php _e( 'Current setting', 'tw-sliders' ); ?></option>\n\n\t\t\t\t\t\t\t<?php foreach( $this->transitions as $transition => $label ) { ?>\n\t\t\t\t\t\t\t\t<option value=\"<?php echo $transition; ?>\">\n\t\t\t\t\t\t\t\t\t<?php echo $label; ?>\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t\t</select>\n\n\t\t\t\t\t</label>\n\t\t\t\t<?php } ?>\n\t\t\t\t\n\t\t\t\t<label class=\"setting\">\n\t\t\t\t\t<span><?php _e('Speed (ms)','tw-sliders'); ?></span>\n\t\t\t\t\t<input type=\"text\" class=\"speed\" data-setting=\"speed\" />\n\t\t\t\t\t<p class=\"description\"><?php _e('Leave empty to inherit','tw-sliders'); ?> (<?php echo get_option('tw-sliders-speed'); ?>)</p>\n\t\t\t\t</label>\n\t\t\t\t\n\t\t\t\t<label class=\"setting\">\n\t\t\t\t\t<span><?php _e('Timeout (ms)','tw-sliders'); ?></span>\n\t\t\t\t\t<input type=\"text\" class=\"timeout\" data-setting=\"timeout\" />\n\t\t\t\t\t<p class=\"description\"><?php _e('Leave empty to inherit','tw-sliders'); ?> (<?php echo get_option('tw-sliders-timeout'); ?>)</p>\n\t\t\t\t</label>\n\t\t\t\t\n\t\t\t\t<?php if($this->navigation) : ?>\n\t\t\t\t\t<label class=\"setting\">\n\t\t\t\t\t\t<span><?php _e('Navigation','tw-sliders'); ?></span>\n\t\t\t\t\t\t<select class=\"navigation\" data-setting=\"navigation\">\n\t\t\t\t\t\t\t<option value=\"inherit\" selected><?php _e('Current setting','tw-sliders'); ?></option>\n\t\t\t\t\t\t\t<?php foreach($this->navigation as $navigate=>$meta) : ?>\n\t\t\t\t\t\t\t\t<option value=\"<?php echo $navigate; ?>\"><?php echo $meta['name']; ?></option>\n\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</label>\n\t\t\t\t<?php endif; ?>\n\t\t\t</div>\n\t\t</script>\n\t\t<?php\n\t}", "function civ_slider(){\n // to use in the WP_Query loop\n global $wpdb;\n $table_name = $wpdb->prefix . 'civ_slider';\n $slides = $wpdb->get_results( \"select * from $table_name order by img_order asc\", 'object');\n\n $f_slide = array();\n $num_slides = count($slides);\n\n foreach ($slides as $slide) {\n array_push($f_slide, $slide->post_id);\n }\n$args = array('post_type' => 'post',\n 'post__in' => $f_slide,\n 'orderby' => 'post__in',\n 'ignore_sticky_posts' => '1'\n);\n\n $slider = new WP_Query($args);\n\n\n while ( $slider->have_posts() ) :\n $slider->the_post(); ?> \n<?php \n //Get the Thumbnail URL\n $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), /*array( 720,405 ),*/ false, '' );\n ?>\n <div class=\"slide\" style=\"background-image:url('<?php echo $src[0]; ?>');\">\n <h2>\n <a href=\"<?php the_permalink(); ?>\">\n <?php the_title(); ?>\n </a>\n </h2>\n <span><?php the_excerpt(); ?></span>\n </div>\n <?php endwhile;\n $wpdb->flush();\nwp_reset_postdata();\n}", "function add_custome_post_home_slider() {\n\n $labels = array(\n 'name' => 'Slides',\n 'singular_name' => 'Slide',\n 'menu_name' => 'Home Slider',\n 'name_admin_bar' => 'Home Slider',\n 'parent_item_colon' => 'Parent Slide',\n 'all_items' => 'All Slides',\n 'add_new_item' => 'Add New Slide',\n 'add_new' => 'Add New',\n 'new_item' => 'New Slide',\n 'edit_item' => 'Edit Slide',\n 'update_item' => 'Update Slide',\n 'view_item' => 'View Slide',\n 'search_items' => 'Search Slide',\n 'not_found' => 'Slide Not found',\n 'not_found_in_trash' => 'Slide Not found in Trash',\n );\n $rewrite = array(\n 'slug' => 'sliders',\n 'with_front' => true,\n 'pages' => true,\n 'feeds' => false,\n );\n $capabilities = array(\n 'edit_post' => 'edit_slide',\n 'read_post' => 'read_slide',\n 'delete_post' => 'delete_slide',\n 'edit_posts' => 'edit_slides',\n 'edit_others_posts' => 'edit_others_slides',\n 'publish_posts' => 'publish_slides',\n 'read_private_posts' => 'read_private_slides',\n );\n $args = array(\n 'label' => 'home_slider',\n 'description' => 'Home Page Slider',\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'revisions', 'page-attributes', ),\n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'rewrite' => $rewrite,\n // 'capabilities' => $capabilities,\n 'menu_icon' => 'dashicons-images-alt2',\n );\n register_post_type( 'home_slider', $args );\n\n}", "function redart_slider( $id = false ){\r\n\r\n\t$slider = false;\r\n\r\n\tif( $id || is_home() || get_post_type() == 'page' ) {\r\n\r\n\t\tif( is_home() ) $id = get_option('page_for_posts');\r\n\t\telseif( is_page() ) $id = redart_ID();\r\n\r\n\t\t$slider_key = get_post_meta( $id, '_tpl_default_settings', true );\r\n\t\t\r\n\t\tif( is_array( $slider_key) && array_key_exists('slider_type', $slider_key) ) {\r\n\t\t\t\r\n\t\t\tif( ( $slider_key['slider_type'] == 'revolutionslider' ) && ( array_key_exists( 'revolutionslider_id', $slider_key ) ) && ( array_key_exists( 'show_slider', $slider_key ) ) ) {\r\n\t\t\t\t\r\n\t\t\t\t// revolution slider\r\n\t\t\t\t$slider = '<div id=\"slider\"><div class=\"dt-sc-main-slider\" id=\"dt-sc-rev-slider\">';\r\n\t\t\t\t\t$slider .= do_shortcode('[rev_slider '. $slider_key['revolutionslider_id'] .']');\r\n\t\t\t\t$slider .= '</div></div>';\r\n\t\t\t\r\n\t\t\t} elseif( ( $slider_key['slider_type'] == 'layerslider' ) && ( array_key_exists('layerslider_id', $slider_key) ) && ( array_key_exists( 'show_slider', $slider_key ) ) ) {\r\n\r\n\t\t\t\t// layer slider\r\n\t\t\t\t$slider = '<div id=\"slider\"><div class=\"dt-sc-main-slider\" id=\"dt-sc-layer-slider\">';\r\n\t\t\t\t\t$slider .= do_shortcode('[layerslider id=\"'. $slider_key['layerslider_id'] .'\"]');\r\n\t\t\t\t$slider .= '</div></div>';\r\n\r\n\t\t\t} elseif( ( $slider_key['slider_type'] == 'customslider' ) && ( array_key_exists('customslider_sc', $slider_key) ) && ( array_key_exists( 'show_slider', $slider_key ) ) ) {\r\n\t\r\n\t\t\t\t// Custom Slider\r\n\t\t\t\t$slider = '<div id=\"slider\"><div class=\"dt-sc-main-slider\" id=\"dt-sc-custom-slider\">';\r\n\t\t\t\t\t$slider .= redart_wp_kses(do_shortcode( $slider_key['customslider_sc'] ));\r\n\t\t\t\t$slider .= '</div></div>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $slider;\r\n}", "function thirdtheme_custom_slider()\n {\n add_theme_support('post-thumbnails');\n $args = array(\n 'labels' => array('name' =>__(' custom slider'),\n 'add_new' =>__('add new slider')),\n \n 'public' => true,\n 'menu_icon' => 'dashicons-format-image',\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'thumbnail' )); \n register_post_type('slider',$args);\n }", "static public function slider_config() {\n ?>\n\n /**\n * J'ai simplement recopié le script du plugin pour pouvoir modifier les\n * caractéristiques du slider car aucun moyen de le configurer n'est \n * mis à dispo dans le backoffice...\n *\n * source https://github.com/sayful1/filterable-portfolio/blob/master/assets/src/frontend/slider.js\n */\n if (tns) {\n var sliders,\n i,\n slider,\n sliderOuter,\n controls,\n showDots,\n showArrows,\n autoplay,\n autoplayHoverPause,\n autoplayTimeout,\n speed,\n gutter,\n loop,\n lazyload,\n slideBy,\n mobile,\n tablet,\n desktop,\n wideScreen,\n fullHD,\n highScreen;\n\n sliders = document.querySelectorAll('.fp-tns-slider');\n for(i=0;i<sliders.length;i++){\n slider=sliders[i];\n\n sliderOuter = slider.parentNode;\n controls = sliderOuter.querySelector('.fp-tns-slider-controls');\n\n mobile = parseInt(slider.getAttribute('data-mobile'));\n tablet = parseInt(slider.getAttribute('data-tablet'));\n desktop = parseInt(slider.getAttribute('data-desktop'));\n wideScreen = parseInt(slider.getAttribute('data-wide-screen'));\n fullHD = parseInt(slider.getAttribute('data-full-hd'));\n highScreen = parseInt(slider.getAttribute('data-high-screen'));\n\n showDots = slider.getAttribute('data-dots') === 'true';\n showArrows = slider.getAttribute('data-arrows') === 'true';\n\n autoplay = slider.getAttribute('data-autoplay') === 'true';\n autoplayHoverPause = slider.getAttribute('data-autoplay-hover-pause') === 'true';\n // Default is 5000\n autoplayTimeout = 10000;\n // Default is 500\n speed = 1000;\n\n gutter = parseInt(slider.getAttribute('data-gutter'));\n loop = slider.getAttribute('data-loop') === 'true';\n lazyload = slider.getAttribute('data-lazyload') === 'true';\n\n slideBy = slider.getAttribute('data-slide-by');\n slideBy = (slideBy === 'page') ? 'page' : parseInt(slideBy);\n\n tns({\n container: slider,\n slideBy: slideBy,\n loop: loop,\n lazyload: lazyload,\n autoplay: autoplay,\n autoplayTimeout: autoplayTimeout,\n autoplayHoverPause: autoplayHoverPause,\n speed: speed,\n gutter: gutter,\n nav: showDots,\n controls: showArrows,\n controlsContainer: controls ? controls : false,\n edgePadding: 0,\n items: mobile,\n responsive: {\n 600: {items: tablet},\n 1000: {items: desktop},\n 1200: {items: wideScreen},\n 1500: {items: fullHD},\n 1921: {items: highScreen}\n }\n });\n }\n }\n\n\n <?php\n }", "function __construct() {\n parent::__construct( false, 'GE Custom Slider Widget' );\n }", "public function slider($limit='0')\n\t{\n\t\tif(!$this->session->userdata('logged_in')){\n\t\t\tredirect('login');\n\t\t\t\n\t\t}\n\t\t$logged_in=$this->session->userdata('logged_in');\n\t\tif($logged_in['base_url'] != base_url()){\n\t\t$this->session->unset_userdata('logged_in');\t\t\n\t\tredirect('login');\n\t\t}\n\t\t\n\t \t\t$logged_in=$this->session->userdata('logged_in');\n $acp=explode(',',$logged_in['setting']);\n\t\t\tif(!in_array('All',$acp)){\n\t\t\texit($this->lang->line('permission_denied'));\n\t\t\t}\n\t\t\t\n\t\t\n\t\t \t \n\t\t\t\n\t\t\t\n\t $data['title']=$this->lang->line('slider');\n\t\t\t\t$data['result']=$this->Cms_model->slider_list();\n\t\t\t\t \n\t\t$this->load->view('header',$data);\n\t\t $this->load->view('slider',$data);\n\t\t$this->load->view('footer',$data);\n\t}", "public function create()\n {\n return view('slider.create');\n }", "public function create()\n {\n return view('slider::create');\n }", "public function create()\n {\n return view('admin.sliders.create',[\n 'slider'=>new Slider(),\n 'title'=>'Create Slider'\n ]);\n }", "function _circ1($options)\n\t{\n\t\n\t\tif ( isset ( $options['ww_header_style'] ) && !empty ( $options['ww_header_style'] ) ) { \n\t\t\t$style = 'uh_'.$options['ww_header_style'];\n\t\t} else { \n\t\t\t$style = '';\n\t\t}\n\t\n\t?>\n <div id=\"slideshow\" class=\"<?php echo $style; ?>\">\n\t\t\n\t\t\t<div class=\"bgback\"></div>\n\t\t\t<div data-images=\"<?php echo IMAGES_URL; ?>/\" id=\"sparkles\"></div>\n\t\t\n\t\t\t<div class=\"container zn_slideshow\">\n\n\t\t\t\t<div id=\"ca-container\" class=\"ca-container\">\n <div class=\"ca-wrapper\">\n <?php\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( isset ( $options['single_circ1'] ) && is_array ( $options['single_circ1'] ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i = 1;\n\t\t\t\t\t\t\t$thumbs = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ( $options['single_circ1'] as $slide ) {\t\t\t\t\t\n\n\t\t\t\t\t\t\t\techo '<div class=\"ca-item ca-item-'.$i.'\">';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<div class=\"ca-item-main\">';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"background\"></div><!-- background color -->';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_image'] ) && !empty ( $slide['ww_slide_image'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-icon\">';\n\t\t\t\t\t\t\t\t\t\t\t\t$image = vt_resize( '',$slide['ww_slide_image'] , '336','200', true );\n\t\t\t\t\t\t\t\t\t\t\t\techo '<img src=\"'.$image['url'].'\" width=\"'.$image['width'].'\" height=\"'.$image['height'].'\" />';\n\t\t\t\t\t\t\t\t\t\t\techo '</div>';\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// TITle\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_title'] ) && !empty ( $slide['ww_slide_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<h3>'. $slide['ww_slide_title'].'</h3>';\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\t// DESC\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_desc'] ) && !empty ( $slide['ww_slide_desc'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<h4>'. $slide['ww_slide_desc'].'</h4>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// DESC\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_read_text'] ) && !empty ( $slide['ww_slide_read_text'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"ca-more\">'.$slide['ww_slide_read_text'].' <span class=\"icon-chevron-right icon-white\"></span></a>';\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// Bottom Title\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_bottom_title'] ) && !empty ( $slide['ww_slide_bottom_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<span class=\"ca-starting\">'. $slide['ww_slide_bottom_title'].'</span>';\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\techo '</div>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content-wrapper\">';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content\">';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Content Title\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_content_title'] ) && !empty ( $slide['ww_slide_content_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<h6>'.$slide['ww_slide_content_title'].'</h6>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"ca-close\"><span class=\"icon-remove\"></span></a>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Content description\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_desc_full'] ) && !empty ( $slide['ww_slide_desc_full'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content-text\">';\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\techo $slide['ww_slide_desc_full'];\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\techo '</div>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Link\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_read_text_content'] ) && !empty ( $slide['ww_slide_read_text_content'] ) && isset ( $slide['ww_slide_link']['url'] ) && !empty ( $slide['ww_slide_link']['url'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"'.$slide['ww_slide_link']['url'].'\" target=\"'.$slide['ww_slide_link']['target'].'\">'.$slide['ww_slide_read_text_content'].'</a>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo '</div><!-- end ca-item -->';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\n </div><!-- end ca-wrapper -->\n </div><!-- end circular content carousel -->\n\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"zn_header_bottom_style\"></div><!-- header bottom style -->\n\t\t\t\n </div><!-- end slideshow -->\n\t<?php\n\t}", "public function getSlider() {\n\t\treturn($this->slider);\n\t}", "function cs_slider_clone(){\n\tglobal $cs_node, $counter;\n\tif( isset($_POST['action']) ) {\n\t\t$cs_node = new stdClass();\n\t\t$cs_node->title = '';\n\t\t$cs_node->description = '';\n\t\t$cs_node->link = '';\n\t\t$cs_node->link_target = '';\n\t\t$cs_node->use_image_as = '';\n\t\t$cs_node->video_code = '';\n\t}\n\tif ( isset($_POST['counter']) ) $counter = $_POST['counter'];\n\tif ( isset($_POST['path']) ) $cs_node->path = $_POST['path'];\n?>\n <li class=\"ui-state-default\" id=\"<?php echo $counter?>\">\n <div class=\"thumb-secs\">\n <?php $image_path = wp_get_attachment_image_src( $cs_node->path, array( get_option(\"thumbnail_size_w\"),get_option(\"thumbnail_size_h\") ) );?>\n <img src=\"<?php echo $image_path[0]?>\" alt=\"\">\n <div class=\"gal-edit-opts\">\n <!--<a href=\"#\" class=\"resize\"></a>-->\n <a href=\"javascript:slidedit(<?php echo $counter?>)\" class=\"edit\"></a>\n <a href=\"javascript:del_this(<?php echo $counter?>)\" class=\"delete\"></a>\n </div>\n </div>\n <div class=\"poped-up\" id=\"edit_<?php echo $counter?>\">\n <div class=\"opt-head\">\n <h5>Edit Options</h5>\n <a href=\"javascript:slideclose(<?php echo $counter?>)\" class=\"closeit\">&nbsp;</a>\n <div class=\"clear\"></div>\n </div>\n <div class=\"opt-conts\">\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Image Title</label></li>\n <li class=\"to-field\"><input type=\"text\" name=\"cs_slider_title[]\" value=\"<?php echo htmlspecialchars($cs_node->title)?>\" class=\"txtfield\" /></li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Image Description</label></li>\n <li class=\"to-field\"><textarea class=\"txtarea\" name=\"cs_slider_description[]\"><?php echo htmlspecialchars($cs_node->description)?></textarea></li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Link</label></li>\n <li class=\"to-field\"><input type=\"text\" name=\"cs_slider_link[]\" value=\"<?php echo htmlspecialchars($cs_node->link)?>\" class=\"txtfield\" /></li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Link Target</label></li>\n <li class=\"to-field\">\n <select name=\"cs_slider_link_target[]\" class=\"select_dropdown\">\n <option <?php if($cs_node->link_target==\"_self\")echo \"selected\";?> >_self</option>\n <option <?php if($cs_node->link_target==\"_blank\")echo \"selected\";?> >_blank</option>\n </select>\n <p>Please select image target.</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n <input type=\"hidden\" name=\"path[]\" value=\"<?php echo $cs_node->path?>\" />\n <input type=\"button\" value=\"Submit\" onclick=\"javascript:slideclose(<?php echo $counter?>)\" class=\"close-submit\" />\n </li>\n </ul>\n <div class=\"clear\"></div>\n </div>\n </div>\n </li>\n<?php\n\tif ( isset($_POST['action']) ) die();\n}", "public function changeSlider(){\n $slider = $this->appearance->getAllSlider();\n return view('dashboard.slider',['slider' => $slider]);\n }", "function register_cpt_Slider() {\n\n $labels = array(\n 'name' => _x( 'Sliders', 'Slider' ),\n 'singular_name' => _x( 'Slider', 'Slider' ),\n 'add_new' => _x( 'Add New', 'Slider' ),\n 'add_new_item' => _x( 'Add New Slider', 'Slider' ),\n 'edit_item' => _x( 'Edit Slider', 'Slider' ),\n 'new_item' => _x( 'New Slider', 'Slider' ),\n 'view_item' => _x( 'View Slider', 'Slider' ),\n 'search_items' => _x( 'Search Sliders', 'Slider' ),\n 'not_found' => _x( 'No Sliders found', 'Slider' ),\n 'not_found_in_trash' => _x( 'No Sliders found in Trash', 'Slider' ),\n 'parent_item_colon' => _x( 'Parent Slider:', 'Slider' ),\n 'menu_name' => _x( 'Sliders', 'Slider' ),\n );\n\n $args = array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'description' => 'Customer Sliders',\n 'supports' => array( 'title'),\n 'public' => false,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-images-alt2',\n 'show_in_nav_menus' => true,\n 'publicly_queryable' => false,\n 'exclude_from_search' => true,\n 'has_archive' => false,\n 'query_var' => true,\n 'can_export' => true,\n 'rewrite' => true,\n 'capability_type' => 'post'\n );\n\n register_post_type( 'Slider', $args );\n}", "function slide_show()\n \t{\n // Setup show\n $show = ( $this->ipsclass->input['show'] == 'first' ) ? 0 : $this->ipsclass->input['show'];\n\n // Figure out if the user has chosen a value, or if we should go with a default\n $sort_key = ( $this->ipsclass->input['sort_key'] ) ? $this->ipsclass->input['sort_key'] : 'date';\n $order_key = ( $this->ipsclass->input['order_key'] ) ? $this->ipsclass->input['order_key'] : 'DESC';\n $prune_key = ( $this->ipsclass->input['prune_key'] ) ? $this->ipsclass->input['prune_key'] : '30';\n\n if( ! empty( $this->ipsclass->input['cat'] ) )\n {\n $where = \"category_id=\". intval( $this->ipsclass->input['cat'] );\n }\n else\n {\n $where = \"album_id=\". intval( $this->ipsclass->input['album'] );\n }\n\n // Get the picture\n $this->ipsclass->DB->cache_add_query( 'slideshow_image', \n\t\t\t\t\t\t\t array( 'where' => $where,\n\t\t\t\t\t\t\t\t\t 'prune' => $prune,\n 'sort_key' => $sort_key,\n 'order_key' => $order_key,\n 'show' => $show,\n\t\t\t\t\t\t\t), 'gallery_sql_queries' );\t\t\t\t\t\t\t\t\t \n $this->ipsclass->DB->simple_exec();\n \n // Show it\n $i = $this->ipsclass->DB->fetch_row();\n\n if( $this->ipsclass->DB->get_num_rows() )\n {\n $show++;\n $photo = $this->glib->make_image_link( $i );\n $type = ( $this->ipsclass->input['cat'] ) ? \"&amp;cat={$this->ipsclass->input['cat']}\" : \"&amp;album={$this->ipsclass->input['album']}&amp;mid={$i['mid']}\";\n $hfoff = ( $this->ipsclass->input['hfoff'] ) ? \"&hfoff=1\" : \"\";\n\t\t\t\t$close = ( $this->ipsclass->input['closewindow'] ) ? \"&closewindow=1\" : \"\";\n\t\t\t\t$url = \"{$this->ipsclass->base_url}automodule=gallery&cmd=slideshow&show={$show}&duration={$this->ipsclass->input['duration']}&sort_key={$this->ipsclass->input['sort_key']}&order_key={$this->ipsclass->input['order_key']}&prune_key={$this->ipsclass->input['prune_key']}{$type}{$hfoff}{$close}\";\n $this->output .= $this->html->ss_slide( $photo, $url, $i['id'] );\n }\n else\n {\n if( ! empty( $this->ipsclass->input['cat'] ) )\n {\n $url = \"automodule=gallery&cmd=sc&cat={$this->ipsclass->input['cat']}\";\n }\n else\n {\n $url = \"automodule=gallery&cmd=user&user={$this->ipsclass->input['mid']}&op=view_album&album={$this->ipsclass->input['album']}\";\n }\n\n\t\t\t\tif( $this->ipsclass->input['closewindow'] )\n\t\t\t\t{\n\t\t\t\t\techo '<html><body onload=\"javascript:window.close();\"></html>';\n\t\t\t\t\tdie();\n\t\t\t\t}\n \n $this->ipsclass->print->redirect_screen( $this->ipsclass->lang['ss_end'], $url );\n }\n\n // Page Info\n $this->title = $this->ipsclass->vars['board_name'].$this->ipsclass->lang['sep'].$this->ipsclass->lang['gallery'];\n $this->nav[] = \"<a href='\".$this->ipsclass->base_url.\"automodule=gallery'>Gallery</a>\";\n $this->nav[] = $i['caption'];\n\t\t\t\n // -------------------------------------------------------\n // Stat Update!\n // -------------------------------------------------------\n $this->ipsclass->DB->simple_update( 'gallery_images', 'views=views+1', \"id={$i['id']}\", 1 );\n $this->ipsclass->DB->simple_exec();\n\n\t\t\tif( $this->ipsclass->input['hfoff'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->print->pop_up_window( $this->title, $this->output );\n\t\t\t}\n }", "function nirvana_pp_slider() {\n\t$nirvanas = nirvana_get_theme_options(); ?>\n\t<script type=\"text/javascript\">\n\tjQuery(document).ready(function() {\n\t\tjQuery('#slider').nivoSlider({\n\t\t\teffect: '<?php echo esc_html($nirvanas['nirvana_fpslideranim']); ?>',\n\t\t\tanimSpeed: <?php echo esc_html($nirvanas['nirvana_fpslidertime']); ?>,\n\t\t\t<?php if ($nirvanas['nirvana_fpsliderarrows']==\"Hidden\"): ?>directionNav: false,<?php endif;\n\t\t\tif ($nirvanas['nirvana_fpsliderarrows']==\"Always Visible\"): ?>directionNavHide: false,<?php endif; ?>\n\t\t\t//controlNavThumbs: true,\n\t\t\tbeforeChange: function(){\n\t\t\t\tjQuery('.nivo-caption h2').addClass('nivo-caption-mate');\n\t\t\t\tjQuery('.inline-slide-text').fadeOut(500);\n\t\t\t\tjQuery('.inline-slide-text').css({'opacity':'100','display':'inline'});\n\t\t\t\tjQuery('.readmore').fadeOut(500);\n\t\t\t\tjQuery('.readmore').css({'opacity':'100','display':'table'});\n\t\t\t},\n\t\t\tpauseTime: <?php echo esc_html($nirvanas['nirvana_fpsliderpause']); ?>\n\t\t});\n\t});\n\t</script>\n\t<?php\n}", "function custom_shortcode_slider() \n {\n require_once(TEMPLATEPATH.'/shortcode/shortcode.php');\n }", "public function sliders()\n {\n \n $this->data['main_title']='Sliders';\n $this->data['url_title']='Sliders';\n $param=[];\n $this->data['slider_details']=$this->settings->sliderList($param);\n $this->load->view('slider/manage_slider',$this->data);\n }", "public function create()\n {\n //\n return view ('admin.slider.addslider');\n }", "public function create()\n {\n return view('admin.slider.create');\n }", "public function create()\n {\n return view('admin.slider.create');\n }", "function create_post_type_sliders()\n{\n register_taxonomy_for_object_type('category', 'html5-blank'); // Register Taxonomies for Category\n register_taxonomy_for_object_type('post_tag', 'html5-blank');\n register_post_type('sliders', // Register Custom Post Type\n array(\n 'labels' => array(\n 'name' => __('Sliders', 'html5blank'), // Rename these to suit\n 'singular_name' => __('Slider', 'html5blank'),\n 'add_new' => __('Add New', 'html5blank'),\n 'add_new_item' => __('Add New Slider', 'html5blank'),\n 'edit' => __('Edit', 'html5blank'),\n 'edit_item' => __('Edit Slider', 'html5blank'),\n 'new_item' => __('New Slider', 'html5blank'),\n 'view' => __('View Slider', 'html5blank'),\n 'view_item' => __('View Slider', 'html5blank'),\n 'search_items' => __('Search Slider', 'html5blank'),\n 'not_found' => __('No Slider found', 'html5blank'),\n 'not_found_in_trash' => __('No Slider found in Trash', 'html5blank')\n ),\n 'public' => true,\n 'hierarchical' => true, // Allows your posts to behave like Hierarchy Pages\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'excerpt',\n 'thumbnail'\n ), // Go to Dashboard Custom HTML5 Blank post for supports\n 'can_export' => true, // Allows export in Tools > Export\n 'taxonomies' => array(\n 'post_tag',\n 'category'\n ) // Add Category and Post Tags support\n ));\n}", "function _circ2($options)\n\t{\n\t\n\t\tif ( isset ( $options['ww_header_style'] ) && !empty ( $options['ww_header_style'] ) ) { \n\t\t\t$style = 'uh_'.$options['ww_header_style'];\n\t\t} else { \n\t\t\t$style = '';\n\t\t}\n\t\n\t?>\n <div id=\"slideshow\" class=\"<?php echo $style; ?>\">\n\t\t\n\t\t\t<div class=\"bgback\"></div>\n\t\t\t<div data-images=\"<?php echo IMAGES_URL; ?>/\" id=\"sparkles\"></div>\n\t\t\n\t\t\t<div class=\"container zn_slideshow\">\n\n\t\t\t\t<div id=\"ca-container\" class=\"ca-container\">\n <div class=\"ca-wrapper\">\n <?php\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( isset ( $options['single_circ2'] ) && is_array ( $options['single_circ2'] ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i = 1;\n\t\t\t\t\t\t\t$thumbs = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ( $options['single_circ2'] as $slide ) {\t\t\t\t\t\n\n\t\t\t\t\t\t\t\techo '<div class=\"ca-item ca-item-'.$i.'\">';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<div class=\"ca-item-main\">';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_image'] ) && !empty ( $slide['ww_slide_image'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-icon\">';\n\t\t\t\t\t\t\t\t\t\t\t\t$image = vt_resize( '',$slide['ww_slide_image'] , '376','440', true );\n\t\t\t\t\t\t\t\t\t\t\t\t$bg = 'style=\"background-image:url('.$image['url'].');\"';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '</div>';\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"background\" '.$bg.'></div><!-- background color -->';\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// TITle\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_title'] ) && !empty ( $slide['ww_slide_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_title_left'] ) && !empty ( $slide['ww_slide_title_left'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t$title_pos_l = 'left:'.$slide['ww_slide_title_left'].'px;';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_title_top'] ) && !empty ( $slide['ww_slide_title_top'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t$title_pos_t = 'top:'.$slide['ww_slide_title_top'].'px;';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"title_circle\" style=\"'.$title_pos_t.' '.$title_pos_l.'\" data-size=\"'.$slide['ww_slide_title_size'].'\">';\n\t\t\t\t\t\t\t\t\t\t\t\techo '<span>'.$slide['ww_slide_title'].'</span>';\n\t\t\t\t\t\t\t\t\t\t\techo '</div>';\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\t// DESC\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_desc'] ) && !empty ( $slide['ww_slide_desc'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<h4>'. $slide['ww_slide_desc'].'</h4>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// DESC\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_read_text'] ) && !empty ( $slide['ww_slide_read_text'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"ca-more\">'.$slide['ww_slide_read_text'].' <span class=\"icon-chevron-right icon-white\"></span></a>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// Bottom Title\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_bottom_title'] ) && !empty ( $slide['ww_slide_bottom_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<span class=\"ca-starting\">'. $slide['ww_slide_bottom_title'].'</span>';\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\techo '</div>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content-wrapper\">';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content\">';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Content Title\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_content_title'] ) && !empty ( $slide['ww_slide_content_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<h6>'.$slide['ww_slide_content_title'].'</h6>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"ca-close\"><span class=\"icon-remove\"></span></a>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Content description\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_desc_full'] ) && !empty ( $slide['ww_slide_desc_full'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content-text\">';\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\techo $slide['ww_slide_desc_full'];\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\techo '</div>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Link\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_read_text_content'] ) && !empty ( $slide['ww_slide_read_text_content'] ) && isset ( $slide['ww_slide_link']['url'] ) && !empty ( $slide['ww_slide_link']['url'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"'.$slide['ww_slide_link']['url'].'\" target=\"'.$slide['ww_slide_link']['target'].'\">'.$slide['ww_slide_read_text_content'].'</a>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo '</div><!-- end ca-item -->';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\n </div><!-- end ca-wrapper -->\n </div><!-- end circular content carousel -->\n\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"zn_header_bottom_style\"></div><!-- header bottom style -->\n\t\t\t\n </div><!-- end slideshow -->\n\t<?php\n\t}", "function create_bootstrap_carousel($string)\n{\n# Nur zum Debug:\n# return \"hier soll mal ein Slider rein\";\n# enthaelt teilweise noch Code, der aktuell nicht benötigt wird, ggf fuer Ausbau\n global $settings, $template;\n $page = isset($GLOBALS['parent_page']) && $GLOBALS['parent_page'] ? $GLOBALS['parent_page'] : PAGE;\n $template->assign('contains_thumbnails', true);\n $template->assign('page', $page);\n $string = explode('|',$string[1]);\n $bootstrap_carousel = $string[0];\n #if(isset($string[1])) $img_class = $string[1];\n $bootstrap_carousel = new Gallery($bootstrap_carousel);\n if($bootstrap_carousel->photos)\n {\n $template->assign('number_of_photos', $bootstrap_carousel->number_of_photos);\n $template->assign('photos', $bootstrap_carousel->photos);\n }\n #$template->assign('lang', Localization::$lang);\n $bootstrap_carousel = $template->fetch(BASE_PATH.'cms/templates/subtemplates/bootstrap-carousel.inc.tpl');\n return $bootstrap_carousel;\n}", "function bnk_slider() {\r\n\tif (is_page_template('template-home.php') || is_single() ) {\r\n\r\n\t\tglobal $smof_data;\r\n\t\t$animation = $smof_data['bnk_slide_animation'];\r\n\t\t$slideDirection = $smof_data['bnk_slide_direction'];\r\n\t\t$slideshowSpeed = $smof_data['bnk_slide_speed'];\r\n\t\t$animationDuration = $smof_data['bnk_slide_animduration'];\r\n\t\t$directionNav = $smof_data['bnk_slide_dirnav'];\r\n\t\t$controlNav = $smof_data['bnk_slide_control'];\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n jQuery(window).load(function() {\r\n\t\t\t\tif (jQuery().flexslider) {\r\n\t\t\t\t\tjQuery('.flexslider').flexslider({\r\n\t\t\t\t\t\t<?php if($animation ) : ?> animation: \"<?php echo $animation; ?>\", <?php endif; ?>\r\n\t\t\t\t\t\t<?php if($slideDirection ) : ?> slideDirection: \"<?php echo $slideDirection; ?>\", <?php endif; ?>\r\n\t\t\t\t\t\t<?php if($slideshowSpeed ) : ?> slideshowSpeed: <?php echo $slideshowSpeed; ?>, <?php endif; ?>\r\n\t\t\t\t\t\t<?php if($animationDuration ) : ?> animationDuration: <?php echo $animationDuration; ?>, <?php endif; ?>\r\n\t\t\t\t\t\t<?php if($directionNav == 0 ) : ?> directionNav: false, <?php endif; ?>\r\n\t\t\t\t\t\t<?php if($controlNav == 0 ) : ?> controlNav: false <?php endif; ?>\r\n\t\t\t\t\t });\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t</script>\r\n\t\t<?php\r\n\t}\r\n}", "public function owlslider_shortcode( $atts = array() ) {\r\n return $this->owlslider( $atts, false );\r\n }", "function wpsight_sylt_listings_slider( $listings = array(), $args = array() ) {\n\techo wpsight_sylt_get_listings_slider( $listings, $args );\n}", "public function create()\n {\n $slider = slider::all();\n return view('admin.slider.add_slider',compact('slider'));\n }", "function itransform_ibanner_slider () { \r\n\r\n\t$itrans_slogan = esc_attr(get_theme_mod('banner_text', of_get_option('itrans_slogan')));\r\n\t$sliderscpeed = get_theme_mod('itrans_sliderspeed', (of_get_option('sliderspeed', 6000)/1000))*1000;\r\n\r\n\t$upload_dir = wp_upload_dir();\r\n\t$upload_base_dir = $upload_dir['basedir'];\r\n\t$upload_base_url = $upload_dir['baseurl'];\r\n\t\t\t\t\t\r\n\t$arrslidestxt = array();\r\n\t$template_dir = get_template_directory_uri();\r\n for($slideno=1;$slideno<=4;$slideno++){\r\n\t\t\t$strret = '';\r\n\t\t\t\r\n\t\t\t$slide_speed = esc_attr( get_theme_mod('itrans_sliderspeed')*1000 );\r\n\t\t\t$slide_title = esc_attr( get_theme_mod('itrans_slide'.$slideno.'_title', of_get_option ('itrans_slide'.$slideno.'_title', 'Multi-Purpose WP Theme')) );\r\n\t\t\t$slide_desc = esc_attr( get_theme_mod('itrans_slide'.$slideno.'_desc', of_get_option ('itrans_slide'.$slideno.'_desc', 'To start setting up i-transform go to appearance &gt; Customize. Make sure you have installed recommended plugin &#34;TemplatesNext Toolkit&#34; by going appearance > install plugin.')) );\r\n\t\t\t$slide_linktext = esc_attr( get_theme_mod('itrans_slide'.$slideno.'_linktext', of_get_option ('itrans_slide'.$slideno.'_linktext', 'Know More')) );\r\n\t\t\t$slide_linkurl = esc_attr( get_theme_mod('itrans_slide'.$slideno.'_linkurl', of_get_option ('itrans_slide'.$slideno.'_linkurl', 'http://templatesnext.org/icraft/?page_id=783')) );\t\t\t\r\n\t\t\t$slide_image = esc_attr( get_theme_mod('itrans_slide'.$slideno.'_image', of_get_option ('itrans_slide'.$slideno.'_image', get_template_directory_uri() . '/images/slide-'.$slideno.'.jpg')) );\t\t\t\t\r\n \r\n\t\t\t$slider_image_id = itransform_get_attachment_id_from_url( $slide_image );\t\t\t\r\n\t\t\t$slider_resized_image = wp_get_attachment_image( $slider_image_id, \"slider-thumb\" );\r\n\r\n\t\t\t\r\n\t\t\tif ($slider_resized_image==\"\")\r\n\t\t\t{\r\n\t\t\t\t$slider_resized_image = '<img src=\"'.get_template_directory_uri() . '/images/missing-thumb.png\">';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//echo \"<h3>Original Image URL : \".$slide_image.\"</h3>\";\r\n\t\t\t//echo \"<h3>Image ID : \".$slider_image_id.\"</h3>\";\r\n\t\t\t//echo \"<h3>Resized Image URL : \".$slider_resized_image.\"</h3>\";\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tif (!$slide_linktext)\r\n\t\t\t{\r\n\t\t\t\t$slide_linktext = __('Read more', 'i-transform');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($slide_title) {\r\n\t\t\t$strret .= '<h2>'.$slide_title.'</h2>';\r\n\t\t\t$strret .= '<p>'.$slide_desc.'</p>';\r\n\t\t\t$strret .= '<a href=\"'.$slide_linkurl.'\" class=\"da-link\">'.$slide_linktext.'</a>';\r\n\t\t\t\r\n\t\t\t\tif( $slide_image!='' ){\r\n\t\t\t\t\tif( file_exists( str_replace($upload_base_url,$upload_base_dir,$slide_image) ) ){\r\n\t\t\t\t\t\t$strret .= '<div class=\"da-img\">' . $slider_resized_image .'</div>';\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//$slide_image = $template_dir.'/images/no-image.png';\r\n\t\t\t\t\t\t$slide_image = $template_dir.'/images/slide-'.$slideno.'.jpg';\r\n\t\t\t\t\t\t$strret .= '<div class=\"da-img noslide-image-1\"><img src=\"'.$slide_image.'\" alt=\"'.$slide_title.'\" /></div>';\t\t\t\t\t\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\t\t\t\t\r\n\t\t\t\t\t$slide_image = $template_dir.'/images/no-image.png';\r\n\t\t\t\t\t$strret .= '<div class=\"da-img noslide-image\"><img src=\"'.$slide_image.'\" alt=\"'.$slide_title.'\" /></div>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($strret !=''){\r\n\t\t\t\t$arrslidestxt[$slideno] = $strret;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t}\r\n\tif(count($arrslidestxt)>0){\r\n\t\techo '<div class=\"ibanner\" data-sliderspeed=\"'.$sliderscpeed.'\">';\r\n echo '\t<div class=\"slidexnav\">';\r\n\t\techo '\t\t<a href=\"#\" class=\"sldprev genericon genericon-leftarrow\"></a>';\r\n\t\techo '\t\t<a href=\"#\" class=\"sldnext genericon genericon-rightarrow\"></a>';\r\n\t\techo '\t</div>';\r\n\t\techo '\t<div id=\"da-slider\" class=\"da-slider\" role=\"banner\">';\r\n\t\t\t\r\n\t\tforeach ( $arrslidestxt as $slidetxt ) :\r\n\t\t\techo '<div class=\"da-slide\">';\t\r\n\t\t\techo\t$slidetxt;\r\n\t\t\techo '</div>';\r\n\r\n\t\tendforeach;\r\n\t\t\r\n\t\techo '\t\t<nav class=\"da-arrows\">';\r\n\t\techo '\t\t\t<span class=\"da-arrows-prev\"></span>';\r\n\t\techo '\t\t\t<span class=\"da-arrows-next\"></span>';\r\n\t\techo '\t\t</nav>';\r\n\t\techo '\t</div>';\r\n\t\techo '</div>';\r\n\t} else\r\n\t{\r\n echo '<div class=\"iheader front\">';\r\n echo ' <div class=\"titlebar\">';\r\n echo ' <h1>';\r\n\t\t\r\n\t\tif ( $itrans_slogan ) {\r\n\t\t\t\t\t\t//bloginfo( 'name' );\r\n\t\t\techo $itrans_slogan;\r\n\t\t} \r\n\t\t//else {\r\n\t\t\t//printf( __( 'Welcome To ', 'i-transform' ) ); bloginfo( 'name' );\r\n\t\t//}\r\n echo ' </h1>';\r\n\t\techo ' \t\t <h2>';\r\n\t\t\t \t\t//bloginfo( 'description' );\r\n\t\t\t\t\t\t//echo of_get_option('itrans_sub_slogan');\r\n\t\techo '\t\t</h2>';\r\n echo ' </div>';\r\n echo '</div>';\r\n\t}\r\n \r\n}", "function cs_get_home_slider(){\n global $cs_theme_option;\n\tif($cs_theme_option['show_slider'] ==\"on\"){\n\t\tif($cs_theme_option['slider_type'] <> \"Revolution Slider\"){?>\n\t\t <div id=\"banner\" class=\"fullwidth\">\n\t\t\t<div class=\"fullwidth\" id=\"bannerwrapp\">\n\t\t\t <?php \n\t\t\t\t if($cs_theme_option['layout_option']== \"wrapper\"){\n\t\t\t\t\t\t $width = 1270;\n\t\t\t\t\t\t $height = 500;\n\t\t\t\t } else {\n\t\t\t\t\t\t $width = 1170;\n\t\t\t\t\t\t $height = 430;\n\t\t\t\t }\n\t\t\t\t $slider_slug = $cs_theme_option['slider_name'];\n\t\t\t\t if($slider_slug <> ''){\n\t\t\t\t\t $args=array(\n\t\t\t\t\t\t'name' => $slider_slug,\n\t\t\t\t\t\t'post_type' => 'cs_slider',\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'showposts' => 1,\n\t\t\t\t\t );\n\t\t\t\t\t $get_posts = get_posts($args);\n\t\t\t\t\t if($get_posts){\n\t\t\t\t\t\t $slider_id = $get_posts[0]->ID;\n\t\t\t\t\t\t if($cs_theme_option['slider_type'] == 'Flex Slider'){\n\t\t\t\t\t\t\tcs_flex_slider($width,$height,$slider_id);\n\t\t\t\t\t\t }\n\t\t\t\t\t } else {\n\t\t\t\t\t\t $slider_id = '';\n\t\t\t\t\t\t echo '<div class=\"box-small no-results-found heading-color\"> <h5>';\n\t\t\t\t\t\t\t\t _e(\"No results found.\",'Rocky');\n\t\t\t\t\t\t echo ' </h5></div>';\n\t\t\t\t\t }\n\t\t\t\t }\n \t\t\t\t?>\n\t\t\t</div>\n\t\t </div>\n\t\t<?php \n\t\t}else{\n\t\t\techo do_shortcode(htmlspecialchars_decode($cs_theme_option['slider_id']));\t\n\t\t}\n\t}\n}", "public function startJs(){\r\n\r\n \r\n\t\t$vs_Js = \"\r\n\t\t\r\n\t\t\tvar interaktingslider = new InteraktingSlider(); \r\n\t\t\t\r\n\t\t\tinteraktingslider.setDelay(\".$this->getModel()->getDelay().\");\r\n\t\t\tinteraktingslider.setTransition('\".$this->getModel()->getTransition().\"');\r\n\t\t\tinteraktingslider.setSpeed(\".$this->getModel()->getSpeed().\");\t\t\r\n\t\t\tinteraktingslider.setMode('\".$this->getModel()->getMode().\"');\r\n\t\t\t\r\n\t\t\";\r\n\r\n\t\t$va_Slides = $this->getSlides();\r\n\r\n\t\tif($va_Slides){\r\n\t\t\tforeach ($va_Slides as $vo_Slide){\r\n\t\t\t\t$vs_Js .= 'interaktingslider.addSlide(\"'.$vo_Slide->getFormatedContent().'\"); ';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$vs_Js .= \"\r\n\t\t\tinteraktingslider.show(); \t\t\r\n\t\t\";\r\n\r\n\r\n\t\treturn $vs_Js;\r\n\r\n\t}", "function print_slider_item($item_xml){\r\r\n\t\t\r\r\n\t\t$xml_size = find_xml_value($item_xml, 'size');\r\r\n\t\tif( $xml_size == 'full-width' ){\r\r\n\t\t\techo '<div class=\"slider-wrapper fullwidth\">';\r\r\n\t\t}else{\r\r\n\t\t\techo '<div class=\"slider-wrapper\">';\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t$slider_width = find_xml_value($item_xml, 'width');\r\r\n\t\t$slider_height = find_xml_value($item_xml, 'height');\r\r\n\t\tif( !empty($slider_width) && !empty($slider_height) ){\r\r\n\t\t\t$xml_size = $slider_width . 'x' . $slider_height;\r\r\n\t\t}else{\r\r\n\t\t\t$xml_size = '980x360';\r\r\n\t\t}\r\r\n\r\r\n\t\tswitch(find_xml_value($item_xml,'slider-type')){\r\r\n\t\t\r\r\n\t\t\tcase 'Anything Slider':\r\r\n\t\t\t\tprint_anything_slider(find_xml_node($item_xml,'slider-item'), $xml_size);\r\r\n\t\t\t\tbreak;\r\r\n\t\t\t\t\r\r\n\t\t\tcase 'Nivo Slider': \r\r\n\t\t\t\tprint_nivo_slider(find_xml_node($item_xml,'slider-item'), $xml_size); \r\r\n\t\t\t\tbreak;\r\r\n\t\t\t\r\r\n\t\t\tcase 'Flex Slider': \r\r\n\t\t\t\tprint_flex_slider(find_xml_node($item_xml,'slider-item'), $xml_size); \r\r\n\t\t\t\tbreak;\r\r\n\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\tif( find_xml_value($item_xml, 'size') == 'full-width' ){\r\r\n\t\t\r\r\n\t\t\techo \"<div class='slider-top-shadow slider-gimmick'></div>\";\r\r\n\t\t\techo \"<div class='slider-bottom-shadow slider-gimmick'></div>\";\r\r\n\t\t\techo \"<div class='slider-bottom-gimmick slider-gimmick'></div>\";\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\techo \"</div>\";\r\r\n\t}", "function carousel_slider($atts, $content = null){\n\textract(shortcode_atts(array(\n\t\t\"enable_slider\" => 'yes',\n\t\t\"hover_effect\" => 'hover-effect2',\n\t\t\"columns\" => 'col3',\n\t\t\"title_tag\" => 'h2',\n\t\t\"title\" => 'Our Team',\n\t\t\"type\" => '',\n\t\t\"auto_play\" => 'false',\n\t\t\"slide_duration\" => '',\n\t\t'animate' => '',\n\t\t'transition' => '',\n\t\t'duration' => '',\n\t\t'delay' => ''\n\t\t), $atts));\n\n\t$animate_class = \"\";\n\t$slideTransition = \"\";\n\t$animateDuration = \"\";\n\t$slideDelay = \"\";\n\n\tif($animate == \"Yes\"){\n\n\t\t$animate_class = ' pix-animate-cre';\n\n\t\t$slideTransition = isset($transition) ? ' data-trans=\"'. esc_attr($transition) .'\"' : '';\n\n\t\t$animateDuration = isset($duration) ? ' data-duration=\"'. $duration .'\"' : '';\n\n\t\t$slideDelay = isset($delay) ? ' data-delay=\"'. $delay .'\"' : '';\n\n\t}\n\n\t$sliderClassName = '';\n\t$slider = ($enable_slider == 'yes') ? 'fcsCarousel' : '';\n\n\t$autoPlay = ($auto_play == 'true') ? 'data-autoplay=\"'. esc_attr($auto_play) .'\"' : '';\n\t$slideDuration = isset($slide_duration) ? 'data-duration=\"'. esc_attr($slide_duration) .'\"' : '';\n\n\t$slider = ($enable_slider == 'yes') ? 'fcsCarousel' : '';\n\n\tif ($type == 'clients')\n\t\t$sliderClassName = 'ourClients';\n\telse if ($type == 'staffs')\n\t\t$sliderClassName = 'member';\t\n\t\n\t$output = '<section class=\"newSection container popup-gallery ' . $slider . ' '.$columns.' '. $sliderClassName .'\" '. $autoPlay .' '. $slideDuration .'>';\n $output .= '<'.$title_tag.' class=\"mainTitle'. esc_attr($animate_class) .'\"'. $slideTransition .' '. $animateDuration .' '. $slideDelay .'>'.esc_html($title).'</'.$title_tag.'>';\n $output .= '<div class=\"carousel-items-con '. $hover_effect .' featuredWorks\">';\n $output .= '<ul class=\"carousel-items\">';\n\t\n\t$output .= do_shortcode($content);\n\t\n\t$output .= '</ul>';\n\tif($enable_slider == 'yes'){\n\t\t$output .= '<div class=\"slider-nav\">';\n\t\t$output .= '<a href=\"#\" data-dir=\"prev\" class=\"slider-btn prevSlide\">&lsaquo;</a>';\n\t\t$output .= '<a href=\"#\" data-dir=\"next\" class=\"slider-btn nextSlide\">&rsaquo;</a>';\n\t\t$output .= '</div> ';\n\t}\n\t$output .= '</div>';\n\t$output .= '</section>';\n\treturn $output;\n}", "public function create()\n {\n return view('slider.create')->with('title',\"Create New Slider\");\n }", "function lucid_slider_get( $id ) {\n\t$slider = new Lucid_Slider( $id );\n\n\treturn $slider->get_slider();\n}", "function wpsp_tour_slideshow() {\n\tglobal $post;\n\n\t$photos = explode( ',', get_post_meta( $post->ID, 'wpsp_tour_slideshow', true ) );\n\n\tif ( $photos[0] != '' ) { ?>\n\t\t<script type=\"text/javascript\">\n jQuery(document).ready(function($){\n $('#slides').superslides({\n \tplay: 5000,\n\t\t\t\t animation_speed: 600,\n\t\t\t\t animation_easing: 'swing',\n\t\t\t\t animation: 'slide',\n\t\t\t inherit_width_from: '.site-slider',\n\t\t\t inherit_height_from: '.site-slider'\n\t\t\t });\n }); \n </script>\n\t<?php\n\t\techo '<div class=\"site-slider\">';\n\t\techo '<div id=\"slides\">';\n echo '<ul class=\"slides-container\">';\n foreach ( $photos as $photo ) : \n echo '<li>' . wp_get_attachment_image( $photo, 'post-slide' ) . '</li>';\n \tendforeach;\n echo '</ul>';\n echo '<nav class=\"slides-navigation\">';\n\t echo '<a href=\"#\" class=\"next\"><i class=\"fa fa-chevron-right\"></i></a>';\n\t echo '<a href=\"#\" class=\"prev\"><i class=\"fa fa-chevron-left\"></i></a>';\n\t echo '</nav>';\n\t\techo ' </div> <!-- #slides -->';\n echo '</div> <!-- .site-slider -->';\n\t}\n}", "function createSelectors($num) { ?>\n\t\t<li class=\"active\" data-target=\"#carousel-photos\" data-slide-to=\"0\"></li> <?PHP\n\t\tfor ($i = 1; $i <= $num; $i++) { ?>\n\t\t\t<li data-target=\"#carousel-photos\" data-slide-to=\"<?= $i ?>\"></li> <?PHP\n\t\t}\n\t}", "function carousel_slider(){\r\n\tregister_post_type('slider', array(\r\n\t\t\t'supports' => array('title', 'editor', 'excerpt'),\r\n\t\t\t'rewrite' => array('slug' => 'slider'),\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'public' => true,\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => 'Slider',\r\n\t\t\t\t'add_new_item' => 'Add New Slider',\r\n\t\t\t\t'edit_item' => 'Edit Slider',\r\n\t\t\t\t'singular_name' => 'Slider'\r\n\t\t\t),\r\n\t\t\t'menu_icon' => 'dashicons-images-alt'));\r\n}", "public function create()\n {\n return view('sadmin.slideradd');\n }", "function mount_slider_post_type()\n{\n $labels = array(\n 'name' => _x('Sliders', 'Post Type General Name', 'mount'),\n 'singular_name' => _x('Slider', 'Post Type Singular Name', 'mount'),\n 'menu_name' => __('Sliders', 'mount'),\n 'parent_item_colon' => __('Parent Slider', 'mount'),\n 'all_items' => __('All Sliders', 'mount'),\n 'view_item' => __('View Slider', 'mount'),\n 'add_new_item' => __('Add New Slider', 'mount'),\n 'add_new' => __('Add New Slider', 'mount'),\n 'edit_item' => __('Edit Slider', 'mount'),\n 'update_item' => __('Update Slider', 'mount'),\n 'search_items' => __('Search Slider', 'mount'),\n 'not_found' => __('No sliders found', 'mount'),\n 'not_found_in_trash' => __('Not found in trash', 'mount'),\n );\n // Another Customizations\n $args = array(\n 'label' => __('Sliders', 'mount'),\n 'description' => __('Sliders for Mount', 'mount'),\n 'labels' => $labels,\n 'supports' => array('title', 'thumbnail',),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menus' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-images-alt2',\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'capability_type' => 'page',\n );\n // register the post Type\n register_post_type('sliders', $args);\n}", "public function sliderread()\n {\n $data['sliders'] = $this->admin_m->geAlltSliders();\n $data['content'] = 'admin/sliderread';\n $this->load->view('components/template', $data);\n }", "function rev_slider_shortcode($args, $mid_content = null){\n $zt_params = JComponentHelper::getParams('com_zt_layerslider');\n $js_defer = $zt_params->get('js_defer') ? 'defer=\"defer\"' : '';\n extract(shortcode_atts(array('alias' => ''), $args, 'zt_layerslider'));\n extract(shortcode_atts(array('settings' => ''), $args, 'zt_layerslider'));\n extract(shortcode_atts(array('order' => ''), $args, 'zt_layerslider'));\n\n if($settings !== '') $settings = json_decode(str_replace(array('({', '})', \"'\"), array('[', ']', '\"'), $settings) ,true);\n if($order !== '') $order = explode(',', $order);\n\n $sliderAlias = ($alias != '') ? $alias : ZTSliderFunctions::getVal($args,0);\n\n $gal_ids = check_for_shortcodes($mid_content); //check for example on gallery shortcode and do stuff\n\n ob_start();\n if(!empty($gal_ids)){ //add a gallery based slider\n $slider = ZTSliderOutput::putSlider($sliderAlias, '', $gal_ids);\n }else{\n $slider = ZTSliderOutput::putSlider($sliderAlias, '', array(), $settings, $order);\n }\n $content = ob_get_contents();\n ob_clean();\n ob_end_clean();\n\n if(!empty($slider)){\n // Do not output Slider if we are on mobile\n $disable_on_mobile = $slider->getParam(\"disable_on_mobile\",\"off\");\n if($disable_on_mobile == 'on'){\n $mobile = (strstr($_SERVER['HTTP_USER_AGENT'],'Android') || strstr($_SERVER['HTTP_USER_AGENT'],'webOS') || strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') ||strstr($_SERVER['HTTP_USER_AGENT'],'iPod') || strstr($_SERVER['HTTP_USER_AGENT'],'iPad') || strstr($_SERVER['HTTP_USER_AGENT'],'Windows Phone') || wp_is_mobile()) ? true : false;\n if($mobile) return false;\n }\n\n $show_alternate = $slider->getParam(\"show_alternative_type\",\"off\");\n\n if($show_alternate == 'mobile' || $show_alternate == 'mobile-ie8'){\n if(strstr($_SERVER['HTTP_USER_AGENT'],'Android') || strstr($_SERVER['HTTP_USER_AGENT'],'webOS') || strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') ||strstr($_SERVER['HTTP_USER_AGENT'],'iPod') || strstr($_SERVER['HTTP_USER_AGENT'],'iPad') || strstr($_SERVER['HTTP_USER_AGENT'],'Windows Phone') || wp_is_mobile()){\n $show_alternate_image = $slider->getParam(\"show_alternate_image\",\"\");\n return '<img class=\"tp-slider-alternative-image\" src=\"'.$show_alternate_image.'\" data-no-retina>';\n }\n }\n\n //handle slider output types\n echo \"<link rel='stylesheet' type='text/css' href='\".JUri::root(true) . '/administrator/components/com_zt_layerslider/assets/css/settings.css'.\"'>\";\n echo \"<script type='text/javascript' src='\".JUri::root(true) . '/administrator/components/com_zt_layerslider/assets/js/jquery.themepunch.tools.min.js'.\"' \".$js_defer.\" ></script>\";\n echo \"<script type='text/javascript' src='\".JUri::root(true) . '/administrator/components/com_zt_layerslider/assets/js/jquery.themepunch.revolution.min.js'.\"' \".$js_defer.\" ></script>\";\n echo $content;\n }else\n echo $content; //normal output\n\n }", "function tmpl_tevolution_single_slider_script(){\r\n\t$is_edit=(isset($_REQUEST['action']) && $_REQUEST['action']=='edit')?'1':'';\t\r\n\tif(is_single() && $is_edit==''){\r\n\t\tglobal $post;\r\n\t\t$post_id = $post->ID;\r\n\t\tif(get_post_meta($post_id,'_event_id',true)){\r\n\t\t\t$post_id=get_post_meta($post_id,'_event_id',true);\r\n\t\t}\r\n\t\t$slider_more_listing_img = bdw_get_images_plugin($post_id,'tevolution_thumbnail');\r\n\t\t\r\n\t\t/*get the theme setting option*/\r\n\t\t$supreme2_theme_settings = (function_exists('supreme_prefix')) ? get_option(supreme_prefix().'_theme_settings'):'';\r\n\t\t\r\n\t\t/*Slider div id */\r\n\t\t$silde_gallery_id=apply_filters('tmpl_detail_slider_gallery_id','silde_gallery');\r\n\t\t$slider_id=apply_filters('tmpl_detail_slider_id','slider');\r\n\t\t/*tmpl_detail_slider_options filter hook for change any slider option */\r\n\t\t$slider_options = apply_filters('tmpl_detail_slider_options',array('animation'=>'slide','slideshow'=>'false','direction'=>'horizontal','slideshowSpeed'=>7000,'animationLoop'=>'true','startAt'=> 0,'smoothHeight'=> 'true','easing'=> \"swing\",'pauseOnHover'=> 'true','video'=> 'true','controlNav'=> 'true','directionNav'=> 'true','prevText'=> '','nextText'=> '','animationLoop'=>'true','itemWidth'=>'60','itemMargin'=>'20'));\r\n\t\t?>\r\n <script type=\"text/javascript\" async >\r\n\t\t\tjQuery(window).load(function()\r\n\t\t\t{ \r\n\t\t\t\tjQuery('#<?php echo $silde_gallery_id?>').flexslider({\r\n\t\t\t\t\tanimation: '<?php echo $slider_options['animation'];?>',\r\n\t\t\t\t\t<?php if(!empty($slider_more_listing_img) && (count($slider_more_listing_img) < apply_filters('tmpl_slider_image_count',4))):?>\r\n\t\t\t\t\tcontrolNav: false,\r\n\t\t\t\t\tdirectionNav: false,\r\n\t\t\t\t\tprevText: '<?php echo $slider_options['prevText'];?>',\r\n\t\t\t\t\tnextText: '<?php echo $slider_options['nextText'];?>',\r\n\t\t\t\t\t<?php \r\n\t\t\t\t\telse: ?>\r\n\t\t\t\t\tcontrolNav: <?php echo $slider_options['controlNav'];?>,\r\n\t\t\t\t\tdirectionNav: <?php echo $slider_options['directionNav'];?>,\r\n\t\t\t\t\t<?php endif; ?>\r\n\t\t\t\t\tanimationLoop: false,\r\n\t\t\t\t\tslideshow: <?php echo $slider_options['slideshow'];?>,\r\n\t\t\t\t\titemWidth: <?php echo $slider_options['itemWidth'];?>,\r\n\t\t\t\t\titemMargin: <?php echo $slider_options['itemMargin'];?>,\r\n\t\t\t\t\t <?php if($supreme2_theme_settings['rtlcss'] ==1 || is_rtl() || (isset($_SESSION['rtlcss']) && $_SESSION['rtlcss']==1)){ ?>\r\n\t\t\t\t\trtl: true,\r\n\t\t\t\t\t<?php } ?>\r\n\t\t\t\t\ttouch:true,\r\n\t\t\t\t\tasNavFor: '#slider'\r\n\t\t\t\t });\r\n\t\t\t\tjQuery('#<?php echo $slider_id;?>').flexslider(\r\n\t\t\t\t{\r\n\t\t\t\t\tanimation: '<?php echo $slider_options['animation'];?>',\r\n\t\t\t\t\tslideshow: <?php echo $slider_options['slideshow'];?>,\r\n\t\t\t\t\tdirection: '<?php echo $slider_options['direction'];?>',\r\n\t\t\t\t\tslideshowSpeed: 7000,\r\n\t\t\t\t\tanimationLoop: <?php echo $slider_options['animationLoop'];?>,\r\n\t\t\t\t\tstartAt: 0,\r\n\t\t\t\t\tsmoothHeight: <?php echo $slider_options['smoothHeight'];?>,\r\n\t\t\t\t\teasing: '<?php echo $slider_options['easing'];?>',\r\n\t\t\t\t\tpauseOnHover: <?php echo $slider_options['pauseOnHover'];?>,\r\n\t\t\t\t\tvideo: <?php echo $slider_options['video'];?>,\r\n\t\t\t\t\tcontrolNav: <?php echo $slider_options['controlNav'];?>,\r\n\t\t\t\t\tdirectionNav: <?php echo $slider_options['directionNav'];?>,\t\r\n\t\t\t\t\ttouch:true,\t\t\t\t\t\r\n\t\t\t\t\tstart: function(slider)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tjQuery('body').removeClass('loading');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t <?php if($supreme2_theme_settings['rtlcss'] ==1 || is_rtl() || (isset($_SESSION['rtlcss']) && $_SESSION['rtlcss']==1)){ ?>\r\n\t\t\t\t\t,rtl: true,\r\n\t\t\t\t\t<?php } ?>\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t/*FlexSlider: Default Settings*/\r\n\t\t</script>\r\n <?php\r\n\t\t\r\n\t}\r\n}", "public function create()\n\t{\n\t\treturn View::make('sliders.create');\n\t}", "function smooth_slider_create_multiple_sliders() {\nglobal $smooth_slider;\n?>\n\n<div class=\"wrap\" style=\"clear:both;\">\n <div style=\"margin:10px auto;clear:left;\">\n <a href=\"http://slidervilla.com/\" title=\"Premium WordPress Slider Plugins\" target=\"_blank\"><img src=\"<?php echo smooth_slider_plugin_url('images/slidervilla-728.jpg');?>\" alt=\"Premium WordPress Slider Plugins\" /></a>\n </div>\n<h2 style=\"float:left;\"><?php _e('Sliders Created','smooth-slider'); ?></h2>\n<form style=\"float:left;\" action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">\n<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">\n<input type=\"hidden\" name=\"hosted_button_id\" value=\"8046056\">\n<input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">\n<img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\">\n</form>\n\n<?php \nif ($_POST['remove_posts_slider']) {\n if ( $_POST['slider_posts'] ) {\n global $wpdb, $table_prefix;\n $table_name = $table_prefix.SLIDER_TABLE;\n\t $current_slider = $_POST['current_slider_id'];\n\t foreach ( $_POST['slider_posts'] as $post_id=>$val ) {\n\t\t $sql = \"DELETE FROM $table_name WHERE post_id = '$post_id' AND slider_id = '$current_slider' LIMIT 1\";\n\t\t $wpdb->query($sql);\n\t }\n }\n if ($_POST['remove_all'] == __('Remove All at Once','smooth-slider')) {\n global $wpdb, $table_prefix;\n $table_name = $table_prefix.SLIDER_TABLE;\n\t $current_slider = $_POST['current_slider_id'];\n\t if(is_slider_on_slider_table($current_slider)) {\n\t\t $sql = \"DELETE FROM $table_name WHERE slider_id = '$current_slider';\";\n\t\t $wpdb->query($sql);\n\t }\n }\n if ($_POST['remove_all'] == __('Delete Slider','smooth-slider')) {\n $slider_id = $_POST['current_slider_id'];\n global $wpdb, $table_prefix;\n $slider_table = $table_prefix.SLIDER_TABLE;\n $slider_meta = $table_prefix.SLIDER_META;\n\t $slider_postmeta = $table_prefix.SLIDER_POST_META;\n\t if(is_slider_on_slider_table($slider_id)) {\n\t\t $sql = \"DELETE FROM $slider_table WHERE slider_id = '$slider_id';\";\n\t\t $wpdb->query($sql);\n\t }\n\t if(is_slider_on_meta_table($slider_id)) {\n\t\t $sql = \"DELETE FROM $slider_meta WHERE slider_id = '$slider_id';\";\n\t\t $wpdb->query($sql);\n\t }\n\t if(is_slider_on_postmeta_table($slider_id)) {\n\t\t $sql = \"DELETE FROM $slider_postmeta WHERE slider_id = '$slider_id';\";\n\t\t $wpdb->query($sql);\n\t }\n }\n}\nif ($_POST['create_new_slider']) {\n $slider_name = $_POST['new_slider_name'];\n global $wpdb,$table_prefix;\n $slider_meta = $table_prefix.SLIDER_META;\n $sql = \"INSERT INTO $slider_meta (slider_name) VALUES('$slider_name');\";\n $result = $wpdb->query($sql);\n}\nif ($_POST['reorder_posts_slider']) {\n $i=1;\n global $wpdb, $table_prefix;\n $table_name = $table_prefix.SLIDER_TABLE;\n foreach ($_POST['order'] as $slide_order) {\n $slide_order = intval($slide_order);\n $sql = 'UPDATE '.$table_name.' SET slide_order='.$i.' WHERE post_id='.$slide_order.'';\n $wpdb->query($sql);\n $i++;\n }\n}\n?>\n<div style=\"clear:both\"></div>\n<?php $url = sslider_admin_url( array( 'page' => 'smooth-slider-settings' ) );?>\n<a href=\"<?php echo $url; ?>\" title=\"<?php _e('Settings Page for Smooth Slider where you can change the color, font etc. for the sliders','smooth-slider'); ?>\"><?php _e('Go to Smooth Slider Settings page','smooth-slider'); ?></a>\n<?php $sliders = ss_get_sliders(); ?>\n\n<div id=\"slider_tabs\">\n <ul class=\"ui-tabs\">\n <?php foreach($sliders as $slider){?>\n <li><a href=\"#tabs-<?php echo $slider['slider_id'];?>\"><?php echo $slider['slider_name'];?></a></li>\n <?php } ?>\n <?php if($smooth_slider['multiple_sliders'] == '1') {?>\n <li><a href=\"#new_slider\"><?php _e('Create New Slider','smooth-slider'); ?></a></li>\n <?php } ?>\n </ul>\n\n<?php foreach($sliders as $slider){?>\n<div id=\"tabs-<?php echo $slider['slider_id'];?>\">\n<form action=\"\" method=\"post\">\n<?php settings_fields('smooth-slider-group'); ?>\n\n<input type=\"hidden\" name=\"remove_posts_slider\" value=\"1\" />\n<div id=\"tabs-<?php echo $slider['slider_id'];?>\">\n<h3><?php _e('Posts/Pages Added To','smooth-slider'); ?> <?php echo $slider['slider_name'];?><?php _e('(Slider ID','smooth-slider'); ?> = <?php echo $slider['slider_id'];?>)</h3>\n<p><em><?php _e('Check the Post/Page and Press \"Remove Selected\" to remove them From','smooth-slider'); ?> <?php echo $slider['slider_name'];?>. <?php _e('Press \"Remove All at Once\" to remove all the posts from the','smooth-slider'); ?> <?php echo $slider['slider_name'];?>.</em></p>\n\n <table class=\"widefat\">\n <thead><tr><th><?php _e('Post/Page Title','smooth-slider'); ?></th><th><?php _e('Author','smooth-slider'); ?></th><th><?php _e('Post Date','smooth-slider'); ?></th><th><?php _e('Remove Post','smooth-slider'); ?></th></tr></thead><tbody>\n\n<?php \n\t/*global $wpdb, $table_prefix;\n\t$table_name = $table_prefix.SLIDER_TABLE;*/\n\t$slider_id = $slider['slider_id'];\n\t//$slider_posts = $wpdb->get_results(\"SELECT post_id FROM $table_name WHERE slider_id = '$slider_id'\", OBJECT); \n $slider_posts=get_slider_posts_in_order($slider_id); ?>\n\t\n <input type=\"hidden\" name=\"current_slider_id\" value=\"<?php echo $slider_id;?>\" />\n \n<?php $count = 0;\t\n\tforeach($slider_posts as $slider_post) {\n\t $slider_arr[] = $slider_post->post_id;\n\t $post = get_post($slider_post->post_id);\t \n\t if ( in_array($post->ID, $slider_arr) ) {\n\t\t $count++;\n\t\t $sslider_author = get_userdata($post->post_author);\n $sslider_author_dname = $sslider_author->display_name;\n\t\t echo '<tr' . ($count % 2 ? ' class=\"alternate\"' : '') . '><td><strong>' . $post->post_title . '</strong><a href=\"'.get_edit_post_link( $post->ID, $context = 'display' ).'\" target=\"_blank\"> '.__( '(Edit)', 'smooth-slider' ).'</a> <a href=\"'.get_permalink( $post->ID ).'\" target=\"_blank\"> '.__( '(View)', 'smooth-slider' ).' </a></td><td>By ' . $sslider_author_dname . '</td><td>' . date('l, F j. Y',strtotime($post->post_date)) . '</td><td><input type=\"checkbox\" name=\"slider_posts[' . $post->ID . ']\" value=\"1\" /></td></tr>'; \n\t }\n\t}\n\t\t\n\tif ($count == 0) {\n\t\techo '<tr><td colspan=\"4\">'.__( 'No posts/pages have been added to the Slider - You can add respective post/page to slider on the Edit screen for that Post/Page', 'smooth-slider' ).'</td></tr>';\n\t}\n\techo '</tbody><tfoot><tr><th>'.__( 'Post/Page Title', 'smooth-slider' ).'</th><th>'.__( 'Author', 'smooth-slider' ).'</th><th>'.__( 'Post Date', 'smooth-slider' ).'</th><th>'.__( 'Remove Post', 'smooth-slider' ).'</th></tr></tfoot></table>'; \n \n\techo '<div class=\"submit\">';\n\t\n\tif ($count) {echo '<input type=\"submit\" value=\"'.__( 'Remove Selected', 'smooth-slider' ).'\" onclick=\"return confirmRemove()\" /><input type=\"submit\" name=\"remove_all\" value=\"'.__( 'Remove All at Once', 'smooth-slider' ).'\" onclick=\"return confirmRemoveAll()\" />';}\n\t\n\tif($slider_id != '1') {\n\t echo '<input type=\"submit\" value=\"'.__( 'Delete Slider', 'smooth-slider' ).'\" name=\"remove_all\" onclick=\"return confirmSliderDelete()\" />';\n\t}\n\t\n\techo '</div>';\n?> \n </tbody></table>\n </form>\n \n \n <form action=\"\" method=\"post\">\n <input type=\"hidden\" name=\"reorder_posts_slider\" value=\"1\" />\n <h3><?php _e('Reorder the Posts/Pages Added To','smooth-slider'); ?> <?php echo $slider['slider_name'];?>(Slider ID = <?php echo $slider['slider_id'];?>)</h3>\n <p><em><?php _e('Click on and drag the post/page title to a new spot within the list, and the other items will adjust to fit.','smooth-slider'); ?> </em></p>\n <ul id=\"sslider_sortable_<?php echo $slider['slider_id'];?>\" style=\"color:#326078\"> \n <?php \n /*global $wpdb, $table_prefix;\n\t$table_name = $table_prefix.SLIDER_TABLE;*/\n\t$slider_id = $slider['slider_id'];\n\t//$slider_posts = $wpdb->get_results(\"SELECT post_id FROM $table_name WHERE slider_id = '$slider_id'\", OBJECT); \n $slider_posts=get_slider_posts_in_order($slider_id);?>\n \n <input type=\"hidden\" name=\"current_slider_id\" value=\"<?php echo $slider_id;?>\" />\n \n <?php $count = 0;\t\n foreach($slider_posts as $slider_post) {\n $slider_arr[] = $slider_post->post_id;\n $post = get_post($slider_post->post_id);\t \n if ( in_array($post->ID, $slider_arr) ) {\n $count++;\n $sslider_author = get_userdata($post->post_author);\n $sslider_author_dname = $sslider_author->display_name;\n echo '<li id=\"'.$post->ID.'\"><input type=\"hidden\" name=\"order[]\" value=\"'.$post->ID.'\" /><strong> &raquo; &nbsp; ' . $post->post_title . '</strong></li>'; \n }\n }\n \n if ($count == 0) {\n echo '<li>'.__( 'No posts/pages have been added to the Slider - You can add respective post/page to slider on the Edit screen for that Post/Page', 'smooth-slider' ).'</li>';\n }\n\t\t \n echo '</ul><div class=\"submit\">';\n \n if ($count) {echo '<input type=\"submit\" value=\"Save the order\" />';}\n \n echo '</div>';\n ?> \n </div> \n </form>\n</div> \n \n<?php } ?>\n\n<?php if($smooth_slider['multiple_sliders'] == '1') {?>\n <div id=\"new_slider\">\n <form action=\"\" method=\"post\" onsubmit=\"return slider_checkform(this);\" >\n <h3><?php _e('Enter New Slider Name','smooth-slider'); ?></h3>\n <input type=\"hidden\" name=\"create_new_slider\" value=\"1\" />\n \n <input name=\"new_slider_name\" class=\"regular-text code\" value=\"\" style=\"clear:both;\" />\n \n <div class=\"submit\"><input type=\"submit\" value=\"<?php _e('Create New','smooth-slider'); ?>\" name=\"create_new\" /></div>\n \n </form>\n </div>\n<?php }?> \n</div>\n\n<div style=\"margin:10px auto;clear:left;\">\n <a href=\"http://slidervilla.com/\" title=\"Premium WordPress Slider Plugins\" target=\"_blank\"><img src=\"<?php echo smooth_slider_plugin_url('images/slidervilla-728.jpg');?>\" alt=\"Premium WordPress Slider Plugins\" /></a>\n</div>\n\n<div id=\"poststuff\" class=\"metabox-holder has-right-sidebar\"> \n <div id=\"side-info-column\" class=\"inner-sidebar\" style=\"float:left;\"> \n\t\t\t<div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span><?php _e('About this Plugin:','smooth-slider'); ?></span></h3> \n\t\t\t <div class=\"inside\">\n <ul>\n <li><a href=\"http://www.clickonf5.org/smooth-slider\" title=\"Smooth Slider Homepage\" ><?php _e('Plugin Homepage','smooth-slider'); ?></a></li>\n <li><a href=\"http://www.clickonf5.org\" title=\"Visit Internet Techies\" ><?php _e('Plugin Parent Site','smooth-slider'); ?></a></li>\n <li><a href=\"http://www.clickonf5.org/phpbb/smooth-slider-f12/\" title=\"Support Forum for Smooth Slider\" ><?php _e('Support Forum','smooth-slider'); ?></a></li>\n <li><a href=\"http://www.clickonf5.org/about/tejaswini\" title=\"Smooth Slider Author Page\" ><?php _e('About the Author','smooth-slider'); ?></a></li>\n <li><a href=\"http://www.clickonf5.org/go/smooth-slider/\" title=\"<?php _e('Donate if you liked the plugin and support in enhancing Smooth Slider and creating new plugins','smooth-slider'); ?>\" ><?php _e('Donate with Paypal','smooth-slider'); ?></a></li>\n </ul> \n </div> \n\t\t\t</div> \n </div>\n \n <div id=\"side-info-column\" class=\"inner-sidebar\" style=\"float:left;margin-left:1em\"> \n\t\t\t<div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span></span><?php _e('Our Facebook Fan Page','smooth-slider'); ?></h3> \n\t\t\t <div class=\"inside\">\n <script type=\"text/javascript\" src=\"http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_GB\"></script><script type=\"text/javascript\">FB.init(\"2aeebe9fb014836a6810ec4426d26f7e\");</script><fb:fan profile_id=\"127760528543\" stream=\"\" connections=\"8\" width=\"270\" height=\"250\"></fb:fan>\n </div> \n\t\t\t</div> \n </div>\n\n <div id=\"side-info-column\" class=\"inner-sidebar\" style=\"float:left;margin-left:1em\"> \n\t\t\t<div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span><?php _e('Credits:','smooth-slider'); ?></span></h3> \n\t\t\t <div class=\"inside\">\n <ul>\n <li><a href=\"http://sorgalla.com/jcarousel/\" title=\"jCarousel jQuey plugin\" >Riding carousels with jQuery</a></li>\n <li><a href=\"http://acko.net/dev/farbtastic\" title=\"Farbtastic Color Picker by Steven Wittens\" >Farbtastic Color Picker</a></li>\n <li><a href=\"http://jquery.com/\" title=\"jQuery JavaScript Library - John Resig\" >jQuery JavaScript Library</a></li>\n </ul> \n </div> \n\t\t\t</div> \n </div>\n \n <div id=\"side-info-column\" class=\"inner-sidebar\" style=\"float:left;margin-left:1em\"> \n\t\t\t<div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span><?php _e('Top Supporters','smooth-slider'); ?></span></h3> \n\t\t\t <div class=\"inside\">\n <div id=\"smooth_sldr_donations\">\n\t\t\t\t\t <ul>\n <li><a href=\"http://www.jacobwiechman.com/wordpress//\" title=\"Visit Jacob Wiechman - $50\" >Jacob Wiechman - $50</a></li>\n <li><a href=\"http://malamedconsulting.com/\" title=\"Visit Connie Malamed - $25\" >Connie Malamed - $25</a></li>\n <li><a href=\"http://uwaterloo.ca/\" title=\"Visit Trevor Bain - $25\" >Trevor Bain - $25</a></li>\n <li><a href=\"http://www.whatsthebigidea.com/\" title=\"Visit WhatsTheBigIdea.com,Inc. - $20\" >WhatsTheBigIdea.com,Inc. - $20</a></li>\n </ul> \n </div>\n </div> \n\t\t\t</div> \n </div> \n <div style=\"clear:left;\"></div>\n\n <div id=\"side-info-column\" style=\"float:left;width:325px;\"> \n <div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span></span><?php _e('Recommended WordPress Hosting','smooth-slider'); ?></h3> \n\t\t\t <div class=\"inside\">\n <div style=\"margin:10px 5px\">\n <a href=\"http://slidervilla.com/go/hostgator/\" title=\"Recommended Web Hosting\" target=\"_blank\"><img src=\"<?php echo smooth_slider_plugin_url('images/hostgator.gif');?>\" alt=\"Recommended Web Hosting\" /></a>\n <p><a href=\"http://slidervilla.com/go/hostgator/\" title=\"Recommended Web Hosting\" target=\"_blank\">HostGator</a> is one of the world's top 10 largest web hosting companies with more than 5,000,000 hosted domains. You can host your own WordPress installation with custom themes, plugins, and your own domain name with HostGator from only $3.96 a month.</p>\n <p><strong>Features: </strong>UNLIMITED Disk Space and Bandwidth, FREE Site Building Tools and Templates, 24/7/365 Award Winning Technical Support</p>\n <p>For more info visit <a href=\"http://slidervilla.com/go/hostgator/\" title=\"Recommended Web Hosting\" target=\"_blank\">HostGator.com</a></p>\n </div>\n </div></div></div>\n \n \t\t<div id=\"side-info-column\" style=\"float:left;margin-left:1em;width:325px;\"> \n <div class=\"postbox\"> \n\t\t\t <h3 class=\"hndle\"><span></span><?php _e('Recommended Themes','smooth-slider'); ?></h3> \n\t\t\t <div class=\"inside\">\n <div style=\"margin:10px 5px\">\n <a href=\"http://slidervilla.com/go/elegantthemes/\" title=\"Recommended WordPress Themes\" target=\"_blank\"><img src=\"<?php echo smooth_slider_plugin_url('images/elegantthemes.gif');?>\" alt=\"Recommended WordPress Themes\" /></a>\n <p><a href=\"http://slidervilla.com/go/elegantthemes/\" title=\"Recommended WordPress Themes\" target=\"_blank\">Elegant Themes</a> are attractive, compatible, affordable, SEO optimized WordPress Themes and have best support in community.</p>\n <p><strong>Beautiful themes, Great support!</strong></p>\n <p><a href=\"http://slidervilla.com/go/elegantthemes/\" title=\"Recommended WordPress Themes\" target=\"_blank\">For more info visit ElegantThemes</a></p>\n </div>\n </div></div></div>\n \n \n <div style=\"clear:left;\"></div>\n </div> <!--end of poststuff --> \n\n\n</div> <!--end of float wrap -->\n<?php\t\n}", "function jfk2013_slide( $limit = -1 ) {\r\n\techo get_jfk2013_slide( $limit );\r\n}", "public function create()\r\n {\r\n return view('Admin.Slider.Add');\r\n }", "protected function render() {\n\t\t$settings = $this->get_settings_for_display();\n\n $nav = $settings['nav'];\n $dots = $settings['dots'];\n $autoplay = $settings['autoplay'];\n $loop = $settings['loop'];\n $autoplayTimeout = $settings['autoplayTimeout'];\n $mouseDrag = $settings['mouseDrag'];\n $touchDrag = $settings['touchDrag'];\n\n $this->add_render_attribute(\n 'slider-wrapper',\n [\n 'class' => 'pnw-slider-wrapper',\n 'data-nav' => $nav,\n 'data-dots' => $dots,\n 'data-autoplay' => $autoplay,\n 'data-loop' => $loop,\n 'data-autoplay-timeout' => $autoplayTimeout,\n 'data-mouse-drag' => $mouseDrag,\n 'data-touch-drag' => $touchDrag\n ]\n );\n\n $args = array(\n\t\t\t'numberposts' => $settings['item_per_page'],\n\t\t\t'post_type' => 'listing'\n\t\t);\n \n ?>\n\t\t\t<div <?php echo $this->get_render_attribute_string('slider-wrapper'); ?>>\n\t\t\t\t<?php\n\t\t\t\t\t$recents = wp_get_recent_posts($args);\n\n if (is_array($recents) || is_object($recents) ) {\n\n\t\t\t\t\tforeach($recents as $recent) { \n $price = get_post_meta( $recent['ID'], 'lcf_PriceList', true );\n\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"listing-cont\">\n <a href=\"<?php echo get_post_permalink( $recent['ID'] ); ?>\">\n <img src=\"<?php echo get_the_post_thumbnail_url( $recent['ID'] ); ?>\" alt=\"<?php echo get_the_title( $recent['ID'] ); ?>\"></a>\n <a href=\"<?php echo get_post_permalink( $recent['ID'] ); ?>\">\n <h3 class=\"list-address\"><?php echo get_the_title( $recent['ID'] ); ?></h3></a>\n <a href=\"<?php echo get_post_permalink( $recent['ID'] ); ?>\">\n <h4 class=\"list-price\"> <?php echo $price; ?></h4></a>\n </div>\n\t\t\t\t\t<?php } \n } ?>\n\t\t\t</div>\n\n \t\t<?php\t\n\t}", "function criar_custom_post_slides(){\n\n\t$args_slides_post_type = array(\n\t\t'labels' => array('name' => 'Slides'),\n\t\t'public' => false,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'supports' => array('title','excerpt','thumbnail'),\n\t\t'register_meta_box_cb' => 'slides_meta_box' );\n\n\tregister_post_type( 'slide_tornese' , $args_slides_post_type );\n}", "function getDefaultSlideshow($width, $height) \n {\n $options = $this->_options['slideshow']['advanced'];\n $options['slideshow'] = get_option('home').'/?theme-constructor=slideshow&w='.$width.'&h='.$height;\n// $options['thumbPath'] = CONSTRUCTOR_DIRECTORY_URI.\"/libs/timthumb.php?src=\";\n $options = json_encode($options);\n \n echo '<div class=\"wp-sl\"></div>';\n wp_enqueue_script('constructor-slideshow', CONSTRUCTOR_DIRECTORY_URI.'/js/jquery.wp-slideshow.js', array('jquery'));\n wp_print_scripts('constructor-slideshow');\n echo \"\n <script type='text/javascript'>\n /* <![CDATA[ */\n var wpSl = $options;\n /* ]]> */\n </script>\";\n }", "function _static1($options)\n\t{\n\t\n\t\tif ( isset ( $options['ww_header_style'] ) && !empty ( $options['ww_header_style'] ) ) { \n\t\t\t$style = 'uh_'.$options['ww_header_style'];\n\t\t} else { \n\t\t\t$style = '';\n\t\t}\n\t\n\t?>\n <div id=\"slideshow\" class=\"<?php echo $style; ?>\">\n \n\t\t\t<div class=\"bgback\"></div>\n\t\t\t<div data-images=\"<?php echo IMAGES_URL; ?>/\" id=\"sparkles\"></div>\n\t\t\n\t\t\t<div class=\"zn_slideshow\">\n <div class=\"container\">\n \t<div class=\"static-content default-style\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t// TITLE\n\t\t\t\t\t\tif ( isset ( $options['ww_slide_title'] ) && !empty ( $options['ww_slide_title'] ) ) {\n\t\t\t\t\t\t\techo '<h2 class=\"centered\">'.do_shortcode($options['ww_slide_title']).'</h2>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// SUBTITLE\n\t\t\t\t\t\tif ( isset ( $options['ww_slide_subtitle'] ) && !empty ( $options['ww_slide_subtitle'] ) ) {\n\t\t\t\t\t\t\techo '<h3 class=\"centered\">'.do_shortcode($options['ww_slide_subtitle']).'</h3>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// BUTTON\n\t\t\t\t\t\tif ( $options['ww_slide_m_button'] || $options['ww_slide_l_text'] ) {\n\t\t\t\t\t\t\techo '<div class=\"info_pop animated fadeBoxIn\" data-arrow=\"top\">';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ( $options['ww_slide_l_text'] && isset ( $options['ww_slide_link']['url'] ) && !empty ( $options['ww_slide_link']['url'] ) ) {\n\t\t\t\t\t\t\t\t\techo '<a class=\"buyit\" href=\"'.$options['ww_slide_link']['url'].'\" target=\"'.$options['ww_slide_link']['target'].'\">'.$options['ww_slide_l_text'].'</a>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// BUTTON LEFT TEXT\n\t\t\t\t\t\t\t\tif ( isset ( $options['ww_slide_m_button'] ) && !empty ( $options['ww_slide_m_button'] ) ) {\n\t\t\t\t\t\t\t\t\techo '<h5 class=\"text\">'.$options['ww_slide_m_button'].'</h5>';\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\techo '<div class=\"clear\"></div>';\n\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t\n \n </div>\n </div>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"zn_header_bottom_style\"></div><!-- header bottom style -->\n\t\t\t\n </div><!-- end slideshow -->\n\t<?php\n\t}", "function fr_carousel_slider(){\r\n\tregister_post_type('fr_slider', array(\r\n\t\t\t'supports' => array('title', 'editor', 'excerpt'),\r\n\t\t\t'rewrite' => array('slug' => 'fr_slider'),\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'public' => true,\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => 'FR_Slider',\r\n\t\t\t\t'add_new_item' => 'FR Add New Slider',\r\n\t\t\t\t'edit_item' => 'FR Edit Slider',\r\n\t\t\t\t'singular_name' => 'FR Slider'\r\n\t\t\t),\r\n\t\t\t'menu_icon' => 'dashicons-images-alt'));\r\n}", "public function create()\n {\n \n return view('admin.slider.add');\n }", "function vslider_defaults() {\r\n $default = array(\r\n 'slideNr' => 3,\r\n \t'width' => 630,\r\n \t'height' => 280,\r\n \t'spw' => 7,\r\n \t'sph' => 5,\r\n \t'delay' => 3000,\r\n \t'sDelay' => 30,\r\n \t'opacity' => '0.7',\r\n \t'titleSpeed' => 1500,\r\n \t'effect' => '',\r\n \t'navigation' => 'true',\r\n 'stickynav' => 'false',\r\n \t'links' => 'true',\r\n 'buttons' => 'true',\r\n \t'hoverPause' => 'false',\r\n \t'fontFamily' => 'Arial, Helvetica, sans-serif',\r\n \t'titleFont' => 16,\r\n \t'fontSize' => 12,\r\n \t'textColor' => 'FFFFFF',\r\n \t'bgColor' => '222222',\r\n \t'customImg' => 'true',\r\n 'catchimage' => 'true',\r\n \t'chars' => 200,\r\n \t'excerpt' => 'true',\r\n \t'slide1' => WP_PLUGIN_URL.'/vslider/images/slide1.jpg',\r\n \t'slide2' => WP_PLUGIN_URL.'/vslider/images/slide2.jpg',\r\n \t'slide3' => WP_PLUGIN_URL.'/vslider/images/slide3.jpg',\r\n 'target' => 'none',\r\n 'navstyle' => 'none',\r\n 'arrstyle' => 'none',\r\n 'navplace' => '10px 0 10px 100px',\r\n 'layout' => 'stripe-bottom',\r\n 'borderWidth' => '5',\r\n 'borderRadius' => '0',\r\n 'borderColor' => 'FFFFFF',\r\n 'holdermar' => '10px 10px 10px 10px',\r\n 'holderfloat' => 'none',\r\n 'timthumb' => 1,\r\n 'quality' => '80',\r\n 'vnavenable' => 0,\r\n 'randimg' => 0\r\n );\r\nreturn $default;\r\n}", "public function create()\n {\n\n return view('backend.slider.create');\n }", "public function create()\n {\n return view('admin.slider.add');\n }", "public function create()\n {\n return view('admin.sliders.create');\n }", "public function show(Slider $slider)\n {\n //\n }", "function wpsight_sylt_get_image_slider_js( $args = array(), $slider_id ) {\n\t\n\tob_start(); ?>\n\t\n\t<script type=\"text/javascript\">\n\t\t(function($) {\n\t\t var $pswp = $('#<?php echo esc_attr( $slider_id ); ?>')[0];\n\t\t var image = [];\n\t\t\n\t\t $('.wpsight-image-slider').each( function() {\n\t\t var $pic = $(this),\n\t\t getItems = function() {\n\t\t var items = [];\n\t\t $pic.find('a').each(function() {\n\t\t var $href = $(this).attr('href'),\n\t\t $size = $(this).data('size').split('x'),\n\t\t $width = $size[0],\n\t\t $height = $size[1],\n\t\t $title = $(this).find('meta[itemprop=title]').attr('content');\n\t\t\n\t\t var item = {\n\t\t src : $href,\n\t\t w : $width,\n\t\t h : $height,\n\t\t title: $title\n\t\t }\n\t\t\n\t\t items.push(item);\n\t\t });\n\t\t return items;\n\t\t }\n\t\t\n\t\t var items = getItems();\n\t\t\n\t\t $.each(items, function(index, value) {\n\t\t image[index] = new Image();\n\t\t image[index].src = value['src'];\n\t\t });\n\t\t\n\t\t $pic.on('click', '.wpsight-image-slider-item a', function(event) {\n\t\t event.preventDefault();\n\t\t \n\t\t var $index = $(this).data('counter');\n\t\t \n\t\t var options = {\n\t\t index: $index,\n\t\t bgOpacity: 0.8,\n\t\t showHideOpacity: true\n\t\t }\n\t\t\n\t\t var lightBox = new PhotoSwipe($pswp, PhotoSwipeUI_Default, items, options);\n\t\t lightBox.init();\n\t\t });\n\t\t });\n\t\t})(jQuery);\n\t</script><?php\n\t\n\treturn apply_filters( 'wpsight_sylt_get_image_slider_js', ob_get_clean(), $args, $slider_id );\n\t\n}", "public function create()\n {\n $sliders = Slider::all();\n return view('backend.admin.slider', compact('sliders'));\n }", "function cs_pb_slider($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$slider_element_size = '50';\n\t\t$cs_slider_header_title_db = '';\n\t\t$cs_slider_type_db = '';\n\t\t$cs_slider_db = '';\n\t\t$cs_slider_width_db = '';\n\t\t$cs_slider_height_db = '';\n\t\t$slider_view= '';\n\t\t$slider_id ='';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$slider_element_size = $cs_node->slider_element_size;\n\t\t\t$cs_slider_header_title_db = $cs_node->slider_header_title;\n\t\t\t$cs_slider_type_db = $cs_node->slider_type;\n\t\t\t$cs_slider_db = $cs_node->slider;\n\t\t\t$slider_view= $cs_node->slider_view;\n\t\t\t$slider_id = $cs_node->slider_id;\n\t\t\t$cs_slider_width_db = $cs_node->width;\n\t\t\t$cs_slider_height_db = $cs_node->height;\n\t\t\t\t$counter = $post->ID.$count_node;\n\t}\n?>\n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $slider_element_size?>\" item=\"slider\" data=\"<?php echo element_size_data_array_index($slider_element_size)?>\" >\n\t\t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"slider_element_size[]\" class=\"item\" value=\"<?php echo $slider_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a>\n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp;\n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n <div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Slider Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n <div class=\"opt-conts\">\n \t<ul class=\"form-elements\">\n <li class=\"to-label\"><label>Slider Header Title</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_slider_header_title[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($cs_slider_header_title_db)?>\" />\n <p>Please enter slider header title.</p>\n </li> \n </ul>\n \t<ul class=\"form-elements\">\n <li class=\"to-label\"><label>Choose SliderType</label></li>\n <li class=\"to-field\">\n <select name=\"cs_slider_type[]\" class=\"dropdown\" onchange=\"cs_toggle_height(this.value,'cs_slider_height<?php echo $name.$counter?>')\">\n <option <?php if($cs_slider_type_db==\"Flex Slider\"){echo \"selected\";}?> >Flex Slider</option>\n <option <?php if($cs_slider_type_db==\"Custom Slider\"){echo \"selected\";}?> >Custom Slider</option>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\" id=\"choose_slider\" style=\"display:<?php if($cs_slider_type_db == \"Custom Slider\")echo \"none\"; else echo \"inline\"; ?>\">\n <li class=\"to-label\"><label>Choose Slider</label></li>\n <li class=\"to-field\">\n <select name=\"cs_slider[]\" class=\"dropdown\">\n <?php\n $query = array( 'posts_per_page' => '-1', 'post_type' => 'cs_slider', 'orderby'=>'ID', 'post_status' => 'publish' );\n $wp_query = new WP_Query($query);\n while ($wp_query->have_posts()) : $wp_query->the_post();\n ?>\n <option <?php if($post->post_name==$cs_slider_db)echo \"selected\";?> value=\"<?php echo $post->post_name; ?>\"><?php the_title()?></option>\n <?php\n endwhile;\n ?>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\" >\n <li class=\"to-label\"><label>Slider View</label></li>\n <li class=\"to-field\">\n <select name=\"slider_view[]\" class=\"dropdown\" >\n <option <?php if($slider_view==\"content\")echo \"selected\";?> >content</option>\n <option <?php if($slider_view==\"header\")echo \"selected\";?> >header</option>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\" id=\"layer_slider\" style=\"display:<?php if($cs_slider_type_db == \"Custom Slider\")echo \"inline\"; else echo \"none\"; ?>\" >\n <li class=\"to-label\">\n <label>Use Short Code</label>\n </li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_slider_id[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($slider_id);?>\" />\n </li>\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n <p>Please enter the Revolution Slider Short Code like [rev_slider rocky]</p>\n </li> \n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"slider\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "public function owlslider($args = array(), $echo = false) {\r\n if( !$args['slider_page'] ) {\r\n if($echo) {\r\n echo 'aucun slider trouvé';\r\n } else {\r\n return false;\r\n }\r\n break;\r\n }\r\n\r\n $slides = $this->query_slides( $args );\r\n\r\n $id = 'owl-'.$args['slider_page'];\r\n $this->slider_ids[] = $id;\r\n \r\n //retrieve the default slide settings from taxonomy\r\n $term = get_term_by('slug', $args['slider_page'], 'owlslidepage');\r\n $term_meta = get_option( \"owlslidepage_\".$term->term_id);\r\n \r\n //fix render for defaults booleans\r\n if( is_array($term_meta) ) {\r\n foreach($term_meta as $key => $meta) {\r\n if(isset($meta) || $meta == null) {\r\n $term_meta[$key] = $this->defaults[$key];\r\n if($this->debug) {\r\n echo $key.'<br>';\r\n echo $term_meta[$key].'<br>';\r\n }\r\n }\r\n }\r\n }\r\n \r\n if($this->debug) {\r\n echo '<pre>defaults :<br>';\r\n var_dump($this->defaults);\r\n echo '<br>Metas :<br>';\r\n var_dump($term_meta);\r\n echo '<br>Args :<br>';\r\n var_dump($args);\r\n\r\n $temp = array_replace($this->defaults, $term_meta);\r\n $temp2 = array_replace($temp, $args);\r\n echo '<br>Merged: <br>';\r\n var_dump( $temp2 );\r\n echo '</pre>';\r\n }\r\n\r\n $this->settings[] = wp_parse_args( $args,wp_parse_args( $term_meta , $this->defaults) );\r\n\r\n $html = '<div id=\"'.$id.'\" class=\"owl-carousel\">';\r\n\r\n if($slides->have_posts()) {\r\n if($args['slider_type'] == 'post') {\r\n while($slides->have_posts()) {\r\n $slides->the_post();\r\n $image = get_the_post_thumbnail( get_the_ID() );\r\n $html .= '<div class=\"owl-slide\">';\r\n if($image) $html .= '<div class=\"owl-slide-image\">'.$image.'</div>';\r\n $html .= '<div '.$imageUrl.' class=\"owl-slide-content\">'.apply_filters( 'the_content' , get_the_content() ).'</div>';\r\n $html .= '</div>';\r\n }\r\n }\r\n else {\r\n while($slides->have_posts()) {\r\n $slides->the_post();\r\n $thumb_id = get_post_thumbnail_id( $post_id );\r\n $image = get_the_post_thumbnail( get_the_ID() );\r\n $url = get_post_meta( get_the_ID(), '_owlslider_url', true );\r\n\r\n $html .= '<div><a href=\"' . esc_url( $url ) . '\">' . $image . '</a></div>';\r\n }\r\n }\r\n }\r\n\r\n $html .= '</div>';\r\n\r\n\r\n if ( true == $echo ) { echo $html; }\r\n\r\n return $html;\r\n }", "public function simple_events_slider() {\r\n if ( ! function_exists( 'register_block_type' ) ) {\r\n return;\r\n }\r\n \r\n // Add block script.\r\n wp_register_script(\r\n 'simple-event-slider',\r\n Plugin::p_url( '/assets/blocks/event-slider/event-slider.js', __FILE__ ),\r\n [ 'wp-blocks', 'wp-element', 'wp-editor' ],\r\n filemtime( Plugin::p_url( '/assets/blocks/event-slider/event-slider.js', __FILE__ ))\r\n );\r\n \r\n // Add block style.\r\n wp_register_style(\r\n 'simple-event-slider',\r\n Plugin::p_url( '/assets/blocks/event-slider/event-slider.css', __FILE__ ),\r\n [],\r\n filemtime( Plugin::p_url( '/assets/blocks/event-slider/event-slider.css', __FILE__ ))\r\n );\r\n \r\n register_block_type( 'pt/simple-event-slider', array(\r\n 'api_version' => 2,\r\n 'editor_script' => 'simple-event-slider',\r\n 'render_callback' => [$this,'simple_events_slider_render_callback']\r\n ) );\r\n \r\n }", "function echotheme_nivoslider_shortcode($atts)\n{\n\tob_start();\n\tget_template_part('part', 'nivo-slider');\n\treturn ob_get_clean();\n}", "function custom_active_slide($atts){\n $para = shortcode_atts(\n array(\n 'id' => '1'\n ), $atts );\n ob_start(); ?>\n\n\n\n <!-- Begin #carousel-section --> \n <section id=\"carousel-section\" class=\"section-global-wrapper\"> \n <div class=\"container-fluid-kamn\">\n <div class=\"row\">\n <div id=\"carousel-<?php echo $para['id']; ?>\" class=\"carousel slide\">\n\n <!-- Wrapper for slides -->\n <div class=\"carousel-inner\">\n \n\n <?php\n\n $slider_query = null;\n $slider_query = new WP_Query( array(\n 'post_type' => 'slider',\n 'posts_per_page' => -1,\n ) );\n\n $pre = '_office_master_';\n $x = 0;\n while ( $slider_query->have_posts() ) {\n $slider_query->the_post(); \n $x++;\n \n $slider_caption = get_post_meta( get_the_ID(), $pre.'slider_caption', true );\n ?> \n\n <!-- Begin Slide 1 -->\n <div class=\"item <?php if ( $x == 1 ) {\n echo 'active';\n } ?>\">\n <?php the_post_thumbnail('slider-pic'); ?>\n <div class=\"carousel-caption\">\n <h3 class=\"carousel-title hidden-xs\"> <?php the_title(); ?> </h3>\n <p class=\"carousel-body\"> <?php echo $slider_caption; ?> </p>\n </div>\n </div>\n <!-- End Slide 1 -->\n\n <?php } ?>\n\n\n \n\n\n </div>\n \n\n\n <!-- Indicators -->\n <ol class=\"carousel-indicators visible-lg\">\n\n <?php for ($i=0; $i < $x ; $i++) { ?>\n \n <li data-target=\"#carousel-<?php echo $para['id']; ?>\" data-slide-to=\"<?php echo $i; ?>\" class=\"<?php if ($i==0) { echo 'active'; } ?>\"> </li>\n \n <?php } ?>\n </ol>\n\n <!-- Controls -->\n <a class=\"left carousel-control\" href=\"#carousel-<?php echo $para['id']; ?>\" data-slide=\"prev\">\n <span class=\"glyphicon glyphicon-chevron-left\"></span>\n </a>\n <a class=\"right carousel-control\" href=\"#carousel-<?php echo $para['id']; ?>\" data-slide=\"next\">\n <span class=\"glyphicon glyphicon-chevron-right\"></span>\n </a>\n </div>\n </div>\n </div>\n </section>\n <!-- End #carousel-section -->\n\n\n\n\n\n <?php \n return ob_get_clean();\n }", "function wpcoupon_register_slider_widget() {\r\n register_widget( 'WPCoupon_Slider_Widget' );\r\n}", "function _testimonial_slider($options)\n\t{\n\t\t\n\t\t$element_size = zn_get_size( $options['_sizer'] );\n\t\t\n\t\t$new_size = $element_size['sizer'];\n\t\t\n\t\tif ( !empty ( $options['tf_title'] ) || !empty ( $options['tf_desc'] ) ) {\n\t\t\tpreg_match('|\\d+|', $element_size['sizer'] , $new_size);\n\t\t\t$new_size = $new_size[0]-3;\n\t\t\t$new_size = 'span'.$new_size;\n\t\t\t\n\t\t\techo '<div class=\"span3 testimonials_fader\">';\n\t\t\t\n\t\t\t\tif ( !empty ( $options['tf_title'] ) ) {\n\t\t\t\t\techo '<h3 class=\"m_title\">'.$options['tf_title'].'</h3>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( !empty ( $options['tf_desc'] ) ) {\n\t\t\t\t\techo '<p>'.$options['tf_desc'].'</p>';\n\t\t\t\t}\n\t\t\t\n\t\t\techo '</div>';\n\n\t\t}\n\t\t\n\t\techo '<div class=\"'.$new_size.' testimonials_fader\">';\n\t\t\techo '<ul id=\"testimonials_fader\" class=\"fixclear\">';\n\t\t\t\tforeach ( $options['testimonials_single'] as $test ) {\n\t\t\t\t\techo '<li>';\n\t\t\t\t\t\n\t\t\t\t\t\techo '<blockquote>'.$test['tf_single_test'].'</blockquote>';\n\t\t\t\t\t\techo '<h6>'.$test['tf_single_author'].'</h6>';\n\t\t\t\t\t\n\t\t\t\t\techo '</li>';\n\t\t\t\t}\n\t\techo '</div>';\n\t\techo '</ul>';\n\n\t}", "public function create()\n {\n //\n return view('admin.sliders.create');\n }", "function header_container_start() { ?>\n\t<!--#slider-container-->\n\t<div id=\"slider-container\">\n<?php\n}", "function register_cpt_slider() {\r\n\r\n $labels = array(\r\n 'name' => _x( 'Slider', 'slider' ),\r\n 'singular_name' => _x( 'Slider item', 'slider' ),\r\n 'add_new' => _x( 'Adicionar Slide', 'slider' ),\r\n 'add_new_item' => _x( 'Adicionar Slide', 'slider' ),\r\n 'edit_item' => _x( 'Editar Slide', 'slider' ),\r\n 'new_item' => _x( 'Novo Slide', 'slider' ),\r\n 'view_item' => _x( 'Ver Slide', 'slider' ),\r\n 'search_items' => _x( 'Procurar Slide', 'slider' ),\r\n 'not_found' => _x( 'Nenhum Slide encontrado', 'slider' ),\r\n 'not_found_in_trash' => _x( 'Nenhum Slide encontrado no lixo', 'slider' ),\r\n 'parent_item_colon' => _x( 'Slide Pai:', 'slider' ),\r\n 'menu_name' => _x( 'Slider', 'slider' ),\r\n );\r\n\r\n $args = array(\r\n 'labels' => $labels,\r\n 'hierarchical' => true,\r\n 'supports' => array('title', 'page-attributes', 'revisions'),\r\n 'taxonomies' => array('category','post_tag'),\r\n 'public' => true,\r\n 'show_ui' => true,\r\n 'show_in_menu' => true,\r\n 'menu_position' => 20,\r\n 'hierarchical' => true,\r\n 'show_in_nav_menus' => true,\r\n 'publicly_queryable' => true,\r\n 'exclude_from_search' => false,\r\n 'has_archive' => false,\r\n 'query_var' => true,\r\n 'can_export' => true,\r\n 'capability_type' => 'page'\r\n );\r\n\r\n register_post_type( 'slider', $args );\r\n}", "function thirdtheme_blog_slider()\n {\n add_theme_support('post-thumbnails');\n add_image_size('small',102,102);\n $args = array(\n 'labels' => array('name' =>__('blog slider'),\n 'add_new' =>__('add new blog')),\n \n 'public' => true,\n 'menu_icon' =>'dashicons-buddicons-buddypress-logo',\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor','thumbnail',)); \n register_post_type('blogslider',$args);\n }", "public function create()\n {\n return view('sliders.create');\n }", "public function create()\n {\n return view('sliders.create');\n }", "public function render()\n {\n return view('gallery::components.slider.'.$this->theme);\n }" ]
[ "0.69778514", "0.6967482", "0.69644666", "0.6889087", "0.676199", "0.6646441", "0.6580058", "0.6551461", "0.6517696", "0.65076864", "0.6505561", "0.64880407", "0.64714444", "0.6464158", "0.6462297", "0.64509857", "0.6441713", "0.6421771", "0.64214784", "0.64031136", "0.6396449", "0.63699543", "0.63585126", "0.63561696", "0.6315248", "0.631332", "0.6307873", "0.63050693", "0.628451", "0.62836015", "0.62741965", "0.62659526", "0.62437207", "0.6239408", "0.62377447", "0.62201345", "0.6196176", "0.61900574", "0.61811584", "0.61808735", "0.61627394", "0.61578196", "0.615058", "0.61447775", "0.61193824", "0.61089694", "0.6097992", "0.6097992", "0.6094941", "0.6081449", "0.607438", "0.6071758", "0.6057738", "0.6044973", "0.60414636", "0.6036383", "0.60357624", "0.6027799", "0.60231763", "0.60199726", "0.60173213", "0.6013098", "0.60124546", "0.60056144", "0.5994706", "0.5990067", "0.59889734", "0.59888595", "0.5979941", "0.59780043", "0.59740466", "0.5974037", "0.5973426", "0.5966423", "0.59592575", "0.5958131", "0.5945973", "0.59373", "0.59250885", "0.59175503", "0.5917271", "0.5907763", "0.5906619", "0.58994126", "0.58947486", "0.58924335", "0.58905023", "0.58878934", "0.588467", "0.58841085", "0.58819544", "0.5869255", "0.58663327", "0.586266", "0.5861154", "0.5860685", "0.5842381", "0.58321565", "0.5829822", "0.5829822", "0.5824786" ]
0.0
-1
Enables the Excerpt meta box in Page edit screen.
function add_excerpt_support_for_pages() { add_post_type_support( 'page', 'excerpt' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gg_add_metabox_excerpt() {\n add_meta_box(\n 'gg_single_excerpt',\n 'Excerpt',\n 'gg_create_field_excerpt',\n 'testowy',\n 'normal',\n 'high'\n );\n }", "public function add_page_excerpts() {\n add_post_type_support( 'page', 'excerpt' );\n }", "function user_add_excerpts_to_pages() {\n add_post_type_support( 'page', 'excerpt' );\n}", "function add_excerpts_to_pages() {\n\t\tadd_post_type_support('page', 'excerpt');\n\t}", "function tbx_add_excerpts_to_pages() {\n\tadd_post_type_support( 'page', 'excerpt' );\n}", "function total_add_excerpts_to_pages() {\n add_post_type_support('page', 'excerpt');\n}", "function tsk_add_excerpts_to_pages() {\n\t\tadd_post_type_support( 'page', 'excerpt' );\n\t}", "function post_excerpt_meta_box($post)\n {\n }", "function agnosia_post_excerpt_settings_meta_box() {\r\n\r\n\t\tglobal $post;\r\n\r\n\t\twp_nonce_field( basename( __FILE__ ) , 'agnosia_post_excerpt_settings_nonce' );\r\n\r\n\t\t$meta_value = get_post_meta( $post->ID, 'agnosia_post_meta' , true ) ;\r\n\r\n\t\t$value_post = isset( $meta_value['content_show_post_excerpt_in_post'] ) ? $meta_value['content_show_post_excerpt_in_post'] : '' ;\r\n\t\t$value_index = isset( $meta_value['content_show_post_excerpt_in_index'] ) ? $meta_value['content_show_post_excerpt_in_index'] : '' ;\r\n\r\n\t\t?>\r\n\r\n\t\t<div id=\"post-excerpt-settings-container\" class=\"settings-container\">\r\n\r\n\t\t\t<ul class=\"category-tabs\" id=\"post-excerpt-tabs\">\r\n\t\t\t\t<li class=\"tabs\"><a href=\"#excerpt-into-post\"><?php _e( 'Into post' , 'agnosia' ); ?></a></li>\r\n\t\t\t\t<li class=\"hide-if-no-js\"><a href=\"#excerpt-into-index\"><?php _e( 'Into index' , 'agnosia' ); ?></a></li>\r\n\t\t\t</ul>\r\n\r\n\t\t\t<div id=\"excerpt-into-post\" class=\"tabs-panel\">\r\n\r\n\t\t\t\t<input type=\"checkbox\" name=\"agnosia_post_meta[content_show_post_excerpt_in_post]\" id=\"content_show_post_excerpt_in_post\" value=\"true\" <?php agnosia_is_checked_meta_box_setting( $value_post , 'true' ); ?>>\r\n\t\t\t\t<label for=\"content_show_post_excerpt_in_post\"><?php _e( 'Show excerpt before content' , 'agnosia' ) ; ?></label><br />\r\n\r\n\t\t\t</div>\r\n\r\n\t\t\t<div id=\"excerpt-into-index\" class=\"tabs-panel hidden\">\r\n\r\n\t\t\t\t<input type=\"radio\" name=\"agnosia_post_meta[content_show_post_excerpt_in_index]\" id=\"content_show_post_excerpt_in_index[0]\" value=\"true\" <?php agnosia_is_checked_meta_box_setting( $value_index , 'true' ); agnosia_default_meta_box_setting( $value_index ); ?>>\r\n\t\t\t\t<label for=\"content_show_post_excerpt_in_index[0]\"><?php _e( 'Show excerpt' , 'agnosia' ) ; ?></label><br />\r\n\r\n\t\t\t\t<input type=\"radio\" name=\"agnosia_post_meta[content_show_post_excerpt_in_index]\" id=\"content_show_post_excerpt_in_index[1]\" value=\"false\" <?php agnosia_is_checked_meta_box_setting( $value_index , 'false' ); ?>>\r\n\t\t\t\t<label for=\"content_show_post_excerpt_in_index[1]\"><?php _e( 'Show content' , 'agnosia' ) ; ?></label><br />\r\n\r\n\t\t\t</div>\r\n\r\n\t\t</div>\r\n\r\n\t\t<?php\r\n\r\n\t}", "function my_add_excerpts_to_pages()\n{\n add_post_type_support('page', 'excerpt');\n}", "function register_block_core_post_excerpt()\n {\n }", "function gg_create_field_excerpt() {\n global $post;\n \n wp_nonce_field( basename( __FILE__ ), 'single_excerpt' );\n\n \n $singleExcerpt = get_post_meta( $post->ID, 'singleExcerpt', true );\n \n echo '<textarea name=\"singleExcerpt\" rows=\"5\" class=\"widefat\">' . esc_textarea( $singleExcerpt ) . '</textarea>';\n }", "function box_init() {\r\n $options = get_option('e_tools');\r\n do_action('log', 'Excerpt tools: init', $options);\r\n $title = isset($options['excerpt_title']) ? trim((string) $options['excerpt_title']) : '';\r\n if (empty($title) || !is_string($title)) $title = __('Excerpt', 'excerpt-tools');\r\n if (empty($title) || !is_string($title)) $title = 'Excerpt';\r\n do_action('log', 'Excerpt tools: Title: \"%s\"', $title);\r\n\r\n foreach (get_post_types(array(), 'objects') as $post_type) {\r\n if (isset($options['enable_'.$post_type->name]) && $options['enable_'.$post_type->name] == 1) {\r\n do_action('log', 'Excerpt tools: Add meta box', $post_type->name, $title);\r\n remove_meta_box('postexcerpt', $post_type->name, 'core');\r\n add_meta_box('e_tools_excerpt', $title, __NAMESPACE__.'\\meta_box', $post_type->name, 'normal', 'high');\r\n }\r\n }\r\n}", "public function setExcerpt($excerpt)\r\n\t\t{\r\n\t\t\t$this->setExcerpt = $excerpt;\r\n\t\t}", "function gg_save_excerpt_meta( $post_id, $post ) {\n \n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return $post_id;\n }\n \n if ( ! isset( $_POST['singleExcerpt'] ) || ! wp_verify_nonce( $_POST['single_excerpt'], basename(__FILE__) ) ) {\n return $post_id;\n }\n\n $events_meta['singleExcerpt'] = esc_textarea( $_POST['singleExcerpt'] );\n foreach ( $events_meta as $key => $value ) :\n if ( 'revision' === $post->post_type ) {\n return;\n }\n if ( get_post_meta( $post_id, $key, false ) ) {\n update_post_meta( $post_id, $key, $value );\n } else {\n add_post_meta( $post_id, $key, $value);\n }\n if ( ! $value ) {\n delete_post_meta( $post_id, $key );\n }\n endforeach;\n }", "function lb_editor_custom_post_excerpt_meta_box($post)\n{\n // available settings view the wp_editor reference\n // http://codex.wordpress.org/Function_Reference/wp_editor\n $settings = array('textarea_rows' => '12', 'quicktags' => false, 'tinymce' => true);\n\n // Create the new meta box editor and decode the current\n // post_excerpt value so the TinyMCE editor can display\n // the content as it is styled.\n wp_editor(html_entity_decode(stripcslashes($post->post_excerpt)), 'excerpt', $settings);\n}", "function wpcodex_add_excerpt_support_for_pages() {\n\tadd_post_type_support( 'page', 'excerpt' );\n}", "function quasar_frontend_init(){\n\tadd_post_type_support( 'post', 'excerpt');\n}", "static function metabox_at_post_edit_page(){\n\t\t \tadd_meta_box('matebox-to-handle-keywords', 'Affiliate Keywords', array(get_class(), 'metabox_to_deal_keywords'), 'product', 'advanced', 'high');\t \t\n\t\t }", "function settings_page() { \r\n global $jscounter;\r\n $options = get_option('e_tools');\r\n\r\n?>\r\n<div class=\"wrap\">\r\n <h2><?php _e('Excerpt Tools', 'excerpt-tools'); ?></h2>\r\n <form method=\"post\" action=\"options.php\">\r\n <?php settings_fields('e_tools_options'); ?>\r\n <div class='metabox-holder'>\r\n <div class='postbox'>\r\n\r\n <h3><?php _e('Options', 'excerpt-tools'); ?></h3>\r\n <div class='inside'>\r\n <table class=\"form-table\">\r\n <?php\r\n\r\n $post_types = array();\r\n $post_type_icons = array(\r\n 'post' => 'dashicons-admin-post',\r\n 'page' => 'dashicons-admin-page',\r\n 'attachment' => 'dashicons-admin-media',\r\n );\r\n\r\n foreach (get_post_types(array(), 'objects') as $post_type) {\r\n // if ($post_type->exclude_from_search) continue;\r\n if (in_array($post_type->name, array('revision', 'nav_menu_item'))) continue;\r\n\r\n $post_types[$post_type->name] = $post_type->labels->name;\r\n if (preg_match('/^dashicons-/', $post_type->menu_icon))\r\n $post_type_icons[$post_type->name] = $post_type->menu_icon;\r\n }\r\n do_action('log', 'Excerpt tools: Post types', $post_types);\r\n\r\n $i = 0;\r\n foreach ($post_types as $key => $name) {\r\n echo \"<tr>\";\r\n if ($i == 0) {\r\n echo \"<th scope='row' rowspan='\".count($post_types).\"'>Post types</th>\";\r\n }\r\n $i++;\r\n echo \"<td><label for='e_tools_enable_$key'>\";\r\n echo \"<input type='checkbox' name='e_tools[enable_$key]' id='e_tools_enable_$key' value='1' \"; checked(isset($options[\"enable_$key\"]) && intval($options[\"enable_$key\"])); echo \">\";\r\n if (isset($post_type_icons[$key]))\r\n echo \" &nbsp;<i class='dashicons ${post_type_icons[$key]}'></i>&nbsp; \";\r\n echo $name;\r\n echo \"</td></tr>\";\r\n }\r\n\r\n $length = '';\r\n if (!empty($options['excerpt_length'])) {\r\n $len = intval($options['excerpt_length']);\r\n if ($len > 0)\r\n $length = $len;\r\n }\r\n\r\n $enforce_length = isset($options['enforce_length']) && (boolean) $options['enforce_length'];\r\n ?>\r\n \r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php _e('Excerpt Length', 'excerpt-tools'); ?></th>\r\n <td><input type=\"text\" name=\"e_tools[excerpt_length]\" id='excerpt_length' value=\"<?php echo $length; ?>\" placeholder='150' style='text-align: right; width: 4em;' /> &nbsp;characters\r\n <p><label for='enforce_length'><input type='checkbox' name='e_tools[enforce_length]' id='enforce_length' <?php checked($enforce_length); ?>>\r\n <?php _e('Enforce this length limit on all excerpts', 'excerpt-tools'); ?></p></td>\r\n </tr>\r\n \r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php _e('Excerpt title', 'excerpt-tools'); ?></th>\r\n <td><input type=\"text\" name=\"e_tools[excerpt_title]\" id='excerpt_title' value=\"<?php echo $options['excerpt_title']; ?>\" placeholder='Excerpt' style='width: 24em;' /></td>\r\n </tr>\r\n \r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php _e('Excerpt description', 'excerpt-tools'); ?></th>\r\n <td>\r\n <textarea rows=\"2\" cols=\"60\" name=\"e_tools[excerpt_text]\" id=\"excerpt_text\"><?php echo $options['excerpt_text']; ?></textarea>\r\n </td>\r\n </tr>\r\n </table>\r\n \r\n </div>\r\n</div>\r\n\r\n<p class=\"submit\">\r\n <input type=\"submit\" class=\"button-primary\" value=\"<?php _e('Save Changes'); ?>\" />\r\n</p>\r\n \r\n</div>\r\n </form>\r\n</div>\r\n\r\n<?php\r\n}", "function _sp_custom_box_excerpt_truncate( $post ) {\t\n\twp_nonce_field( '_sp_process_meta_excerpt_truncate', '_sp_meta_excerpt_truncate_nonce' );\t\n\t\n\tif ( $post->ID ) {\n\t\t$count = (int)get_post_meta( $post->ID, '_sp_truncate_count', true );\n\t\t$denote = get_post_meta( $post->ID, '_sp_truncate_denote', true );\n\t\t$excerpt_truncate = get_post_meta( $post->ID, '_sp_excerpt_truncate', true );\n\t}\n\n\t// check if truncate function is on\n\tif ( $excerpt_truncate == 'on' )\n\t\t$display = 'style=\"display:block\"';\n\telse \n\t\t$display = 'style=\"display:none\"';\n\n\t$output = '';\n\t$output .= '<p class=\"howto\">' . __( 'This section is to help manage the excerpt text for this post. It allows you to have fine control over how much text from your content is shown on pages that shows only a snippet of your content. If enabled, this will override your excerpt field.', 'sp-theme' ) . '</p>' . PHP_EOL;\n\t\n\t$output .= '<p><label><input type=\"checkbox\" value=\"on\" name=\"excerpt_truncate\" id=\"excerpt-truncate\"' . checked( $excerpt_truncate, 'on', false ) . ' /> ' . __( 'Enable Truncate Function', 'sp-theme' ) . ' </label></p>' . PHP_EOL;\n\t\n\t$output .= '<p class=\"howto\">' . __( 'Check box to enable the auto text truncate function for this post. If left disabled, the default truncate settings will apply on excerpt pages.', 'sp-theme' ) . '</p>' . PHP_EOL;\n\t\n\t$output .= '<div class=\"truncate-settings-container\" ' . $display . '>' . PHP_EOL;\t\n\t\t\n\t$output .= '<p><label>' . __( 'How Many Characters to Show', 'sp-theme' ) . '<input type=\"text\" value=\"' . esc_attr( $count ) . '\" name=\"truncate_count\" id=\"truncate-count\" class=\"widefat\" /></label></p>' . PHP_EOL; \n\t$output .= '<p class=\"howto\">' . __( 'Choose how many characters to show before it starts to truncate. i.e. if you enter 500, it would show 500 characters before cutting off the rest.', 'sp-theme' ) . '</p>' . PHP_EOL;\n\t\n\t$output .= '<p><label>' . __( 'The Denote Character to Use', 'sp-theme' ) . '<input type=\"text\" value=\"' . esc_attr( $denote ) . '\" name=\"truncate_denote\" id=\"truncate-denote\" class=\"widefat\" /></label></p>' . PHP_EOL;\n\t$output .= '<p class=\"howto\">' . __( 'This character denotation is used to signify there are more text to be displayed. i.e. you can type ... or [...]', 'sp-theme' ) . '</p>' . PHP_EOL;\n\n\t$output .= '</div>' . PHP_EOL;\n\n\techo $output;\n}", "function wpcodex_add_excerpt_support_for_custom_post_type() {\r\r\n\tadd_post_type_support( 'sp_articles', array('comments','excerpt') );\r\r\n}", "public function setExcerpt(string $excerpt): void\n {\n $this->_excerpt = $excerpt;\n }", "public function setExcerptAttribute($value)\n {\n $this->attributes['excerpt'] = $value ? $value : null;\n }", "function enable_full_meta_for_pages() {\n add_post_type_support( 'page', 'excerpt' );\n register_taxonomy_for_object_type( 'post_tag', 'page' );\n register_taxonomy_for_object_type( 'category', 'page' );\n}", "function settings_section_article_before() {\n\techo '<p>' . __( 'These settings may be overridden for individual articles.' ) . '</p>';\n}", "function MPU_seo_setup() {\n add_action( 'add_meta_boxes', 'MPU_add_seo_setup' );\n add_action( 'save_post', 'MPU_save_seo_setup', 10, 2 );\n}", "function kstHelpWordpressBlogPosts_excerptsAndMoreTeasers() {\n ?>\n <p>\n Your theme uses the excerpt field as well as the &lt;--more--&gt; tag giving\n you many options for formatting your blog index. Many themes use either the\n excerpt or the &lt;--more--&gt; tag to control what content appears on your\n blog index.\n </p>\n <p>\n Posts are displayed on the index in one of these formats (and order shown):\n </p>\n <ol>\n <li>Title and excerpt (if you type anything in the excerpt field)</li>\n <li>Title and the post up to the &lt;--more--&gt; (if you insert &lt;--more--&gt; in the post)</li>\n <li>Title and the entire post (if you do not enter an excerpt or the &lt;--more--&gt; tag)</li>\n </ol>\n <p><em>i.e. If you enter an excerpt and include a &lt;--more--&gt; tag only the excerpt will display</em></p>\n <p>\n <strong>How to use the \"more\" tag:</strong>\n </p>\n <p>\n In \"Visual\" mode:<br />\n Place the cursor <em>after</em> the content you would like to appear on the blog index for that post.\n Click the button above the post editor that looks like\n a rectangle cut in two pieces (a small rectangle on top and a longer rectangle on the button).\n A line that says \"more\" will appear.\n </p>\n <p>\n In \"html\" mode:<br />\n Place the cursor <em>after</em> the content you would like to appear on the blog index for that post.\n Type &lt;--more--&gt; on it's own line.\n </p>\n <p>\n Note: You may also customize the \"more\" link text that is shown per post (only possible using \"html\" mode).<br />\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Simply type the text to use after \"more\" e.g. &lt;--more But wait, there's more! --&gt;\n </p>\n <?php\n}", "public function post_excerpt( $key ) {\n\t\t$this->data['post_excerpt'] = $key;\n\t}", "function accouk_post_excerpt() {\n if(has_excerpt()) {\n the_excerpt();\n }\n}", "function the_excerpt_embed()\n {\n }", "function custom_excerpt_more( $more ) {\r\n\t return '...';\r\n}", "function charity_use_excerpt() {\n $display = TRUE;\n $display = apply_filters('charity_use_excerpt', $display);\n return $display;\n}", "public function add_options_pages() {\n if ( function_exists('acf_add_options_page') ) {\n acf_add_options_page(array(\n \"page_title\" => \"Explanatory Text\",\n \"capability\" => \"edit_posts\",\n \"position\" => 50,\n \"icon_url\" => \"dashicons-format-aside\"\n ));\n }\n }", "function twentyten_auto_excerpt_more( $more ) {\n\tif ( ! is_admin() ) {\n\t\treturn ' &hellip;' . twentyten_continue_reading_link();\n\t}\n\treturn $more;\n}", "function charity_use_autoexcerpt() {\n $display = FALSE;\n $display = apply_filters('charity_use_autoexcerpt', $display);\n return $display;\n}", "function twentyten_custom_excerpt_more( $output ) {\n\tif ( has_excerpt() && ! is_attachment() && ! is_admin() ) {\n\t\t$output .= twentyten_continue_reading_link();\n\t}\n\treturn $output;\n}", "function render_block_core_post_excerpt($attributes, $content, $block)\n {\n }", "function agnosia_add_post_meta_boxes() {\r\n\r\n\t\tglobal $post;\r\n\r\n\t\t$meta_value = get_post_meta( $post->ID, 'agnosia_post_meta' , true ) ;\r\n\r\n\t\tadd_meta_box(\r\n\t\t\t'post-excerpt-settings',\t\t\t// Unique ID\r\n\t\t\tesc_html( __( 'Excerpt settings', 'agnosia' ) ),\t\t// Title\r\n\t\t\t'agnosia_post_excerpt_settings_meta_box',\t\t// Callback function\r\n\t\t\t'',\t\t\t\t\t// Admin page (or post type)\r\n\t\t\t'side',\t\t\t\t\t// Context\r\n\t\t\t'core'\t\t\t\t\t// Priority\r\n\t\t);\r\n\r\n\t\tif ( current_user_can( 'content_enable_custom_stylesheet' ) \r\n\t\t\tand ( !isset( $meta_value['block_custom_stylesheet'] ) \r\n\t\t\t\tor !$meta_value['block_custom_stylesheet'] \r\n\t\t\t) \r\n\t\t) :\r\n\r\n\t\t\tadd_meta_box(\r\n\t\t\t\t'post-custom-stylesheet',\t\t\t// Unique ID\r\n\t\t\t\tesc_html( __( 'Custom stylesheet', 'agnosia' ) ),\t\t// Title\r\n\t\t\t\t'agnosia_post_custom_stylesheet_meta_box',\t\t// Callback function\r\n\t\t\t\t'',\t\t\t\t\t// Admin page (or post type)\r\n\t\t\t\t'advanced',\t\t\t\t\t// Context\r\n\t\t\t\t'default'\t\t\t\t\t// Priority\r\n\t\t\t);\r\n\r\n\t\tendif;\r\n\r\n\t\tif ( current_user_can( 'content_enable_featured_image_position' ) \r\n\t\t\tand ( !isset( $meta_value['block_featured_image_position'] ) \r\n\t\t\t\tor !$meta_value['block_featured_image_position'] \r\n\t\t\t) \r\n\t\t) :\r\n\r\n\t\t\tadd_meta_box(\r\n\t\t\t\t'post-featured-image-settings',\t\t\t// Unique ID\r\n\t\t\t\tesc_html( __( 'Featured image position', 'agnosia' ) ),\t\t// Title\r\n\t\t\t\t'agnosia_post_featured_image_settings_meta_box',\t\t// Callback function\r\n\t\t\t\t'',\t\t\t\t\t// Admin page (or post type)\r\n\t\t\t\t'side',\t\t\t\t\t// Context\r\n\t\t\t\t'low'\t\t\t\t\t// Priority\r\n\t\t\t);\r\n\r\n\t\tendif;\r\n\r\n\t\tif ( current_user_can( 'content_enable_override_default_settings' ) \r\n\t\t\tand ( !isset( $meta_value['block_override_default_settings'] ) \r\n\t\t\t\tor !$meta_value['block_override_default_settings'] \r\n\t\t\t) \r\n\t\t) :\r\n\r\n\t\t\tadd_meta_box(\r\n\t\t\t\t'post-custom-settings',\t\t\t// Unique ID\r\n\t\t\t\tesc_html ( __( 'Override default settings', 'agnosia' ) ),\t\t// Title\r\n\t\t\t\t'agnosia_post_settings_meta_box',\t\t// Callback function\r\n\t\t\t\t'',\t\t\t\t\t// Admin page (or post type)\r\n\t\t\t\t'advanced',\t\t\t\t\t// Context\r\n\t\t\t\t'core'\t\t\t\t\t// Priority\r\n\t\t\t);\r\n\r\n\t\tendif;\r\n\r\n\t\tif ( current_user_can( 'manage_options' ) ) :\r\n\r\n\t\t\tadd_meta_box(\r\n\t\t\t\t'post-block-advanced-options',\t\t// Unique ID\r\n\t\t\t\tesc_html( __( 'Block advanced options', 'agnosia' ) ),\t\t// Title\r\n\t\t\t\t'agnosia_post_block_advanced_options',\t\t// Callback function\r\n\t\t\t\t'',\t\t\t\t\t// Admin page (or post type)\r\n\t\t\t\t'advanced',\t\t\t\t\t// Context\r\n\t\t\t\t'high'\t\t\t\t\t// Priority\r\n\t\t\t);\r\n\r\n\t\tendif;\r\n\r\n\t}", "function sr_admin_actions() { \n\tadd_options_page(\"Standards Reader\", \"Standards Reader\", \"edit_published_posts\", \"sr_options\", \"sr_admin\");\n}", "function themify_custom_excerpt_more($more) {\n global $post;\n return '';\n}", "function custom_desktop_excerpt_more($more) {\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn ' <a href=\"'. get_permalink($post->ID) . '\"><em>(Continue Reading...)</em></a>';\n}", "function new_excerpt_more( $more ) {\n\tglobal $post;\n\treturn '... <div class=\"button small text-center\"><a href=\"'. get_permalink($post->ID) . '\">Continue Reading</a></div>';\n}", "function wpdocs_excerpt_more( $more ) {\n return ' ...';\n}", "function medigroup_mikado_excerpt($excerpt_length = '') {\n global $post;\n\n if(post_password_required()) {\n echo get_the_password_form();\n } //does current post has read more tag set?\n elseif(medigroup_mikado_post_has_read_more()) {\n global $more;\n\n //override global $more variable so this can be used in blog templates\n $more = 0;\n the_content(true);\n } //is word count set to something different that 0?\n elseif($excerpt_length != '0') {\n //if word count is set and different than empty take that value, else that general option from theme options\n $word_count = '45';\n if(isset($excerpt_length) && $excerpt_length != \"\") {\n $word_count = $excerpt_length;\n\n } elseif(medigroup_mikado_options()->getOptionValue('number_of_chars') != '') {\n $word_count = esc_attr(medigroup_mikado_options()->getOptionValue('number_of_chars'));\n }\n //if post excerpt field is filled take that as post excerpt, else that content of the post\n $post_excerpt = $post->post_excerpt != \"\" ? $post->post_excerpt : strip_tags($post->post_content);\n\n //remove leading dots if those exists\n $clean_excerpt = strlen($post_excerpt) && strpos($post_excerpt, '...') ? strstr($post_excerpt, '...', true) : $post_excerpt;\n\n //if clean excerpt has text left\n if($clean_excerpt !== '') {\n //explode current excerpt to words\n $excerpt_word_array = explode(' ', $clean_excerpt);\n\n //cut down that array based on the number of the words option\n $excerpt_word_array = array_slice($excerpt_word_array, 0, $word_count);\n\n //add exerpt postfix\n $excert_postfix = apply_filters('medigroup_mikado_excerpt_postfix', '...');\n\n //and finally implode words together\n $excerpt = implode(' ', $excerpt_word_array).$excert_postfix;\n\n //is excerpt different than empty string?\n if($excerpt !== '') {\n echo '<p class=\"mkd-post-excerpt\">'.wp_kses_post($excerpt).'</p>';\n }\n }\n }\n }", "function voyage_mikado_excerpt($excerpt_length = '') {\n global $post;\n\n if(post_password_required()) {\n echo get_the_password_form();\n } //does current post has read more tag set?\n elseif(voyage_mikado_post_has_read_more()) {\n global $more;\n\n //override global $more variable so this can be used in blog templates\n $more = 0;\n the_content(true);\n } //is word count set to something different that 0?\n elseif($excerpt_length != '0') {\n //if word count is set and different than empty take that value, else that general option from theme options\n $word_count = '45';\n if(isset($excerpt_length) && $excerpt_length != \"\") {\n $word_count = $excerpt_length;\n\n } elseif(voyage_mikado_options()->getOptionValue('number_of_chars') != '') {\n $word_count = esc_attr(voyage_mikado_options()->getOptionValue('number_of_chars'));\n }\n //if post excerpt field is filled take that as post excerpt, else that content of the post\n $post_excerpt = $post->post_excerpt != \"\" ? $post->post_excerpt : strip_tags($post->post_content);\n\n //remove leading dots if those exists\n $clean_excerpt = strlen($post_excerpt) && strpos($post_excerpt, '...') ? strstr($post_excerpt, '...', true) : $post_excerpt;\n\n //if clean excerpt has text left\n if($clean_excerpt !== '') {\n //explode current excerpt to words\n $excerpt_word_array = explode(' ', $clean_excerpt);\n\n //cut down that array based on the number of the words option\n $excerpt_word_array = array_slice($excerpt_word_array, 0, $word_count);\n\n //add exerpt postfix\n $excert_postfix = apply_filters('voyage_mikado_excerpt_postfix', '...');\n\n //and finally implode words together\n $excerpt = implode(' ', $excerpt_word_array).$excert_postfix;\n\n //is excerpt different than empty string?\n if($excerpt !== '') {\n echo '<p class=\"mkdf-post-excerpt\">'.wp_kses_post($excerpt).'</p>';\n }\n }\n }\n }", "function start_replace_excerpt_more( $more ) {\n\tglobal $post;\n\t// edit here if you like\n\treturn null;\n}", "function always_the_excerpt() {\n\tglobal $more;\n\t$old_more = isset($more) ? $more : null;\n\t$more = 0;\n\tthe_excerpt();\n\t$more = $old_more;\n}", "function Enable() {\n\n\t\t\t//add_action('load-categories.php', array(\"TreBiMeteo\",'SetAdminConfiguration'));\n\t\t\t//add_action('load-edit-tags.php', array(\"TreBiMeteo\",'SetAdminConfiguration'));\n\t\t\t// Aggiungiamo la pagina delle opzioni\n\t\t\tadd_action('admin_menu', array(\"TreBiMeteo\",'SetAdminConfiguration'));\n\t\t\t//add_action('widgets_init', array(\"TreBiMeteo\",'SetWidget'));\t\t\t\n\n\t\t}", "function rw_custom_excerpt_more( $output )\n{\n if( has_excerpt() && !is_attachment() )\n {\n $output .= rw_continue_reading_link();\n }\n return $output;\n}", "function ci_e_content($more_link_text = null, $stripteaser = false)\n{\n\tglobal $post, $ci;\n\tif (is_single() or is_page())\n\t\tthe_content(); \n\telse\n\t{\n\t\tif(ci_setting('preview_content')=='enabled')\n\t\t{\n\t\t\tthe_content($more_link_text, $stripteaser);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthe_excerpt();\n\t\t}\n\t}\n}", "function thefirst_new_excerpt_more($more) {\n global $post;\n\treturn '...';\n}", "function mithpress_custom_excerpt_more( $output ) {\n\tif ( has_excerpt() && ! is_attachment() ) {\n\t\t$output .= mithpress_continue_reading_link();\n\t}\n\treturn $output;\n}", "function new_excerpt_more( $more ) {\n\treturn '&hellip;';\n/*\n\tif(is_front_page()){\n\treturn '&nbsp;<span class=\"genericon genericon-next\"></span>';\t\t\n\t} else {\n\treturn '&hellip;';\n\t}\n*/\n}", "function jetpack_the_excerpt_customizer( $excerpt ) {\n\tif ( ( is_home() || is_archive() ) && ! is_post_type_archive( array( 'jetpack-testimonial', 'jetpack-portfolio', 'product' ) ) ) {\n\t\tob_start();\n\t\tthe_content(\n\t\t\tsprintf(\n\t\t\t\twp_kses(\n\t\t\t\t\t/* translators: %s: Name of current post. Only visible to screen readers */\n\t\t\t\t\t__( 'Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'jetpack' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'span' => array(\n\t\t\t\t\t\t\t'class' => array(),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tget_the_title()\n\t\t\t)\n\t\t);\n\t\t$content = ob_get_clean();\n\t}\n\tif ( empty( $content ) ) {\n\t\treturn $excerpt;\n\t} else {\n\t\treturn sprintf( '<div class=\"jetpack-blog-display jetpack-the-content\">%s</div><div class=\"jetpack-blog-display jetpack-the-excerpt\">%s</div>', $content, $excerpt );\n\t}\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn '... (<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\">Read more</a>)';\n}", "function new_excerpt_more($more) {\n global $post;\n return '...';\n}", "function the_excerpt()\n {\n }", "function ppes_admin_init(){\r\n\tadd_meta_box(\"et_post_meta\", \"ET Settings\", \"et_post_meta\", \"auctions\", \"normal\", \"high\");\r\n}", "function wp_embed_excerpt_more($more_string)\n {\n }", "function new_excerpt_more($more) {\n global $post;\n\treturn '<p><a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read More</a></p>';\n}", "function _sp_custom_box_advanced_page_options( $post ) {\n\twp_nonce_field( '_sp_process_meta_advanced_page_options', '_sp_meta_advanced_page_options_nonce' );\t\n\n\tif ( $post->ID ) {\n\t\t$show_title = get_post_meta( $post->ID, '_sp_page_show_title', true );\n\t\t$show_tagline = get_post_meta( $post->ID, '_sp_page_show_tagline', true );\n\t\t$tagline = get_post_meta( $post->ID, '_sp_page_tagline_text', true );\n\t\t$show_share = get_post_meta( $post->ID, '_sp_page_show_share', true );\n\t\t$show_wishlist = get_post_meta( $post->ID, '_sp_page_show_wishlist', true );\n\t\t$show_compare = get_post_meta( $post->ID, '_sp_page_show_compare', true );\n\t}\n\n\t// set default\n\tif ( ! isset( $show_header_section ) || empty( $show_header_section ) )\n\t\t$show_header_section = 'on';\n\n\tif ( ! isset( $show_title ) || empty( $show_title ) )\n\t\t$show_title = 'on';\n\n\t// set default\n\tif ( ! isset( $show_tagline ) || empty( $show_tagline ) )\n\t\t$show_tagline = 'off';\n\n\t// set default\n\tif ( ! isset( $show_share ) || empty( $show_share ) )\n\t\t$show_share = 'on';\n\n\t// show by default if post type is a blog post else off for all others\n\tif ( get_post_type() === 'post' ) {\n\t\tif ( ! isset( $show_social_buttons ) || empty( $show_social_buttons ) )\n\t\t\t$show_social_buttons = 'on';\n\t} else {\n\t\tif ( ! isset( $show_social_buttons ) || empty( $show_social_buttons ) )\n\t\t\t$show_social_buttons = 'off';\n\t}\n\n\t// set default\n\tif ( ! isset( $show_breadcrumbs ) || empty( $show_breadcrumbs ) )\n\t\t$show_breadcrumbs = 'on';\n\n\t// set default\n\tif ( ! isset( $show_wishlist ) || empty( $show_wishlist ) )\n\t\t$show_wishlist = 'on';\n\n\t// set default\n\tif ( ! isset( $show_compare ) || empty( $show_compare ) )\n\t\t$show_compare = 'on';\n\n\t$output = '';\n\n\t$output .= '<p><strong>' . __( 'Show Page Title:', 'sp-theme' ) . '</strong></p>' . PHP_EOL;\t\n\t$output .= '<p><label>' . __( 'Show', 'sp-theme' ) . ' <input type=\"radio\" name=\"page_show_title\" value=\"on\" ' . checked( $show_title, 'on', false ) . ' /></label>&nbsp;&nbsp;<label>' . __( 'Hide', 'sp-theme' ) . ' <input type=\"radio\" name=\"page_show_title\" value=\"off\" ' . checked( $show_title, 'off', false ) . '/></label></p>' . PHP_EOL;\n\n\t$output .= '<p><strong>' . __( 'Show Page Tagline:', 'sp-theme' ) . '</strong></p>' . PHP_EOL;\t\n\t$output .= '<p><label>' . __( 'Show', 'sp-theme' ) . ' <input type=\"radio\" name=\"page_show_tagline\" value=\"on\" ' . checked( $show_tagline, 'on', false ) . ' /></label>&nbsp;&nbsp;<label>' . __( 'Hide', 'sp-theme' ) . ' <input type=\"radio\" name=\"page_show_tagline\" value=\"off\" ' . checked( $show_tagline, 'off', false ) . '/></label></p>' . PHP_EOL;\n\n\t$output .= '<p><strong>' . __( 'Page Tagline Text:', 'sp-theme' ) . '</strong></p>' . PHP_EOL;\t\n\t$output .= '<p><input type=\"text\" name=\"page_tagline_text\" class=\"widefat\" value=\"' . esc_attr( $tagline ) . '\" /></p>' . PHP_EOL;\n\n\t$output .= '<p><strong>' . __( 'Show Social Share', 'sp-theme' ) . '</strong></p>' . PHP_EOL;\t\n\t$output .= '<p><label>' . __( 'Show', 'sp-theme' ) . ' <input type=\"radio\" name=\"page_show_share\" value=\"on\" ' . checked( $show_share, 'on', false ) . ' /></label>&nbsp;&nbsp;<label>' . __( 'Hide', 'sp-theme' ) . ' <input type=\"radio\" name=\"page_show_share\" value=\"off\" ' . checked( $show_share, 'off', false ) . '/></label></p>' . PHP_EOL;\n\n\t// check if post type is products\n\tif ( get_post_type() === 'product' ) {\n\t\t$output .= '<p><strong>' . __( 'Show Product Wishlist', 'sp-theme' ) . '</strong></p>' . PHP_EOL;\t\n\t\t$output .= '<p><label>' . __( 'Show', 'sp-theme' ) . ' <input type=\"radio\" name=\"page_show_wishlist\" value=\"on\" ' . checked( $show_wishlist, 'on', false ) . ' /></label>&nbsp;&nbsp;<label>' . __( 'Hide', 'sp-theme' ) . ' <input type=\"radio\" name=\"page_show_wishlist\" value=\"off\" ' . checked( $show_wishlist, 'off', false ) . '/></label></p>' . PHP_EOL;\n\n\t\t$output .= '<p><strong>' . __( 'Show Product Compare', 'sp-theme' ) . '</strong></p>' . PHP_EOL;\t\n\t\t$output .= '<p><label>' . __( 'Show', 'sp-theme' ) . ' <input type=\"radio\" name=\"page_show_compare\" value=\"on\" ' . checked( $show_compare, 'on', false ) . ' /></label>&nbsp;&nbsp;<label>' . __( 'Hide', 'sp-theme' ) . ' <input type=\"radio\" name=\"page_show_compare\" value=\"off\" ' . checked( $show_compare, 'off', false ) . '/></label></p>' . PHP_EOL;\t\t\n\t}\n\n\techo $output;\n}", "function page_setup_metabox_content( $post ){\n\twp_nonce_field( 'mptheme_layout_save_meta_box', 'mptheme_page_setup_meta_box_nonce' );\n\n\t/*\n\t * Use get_post_meta() to retrieve an existing value\n\t * from the database and use the value for the form.\n\t */\n\t$mptheme_page_setup_show_heading = get_post_meta( $post->ID, 'mptheme_page_setup_show_heading', true );\n\n\tif(!$mptheme_page_setup_show_heading){\n\t\t$mptheme_page_setup_show_heading = 'true';\n\t}\n\t?>\n\t\t<p class=\"post-attributes-label-wrapper\">\n\t\t\t<label class=\"post-attributes-label\"> <?php _e( 'Show page heading', 'mptheme' ); ?> </label>\n\t\t</p>\n\t\t<select name=\"mptheme_page_setup_show_heading\">\n\t\t\t<option value=\"true\" <?php echo selected( $mptheme_page_setup_show_heading, 'true', false); ?>> <?php _e( 'Enable', 'mptheme' ); ?></option>\n\t\t\t<option value=\"false\" <?php echo selected( $mptheme_page_setup_show_heading, 'false', false); ?>> <?php _e( 'Disable', 'mptheme' ); ?></option>;\n\t\t</select>\n\n\t<?php\n\t// if Revolution Slider is available uset can select an slider for the page\n\tif(class_exists('RevSliderAdmin')) {\n\t\tglobal $wpdb;\n\n\t\t$rs = $wpdb->get_results( \n\t\t\t\"\n\t\t\tSELECT id, title, alias\n\t\t\tFROM \".$wpdb->prefix.\"revslider_sliders\n\t\t\tORDER BY id ASC LIMIT 100\n\t\t\t\"\n\t\t);\n\t\t$revsliders = array(array(\n\t\t\t'value' => 'no_slider',\n\t\t\t'label' => 'No Slider'\n\t\t));\n\t\tif ($rs) {\n\t\t\t$_ri = 1;\n\t\t\tforeach ( $rs as $slider ) {\n\t\t\t\t$revsliders[$_ri]['value'] = $slider->alias;\n\t\t\t\t$revsliders[$_ri]['label'] = $slider->title;\n\t\t\t\t$_ri++;\n\t\t\t}\n\t\t} else {\n\t\t\t$revsliders[\"No sliders found\"] = 0;\n\t\t}\n\n\t\tif(count($revsliders)>0 ){\n\t\t\t// Get the saved slider\n\t\t\t$mptheme_page_setup_revslider = get_post_meta( $post->ID, 'mptheme_page_setup_revslider', true );\n\n\t\t\tif(!$mptheme_page_setup_revslider){\n\t\t\t\t$mptheme_page_setup_revslider = 'no_slider';\n\t\t\t}\n\n\t\t?>\n\n\t\t\t<p class=\"post-attributes-label-wrapper\">\n\t\t\t\t<label class=\"post-attributes-label\"> <?php _e( 'Show hero Revolution Slider insted of heading?', 'mptheme' ); ?> </label>\n\t\t\t</p>\n\t\t\t<select name=\"mptheme_page_setup_revslider\">\n\t\t\t\t<?php for ($i=0; $i < count($revsliders); $i++) { ?>\n\t\t\t\t\t<option value=\"<?php echo $revsliders[$i][\"value\"] ?>\" <?php echo selected( $mptheme_page_setup_revslider, $revsliders[$i][\"value\"], false); ?>><?php echo $revsliders[$i][\"label\"] ?></option>\n\t\t\t\t<?php } ?>\n\t\t\t</select>\n\n\t\t<?php }\n\t}\n\t?>\n\n\t<?php\n}", "function greater_jackson_habitat_extra_metabox_content() {\n\t\n\tgreater_jackson_habitat_do_field_textarea( array(\n\t\t'name' => 'gjh_extra',\n\t\t'group' => 'gjh_extra',\n\t\t'wysiwyg' => true,\n\t) );\n\t\n\tgreater_jackson_habitat_init_field_group( 'gjh_extra' );\n\t\n}", "function codium_extend_excerpt_more($more) {\n global $post;\n $readmore = __('Czytaj wiecej', 'codium_extend' );\n return '';\n}", "function codium_extend_excerpt_more($more) {\n global $post;\n $readmore = __('Czytaj wiecej', 'codium_extend' );\n return '';\n}", "function mithpress_auto_excerpt_more( $more ) {\n\treturn ' . . . ' . mithpress_continue_reading_link();\n}", "function new_excerpt_more($more)\r\n{\r\n\tglobal $post;\r\n\treturn '<a class=\"moretag\" href=\"' . get_permalink($post->ID) . '\"> Read the full article...</a>';\r\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn ' <a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\">[ more ]</a>';\n}", "function new_excerpt_more($more) {\n global $post;\n return ' [...] <a href=\"' . get_permalink($post->ID) . '\">' . __('Continue reading <span class=\"meta-nav\">&rarr;</span>', 'twentytwelve') . '</a>';\n }", "function new_excerpt_more($more) {\n global $post;\n\treturn '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> read more...</a>';\n}", "function law_firm_posts_and_pages($wp_customize)\n{\n\n /*=================== Posts and page section ====================*/\n $wp_customize->add_section(\n 'posts_and_pages',\n array(\n 'title' => __('Posts and Page Section', 'kriti_law_firm'),\n 'capability' => 'edit_theme_options',\n 'priority' => 10,\n 'panel' => 'general_settings'\n )\n );\n\n // Show related posts checkbox\n $wp_customize->add_setting(\n 'show_related_posts',\n array(\n 'priority' => 10,\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => 'refresh',\n 'default' => 0,\n 'sanitize_callback' => 'kriti_law_firm_sanitize_checkbox'\n )\n );\n\n $wp_customize->add_control(\n 'show_related_posts',\n array(\n 'label' => __('Show Relates Posts', 'kriti_law_firm'),\n 'section' => 'posts_and_pages',\n 'settings' => 'show_related_posts',\n 'type' => 'checkbox'\n )\n );\n\n // show related posts title\n\n $wp_customize->add_setting(\n 'show_related_post_title',\n array(\n 'priority' => 20,\n 'type' => 'theme_mod',\n 'capability' => 'edit_theme_options',\n 'transport' => 'refresh',\n 'default' => __('Related Posts', 'kriti_law_firm'),\n 'sanitize_callback' => 'wp_filter_nohtml_kses'\n )\n );\n\n $wp_customize->add_control(\n 'show_related_post_title',\n array(\n 'label' => __('Read more Button', 'kriti_law_firm'),\n 'section' => 'posts_and_pages',\n 'settings' => 'show_related_post_title',\n 'type' => 'text'\n )\n );\n}", "function medigroup_mikado_excerpt_more($more) {\n return '...';\n }", "function _sp_custom_box_seo_settings( $post ) {\n\twp_nonce_field( '_sp_process_meta_seo_settings', '_sp_meta_seo_settings_nonce' );\t\n\t\n\t$description = get_post_meta( $post->ID, '_sp_page_seo_description', true );\n\t$keywords = get_post_meta( $post->ID, '_sp_page_seo_keywords', true );\n\t$title = get_post_meta( $post->ID, '_sp_page_seo_title', true );\n\t$robot = get_post_meta( $post->ID, '_sp_page_seo_robot', true );\n\n\t$output = '';\n\t$output .= '<p class=\"howto\">' . __( 'Here you can put in specific SEO meta description and meta keywords just for this page. It will override the default general SEO settings. This gives you fine grain control over each page. Leaving it blank will use the default settings.', 'sp-theme' ) . '</p>' . PHP_EOL;\n\n\t$output .= '<p><label for=\"seo-title\">' . __( 'Title - Enter the title you want the search engines to see.', 'sp-theme' ) . '</label></p>' . PHP_EOL;\n\t$output .= '<p><input type=\"text\" id=\"seo-title\" name=\"seo_title\" class=\"widefat\" value=\"' . esc_attr( $title ) . '\" /></p>' . PHP_EOL;\t\n\n\t$output .= '<p><label for=\"seo-description\">' . __( 'Meta Description - You want to keep your description under 160 characters long.', 'sp-theme' ) . '</label></p>' . PHP_EOL;\n\t$output .= '<p><textarea id=\"seo-description\" name=\"seo_description\" class=\"widefat\">' . $description . '</textarea></p>' . PHP_EOL;\n\t\n\t$output .= '<p><label for=\"seo-keywords\">' . __( 'Meta Keywords - Separate each keyword by a comma. You want to have no more than 30 keywords.', 'sp-theme' ) . '</label></p>' . PHP_EOL;\n\t$output .= '<p><textarea id=\"seo-keywords\" name=\"seo_keywords\" class=\"widefat\">' . $keywords . '</textarea></p>' . PHP_EOL;\n\n\t$output .= '<p><label for=\"robot\">' . __( 'Robot Settings - allows you to set specific robot/spiders/crawlers to follow and index the page.', 'sp-theme' ) . '</label></p>' . PHP_EOL;\n\t$output .= '<p><select id=\"robot\" name=\"seo_robot\" class=\"select2-select\">' . PHP_EOL;\n\t$output .= '<option value=\"0\" ' . selected( $robot, '0', false ) . '>' . __( '--Please Select--', 'sp-theme' ) . '</option>' . PHP_EOL;\n\t$output .= '<option value=\"index,nofollow\" ' . selected( $robot, 'index,nofollow', false ) . '>' . __( 'Index, No Follow', 'sp-theme' ) . '</option>' . PHP_EOL;\n\t$output .= '<option value=\"index,follow\" ' . selected( $robot, 'index,follow', false ) . '>' . __( 'Index, Follow', 'sp-theme' ) . '</option>' . PHP_EOL;\n\t$output .= '<option value=\"noindex,follow\" ' . selected( $robot, 'noindex,follow', false ) . '>' . __( 'No Index, Follow', 'sp-theme' ) . '</option>' . PHP_EOL;\n\t$output .= '<option value=\"nofollow,noindex\" ' . selected( $robot, 'nofollow,noindex', false ) . '>' . __( 'No Follow & No Index', 'sp-theme' ) . '</option>' . PHP_EOL;\n\t$output .= '</select>' . PHP_EOL;\n\n\techo $output;\n}", "function echotheme_custom_excerpt_more($output) {\n\tif (has_excerpt() && ! is_attachment()) {\n\t\t$output .= echotheme_continue_reading_link();\n\t}\n\treturn $output;\n}", "function productTeaser($post)\r\n{\r\n ?>\r\n <p>\r\n <span>Embed-cсылка на тизер: </span>\r\n <input type=\"text\" name='extra[teaser]' value=\"<?php echo get_post_meta($post->ID, \"teaser\", 1); ?>\">\r\n </p>\r\n <?php\r\n}", "function clonemaker_add_meta_box(){\r\n add_meta_box(\r\n 'clonemaker',\r\n 'Clone a Page',\r\n 'add_post_list',\r\n 'page',\r\n 'side'\r\n );\r\n\r\n\r\n}", "function emc_the_link_excerpt() {\r\n\r\n\t$title = ( get_field( 'link_title' ) ) ? get_field( 'link_title' ) : get_the_title();\r\n\t$url = ( is_single() ) ? get_field( 'link_url' ) : get_permalink();\r\n\t$source = get_field( 'source' );\r\n\t$excerpt = get_field( 'excerpt' );\r\n\r\n\tif ( ! $url ) return false; ?>\r\n\r\n\t<div class=\"emc-link\">\r\n\t\t<a href=\"<?php echo esc_url( $url ); ?>\">\r\n\t\t\t<!--<?php echo get_the_post_thumbnail( get_the_ID(), 'thumbnail' ); ?>-->\r\n\t\t\t<div class=\"emc-link-content\">\r\n\t\t\t\t<h2 class=\"emc-link-title\"><?php echo esc_html( $title ); ?></h2>\r\n\t\t\t\t<?php if(is_single()) {\r\n\t\t \techo '<div class=\"link-post-icon\"><img src=\"http://earlymath.erikson.edu/wp-content/themes/emc/img/icon-link.png\"></div>';\r\n\t\t \t}?>\r\n\t\t\t\t<div class=\"emc-link-source\"><?php echo esc_html( $source ); ?></div>\r\n\t\t\t\t<?php echo esc_html( $excerpt ); ?>\r\n\t\t\t</div>\r\n\t\t</a>\r\n\t</div><!-- .emc-link -->\r\n\r\n<?php }", "function jetpack_the_content_customizer( $content ) {\n\t$class = jetpack_the_content_customizer_class();\n\tif ( ( is_home() || is_archive() ) && ! is_post_type_archive( array( 'jetpack-testimonial', 'jetpack-portfolio', 'product' ) ) ) {\n\t\tif ( post_password_required() ) {\n\t\t\t$excerpt = sprintf( '<p>%s</p>', esc_html__( 'There is no excerpt because this is a protected post.', 'jetpack' ) );\n\t\t} else {\n\t\t\t$excerpt = jetpack_blog_display_custom_excerpt( $content );\n\t\t}\n\t}\n\tif ( empty( $excerpt ) ) {\n\t\treturn $content;\n\t} else {\n\t\treturn sprintf( '<div class=\"jetpack-blog-display %s jetpack-the-content\">%s</div><div class=\"jetpack-blog-display %s jetpack-the-excerpt\">%s</div>', $class, $content, $class, $excerpt );\n\t}\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn '<div class=\"readmore\"><a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read More <i class=\"fa fa-long-arrow-right\" aria-hidden=\"true\"></i></a></div>';\n}", "function new_excerpt_more($more) {\n\tglobal $post;\n\treturn '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Leia o artigo completo...</a>';\n}", "public function add_reading_settings(){\n add_settings_section('theme-pages-section', __('Custom page settings', 'theme-translations '), array($this, 'add_additional_page_settings'), 'reading');\n }", "public function add_reading_settings(){\n add_settings_section('theme-pages-section', __('Custom page settings', 'theme-translations '), array($this, 'add_additional_page_settings'), 'reading');\n }", "function TS_VCSC_Custom_Excerpt_Routines() {\r\n\t\t\t// Setze Auszugslänge Global auf 100 Wörter\r\n\t\t\tfunction TS_VCSC_Custom_Excerpt_Length($length) {\r\n\t\t\t\treturn 100;\r\n\t\t\t}\r\n\t\t\tadd_filter('excerpt_length', 'TS_VCSC_Custom_Excerpt_Length', \t888);\r\n\t\t\t\r\n\t\t\t// Entferne Standard WP Routine für den Beitragsauszug\r\n\t\t\tremove_filter('get_the_excerpt', 'wp_trim_excerpt');\r\n\t\t\t\r\n\t\t\t// Erstellt Auszugsinhalt unter Berücksichtigung von WBP Textblock Inhalten\r\n\t\t\tfunction TS_VCSC_Custom_Excerpt_Content($text) {\r\n\t\t\t\tglobal $post;\r\n\t\t\t\t// Speichere RAW Auszugs Text\r\n\t\t\t\t$excerpt_rawcode\t= $text;\r\n\t\t\t\t// Setze Auszugslänge auf 100 Wörter\r\n\t\t\t\t$excerpt_length \t= apply_filters('excerpt_length', \t\t100);\r\n\t\t\t\t// Definiere den Indikator für mehr Inhalt\r\n\t\t\t\t$excerpt_more \t\t= apply_filters('excerpt_more', ' ' . '[...]');\r\n\t\t\t\t// Entferne WBP Textblock Shortcodes vom Filter\r\n\t\t\t\t$excerpt_composer \t= array('vc_column_text', 'TS_VCSC_Advanced_Textblock');\r\n\t\t\t\t$excerpt_values\t\t= array_values($excerpt_composer);\r\n\t\t\t\t$excerpt_exclude \t= implode('|', $excerpt_values);\r\n\t\t\t\t// Nutze Beitragsinhalt wenn kein Auszug vorhanden\t\r\n\t\t\t\tif ('' == $text) {\r\n\t\t\t\t\t$text \t\t\t= get_the_content('');\r\n\t\t\t\t\t$text\t\t\t= preg_replace(\"~(?:\\[/?)(?!(?:$excerpt_exclude))[^/\\]]+/?\\]~s\", '', $text);\r\n\t\t\t\t\t$text \t\t\t= apply_filters('the_content', $text);\r\n\t\t\t\t\t$text \t\t\t= str_replace(']]>', ']]&gt;', $text);\r\n\t\t\t\t}\r\n\t\t\t\t// Entferne jedweden HTML oder PHP Code\r\n\t\t\t\t$text \t\t\t\t= strip_tags($text);\r\n\t\t\t\t// Kürze Ausug auf die Anzahl von vorgegebenen Wörtern\r\n\t\t\t\t$text \t\t\t\t= wp_trim_words($text, $excerpt_length, $excerpt_more);\r\n\t\t\t\treturn apply_filters('wp_trim_excerpt', $text, $excerpt_rawcode);\r\n\t\t\t}\r\n\t\t\tadd_filter('get_the_excerpt', 'TS_VCSC_Custom_Excerpt_Content', 999);\r\n\t\t}", "public function action_edit_form_after_title() {\n\n if ( 'pedestal_story' == get_current_screen()->post_type ) {\n $this->pedestal_headline_context->render_meta_box( get_post( get_the_ID() ) );\n }\n\n }", "function et_excerpt_more($more) {\n global $post;\n return '<div class=\"view-full-post\"><a href=\"'. get_permalink($post->ID) . '\" class=\"view-full-post-btn\">Skaityti</a></div>';\n}", "function cera_grimlock_the_excerpt( $more_link ) {\n\t\t$allowed_html = array(\n\t\t\t'a' => array(\n\t\t\t\t'href' => array(),\n\t\t\t\t'title' => array(),\n\t\t\t\t'class' => array(),\n\t\t\t),\n\t\t\t'span' => array(\n\t\t\t\t'class' => array(),\n\t\t\t),\n\t\t);\n\n\t\tif ( has_post_format( array( 'link', 'quote' ) ) ) : ?>\n\t\t\t<div class=\"entry-content clearfix\">\n\t\t\t\t<?php\n\t\t\t\tthe_content();\n\t\t\t\techo wp_kses( $more_link, $allowed_html ); ?>\n\t\t\t</div><!-- .entry-content -->\n\t\t\t<?php\n\t\telse : ?>\n\t\t\t<div class=\"entry-summary clearfix\">\n\t\t\t\t<?php\n\t\t\t\tthe_excerpt();\n\t\t\t\techo wp_kses( $more_link, $allowed_html ); ?>\n\t\t\t</div><!-- .entry-summary -->\n\t\t\t<?php\n\t\tendif;\n\t}", "function indieweb_publisher_show_excerpt() {\n\t\t/* Only show excerpts for Standard post format OR Chat format,\n\t\t * when this is not both the very first standard post and also a Sticky post AND\n\t\t * when excerpts enabled or One-Sentence Excerpts enabled AND\n\t\t * this is not the very first standard post when Show Full Content First Post enabled\n\t\t */\n\t\tif ( ( !get_post_format() || 'chat' === get_post_format() ) ) {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function labs_auto_excerpt_more( $more ) {\n\treturn ' &hellip;' . labs_continue_reading_link();\n}", "public function extra_form_fields() {\n\t?>\n\t\t<tr valign=\"top\">\n\t\t\t<th scope=\"row\"><?php _e( 'Make slider featured randomly?', $this->textdomain ); ?></th>\n\t\t\t<td><input type=\"checkbox\" name=\"slider_featured\" value=\"1\" checked=\"checked\" /></td>\n\t\t</tr>\n\t<?php\n\t}", "public function additional_plugin_setup() {\n\n\t\t$page_main = $this->_admin_pages[ 'vfb-pro' ];\n\n\t\t// If first time editing, disable advanced items by default.\n\t\tif( false === get_user_option( 'manage' . $page_main . 'columnshidden' ) ) {\n\t\t\t$user = wp_get_current_user();\n\t\t\tupdate_user_option( $user->ID, 'manage' . $page_main . 'columnshidden', array( 0 => 'merge-tag' ), true );\n\t\t}\n\n\t\tif ( !get_option( 'vfb_dashboard_widget_options' ) ) {\n\t\t\t$widget_options['vfb_dashboard_recent_entries'] = array(\n\t\t\t\t'items' => 5,\n\t\t\t);\n\t\t\tupdate_option( 'vfb_dashboard_widget_options', $widget_options );\n\t\t}\n\n\t}", "function et_excerpt_more($more) {\n global $post;\n return '<div><a href=\"'. get_permalink($post->ID) . '\" > ... Click to View Full Post</a></div>;';\n}", "function new_excerpt_more($more) {\n\tglobal $post;\n\treturn '&hellip; </br> <a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\">Read more</a>';\n}", "function new_excerpt_more( $more ) {\n return ' ...';\n}", "public function MetaEditable() {\n\t\t\treturn true;\n\t\t}", "function darksnow_custom_excerpt_more( $output ) {\n\tif ( has_excerpt() && ! is_attachment() ) {\n\t\t$output .= darksnow_continue_reading_link();\n\t}\n\treturn $output;\n}", "function init() {\r\n $options = get_option('e_tools');\r\n if ($options['enforce_length']) {\r\n add_filter('wp_trim_excerpt', __NAMESPACE__.'\\filter_trim_excerpt', 11, 2);\r\n add_filter('option_relevanssi_excerpt_length', __NAMESPACE__.'\\option_relevanssi_excerpt_length', 99);\r\n }\r\n}", "function uwmadison_custom_excerpt_more( $output ) {\n\t\tif ( has_excerpt() && ! is_attachment() ) {\n\t\t\t$output .= uwmadison_continue_reading_link();\n\t\t}\n\t\treturn $output;\n\t}" ]
[ "0.71937954", "0.70432514", "0.6875515", "0.6872793", "0.686957", "0.68686664", "0.6851628", "0.6775768", "0.677413", "0.6732943", "0.6679325", "0.66478676", "0.657382", "0.64732915", "0.64498574", "0.6392019", "0.63688976", "0.63142735", "0.6199261", "0.6159048", "0.61331797", "0.6101716", "0.60610867", "0.6059492", "0.6003806", "0.59857947", "0.5964737", "0.5936626", "0.5919852", "0.5908593", "0.58956313", "0.58839697", "0.5875972", "0.58743083", "0.58660626", "0.5834491", "0.5804173", "0.579744", "0.57891506", "0.5740001", "0.5732254", "0.5720042", "0.56963736", "0.5695739", "0.5677387", "0.5670193", "0.5667076", "0.5660291", "0.5647435", "0.5638941", "0.5633635", "0.5630347", "0.5616287", "0.5597438", "0.55951536", "0.5591541", "0.55883735", "0.55706584", "0.5566565", "0.5563916", "0.55570906", "0.5550714", "0.55457836", "0.5539436", "0.5534647", "0.55313766", "0.55313766", "0.5519555", "0.551098", "0.5504228", "0.5499968", "0.5494128", "0.54910636", "0.5487319", "0.5483807", "0.54818183", "0.5472255", "0.5457828", "0.5438864", "0.54279256", "0.5427147", "0.5423499", "0.54208124", "0.54208124", "0.5418845", "0.5416624", "0.5413706", "0.53929436", "0.5386408", "0.538267", "0.5381395", "0.53809214", "0.5370644", "0.5367484", "0.5362488", "0.5354527", "0.5354523", "0.5353304", "0.534486" ]
0.6263546
19
Add Subtitle in admin post
function subtitle( $post ) { if ( ! in_array( $post->post_type, [ 'post', 'page' ], true ) ) { return; } // The subtitle field. $_stitle = sanitize_text_field( get_post_meta( $post->ID, '_subtitle', true ) ); echo '<div class="inside">'; echo '<div id="edit-slug-box" class="hide-if-no-js">'; echo '<label for="subtitle"><strong>' . __( 'Sub Title: ' ) . '</strong></label>'; echo '<input type="text" name="subtitle" id="subtitle" value="' . $_stitle . '" size="30" spellcheck="true" autocomplete="off" />'; echo '</div>'; echo '</div>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ts_set_custom_title( $title ) {\r\n \r\n\tif (is_single() || is_page())\r\n\t{\r\n\t\t$subtitle = get_post_meta (get_the_ID(), 'subtitle', true);\r\n\t\tif (!empty($subtitle))\r\n\t\t{\r\n\t\t\t$title .= $subtitle.' | ';\r\n\t\t}\r\n\t}\r\n return $title;\r\n}", "function slb_custom_admin_titles($title, $post_id) {\n\tglobal $post;\n\n\t$output = $title;\n\n\tif(isset($post->post_type)){\n\t\tswitch ($post->post_type) {\n\t\t\tcase 'slb_subscriber':\n\t\t\t\t$fname = get_field('slb_fname', $post_id);\n\t\t\t\t$lname = get_field('slb_lname', $post_id);\n\t\t\t\t$output = $fname . ' ' . $lname;\n\t\t\t\tbreak;\t\t\t\n\t\t}\n\t}\n\treturn $output;\n}", "function pgm_register_custom_admin_titles() {\n add_filter('the_title','pgm_custom_admin_titles',99,2);\n}", "static function add_title(): void {\r\n\t\tself::add_acf_inner_field(self::roles, self::title, [\r\n\t\t\t'label' => 'Title',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'The name of the role.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '25',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t]);\r\n\t}", "function tsd_change_post_subtitle_meta_key() {\n return \"post_subtitle\";\n}", "function edit_form_after_title()\n {\n }", "function edit_form_after_title()\n {\n }", "function pgm_custom_admin_titles( $title, $post_id ) {\n\n global $post;\n\n $output = $title;\n\n if( isset($post->post_type) ):\n switch( $post->post_type ) {\n case 'pgm_subscriber':\n $fname = get_field('pgm_fname', $post_id );\n $lname = get_field('pgm_lname', $post_id );\n $output = $fname .' '. $lname;\n break;\n }\n endif;\n\n return $output;\n}", "function register_block_core_post_title()\n {\n }", "function gw_the_sub_title($echo = true){\r\n $subtitle = get_post_meta( get_the_ID(), '_gw_make_subtitle', true);\r\n if($subtitle != ''){\r\n $return = \"<h3 class='gw-subtitle'>{$subtitle}</h3>\";\r\n }\r\n if ($echo) {\r\n echo $return;\r\n }\r\n return $return;\r\n}", "public function getSubTitle()\n {\n return $this->_sub_title;\n }", "function GetAdminTitle()\n\t{\tif ($this->id)\n\t\t{\t$this->admintitle = $this->details['pagetitle'];\n\t\t}\n\t}", "public function get_title() {\n\t\treturn __( 'Inline Editing', 'elementor-hello-world' );\n\t}", "function slb_register_custom_admin_titles() {\n\tadd_filter(\n\t\t'the_title',\n\t\t'slb_custom_admin_titles',\n\t\t99,\n\t\t2\n\t);\n}", "function ding_panels_node_body_content_type_admin_title($subtype, $conf, $context) {\n return t('“@s”: Node body', array('@s' => $context->identifier));\n}", "function revcon_change_post_label() {\n global $menu;\n global $submenu;\n $menu[5][0] = 'Artists';\n $submenu['edit.php'][5][0] = 'Artists';\n $submenu['edit.php'][10][0] = 'Add Artist';\n $submenu['edit.php'][16][0] = 'Artist Tags';\n}", "function rkv_change_post_text( $title ) {\n $screen = get_current_screen();\n\n if ( 'tutorials' == $screen->post_type ) :\n $title = 'Tutorial Name';\n endif;\n\n return $title;\n}", "function sl_new_wp_title() {\n$new_title= __('Dashboard of ', 'sl_dashtweaks') . get_option('blogname');\nreturn $new_title;\n}", "function getMenuSubTitle();", "function revcon_change_post_label() {\n global $menu;\n global $submenu;\n $menu[5][0] = 'Videos';\n $submenu['edit.php'][5][0] = 'All Videos';\n $submenu['edit.php'][10][0] = 'Add Video';\n $submenu['edit.php'][16][0] = 'Video Tags';\n echo '';\n}", "function edit_post_change_title() {\r\n\r\n global $post;\r\n\r\n if( $post->post_type == 'products' ) {\r\n\r\n add_filter( 'the_title', 'products_title', 10, 2 );\r\n\r\n }\r\n\r\n}", "function aeris_team_manager_title_updater( $post_id ) {\n\n $my_post = array();\n $my_post['ID'] = $post_id;\n\n if ( get_post_type() == 'aeris-member' ) {\n $my_post['post_title'] = get_field('lastname').\" \".get_field('firstname');\n $my_post['post_name'] = get_field('lastname');\n } \n\n // Update the post into the database\n wp_update_post( $my_post );\n\n }", "function ding_event_similar_events_content_type_admin_title($subtype, $conf, $context) {\n return t('\"@s\" similar events', array('@s' => $context->identifier));\n}", "public function get_title() {\n\t\treturn __( 'Elhelper Post Mansory', 'elhelper' );\n\t}", "function change_admin_post_label() {\n\tglobal $menu;\n\tglobal $submenu;\n\t$menu[5][0] = 'Recipes';\n\t$submenu['edit.php'][5][0] = 'Recipes';\n\t$submenu['edit.php'][10][0] = 'Add Recipe';\n\t$submenu['edit.php'][16][0] = 'Tags';\n\techo '';\n}", "function editTitle($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$title = $this->modify(mysqli_real_escape_string($conn, $data['title']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($title)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-zA-Z]+(||_|-|,|:|0-9|\\.| |\\*)?[a-zA-Z0-9,\\.:-_* ]*$/\", $title)) {\n\t\t\t\t\tif($this->length($title, 50, 10)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_title', $title, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function setsubtitleAction() {\n\t\t$story_id \t\t= $this->getRequest()->getParam(\"story\");\n\t\t\n\t\t// TODO We should also filter and strip tags here\n\t\t$title\t \t\t= substr($this->getRequest()->getParam(\"value\"),0, 50); \n\t\t\n\t\t//Verify if the requested story exist\n\t\t$stories\t\t= new Stories();\n\t\tif (!($story\t= $stories->getStory($story_id))) {\n\t\t\treturn $this->_helper->json->sendJson(false);\n\t\t}\n\n\t\t// Check if we are the owner\n\t\tif ($this->_application->user->id != $story->user_id) {\n\t\t\treturn $this->_helper->json->sendJson(false);\n\t\t}\n\t\t\n\t\t// Ok, we can set the title\n\t\t$stories->setSubTitle($story_id, $title);\n\t\t\n\t\t// Die with the string\n\t\tif (!$title) $title = '[Edit Subtitle]';\n\t\tdie($title);\n\t}", "function custom_sub_menu_function() \n {\n add_theme_page('sub Title name', 'sub Menu name', 'manage_options', 'sub-menu-slug', 'sub_menu_panel');\n }", "public static function pf_subpagetitle( &$parser /* , $title = null */ ) {\n\t\t$t = self::newTitleObject( $parser, func_get_args() );\n\t\tif ( $t === null ) {\n\t\t\treturn ''; // invalid title given\n\t\t}\n\t\treturn wfEscapeWikiText( SubpageInfo::getSubpageTitle( $t ) );\n\t}", "function greater_jackson_habitat_subtitle_metabox_content() {\n\t\n\tgreater_jackson_habitat_do_field_text( array(\n\t\t'name' => 'gjh_subtitle',\n\t\t'group' => 'gjh_subtitle',\n\t\t'input_atts' => array(\n\t\t\t'style' => 'width: 100%',\n\t\t),\n\t) );\n\t\n\tgreater_jackson_habitat_init_field_group( 'gjh_subtitle' );\n\t\n}", "function get_admin_page_title()\n {\n }", "function cs_get_subheader_title(){\n\tglobal $post;\n\t$show_title=true;\n \t?>\n <div class=\"subtitle float-left bgcolr\">\n\t\t<?php \n\t\t\tif (is_page() || is_single()) {\n\t\t\t\tif (is_page() ){\n\t\t\t\t\t$cs_xmlObject = cs_meta_page('cs_page_builder');\n\t\t\t\t \tif (isset($cs_xmlObject) and $cs_xmlObject <> '') {\n\t\t\t\t\t\tif ($cs_xmlObject->page_title == \"No\") {\n\t\t\t\t\t\t\t$show_title = false;\n\t\t\t\t\t \t}\n \t\t\t\t \t}\n }\n \t\t\t\tif(isset($show_title) && $show_title==true){\n\t\t\t\t\techo '<h1 class=\"page-title\">' . substr(get_the_title(), 0, 40) . '</h1>';\n\t\t\t\t}\n\t\t } else { ?>\n <h1 class=\"page-title\"><?php cs_post_page_title(); ?></h1>\n\t\t <?php }?> \n </div>\n <?php\n}", "function upm_replace_howdy( $wp_admin_bar ) {\r\n $my_account=$wp_admin_bar->get_node('my-account');\r\n $new_title = str_replace( 'Howdy,', 'Welcome,', $my_account->title );\r\n $wp_admin_bar->add_node( array(\r\n 'id' => 'my-account',\r\n 'title' => $new_title,\r\n ) );\r\n}", "function my_module_plugin_admin_info($subtype, $conf, $context) {\n // Set the title that shows on the admin Content page to the overridden title.\n $block = new stdClass();\n $title_text = \"My Special Page Section\";\n\n if (!empty($title_text)) {\n $admin_title = $title_text;\n }\n else {\n $admin_title = 'No Title';\n }\n $block->title = $conf['override_title_text'] ? $conf['override_title_text'] : $admin_title;\n return $block;\n}", "function my_post_title_updater( $post_id ) {\n $my_post = array();\n $my_post['ID'] = $post_id;\n\t$slug = get_the_title($post_id);\n\t\n\tif ( get_post_type() == 'message' ) {\n\t\t$campus = get_field('campus');\n\t\t$campus = get_term( $campus, 'campuses' );\n\t \n\t\tif($campus->slug == 'costa-mesa') {\n\t\t\t$my_post['post_name'] = $slug;\n\t\t} else {\n\t\t\t$my_post['post_name'] = $slug . '_' . $campus->slug;\n\t\t}\n }\n // Update the post into the database\n wp_update_post( $my_post );\n }", "protected function page_title() {\n?>\n\t\t<h2>\n\t\t\t<?php echo __( 'Marketplace Add-ons', APP_TD ); ?>\n\t\t\t<a href=\"https://marketplace.appthemes.com/\" class=\"add-new-h2\"><?php _e( 'Browse Marketplace', APP_TD ); ?></a>\n\t\t\t<a href=\"https://www.appthemes.com/themes/\" class=\"add-new-h2\"><?php _e( 'Browse Themes', APP_TD ); ?></a>\n\t\t</h2>\n<?php\n\t}", "function bethel_add_menu_subtitles ($string) {\n\tif (substr($string, 3, 7) == 'title=\"') {\n\t\t$title = substr($string, 10, strpos($string, '\"', 11)-10);\n\t\t$string = substr($string,0,-4).\"<br/><span class=\\\"subtitle\\\">{$title}</span></a>\";\n\t}\n\treturn $string;\n}", "function append_title($title){\r\n\t\t$this->_title .= \" - {$title}\";\r\n\t}", "function wpfc_modify_podcast_title ($title) {\n\t$settings = get_option('wpfc_options'); \n\t$podcast_title = esc_html( $settings['title'] );\n\tif ($podcast_title != '')\n\t\t\t$title = $podcast_title;\n\treturn $title;\n}", "function customPageTitle($string) {\n return sprintf(__('Add language &raquo; %s'), $string);\n}", "public function post_title( $key ) {\n\t\t$this->data['post_title'] = $key;\n\t}", "private function getATOMSubtitle() {\r\n $subtitle = '';\r\n if (isset($this->description['properties']['totalResults']) && $this->description['properties']['totalResults'] !== -1) {\r\n $subtitle = $this->context->dictionary->translate($this->description['properties']['totalResults'] === 1 ? '_oneResult' : '_multipleResult', $this->description['properties']['totalResults']);\r\n }\r\n $previous = isset($this->description['properties']['links']['previous']) ? '<a href=\"' . RestoUtil::updateUrlFormat($this->description['properties']['links']['previous'], 'atom') . '\">' . $this->context->dictionary->translate('_previousPage') . '</a>&nbsp;' : '';\r\n $next = isset($this->description['properties']['links']['next']) ? '&nbsp;<a href=\"' . RestoUtil::updateUrlFormat($this->description['properties']['links']['next'], 'atom') . '\">' . $this->context->dictionary->translate('_nextPage') . '</a>' : '';\r\n $subtitle .= isset($this->description['properties']['startIndex']) ? '&nbsp;|&nbsp;' . $previous . $this->context->dictionary->translate('_pagination', $this->description['properties']['startIndex'], $this->description['properties']['startIndex'] + 1) . $next : '';\r\n return $subtitle;\r\n }", "function post_enter_title_here($placeholder, $post){\n return $this->label;\n }", "function set_the_title($title) {\n\n md_set_the_title($title);\n \n }", "public function action_edit_form_after_title() {\n\n if ( 'pedestal_story' == get_current_screen()->post_type ) {\n $this->pedestal_headline_context->render_meta_box( get_post( get_the_ID() ) );\n }\n\n }", "public function title() { return $this->post->post_title; }", "function revcon_change_post_label() {\n global $menu;\n global $submenu;\n $menu[5][0] = 'Aktualności';\n // $submenu['edit.php'][5][0] = 'Blog';\n // $submenu['edit.php'][10][0] = 'Add News';\n // $submenu['edit.php'][16][0] = 'News Tags';\n}", "function opanda_change_menu_title( $title ) {\r\n if ( !BizPanda::isSinglePlugin() ) return $title;\r\n return __('Opt-In Panda', 'opanda');\r\n}", "function the_embed_site_title()\n {\n }", "public function loadPageTitle()\n \t\t{\n echo \"<title>Add Item</title>\";\n }", "public function admin_title( $admin_title, $title ) {\n\t\t\n\t\tglobal $current_screen;\n\t\t\n\t\tif ( $current_screen->base == 'settings_page_schedule-a-visit-to-sherpa' ) {\n\t\t\treturn __( 'Schedule a Visit Leads to Sherpa', 'learndash-slack' ) . $admin_title;\n\t\t}\n\t\t\n\t\treturn $admin_title;\n\t\t\n\t}", "function thinkup_input_blogtitle() {\n\n\techo\t'<h2 class=\"blog-title\">',\n\t\t\t'<a href=\"' . esc_url( get_permalink() ) . '\" title=\"' . esc_attr( sprintf( __( 'Permalink to %s', 'ESTSB' ), the_title_attribute( 'echo=0' ) ) ) . '\">' . get_the_title() . '</a>',\n\t\t\t'</h2>';\n}", "public function render_checkout_step_one_sub_title() {\n\t\t\treturn astra_get_option( 'two-step-checkout-modern-step-1-sub-text' );\n\t\t}", "function wpvideocoach_custom_title()\r\n{\r\n\tglobal $wpvideocoach_custom_title;\r\n\tif(empty($wpvideocoach_custom_title)){\r\n\t\t$wpvideocoach_custom_title = __('WordPress Video Coach', 'wp-video-coach');\r\n\t}\r\n\treturn $wpvideocoach_custom_title;\r\n}", "function tbx_title_placeholder_text ( $title ) {\n\tif ( get_post_type() == 'lesson' ) {\n\t\t$title = __( 'Lesson Name' );\n\t} else if ( get_post_type() == 'source' ) {\n $title = __( 'Resource Name' );\n\t};\n\treturn $title;\n}", "function set_subtitle($subtitle) \r\n\t{\r\n\t\t//$this->subtitle = $subtitle;\r\n\t\t$this->data['subtitle_for_layout'] = $subtitle;\r\n\t\t$this;\r\n\t}", "public function addTitle() {\n\t\tglobal $REQUEST_DATA;\n\n\t\treturn SystemDatabaseManager::getInstance()->runAutoInsert('employee_appraisal_title', \n array('appraisalTitle'), array(trim($REQUEST_DATA['titleName'])) \n );\n\t}", "function get_player_title ( $post_id ) {\n global $wpdb;\n if ( get_post_type( $post_id ) == 'joueur' ) {\n $lastname = mb_strtoupper(get_field('lastname', $post_id));\n $firstname = ucwords(mb_strtolower(get_field('firstname', $post_id)));\n $title = join(' ', [$lastname, $firstname]);\n $where = array( 'ID' => $post_id );\n $wpdb->update( $wpdb->posts, array( 'post_title' => $title ), $where );\n }\n}", "public function setTitle($val){ return $this->setField('title',$val); }", "function replace_howdy($wp_admin_bar) {\n $my_account=$wp_admin_bar->get_node('my-account');\n $newtitle = str_replace('Howdy,', '', $my_account->title );\n $wp_admin_bar->add_node(array(\n 'id' => 'my-account',\n 'title' => $newtitle,\n )\n );\n}", "public function get_title()\n {\n return __('[D.Korol] Blog Single Page Widget', 'elementor-header-bullet');\n }", "function my_module_hero_image_admin_info($subtype, $conf, $context) {\n // Set the title that shows on the admin Content page to the overridden title.\n $block = new stdClass();\n if (!empty($conf['title_text'])) {\n $conf_title = $conf['title_text'];\n }\n else {\n $conf_title = 'No Title';\n }\n $block->title = $conf['override_title_text'] ? $conf['override_title_text'] : $conf_title;\n return $block;\n}", "public function restoration_title($title) {\n\t\techo '<h2>'.$title.'</h2>';\n\t}", "function segments_update_archive_title( $title ) {\n if ( is_post_type_archive() ) {\n return post_type_archive_title( '', false );\n }\n\n return $title;\n}", "function get_title() \t{\n \t\treturn $this->title;\t\n \t}", "public function get_title() {\n return __( 'Video CTA', 'yx-super-cat' );\n }", "function change_title_text( $title ){\n $screen = get_current_screen();\n if ( 'projects' == $screen->post_type ) {\n $title = 'Enter project name here';\n }\n return $title;\n}", "public static function crearSubTitulo($subTitulo)\n\t {\t\n\t\techo '<tr bgcolor=\"#D6D6DD\">';\n echo\t'<td height=\"14\" colspan=\"6\" align=\"right\" class=\"contBold1\" ><div align=\"center\" class=\"ventana_tit\">'.$subTitulo.'</div></td>';\n echo '</tr>';\n\t\techo '<tr>';\n echo \t'<td height=\"14\" align=\"right\" class=\"contBold1\" ><div align=\"left\"></div></td>';\n echo\t'<td height=\"14\" colspan=\"6\" class=\"contBold1\" align=\"center\">&nbsp;</td>';\n echo '</tr>';\t\n\t\t \t\n\t }", "function get_subtitle() \t{\n \t\treturn $this->subtitle;\t\n \t}", "function product_single_title_update( $title = '', $args = array(), $escape = true ) {\n if( is_product() ) {\n $title = get_the_title();\n $sku = get_post_meta(get_the_ID(), '_sku', true);\n if( $sku === '' ) {\n return $title;\n } else {\n return '[' . $sku . '] ' . $title;\n }\n }\n}", "public function withSubpage(string $title = null)\n {\n if (empty($this->admin_page)) {\n return $this;\n }\n $admin_page = $this->admin_page[0];\n\n $sub_page = array(\n [\n 'parent_slug' => $admin_page[\"menu_slug\"],\n 'page_title' => $admin_page[\"page_title\"],\n 'menu_title' => ($title) ? $title : $admin_page[\"menu_title\"],\n 'capability' => $admin_page[\"capability\"],\n 'menu_slug' => $admin_page[\"menu_slug\"],\n 'callback' => $admin_page[\"callback\"]\n\n ],\n );\n $this->admin_subpages = $sub_page;\n return $this;\n }", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "function modify_group_titles_of_courses ( $title, $id ) {\n\n if ( get_post_type ( $id ) == 'sfwd-courses' && in_category( 'Full Time', $id ) ) {\n $title = 'Full Time: ' . $title;\n }\n\n return $title;\n}", "function maker_4ym_menu_posts_label() {\n global $menu;\n global $submenu;\n\n $menu[5][0] = 'Blog 4YM';\n $submenu['edit.php'][5][0] = 'Artículos del Blog';\n $submenu['edit.php'][10][0] = 'Agregar un Nuevo Artículo'; \n}", "public function appendTitle($title) {\n\t\tTemplate::appendSiteTitle($tile);\n\t}", "function tsk_title_placeholder_text ( $title ) {\n\t\tif ( get_post_type() == 'project' ) {\n\t\t\t$title = __( 'Project Name' );\n\t\t} else if ( get_post_type() == 'piece' ) {\n\t $title = __( 'Piece Name' );\n\t\t}\n\t\treturn $title;\n\t}", "public function _syncTitle() {}", "function hybrid_entry_title() {\n\t\n\techo apply_atomic_shortcode( 'entry_title', '[entry-title]' );\n}", "public function get_form_editor_field_title() {\n\t\treturn esc_attr__( 'Simple', 'simplefieldaddon' );\n\t}", "function udesign_page_title_after() {\r\n do_action('udesign_page_title_after');\r\n}", "function ajoute_le_titre()\n{\n if (!is_admin()) {\n add_theme_support(\"title-tag\");\n } \n}", "protected function setMetaTitle() {\r\n\t\t$partStg = trim($this->settings['news']['semantic']['general']['metaTitle']);\r\n\t\tif (is_int(strpos($partStg, '+'))) {\r\n\t\t\t$parts = t3lib_div::trimExplode('+', $partStg);\r\n\t\t\tforeach ($parts as $part) {\r\n\t\t\t\t$action = 'get' . ucfirst($part);\r\n\t\t\t\t$value = $this->newsItem->$action();\r\n\t\t\t\tif ($value !== '') {\r\n\t\t\t\t\t$data[] = $value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->metaTitle = implode(': ', $data);\r\n\t\t} elseif (is_int(strpos($partStg, '//'))) {\r\n\t\t\t$parts = t3lib_div::trimExplode('//', $partStg);\r\n\t\t\tforeach ($parts as $part) {\r\n\t\t\t\t$action = 'get' . ucfirst($part);\r\n\t\t\t\t$data = $this->newsItem->$action();\r\n\t\t\t\tif ($data !== '') {\r\n\t\t\t\t\t$this->metaTitle = $data;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$action = 'get' . ucfirst($partStg);\r\n\t\t\t$this->metaTitle = $this->newsItem->$action();\r\n\t\t}\r\n\t}", "function childtheme_override_blogtitle() { ?>\n\t\t\n\t\t<div id=\"blog-title\"><span><a href=\"<?php bloginfo('url') ?>/\" title=\"<?php bloginfo('name') ?>\" rel=\"home\"><span class=\"name\">Naomi Ture</span> <span class=\"portfolio\">Portfolio</span></a></span></div>\n\t\t\n<?php\n}", "public function add_theme_title_tag() {\n\t\t\tif (!is_admin()) {\n\t\t\t\t// auto gen <title>\n\t\t\t\tif (!current_theme_supports('title-tag')) {\n\t\t\t\t\tadd_theme_support( 'title-tag' );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function addtitlesuffix($title) {\n\t\tglobal $I2_USER, $I2_ROOT;\n\t\tif($I2_USER->objectClass == \"tjhsstStudent\") {\n $numabs = count(EighthSchedule::get_absences($I2_USER->uid));\n if($numabs > 0 && !$I2_USER->is_group_member(\"admin_all\")) {\n $suffix = \"<a style='\".($numabs>2?\"color: red\":\"\").\";float:right' href='{$I2_ROOT}eighth/vcp_schedule/absences/uid/{$I2_USER->uid}'>{$numabs} absence\".($numabs>1?'s':'').\"</a>\";\n } else $suffix = \"\";\n } else $suffix = \"\";\n\t\treturn $title . $suffix;\n\t}", "function glass_change_post_menu_label() {\n\tglobal $menu;\n\tglobal $submenu;\n\t$menu[5][0] = 'News';\n\t$submenu['edit.php'][5][0] = 'News';\n\t$submenu['edit.php'][10][0] = 'Add News';\n\t$submenu['edit.php'][16][0] = 'News Tags';\n\techo '';\n}", "public function setTitle($title){ $this->setSeoTitle($title)->setContentTitle($title); return $this; }", "public function set_pub_subtitle( $post_meta ){\n\t\t\n\t\t$subtitle = ( ! empty( $post_meta['_cwpp_subtitle'] ) )? $post_meta['_cwpp_subtitle'][0] : '';\n\t\t\n\t\t$this->pub_subtitle = $subtitle;\n\t\t\n\t}", "function single_post_title($prefix = '', $display = \\true)\n {\n }", "public function get_title() {\n\t\treturn __( 'Main Gallery', 'elementor-main-gallery' );\n\t}", "public function render_checkout_step_two_sub_title() {\n\t\t\treturn astra_get_option( 'two-step-checkout-modern-step-2-sub-text' );\n\t\t}", "public function title() { \n $title = $this->content()->get('title');\n if($title != '') {\n return $title;\n } else {\n $title->value = $this->uid();\n return $title;\n }\n }", "public function set_pub_title( $post ){\n\t\t\n\t\t$this->pub_title = $post->post_title;\n\t\t\n\t}", "public function title()\n {\n return __(\"I'd like to control\", 'idlikethis');\n }" ]
[ "0.70356274", "0.68737257", "0.687299", "0.6710484", "0.6686851", "0.6658795", "0.6658795", "0.663832", "0.6634327", "0.6602547", "0.6562135", "0.65276784", "0.6512621", "0.65029126", "0.6478026", "0.6423363", "0.641111", "0.6393536", "0.63674873", "0.6332532", "0.63076013", "0.6306785", "0.6285656", "0.62833685", "0.6276309", "0.62725145", "0.6271315", "0.6269479", "0.62638736", "0.62304664", "0.62153125", "0.6214982", "0.6193782", "0.618598", "0.61721206", "0.6162095", "0.6145555", "0.6134729", "0.6116649", "0.61046493", "0.6091356", "0.6045899", "0.60316885", "0.60310817", "0.6029885", "0.60267985", "0.6023976", "0.6017857", "0.60029644", "0.60003823", "0.5999971", "0.59991837", "0.59953845", "0.59873796", "0.5986546", "0.59784997", "0.5974262", "0.5966142", "0.595633", "0.5952447", "0.5938375", "0.59211797", "0.5919316", "0.5913708", "0.59051985", "0.59025985", "0.5900791", "0.58987355", "0.58943456", "0.5893898", "0.589384", "0.58836806", "0.58836806", "0.58836806", "0.58836806", "0.58836806", "0.58836806", "0.58836806", "0.5876394", "0.58746123", "0.5873549", "0.58624476", "0.58601695", "0.58568245", "0.58564067", "0.58557945", "0.58554924", "0.5852982", "0.5851998", "0.5851887", "0.5850868", "0.58507586", "0.5849968", "0.58484465", "0.5838532", "0.5832172", "0.5827635", "0.58265376", "0.58265364", "0.5826225" ]
0.7302767
0
show all the invalid properties with reasons.
public function listInvalidProperties() { $invalid_properties = array(); return $invalid_properties; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listInvalidProperties();", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n $allowed_values = [\"CREDIT_CARD\", \"CASH\", \"THIRD_PARTY_CARD\", \"NO_SALE\", \"SQUARE_WALLET\", \"SQUARE_GIFT_CARD\", \"UNKNOWN\", \"OTHER\"];\n if (!in_array($this->container['event_type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'event_type', must be one of #{allowed_values}.\";\n }\n\n $allowed_values = [\"OTHER_BRAND\", \"VISA\", \"MASTERCARD\", \"AMERICAN_EXPRESS\", \"DISCOVER\", \"DISCOVER_DINERS\", \"JCB\", \"CHINA_UNIONPAY\", \"SQUARE_GIFT_CARD\"];\n if (!in_array($this->container['card_brand'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'card_brand', must be one of #{allowed_values}.\";\n }\n\n $allowed_values = [\"MANUAL\", \"SCANNED\", \"SQUARE_CASH\", \"SQUARE_WALLET\", \"SWIPED\", \"WEB_FORM\", \"OTHER\"];\n if (!in_array($this->container['entry_method'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'entry_method', must be one of #{allowed_values}.\";\n }\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n $allowedValues = $this->getStyleIdentifierAllowableValues();\n if (!in_array($this->container['style_identifier'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'style_identifier', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTextEffectAllowableValues();\n if (!in_array($this->container['text_effect'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'text_effect', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getUnderlineAllowableValues();\n if (!in_array($this->container['underline'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'underline', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties() {\n\t\treturn array();\n\t}", "public function listInvalidProperties()\n {\n $invalid_properties = parent::listInvalidProperties();\n\n return $invalid_properties;\n }", "public function listInvalidProperties() {\n\n $invalidProperties = [];\n\n /*\n * Any needed validation goes here. If a property requires no validation\n * (e.g. it's OK for it to be empty) then it may be omitted.\n */\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getLevelAllowableValues();\n if (!is_null($this->container['level']) && !in_array($this->container['level'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'level', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'status', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n return [];\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n $allowed_values = $this->getBootOrderAllowableValues();\n if (!in_array($this->container['boot_order'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'boot_order', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getFirewallAllowableValues();\n if (!in_array($this->container['firewall'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'firewall', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getVideoModelAllowableValues();\n if (!in_array($this->container['video_model'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'video_model', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getVncAllowableValues();\n if (!in_array($this->container['vnc'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'vnc', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n $allowedValues = $this->getTypeAllowableValues();\r\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'type', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getStatusAllowableValues();\r\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'status', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n $allowedValues = $this->getTypeAllowableValues();\r\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'type', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getStatusAllowableValues();\r\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'status', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['overview'] === null) {\n $invalidProperties[] = \"'overview' can't be null\";\n }\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['legalName'] === null) {\n $invalidProperties[] = \"'legalName' can't be null\";\n }\n if ($this->container['registeredAddress'] === null) {\n $invalidProperties[] = \"'registeredAddress' can't be null\";\n }\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'type', must be one of '%s'\",\n $this->container['type'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getVatAbsenceReasonAllowableValues();\n if (!is_null($this->container['vatAbsenceReason']) && !in_array($this->container['vatAbsenceReason'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'vatAbsenceReason', must be one of '%s'\",\n $this->container['vatAbsenceReason'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['id'] === null) {\n $invalidProperties[] = \"'id' can't be null\";\n }\n if ($this->container['type'] === null) {\n $invalidProperties[] = \"'type' can't be null\";\n }\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getResultAllowableValues();\n if (!is_null($this->container['result']) && !in_array($this->container['result'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'result', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n if ($this->container['locale'] === null) {\n $invalidProperties[] = \"'locale' can't be null\";\n }\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getFieldAllowableValues();\n if (!is_null($this->container['field']) && !in_array($this->container['field'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'field', must be one of '%s'\",\n $this->container['field'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getOpAllowableValues();\n if (!is_null($this->container['op']) && !in_array($this->container['op'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'op', must be one of '%s'\",\n $this->container['op'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getCostTypeAllowableValues();\n if (!is_null($this->container['cost_type']) && !in_array($this->container['cost_type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'cost_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n if ($this->container['text'] === null) {\r\n $invalidProperties[] = \"'text' can't be null\";\r\n }\r\n if ($this->container['textOriginal'] === null) {\r\n $invalidProperties[] = \"'textOriginal' can't be null\";\r\n }\r\n if ($this->container['textNormalised'] === null) {\r\n $invalidProperties[] = \"'textNormalised' can't be null\";\r\n }\r\n if (!is_null($this->container['score']) && ($this->container['score'] > 1E+2)) {\r\n $invalidProperties[] = \"invalid value for 'score', must be smaller than or equal to 1E+2.\";\r\n }\r\n if (!is_null($this->container['score']) && ($this->container['score'] < 0)) {\r\n $invalidProperties[] = \"invalid value for 'score', must be bigger than or equal to 0.\";\r\n }\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n return $invalidProperties;\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n if ($this->container['use_async_pattern'] === null) {\n $invalid_properties[] = \"'use_async_pattern' can't be null\";\n }\n if ($this->container['source_file_name'] === null) {\n $invalid_properties[] = \"'source_file_name' can't be null\";\n }\n if ($this->container['source_file_content'] === null) {\n $invalid_properties[] = \"'source_file_content' can't be null\";\n }\n if ($this->container['copy_metadata'] === null) {\n $invalid_properties[] = \"'copy_metadata' can't be null\";\n }\n $allowed_values = [\"English\", \"Arabic\", \"Danish\", \"German\", \"Dutch\", \"Finnish\", \"French\", \"Hebrew\", \"Hungarian\", \"Italian\", \"Norwegian\", \"Portuguese\", \"Spanish\", \"Swedish\", \"Russian\"];\n if (!in_array($this->container['language'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'language', must be one of 'English', 'Arabic', 'Danish', 'German', 'Dutch', 'Finnish', 'French', 'Hebrew', 'Hungarian', 'Italian', 'Norwegian', 'Portuguese', 'Spanish', 'Swedish', 'Russian'.\";\n }\n\n $allowed_values = [\"Slow but accurate\", \"Faster and less accurate\", \"Fastest and least accurate\"];\n if (!in_array($this->container['performance'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'performance', must be one of 'Slow but accurate', 'Faster and less accurate', 'Fastest and least accurate'.\";\n }\n\n $allowed_values = [\"None\", \"Whitelist\", \"Blacklist\"];\n if (!in_array($this->container['characters_option'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'characters_option', must be one of 'None', 'Whitelist', 'Blacklist'.\";\n }\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n if ($this->container['name'] === null) {\n $invalid_properties[] = \"'name' can't be null\";\n }\n if ($this->container['type'] === null) {\n $invalid_properties[] = \"'type' can't be null\";\n }\n $allowed_values = array(\"text\", \"range\", \"category\");\n if (!in_array($this->container['type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'type', must be one of #{allowed_values}.\";\n }\n\n if ($this->container['sort_type'] === null) {\n $invalid_properties[] = \"'sort_type' can't be null\";\n }\n $allowed_values = array(\"alphabetical\", \"count\", \"value\", \"size\");\n if (!in_array($this->container['sort_type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'sort_type', must be one of #{allowed_values}.\";\n }\n\n if ($this->container['values'] === null) {\n $invalid_properties[] = \"'values' can't be null\";\n }\n return $invalid_properties;\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n if ($this->container['status'] === null) {\r\n $invalidProperties[] = \"'status' can't be null\";\r\n }\r\n $allowedValues = $this->getStatusAllowableValues();\r\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'status', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n if ($this->container['reason'] === null) {\r\n $invalidProperties[] = \"'reason' can't be null\";\r\n }\r\n if ($this->container['message'] === null) {\r\n $invalidProperties[] = \"'message' can't be null\";\r\n }\r\n if ($this->container['currentVersion'] === null) {\r\n $invalidProperties[] = \"'currentVersion' can't be null\";\r\n }\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n if ($this->container['name'] === null) {\n $invalid_properties[] = \"'name' can't be null\";\n }\n if ($this->container['has_thumbnail'] === null) {\n $invalid_properties[] = \"'has_thumbnail' can't be null\";\n }\n $allowed_values = [\"stl\", \"step\", \"iges\", \"obj\", \"svf2\",\"svf\", \"thumbnail\", \"ifc\"];\n if (!in_array($this->container['output_type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'output_type', must be one of 'stl', 'step', 'iges', 'obj', 'svf2','svf', 'thumbnail', 'ifc'.\";\n }\n\n if ($this->container['progress'] === null) {\n $invalid_properties[] = \"'progress' can't be null\";\n }\n if ($this->container['status'] === null) {\n $invalid_properties[] = \"'status' can't be null\";\n }\n $allowed_values = [\"pending\", \"inprogress\", \"success\", \"failed\", \"timeout\", \"partialsuccess\"];\n if (!in_array($this->container['status'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'status', must be one of 'pending', 'inprogress', 'success', 'failed', 'timeout', 'partialsuccess'.\";\n }\n\n if ($this->container['children'] === null) {\n $invalid_properties[] = \"'children' can't be null\";\n }\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['last_change'] === null) {\n $invalidProperties[] = \"'last_change' can't be null\";\n }\n $allowedValues = $this->getNetworkAllowableValues();\n if (!is_null($this->container['network']) && !in_array($this->container['network'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'network', must be one of '%s'\",\n $this->container['network'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n if ($this->container['status'] === null) {\n $invalidProperties[] = \"'status' can't be null\";\n }\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'status', must be one of '%s'\",\n $this->container['status'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'status', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'status', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getFilingFrequencyAllowableValues();\n if (!is_null($this->container['filing_frequency']) && !in_array($this->container['filing_frequency'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'filing_frequency', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getFilingTypeAllowableValues();\n if (!is_null($this->container['filing_type']) && !in_array($this->container['filing_type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'filing_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getAccrualTypeAllowableValues();\n if (!is_null($this->container['accrual_type']) && !in_array($this->container['accrual_type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'accrual_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getFraudResultTypeAllowableValues();\n if (!is_null($this->container['fraudResultType']) && !in_array($this->container['fraudResultType'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'fraudResultType', must be one of '%s'\",\n $this->container['fraudResultType'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getRecurringProcessingModelAllowableValues();\n if (!is_null($this->container['recurringProcessingModel']) && !in_array($this->container['recurringProcessingModel'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'recurringProcessingModel', must be one of '%s'\",\n $this->container['recurringProcessingModel'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n if (!is_null($this->container['athlete_count']) && ($this->container['athlete_count'] < 1)) {\n $invalidProperties[] = \"invalid value for 'athlete_count', must be bigger than or equal to 1.\";\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n $allowedValues = $this->getRelativeHorizontalPositionAllowableValues();\n if (!in_array($this->container['relative_horizontal_position'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'relative_horizontal_position', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getRelativeVerticalPositionAllowableValues();\n if (!in_array($this->container['relative_vertical_position'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'relative_vertical_position', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getWrapTypeAllowableValues();\n if (!in_array($this->container['wrap_type'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'wrap_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n return $invalidProperties;\n }" ]
[ "0.788498", "0.7703965", "0.7691127", "0.7683089", "0.7675031", "0.76657593", "0.7652722", "0.7652722", "0.76327837", "0.76316875", "0.76316875", "0.76316875", "0.76316875", "0.76316875", "0.76316875", "0.76251876", "0.76119787", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.7598507", "0.75777876", "0.75777876", "0.7564572", "0.7554151", "0.7554151", "0.7554151", "0.7554151", "0.7554151", "0.7554151", "0.75371164", "0.7533008", "0.7527955", "0.75178236", "0.751747", "0.7514795", "0.7514795", "0.7514795", "0.7514795", "0.7504821", "0.7504821", "0.7504821", "0.7504821", "0.7504821", "0.7504821", "0.7504821", "0.7504821", "0.7504821", "0.7504821", "0.7504821", "0.7504821", "0.7504821", "0.7504821", "0.7493807", "0.7490778", "0.74825484", "0.7481234", "0.7479027", "0.7476356", "0.7470106", "0.7454084", "0.74520063", "0.7449684", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754", "0.74489754" ]
0.7684766
5
validate all the properties in the model return true if all passed
public function valid() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate(){\n\t\t$valid = true;\n\t\t$ref = new ReflectionObject($this);\n\t\tforeach($ref->getProperties() as $prop){\n\t\t\tif(isset($this->_atributosMetadata[$prop->getName()])){\n\t\t\t\t$propMetadata = $this->_atributosMetadata[$prop->getName()];\n\t\t\t\tif($propMetadata->needValidate){\n\t\t\t\t\t$propMetadata->Validate($prop->getValue($this));\n\t\t\t\t\tif($propMetadata->isValid){\n\t\t\t\t\t\t$valid = $valid && $propMetadata->isValid; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $valid;\t\t\n\t}", "public function isValid(): bool\n {\n return count($this->filterProperties()) === 5;\n }", "function validate_rows() {\r\n $ok = True;\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (!$this->validate_field($colvar,$i)) { # make sure this field is not empty\r\n $ok = False;\r\n }\r\n }\r\n }\r\n return $ok;\r\n }", "public function validate(){\n $valid = true;\n foreach($this->fields as $field){\n if(!$field->validate()) $valid = false;\n }\n $this->setIsValid($valid);\n return $valid;\n }", "public function validate()\r\n {\r\n //clean out the errors in the errors array\r\n $this->errors = array(); //set it equal to a new empty array to clear the items in the array\r\n\r\n // need find a way to check each property\r\n // lets uses a naming convention that any function that begins with 'validate_'\r\n //will be executed in this method\r\n $methods = get_class_methods($this);\r\n $validationResults = array();\r\n foreach($methods as $func)\r\n {\r\n //see if the function begins with the text 'validate_'\r\n if(strpos($func,'validate_')===0)\r\n {\r\n //call the method with the name stored in the $func variable\r\n $validationResults[] = call_user_func([$this,$func]);\r\n }\r\n }\r\n //check to see if any of the property validation functions returned false\r\n return !in_array(false,$validationResults);\r\n\r\n }", "function is_valid() {\n $valid = True;\n foreach(get_object_vars($this) as $name => $obj) {\n if ($obj != NULL) {\n #validacion errores genericos de los campos\n $obj->required_validate();\n $flag = $obj->is_valid(); \n if (!$flag) \n { \n $valid = False;\n echo $obj->name.\" \";\n }\n #echo $obj->name;\n }\n }\n #busca metodos de validacion definido por usuario\n foreach(get_class_methods($this) as $fname) {\n $pos = strpos($fname, \"clean_\");\n if ($pos !== False) {\n $flag = $this->$fname();\n if (!$flag) \n { \n $valid = False;\n echo $fname.\" \";\n }\n }\n }\n echo $valid;\n return $valid;\n }", "private function validate() {\n $this->valid = (1 === count($this->marriages));\n }", "public function validate()\n {\n return $this->validateId()\n && $this->validateCreatedAt()\n && $this->validateOnBoardingPercentage()\n && $this->validateCountApplication()\n && $this->validateCountAcceptedApplications();\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\n {\n return 0 === count($this->listInvalidProperties());\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }" ]
[ "0.7714811", "0.7492581", "0.73749787", "0.72615504", "0.7256669", "0.72510725", "0.7190045", "0.71770793", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.7157919", "0.71252364", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293", "0.7124293" ]
0.0
-1
Returns true if offset exists. False otherwise.
public function offsetExists($offset) { return isset($this->container[$offset]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function offsetExists($offset): bool\n {\n return false;\n }", "public function hasOffset(){\n return $this->_has(1);\n }", "public function offsetExists($offset): bool;", "public function offsetExists($offset) {\n\t\t$result = false;\n\t\t\n\t\tif($this->_data[$offset]) {\n\t\t\t$result = true;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function offsetExists($offset)\n {\n return isset($this->data[$offset]) ? true : false;\n }", "public function offsetExists($offset)\n {\n return true;\n }", "public function offsetExists($offset): bool\n {\n return isset($this->contents[$offset]);\n }", "public function offsetExists($offset){\n\t\treturn $this->has($offset);\n\t}", "public function offsetExists($offset)\n {\n return !is_null($this->getAttribute($offset));\n }", "public function offsetExists($offset)\n {\n return !is_null($this->getAttribute($offset));\n }", "public function offsetExists($offset): bool\n {\n return isset($this->json()[$offset]);\n }", "public function offsetExists($offset) {\n\t\treturn $this->hasValueForKey($offset);\n\t}", "public function offsetExists($offset): bool\n {\n return $this->__isset($offset);\n }", "public function offsetExists($offset)\n {\n // init\n $length = $this->length();\n $offset = (int) $offset;\n\n if ($offset >= 0) {\n return ($length > $offset);\n }\n\n return ($length >= abs($offset));\n }", "public function offsetExists($offset): bool\n {\n return $this->getAttribute($offset) !== null;\n }", "public function offsetExists($offset): bool\n {\n return $this->has($offset);\n }", "public function exists($offset): bool\n {\n return $this->get($offset) !== null;\n }", "public function offsetExists($offset): bool\n {\n return isset($this->{$offset});\n }", "public function offsetExists($offset) {\n\t\treturn isset($this->data[$offset]);\n\t}", "public function offsetExists($offset) {\n\t\treturn isset($this->data[$offset]);\n\t}", "public function offsetExists($offset): bool\n {\n return isset($this->array[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return (bool) $this->get($offset);\n }", "public function offsetExists($offset)\n {\n return isset($this->$offset);\n }", "public function offsetExists($offset) : bool\n {\n return isset($this->attributes[$offset]);\n }", "public function offsetExists(mixed $offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists(mixed $offset): bool\n {\n return $this->has((string) $offset);\n }", "public function offsetExists($offset) {\n return $this->__isset($offset);\n }", "public function offsetExists($offset) {\n\t\treturn isset($this->tokens[$offset]);\n\t}", "public function offsetExists($offset) {\n $value = $this->{\"get$offset\"}();\n return $value !== null;\n }", "public function offsetExists($offset) {\n\t\treturn isset($this->pile[$offset]);\n\t}", "public function offsetExists($offset)\n {\n return ! is_null($this->getAttribute($offset));\n }", "public function offsetExists($offset) {\n return isset(current($this->_data)[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return array_key_exists($offset, $this->array);\n }", "public function offsetExists ($offset)\n {\n try\n {\n $this->get ($offset);\n }\n catch (InvalidArgumentException $exception)\n {\n return false;\n }\n catch (UnexpectedValueException $exception)\n {\n return false;\n }\n \n return true;\n }", "public function offsetExists($offset)\n {\n return $this->__isset($offset);\n }", "public function offsetExists($offset)\n {\n return $this->__isset($offset);\n }", "public function offsetExists($offset)\n {\n return $this->__isset($offset);\n }", "public function offsetExists($offset) {\n\t\tsettype($offset, 'integer');\n\n\t\tif ($offset >= 0 && $offset < $this->indexMax) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function has($offset) {\n return $this->offsetExists($offset);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->items()[$offset]);\n }", "public function offsetExists($offset):bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset)\n {\n return isset($this->$offset);\n\n }", "public function offsetExists($offset);", "public function offsetExists($offset);", "public function offsetExists($offset) : bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset) : bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset) : bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset) : bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset) : bool\n {\n return isset($this->container[$offset]);\n }" ]
[ "0.8555834", "0.8536144", "0.84876734", "0.8325894", "0.8322583", "0.8300258", "0.821515", "0.81559885", "0.8143132", "0.8143132", "0.81348807", "0.81315136", "0.8130816", "0.8128181", "0.8118165", "0.81153667", "0.81060076", "0.8103301", "0.80874085", "0.80874085", "0.8082012", "0.80752295", "0.8074589", "0.8064161", "0.80609185", "0.80597305", "0.8058638", "0.8055913", "0.80540025", "0.805388", "0.8049724", "0.80424815", "0.8039266", "0.803328", "0.803072", "0.803072", "0.803072", "0.80282956", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.80212057", "0.80201447", "0.801126", "0.80099213", "0.80095094", "0.80095094", "0.8007395", "0.8007395", "0.8007395", "0.8007395", "0.8007395" ]
0.0
-1
Sets value based on offset.
public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set($offset, $value);", "public function set($offset, $value = null);", "function setOffset($value) {\n $this->offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset,$value) {\n if (is_null($offset)) {\n current($this->_data)[] = $value;\n } else {\n current($this->_data)[$offset] = $value;\n }\n }", "public function offsetSet($offset, $value)\n {\n $this->getValue()[$offset] = $value;\n }", "public function offsetSet( $offset, $value ) {\n\t\t// ...\n\t}", "public function offsetSet($offset, $value);", "public function offsetSet($offset, $value);", "public function offsetSet($offset, $value){\n\t\t$this->set($offset, $value);\n\t}", "public function offsetSet($offset, $value) {}", "public function offsetSet($offset, $value) {}", "public function offsetSet($offset, $value) {}", "public function offsetSet($offset, $value) {}", "public function offsetSet(mixed $offset, mixed $value): void\n {\n if (Arr::accessible($this->value)) {\n $this->value[$offset] = $value;\n }\n }", "public function offsetSet($offset, $value) { }", "public function offsetSet($offset, $value)\r\n {\r\n $this->data[$offset] = $value;\r\n }", "public function offsetSet($offset, $value)\n\t{\n\t\t$this->{$offset} = $value;\n\t}", "public function offsetSet($offset, $value)\n {\n $this->_data[$offset] = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->_data[$offset] = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->data[$offset] = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->data[$offset] = $value;\n }", "public function offsetSet($offset, $value)\n {\n\n\n $this->__set($offset, $value);\n }", "public\t\tfunction\tsetValue($offset, $value)\n\t\t{\n\t\t\tif(array_key_exists($offset, $this->_values) && $this->_values[$offser] !== $value) {\n\t\t\t\t$this->_values[$offset]\t=\t$value;\n\t\t\t\t$this->_saved\t\t\t=\tfalse;\n\t\t\t}\n\t\t}", "public function offsetSet($offset,$value) {\n if ($offset == \"\") {\n\t $this->_data[] = $value;\n\t}else {\n\t $this->_data[$offset] = $value;\n\t}\n }", "public function setOffset($offset, $value, $container = 'default');", "public function offsetSet($offset, $value)\n {\n }", "public function offsetSet($offset, $value)\n {\n $this->setModel($value, $offset);\n }", "public function offsetSet($offset, $value) \n {\n }", "public function offsetSet($offset, $value) { \n if (is_null($offset)) {\n $this->insert($value);\n $this->incrementLength();\n } else {\n if (is_null($this->offsetGet($offset))) {\n $this->incrementLength();\n }\n\n $this->update($offset, $value); \n }\n }", "public function offsetSet($offset, $value)\n {\n if (!is_null($offset)) {\n $this->data[$offset] = $value;\n }\n }", "public function offsetSet ($offset, $value) {\n $this->__set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->setAttribute($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n }", "public function offsetSet($offset, $value) {\n $this->__set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->item[$offset] = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->setAttribute($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->setAttribute($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->setAttribute($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->elements[$offset] = $offset;\n }", "public function offsetSet($offset, $value)\n {\n if ($offset == null)\n {\n $this->data[] = $offset;\n }\n else\n {\n $this->data[$offset] = $value;\n }\n $this->size++;\n }", "public function offsetSet($offset, $value): void;", "final public function offsetSet($offset, $value)\n\t{\n\t\t$this->__set($offset, $value);\n\t}", "public function offsetSet($offset, $value)\n {\n $this->__set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->__set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->__set($offset, $value);\n }", "public function offsetSet($offset , $value) {\n $this->_items[$offset] = $value;\n }", "public function offsetSet($offset, $value)\n {\n $method = 'set' . str_replace(\" \", \"\", ucwords(strtr($offset, \"_-\", \" \")));\n if(method_exists($this, $method)){\n $this->$method($value);\n }\n }", "public function offsetSet($offset, $value)\n\t{\n\t\t// TODO: Implement offsetSet() method.\n\t}", "public function offsetSet($offset, $value)\n {\n if (is_null($offset)) {\n $this->data[] = $value;\n } else {\n $this->data[$offset] = $value;\n }\n }", "public function offsetSet($offset, $value)\n {\n if (is_null($offset)) {\n $this->data[] = $value;\n } else {\n $this->data[$offset] = $value;\n }\n }", "public function offsetSet($offset, $value)\n {\n $this->set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->set($offset, $value);\n }", "public function offsetSet($offset,$value)\n\t{\n\t\t$this->store()->offsetSet($offset,$value);\n\t}", "public function offsetSet($offset, $value): void\n {\n $this->update($offset, $value);\n }", "public function offsetSet($offset, $value): void\n {\n }", "public function offsetSet($offset, $value)\n {\n if ($offset === null) {\n $this->data[] = $value;\n } else {\n $this->data[$offset] = $value;\n }\n }", "public function set($offset, $value): void\n {\n $this->store->set($offset, $value);\n }", "public function offsetSet($offset, $value)\n\t\t{\n\t\t\tif(is_null($offset))\n\t\t\t\t$this->source[] = $value;\n\t\t\telse\n\t\t\t\t$this->source[$offset] = $value;\n\t\t}", "public function offsetSet(mixed $offset, mixed $value)\n {\n $this->set((string) $offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n\n // add the data depending an offset has been passed or not\n if (is_null($offset)) {\n $offset = apc_inc($this->serial);\n }\n\n // store the data back to the property\n $this->__set($offset, $value);\n }", "public function offsetSet($offset, $value) {\n\t\tif(!array_key_exists($offset, $this->_data)) {\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('The specified column \"' . $offset . '\" is not a part of this record, the value was not assigned.');\n\t\t}\n\t\t\n\t\t$this->_data[$offset] = $value;\n\t}", "public function offsetSet($offset, $value)\n {\n parent::offsetSet($offset, $value);\n $this->performHook('modified');\n }", "public function offsetSet($offset, $value): void\n {\n $items = &$this->items();\n $items[$offset] = $value;\n }", "public /*void*/ function offsetSet(/*scalar*/ $offset, /*mixed*/ $value)\n\t{\n\t\tif($offset === null) {\n\t\t\t$this->_data[] = $value;\n\t\t} else {\n\t\t\t$this->_data[$offset] = $value;\n\t\t}\n\t}", "function offsetSet($offset, $value) {\n $property = defined('static::$DOMAIN_PROPERTY') ? static::$DOMAIN_PROPERTY : 'data';\n if(!isset($this->{$property})) {\n $this->{$property} = [];\n }\n \n if (is_null($offset)) {\n $offset = 0;\n if (!empty($this->{$property})) {\n $keys = \\preg_grep( '#^(0|([1-9][0-9]*))$#', \\array_keys($this->{$property}));\n if (!empty($keys)) {\n $offset = \\max($keys) + 1;\n }\n }\n }\n\n $this->{$property}[$offset] = $value;\n }", "public function offsetSet($offset, $value)\r\n {\r\n if ( ! isset($offset)) {\r\n $this->add($value);\r\n } else {\r\n $this->set($offset, $value);\r\n }\r\n }" ]
[ "0.8670502", "0.84270954", "0.821386", "0.8191476", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.81676894", "0.8118936", "0.8105677", "0.80739844", "0.80739844", "0.8055169", "0.8049614", "0.8049066", "0.8049066", "0.8049066", "0.8047941", "0.80345124", "0.8014046", "0.8012902", "0.80005074", "0.80005074", "0.79962283", "0.79962283", "0.7993535", "0.7988586", "0.79849035", "0.79569495", "0.79568005", "0.7947382", "0.7944527", "0.79422164", "0.7940082", "0.79384965", "0.7937125", "0.7935071", "0.7918337", "0.7916076", "0.7908293", "0.7908293", "0.7908293", "0.79033184", "0.78849", "0.787758", "0.7874427", "0.78388196", "0.78388196", "0.78388196", "0.78323215", "0.78242445", "0.78159875", "0.78142", "0.78142", "0.7813506", "0.7813506", "0.7813506", "0.7813506", "0.7813506", "0.7813506", "0.78095996", "0.7808172", "0.78012717", "0.779916", "0.77978307", "0.7793151", "0.7784688", "0.7784433", "0.7757673", "0.77549654", "0.77270854", "0.7702829", "0.7696581", "0.7691455" ]
0.0
-1
Gets the string presentation of the object
public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Ubo\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); } return json_encode(\Ubo\Client\ObjectSerializer::sanitizeForSerialization($this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __toString() {\r\n\t\treturn $this->getPrint();\r\n\t}", "public function __toString() {\r\n\t\treturn $this->getPrint();\r\n\t}", "public function __toString() {\n\t\treturn $this->getPrint();\n\t}", "public function visualize()\n {\n \n return new StringWrapper('object('.$this->name().')');\n \n }", "public function __toString()\n {\n $result = $this->show();\n return $result ? $result : '';\n }", "public function getToString()\n {\n return $this->toString();\n }", "public function to_string() { return $this->__toString(); }", "public function __toString()\n {\n return $this->formatAsString();\n }", "public function toString()\n {\n $data = $this->origin->data();\n $out = '';\n if (is_scalar($data) || is_null($data)) {\n $out = (string) $data;\n } elseif (is_object($data) && method_exists($data, '__toString')) {\n $out = (string) $data;\n }\n return $out;\n }", "function asString () {\n \t\treturn $this->printableString();\n \t}", "public function __toString()\n {\n return $this->format();\n }", "public function __toString()\n {\n return $this->format();\n }", "public function __toString()\n {\n return $this->format();\n }", "public function __toString()\n {\n return sprintf('%s -> %s', $this->getLugar(), $this->getMotivo());\n }", "public function toString()\n {\n return $this->__toString();\n }", "public function __toString()\r\n {\r\n return $this->getFormattedString();\r\n }", "public function __toString() {\n\t\t\treturn Core\\Convert::toString($this->render());\n\t\t}", "public function __toString() { return $this->as_string(); }", "public function __toString()\n {\n try {\n return $this->toString();\n } catch (\\Exception $e) {\n return '';\n }\n }", "public function toString()\n {\n return $this->cast('string');\n }", "public function __toString()\n\t{\n\t\treturn $this->get();\n\t}", "public function __toString() {\r\n return $this->toString();\r\n }", "public function __toString()\n {\n return $this->toFormattedString();\n }", "public function __toString()\n {\n return $this->make()->toString();\n }", "public function __toString(): string\n {\n return (string) $this->format();\n }", "public function __toString() {\n\t\treturn get_class($this) . '-object ' . \"\\n\";\n\t}", "public function __toString()\n {\n return $this->assemble();\n }", "public function toString()\n {\n $data = $this->getProperties();\n $out = get_class($this).' ('.CRLF;\n foreach ($data as $key => $value) {\n $type = gettype($value);\n $value = is_bool($value) ? (int) $value : $value;\n $value = is_string($value) ? '\"'.$value.'\"' : $value;\n $value = is_object($value) ? implode(CRLF.TAB, explode(CRLF, (string) $value)) : $value;\n $value = is_array($value) ? print_r($value, true) : $value;\n $out .= TAB.$key.' ('.$type.')';\n $out .= ': '.$value.CRLF;\n }\n\n return $out.');';\n }", "public function __toString() {\n return $this->toString();\n }", "public function __toString() {\n return $this->toString();\n }", "function __toString() \n {\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) {\n if ($obj != NULL) {\n $obj->name = $name; #nombre de la variable que hace de nombre de objecto\n $str .= $obj->label();\n $str .= $obj;\n $str .= \"<br />\\n\";\n }\n }\n return $str;\n }", "public function __toString() {\n return $this->assemble();\n }", "public function __toString() {\n\t\treturn $this->toString();\n\t}", "public function __toString() {\n\t\treturn $this->toString();\n\t}", "public function __toString() {\n return $this->as_string();\n }", "function __toString() {\n return $this->string();\n }", "public function __toString () {\r\n\t\treturn '';\r\n\t}", "public function __tostring() {\r\n return (string) $this->object->getId();\r\n }", "public function __toString() {\n \n return $this->toString();\n }", "public function __toString()\n {\n return (string) $this->getContents();\n }", "public function __toString()\n {\n \treturn $this->get();\n }", "public function __tostring();", "public function __toString()\n {\n return $this->adaptor->render();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function toString() {\n return $this->getClassName().'<'.$this->name.'>';\n }", "public function __toString()\n {\n return (string) $this->exportTo(SekolahPaudPeer::DEFAULT_STRING_FORMAT);\n }", "public function __toString(){\n\t\t$ref = new ReflectionObject($this);\n\t\t$r = \"[\".$ref->getName().\"]\\n\";\n\t\tforeach($ref->getProperties() as $prop){\n\t\t\t$r .= \"\\t - \".$prop->getName().\"=\".$prop->getValue().\"\\n\";\n\t\t}\n\t\treturn $r;\n\t}", "public function toString()\n {\n return json_encode($this->obj);\n }", "public function __toString()\n {\n return $this->_;\n }", "public function __toString()\n {\n return $this->_;\n }", "public function __toString()\n {\n return $this->_;\n }", "public function __toString()\n {\n return (string) $this->exportTo(SanitasiPeer::DEFAULT_STRING_FORMAT);\n }", "public function __toString() {\n return $this->toString();\n }", "public function __tostring()\n {\n return get_class($this) . '#' . $this->get_id() . ' (' . $this->get_title() . ')';\n }", "public function __toString()\n {\n return $this->_render();\n }", "public function __toString() : string {\n return $this->box . ' ' . $this->created->format('c');\n }", "public function __toString()\n {\n return (string) $this->exportTo(JadwalPeer::DEFAULT_STRING_FORMAT);\n }", "public function __toString(): string\n {\n return $this -> text;\n }", "public function __toString() {\n\t\t\treturn $this->name();\n\t\t}", "public function __toString()\n\t{\n\t\treturn '';\n\t}", "public function __toString()\n {\n notice('Object: \"'.get_class($this).'\" is used as string');\n\n return 'Object('.get_class($this).')';\n }", "public function __toString(){\n return $this->convert();\n }", "public function __toString()\n {\n return $this->toNative();\n }", "public function __toString()\n\t{\n\t\treturn $this->_toString();\n\t}", "public function __toString() {\n\t\treturn $this->debug();\n\t}", "public function toString() {\n $s= $this->getClassName().'@('.$this->hashCode().\"){\\n\";\n $s.= ' [ name ] '.$this->name.\"\\n\";\n $s.= ' [ value ] '.$this->value.\"\\n\";\n $s.= ' [ mustUnderstand ] '.xp::stringOf($this->mustUnderstand).\"\\n\";\n $s.= ' [ encodingStyle ] '.$this->encodingStyle.\"\\n\";\n $s.= ' [ actor ] '.$this->actor.\"\\n\";\n return $s.'}';\n }", "public function __toString()\n {\n return $this->reference ?? '';\n }", "public function __toString()\n {\n return $this->render(true);\n }", "public function __toString() : string\n {\n return $this->toString();\n }", "public function __toString() {\n\t\treturn $this->name->getFullyQualifiedName();\n//\t\t$s = $this->name->getFullyQualifiedName();\n//\t\t$c = $this->extended;\n//\t\twhile($c !== NULL){\n//\t\t\t$s .= \"->\" . $c->name;\n//\t\t\t$c = $c->extended;\n//\t\t}\n//\t\treturn $s;\n\t}", "public function __toString() {\n\t\treturn $this->render();\n\t}", "public function __toString()\n {\n return $this->make()->render();\n }", "public function __toString()\n {\n return $this->output();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }" ]
[ "0.78991926", "0.78991926", "0.7865998", "0.78267187", "0.7798071", "0.77831763", "0.77773", "0.77699673", "0.77430934", "0.7738672", "0.77338606", "0.77338606", "0.77338606", "0.76946604", "0.76782423", "0.76638633", "0.76593435", "0.76323766", "0.76227117", "0.7610615", "0.75772125", "0.75752896", "0.7574316", "0.75741076", "0.7561986", "0.75474423", "0.753795", "0.7536732", "0.75350815", "0.75350815", "0.7530464", "0.7519796", "0.7515456", "0.7515456", "0.75024366", "0.7501487", "0.74975276", "0.74940675", "0.748856", "0.7480022", "0.74733543", "0.7462552", "0.7459644", "0.74573076", "0.74573076", "0.74573076", "0.74573076", "0.74573076", "0.74573076", "0.74573076", "0.74573076", "0.74573076", "0.74573076", "0.74573076", "0.74573076", "0.74573076", "0.74573076", "0.74573076", "0.74567866", "0.745588", "0.7453805", "0.7453753", "0.7449804", "0.7449804", "0.7449804", "0.744585", "0.7443246", "0.74430716", "0.7430875", "0.74221826", "0.741488", "0.7413293", "0.7409747", "0.7401319", "0.7393285", "0.7387001", "0.7386451", "0.73858726", "0.7385023", "0.738435", "0.73814106", "0.7380023", "0.7370644", "0.73674417", "0.73632735", "0.73621887", "0.7358468", "0.7357771", "0.7357771", "0.7357771", "0.7357771", "0.7357771", "0.7357771", "0.7357771", "0.7357771", "0.7357771", "0.7357771", "0.7357771", "0.7357771", "0.7357771", "0.7357771" ]
0.0
-1
Register User Test. ./vendor/bin/phpunit
public function test_register() { $faker = Factory::create(); // User's data $user = [ 'email' => $faker->email, 'name' => $faker->name, 'password' => 'password', ]; // Send post request $response = $this->json('POST', route('api.register'), $user); // Assert it was successful $response->assertStatus(200)->json(['successfully register test user!']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testRegister()\n {\n $this->visit('/register')\n ->type('Test User', 'name')\n ->type('081233548738', 'phone')\n ->type('Tester', 'occupation')\n ->type('[email protected]', 'email')\n ->type(bcrypt('testing123'), 'password')\n ->press('Register')\n ->seeInDatabase('users', ['email' => '[email protected]']);\n }", "public function testUserRegister()\n {\n $response = $this->get('/register')\n ->assertStatus(200)\n ->assertSee('Register');\n }", "public function testRegisterUser()\n {\n $this->withoutExceptionHandling();\n $user = [\n 'email' => '[email protected]',\n 'password' => 'test1234',\n ];\n $response = $this->postJson('/api/register', $user);\n $response->assertStatus(201)->assertJsonFragment([\n 'email' => '[email protected]',\n ]);\n }", "public function testNewUserRegistration()\n\t{\n\t $this->visit('/register')\n\t ->type('Taylor', 'name')\n\t ->type('[email protected]', 'email')\n\t ->type('mytest', 'password')\n\t ->type('mytest', 'password_confirmation')\n\t ->press('Register');\n\t}", "public function testRegistrationUITest()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/add_user')\n ->assertSee('Username')\n ->assertSee('First Name')\n ->assertSee('Last Name')\n ->assertSee('Password')\n ->assertSee('Confirm Password')\n ->assertSee('Role')\n ->assertSee('Save');\n });\n }", "public function testRegisterUser()\n {\n\n $data = factory(User::class)->raw([\n 'password' => $this->faker->password,\n ]);\n\n $response = $this->postJson(\"$this->baseurl/signup\", $data);\n $response->assertStatus(201);\n $response->assertJsonStructure([\n \"data\" => [\n \"token\",\n \"user\",\n ],\n \"status\",\n \"message\",\n ]);\n }", "public function testRegister()\n {\n }", "public function test_user_can_register()\n {\n $this->withoutExceptionHandling();\n\n $user = [\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'password' => 'password',\n 'password_confirmation' => 'password',\n ];\n\n $response = $this->post('/api/register/', $user);\n\n $response->assertStatus(200);\n $response->assertStatus(Response::HTTP_OK);\n $this->assertDatabaseHas('users', ['email' => '[email protected]']);\n }", "public function testRegisterSucessful() {\n\t\t$data = $this->getUserData(\n\t\t\t$this->username,\n\t\t\t$this->first_name,\n\t\t\t$this->surname,\n\t\t\t$this->email\n\t\t);\n\t\t\n\t\t$response = $this->call('POST','v1/users', $data);\n\t\t$resp_data = $response->getData();\n\t\tvar_dump($resp_data);\n\t\t$this->assertResponseStatus(201);\n\t\t$this->assertEquals($resp_data->user->username, $this->username);\n\t\t$this->assertEquals($resp_data->user->first_name, $this->first_name);\n\t\t$this->assertEquals($resp_data->user->surname, $this->surname);\n\t\t$this->assertEquals($resp_data->user->email, $this->email);\n\t}", "public function testCanRegisterUsers()\n {\n $this->post('/api/v1/register', [\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'password' => 'johndoepass',\n 'password_confirmation' => 'johndoepass',\n ], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'user' => [\n 'name' => 'John Doe',\n 'email' => '[email protected]'\n ]\n ]);\n $this->assertDatabaseHas('users', [\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'activated' => false\n ]);\n $this->assertDatabaseHas('user_activations', [\n 'email' => '[email protected]'\n ]);\n }", "public function testLoginRegister(){\n $user = User::find(1);\n $this->be($user);\n\n $response =$this->get(route('administracion'));\n $response->assertStatus(200);\n }", "public function testSignUp()\n {\n //add new user\n $this->browse(function ($browser) {\n $browser->visit('user/signup')\n ->type('email', '[email protected]')\n ->type('phone', '0775635458')\n ->type('name', 'ABC')\n ->type('password', '1234')\n ->type('passwordConfirm', '1234')\n ->click('.signup')\n ->assertPathIs('/');\n\n });\n }", "public function testRegister()\n {\n// $user->register(20,5);\n//\n// $this->assertEquals(25, $user->register(20, 5));\n\n// $this->assertEqual();\n// $this->assertNull();\n// $this->assertTrue($this->setUp());\n// $this->assertNan();\n// $this->assertLessThanOrEqual();\n// $this->assertClassHasAttribute();\n// $this->assertContains();\n// $this->assertIsWritable();\n }", "public function test_new_user_can_register()\n {\n $this->RegisterRolesAndPermissions();\n// $this->withExceptionHandling();\n $response = $this->postJson(route('auth.register'), [\n 'name' => \"ehsan dastras\",\n 'email' => \"[email protected]\",\n 'password' => \"12345678\",\n ]);\n\n $response->assertStatus(Response::HTTP_CREATED);\n }", "public function testSignUp()\n {\n $rand = rand();\n $this->visit('/register')\n ->type('ruchi', 'name')\n ->type('ruchi' .$rand.'@in.com', 'email')\n ->type('qwerty', 'password')\n ->type('qwerty', 'password_confirmation')\n ->press('Register')\n ->seePageIs('/');\n }", "public function test_passed_registration()\n {\n\n $user = $this->user();\n\n $response = $this->post('api/v1/register', $user);\n $response->assertStatus(200);\n $response->assertJsonMissing([\n \"status\"=>'Failed'\n ]);\n\n }", "public function testRegister()\n {\n $this->visit('/')\n ->click('Login')\n ->type('[email protected]', 'email')\n ->type('password', 'password')\n ->press('Login')\n ->see('Dashboard');\n }", "public function testSignUp()\n {\n $user = factory(App\\User::class)->make();\n $response = $this->post('/users', [\n 'first_name' => $user->getAttributeValue('first_name'),\n 'last_name' => $user->getAttributeValue('last_name'),\n 'email' => $user->getAttributeValue('email'),\n 'password' => 'qwerty',\n 'password_confirmation' => 'qwerty',\n '_token' => csrf_token()\n ]);\n\n $this->seeJson([\n 'id' => Auth::id(),\n 'first_name' => $user->getAttributeValue('first_name'),\n 'last_name' => $user->getAttributeValue('last_name'),\n 'email' => $user->getAttributeValue('email'),\n 'created_at' => Auth::user()->created_at->format($this->date_format),\n 'updated_at' => Auth::user()->updated_at->format($this->date_format)\n ]);\n\n $user = Auth::user();\n $this->assertTrue($user->hasRole(config('entrust.default')));\n $this->assertResponseStatus(200);\n }", "public function testRegisterUsedUsername() {\n\t\t$data = $this->getUserData(\n\t\t\t$this->username,\t\t\t// Already registered\n\t\t\t$this->first_name,\n\t\t\t$this->surname,\n\t\t\t'[email protected]'\n\t\t);\n\t\t\n\t\t$response = $this->call('POST','v1/users', $data);\n\t\t$resp_data = $response->getData();\n\n\t\t$this->assertResponseStatus(400);\n\t\t$this->assertTrue($resp_data->error);\n\t\t$this->assertEquals(count($resp_data->messages), 1);\n\t}", "public function testUser()\n {\n $this->assertDatabaseHas('users', [\n 'email' => '[email protected]'\n ]);\n }", "public function testRegistration(): void { }", "public function test_user_created()\n {\n $this->wrongCredentials = false;\n $credentials = self::DEFAULT_CREDENTIALS;\n $user = $this->registerService->registerUser($credentials);\n $this->assertInstanceOf(User::class, $user);\n $this->assertEquals($credentials['email'], $user->email);\n $this->assertEquals($credentials['name'], $user->name);\n\n }", "public function testSuccessfulRegistration(){\n \t/*\n \t * Create a user for registration\n \t */\n \t$clearpass = str_random(10);\n \t$user = factory(App\\User::class)->make([\n \t\t\t'password' => bcrypt($clearpass)\n \t]);\n \t\n \t/*\n \t * Visit the Registration page and confirm a user can successfully create an account\n \t */\n \t$this->visit('/register')\n \t->see('E-Mail Address')\n \t->type($user->name, 'name')\n \t->type($user->email, 'email')\n \t->type($clearpass, 'password')\n \t->type($clearpass, 'password_confirmation')\n \t->press('Register') \t\n \t->see('You are logged in!');\n \t\n \t$this->assertFalse(App\\User::where('name', $user->name)->get()->isEmpty());\n }", "public function test()\n {\n $userData = factory(User::class)->make()->toArray();\n $userData['password'] = $userData['password_confirmation'] = 'qweqweqwe';\n\n /**\n * @see \\App\\Http\\Controllers\\RegisterController::signUp()\n */\n $response = $this->post('/auth/sign-up', $userData);\n\n $response->assertResponseStatus(201);\n\n $user = User::where('email', $userData['email'])->first();\n\n $this->assertNotEmpty($user);\n\n /**\n * @see \\App\\Http\\Controllers\\LoginController::signIn()\n */\n $response = $this->post('/auth/sign-in', [\n 'email' => $user->email,\n 'password' => $userData['password'],\n ]);\n\n $response->assertResponseOk();\n\n $response->seeHeader('Authorization');\n }", "public function test_user_can_register_via_password()\n {\n\n $this->artisan('passport:install');\n\n $temp_user = factory(User::class)->make();\n\n $request = [\n 'email' => $temp_user->email,\n 'name' => $temp_user->name,\n 'password' => 'password',\n 'password_confirmation' => 'password',\n ];\n\n $response = $this->postJson('/register', $request);\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n \"access_token\",\n \"token_type\",\n \"refresh_token\",\n \"expires_in\"\n ]);\n }", "public function testAddUser()\n\t{\n\t\t$response = $this->call('GET', 'user/register/company');\n\n\t\t$this->assertTrue($this->client->getResponse()->isOk());\n\t}", "public function testCreateUser()\n {\n $num = rand(10, 1000);\n $userData = [\n \"name\" => \"John Doe $num\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345\",\n \"org_id\" => 1\n ];\n $this->json('POST', 'api/user/create', $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "public function test_it_store_data_for_user()\n {\n $user = ['name'=>'mostafa','email'=>'123@frr','password'=>'5654'];\n $response = $this->post('/api/register',$user);\n $this->assertDatabaseHas('users',['name'=>'mostafa']);\n }", "private function register()\n {\n $this->browser->visit('/admin')->pause(1000)\n ->assertPathIs('/admin/register')\n ->type('first_name', $this->faker->firstName)\n ->type('last_name', $this->faker->lastName)\n ->type('email', $this->email)\n ->type('password', $this->password)\n ->type('password_confirmation', $this->password)\n ->press('Register')\n ->assertPathIs('/admin');\n }", "public function testRegisterSuccess()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"token\": \"QpwL5tke4Pnpja7X4\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->post('api/user/create-user', ['email' => '[email protected]', 'password' => 'password'], $this->headers)\n ->assertStatus(200)\n ->assertJson(['token' => 'QpwL5tke4Pnpja7X4']);\n\n }", "public function testAddUser()\n {\n }", "public function testUserCreation()\n {\n $testingMail = '[email protected]';\n $testingPass = '123123';\n\n $this->visit('/login')\n ->click('Sign Up')\n ->seePageIs('/signup');\n\n $this->type($testingMail, 'email');\n $this->type($testingPass, 'password');\n $this->type($testingPass, 'passwordConfirmation');\n\n $this->press('Sign up!');\n $this->see('Registration completed!');\n\n $user = User::where('email', $testingMail)->first();\n\n $this->assertNotNull($user, 'User not found');\n\n $user->delete();\n }", "public function testRegistration()\n {\n $this->module->enableRegistration = false;\n\n $this->specify(\"we have register if registration disabled\", function () {\n $user = new User([\n 'email' => '[email protected]',\n 'password' => 'password',\n 'name' => 'Tester',\n ]);\n expect(\"we can't register if registration disabled\", $user->register())->false();\n expect(\"we must see message about this\", $user->getErrors())->hasKey('registration');\n });\n\n $this->module->enableRegistration = true;\n $this->module->enableConfirmation = true;\n $this->module->registrationFields = [];\n $this->specify(\"we have register user by email\", function () {\n $user = new User([\n 'email' => '[email protected]',\n ]);\n expect(\"we can register user by email only\", $user->register())->true();\n expect(\"user must have register date\", $user->registered_at)->notEmpty();\n expect(\"user must have status STATUS_CONFIRM\", $user->status)->equals(User::STATUS_CONFIRM);\n expect(\"we can get user profile\", Profile::findOne(['user_id' => $user->id]))->notNull();\n\n $this->tester->seeEmailIsSent();\n $message = $this->tester->grabLastSentEmail();\n expect(\"we must view confirmation email\", $message->getTo())->hasKey($user->email);\n expect(\"we must view confirmation email\", $message->getSubject())->contains('confirm');\n\n //register() on existing user throw \\RuntimeException\n $user->register();\n }, ['throws' => new \\RuntimeException]);\n\n $this->specify(\"we have register user with same email\", function () {\n $user = new User([\n 'email' => '[email protected]',\n ]);\n expect(\"we can't create user with same email\", $user->register())->false();\n expect(\"we must see error message\", $user->getErrors())->hasKey('email');\n });\n\n $this->module->registrationFields = ['password'];\n $this->specify(\"we have register user by email with password\", function () {\n $pass = 'password';\n $user = new User([\n 'email' => '[email protected]',\n ]);\n expect(\"we can't register user without pass\", $user->register())->false();\n expect('we must see error in password', $user->getErrors())->hasKey('password');\n $user->password = $pass;\n expect(\"we can register user\", $user->register())->true();\n expect(\"`pass_hash` must match\", Yii::$app->security->validatePassword($pass, $user->pass_hash))->true();\n expect(\"we can get user profile\", Profile::findOne(['user_id' => $user->id]))->notNull();\n });\n\n $this->module->registrationFields = ['password', 'name'];\n $this->specify(\"we have register user with full data\", function () {\n $pass = 'password';\n $name = 'Tester';\n $user = new User([\n 'email' => '[email protected]',\n ]);\n expect(\"we can't register user without pass and name\", $user->register())->false();\n expect('we must see error in password', $user->getErrors())->hasKey('password');\n expect('we must see error in name', $user->getErrors())->hasKey('name');\n $user->password = $pass;\n $user->name = $name;\n expect(\"we can register user\", $user->register())->true();\n expect(\"`pass_hash` must match\", Yii::$app->security->validatePassword($pass, $user->pass_hash))->true();\n expect(\"we can get user profile\", Profile::findOne(['user_id' => $user->id]))->notNull();\n $user1 = User::findOne($user->id);\n expect(\"name must be set\", $user1->name)->equals($name);\n });\n\n $this->module->registrationFields = ['password', 'name', 'gender', 'birth'];\n $this->specify(\"we have register user with full data\", function () {\n $pass = 'password';\n $name = 'Tester';\n $gender = User::MALE;\n $birth = '2000-01-01';\n $user = new User([\n 'email' => '[email protected]',\n 'password' => $pass,\n 'name' => $name,\n ]);\n expect(\"we can register user without gender and birth\", $user->register())->true();\n\n $user = new User([\n 'email' => '[email protected]',\n 'password' => $pass,\n 'name' => $name,\n 'gender' => $gender,\n 'birth' => $birth,\n ]);\n expect(\"we can register user with full data\", $user->register())->true();\n $user1 = User::findOne($user->id);\n expect('we must see gender', $user1->gender)->equals($gender);\n expect('we must see birth', $user1->birth)->equals($birth);\n });\n\n $this->module->enableConfirmation = false;\n $this->module->registrationFields = [];\n $this->specify(\"we have register user without confirm email\", function () {\n $user = new User([\n 'email' => '[email protected]',\n ]);\n expect(\"we can register user\", $user->register())->true();\n expect(\"user must have status STATUS_ACTIVE\", $user->status)->equals(User::STATUS_ACTIVE);\n $this->tester->seeEmailIsSent();\n $message = $this->tester->grabLastSentEmail();\n expect(\"we must view registration email\", $message->getTo())->hasKey($user->email);\n expect(\"we must view registration email\", $message->getSubject())->contains('register');\n });\n }", "public function testAddUser()\n {\n\n }", "public function testRegisterStudent()\n {\n $this->browse(function (Browser $browser){\n $browser->visit('/register')\n ->click('.slider__container')\n ->type('firstname', env('DUSK_NEW_FIRSTNAME'))\n ->type('lastname', env('DUSK_NEW_LASTNAME'))\n ->type('email', env('DUSK_NEW_USER_STUDENT'))\n ->type('verificateEmail', env('DUSK_NEW_USER_STUDENT'))\n ->type('password', env('DUSK_NEW_PASSWORD'))\n ->press('.button')\n ->assertPathIs('/');\n });\n }", "public function testCreatingFirstUser()\n {\n $response = $this->postJson('users', [\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'password' => 'password'\n ]);\n\n $response->assertStatus(201);\n }", "public function testIndexCreateUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@create'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->type('first_name', 'cowell@123')\n ->type('last_name', 'cowell@123')\n ->select('id_role', '3')\n ->press('Create')\n ->assertSee('Xong rồi');\n });\n }", "public function testRegistrationIsSuccessfulWithValidInputs()\n {\n $this->output->writeln('Running testRegistrationIsSuccessfulWithValidInputs...');\n\n $this->browse(function ($browser) {\n $browser->visit('/register')\n ->type('name', 'John Smith')\n ->type('email', '[email protected]')\n ->type('password', 'secret')\n ->type('password_confirmation', 'secret')\n ->press('Register')\n ->assertPathIs('/home');\n });\n }", "private function addTestUser(): void\n {\n $this->terminus(sprintf('site:team:add %s %s', $this->getSiteName(), $this->getUserEmail()));\n }", "public function testSeeRegisterTest()\n {\n $response = $this->get('/register');\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function testCreateUser()\n {\n }", "public function testSuccess()\n {\n $this->userGhost();\n \n # Config for easy registration\n $module = Module_Register::instance();\n $module->saveConfigValue('signup_password_retype', false);\n $module->saveConfigValue('email_activation', false);\n $module->saveConfigValue('admin_activation', false);\n $module->saveConfigValue('activation_login', false);\n $module->saveConfigValue('force_tos', false);\n $method = Form::make();\n $parameters = [\n 'user_name' => 'Peter1',\n 'user_password' => '11111111',\n ];\n $response = MethodTest::make()->method($method)->parameters($parameters)->execute();\n assertEquals(200, $response->code, \"Check if registration works\");\n }", "function testEmailAsUsername() {\n\t\t$this->user->username = '';\n\t\t$this->user->email = 'testuser';\n\t\t$pkey = Cgn_User::registerUser($this->user);\n\t\t$this->assertEqual(FALSE, $pkey);\n\t}", "public function testRegisterCompany()\n {\n $this->browse(function (Browser $browser){\n $browser->visit('/register')\n ->type('name', env('DUSK_NEW_NAME'))\n ->type('email', env('DUSK_NEW_USER'))\n ->type('verificateEmail', env('DUSK_NEW_USER'))\n ->type('password', env('DUSK_NEW_PASSWORD'))\n ->press('.button')\n ->assertPathIs('/');\n });\n }", "public function testRegisterSmallUsername() {\n\t\t$data = $this->getUserData(\n\t\t\t't',\t\t\t\t\t\t// 1 char\n\t\t\t$this->first_name,\n\t\t\t$this->surname,\n\t\t\t'[email protected]'\n\t\t);\n\t\t\n\t\t$response = $this->call('POST','v1/users', $data);\n\t\t$resp_data = $response->getData();\n\t\t\n\t\t$this->assertResponseStatus(400);\n\t\t$this->assertTrue($resp_data->error);\n\t\t$this->assertEquals(count($resp_data->messages), 1);\n\t}", "public function testCreateUser()\n {\n $this->visit('/Users/create')\n\t ->type('1', 'role_id')\n\t ->type('Daniel', 'firstname')\n\t ->type('Becerra', 'lastname')\n\t ->type('[email protected]', 'email')\n\t ->type('danielbecerrao', 'user')\n\t ->type('12345678', 'password')\n\t ->type('12345678', 'register')\n\t ->press('Crear')\n\t ->seePageIs('/Users');\n\n }", "public function testTokenRegistration()\n {\n\n User::where('email', '[email protected]')->delete();\n\n $response = $this->post('/api/register', ['email' => '[email protected]', 'name' => 'test', 'password' => '123456', 'is_admin' => 0]);\n\n $this->assertEquals(200, $response->status());\n\n User::where('email', '[email protected]')->delete();\n\n $response = $this->post('/api/register', ['email' => '[email protected]', 'name' => 'test', 'password' => '123456', 'is_admin' => 0]);\n\n // Assert the JSON structure of successfull action.\n $response->assertJsonStructure( [\n 'status',\n 'token'\n ]);\n\n\n $response = $this->post('/api/register', ['email' => '[email protected]', 'name' => 'test', 'password' => '123456', 'is_admin' => 0]);\n\n // Assert if user is douplicated\n $this->assertEquals(401, $response->status());\n\n $response->assertJsonStructure( [\n 'error' => [ 'email' ]\n ]);\n\n\n }", "public function user_can_register()\n {\n\n $this->withoutExceptionHandling();\n\n $response = $this->post(\"api/v1/auth/register\", [\n \"name\" => \"Jack Doe\",\n \"email\" => \"[email protected]\",\n \"password\" => \"password\"\n ]);\n\n $response->assertJsonStructure([\n 'token'\n ]);\n \n $response->assertStatus(200);\n\n $this->assertDatabaseCount('users', 1);\n $this->assertDatabaseHas('users', [\n 'email' => '[email protected]',\n ]);\n }", "public function testUniqueEmailOnRegistration(){\n User::factory(1)->create();\n\n $credentials = [\n \"email\" => \"[email protected]\",\n \"password\" => \"111111\",\n \"password_confirmation\" => \"111111\",\n \"account_type\" => \"Savings\",\n \"account_name\" => \"John Doe\",\n \"phone_number\" => \"08133093344\",\n ];\n\n $response = $this->post(route(\"register.submit\"),$credentials);\n\n $response->assertSessionHasErrors(\"email\");\n\n }", "public function testUser()\n {\n $user = new User();\n $user->email = \"[email protected]\";\n \t\t $user->first_name = \"Sankaja\";\n \t\t $user->last_name = \"Rajapakse\";\n \t\t $user->password = \"123123\";\n \t\t $user->save();\n \t\t //testing for email\n $this->assertEquals($user->email,\"[email protected]\");\n //testing for first name\n $this->assertEquals($user->first_name,\"Sankaja\");\n //testing for second name\n $this->assertEquals($user->last_name,\"Rajapakse\");\n //see in database\n $this->assertDatabaseHas('users',['email' => '[email protected]','first_name'=>'Sankaja','last_name' => 'Rajapakse','password' => '123123']);\n }", "public function test()\n {\n $data = [\n 'name' => 'Test user',\n 'email' => '[email protected]',\n 'password' => 'test123',\n ];\n\n\n $this->browse(function (Browser $browser) use ($data) {\n $browser->visit('/')\n ->assertSee('ZAREJESTRUJ SIĘ')\n ->clickLink('Zarejestruj się')\n ->screenshot('1.Register_form')\n ->type('name', $data['name'])\n ->type('email', $data['email'])\n ->type('password', $data['password'])\n ->type('password_confirmation', $data['password'])\n ->screenshot('2.Register_form_filled')\n ->press('Zarejestruj się')\n ->screenshot('3.Registred')\n ->assertSee('Witaj, Test user!')\n ->clickLink($data['name'])\n ->clickLink('Wyloguj')\n ->screenshot('4.Logout')\n ->clickLink('Logowanie')\n ->type('email', $data['email'])\n ->type('password', $data['password'])\n ->press('Logowanie')\n ->screenshot('5.Logged')\n ->assertSee('Witaj, Test user!')\n ;\n });\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 test_create_user_success()\n {\n if( User::where('email',$this->email)->exists()){\n User::where('email',$this->email)->delete();\n }\n $response = $this->json('POST', '/user_create',\n [\n 'name' => $this->name,\n 'email' => $this->email,\n 'password' => $this->password]);\n $response\n ->assertStatus(200)\n ->assertExactJson([\n $this->all_message => $this->user_create_success,\n ]);\n }", "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 testGetUser()\n {\n }", "public function testInsertUser()\n {\n // Validate the request...\n\n $record = factory(\\App\\User::class)->make();\n\n\n $this->assertTrue($record->save());\n\n }", "public function testCanRegister()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/');\n $browser->assertSee('TicTacToe');\n $browser->clickLink('register');\n $browser->assertSee('Create your account');\n $browser->type('name', $name = $this->faker->name);\n $browser->type('email', $this->faker->email);\n $password = $this->faker->password;\n $browser->type('password', $password);\n $browser->type('password_confirmation', $password);\n $browser->press('Register')\n ->on(new Home)\n ->assertSee('Dashboard')\n ->assertSee($name . ', you have lost 0 times and won 0 times.');\n });\n }", "private function register(): void\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n }", "public function testUserRegister()\n {\n //Voter user registration testing\n $this->browse(function (Browser $voter,$photographer,$organizer) {\n $voter->visit('/')\n ->clickLink('Register')\n ->assertSee('User Registration')\n ->value('#name','VoterTesting')\n ->value('#email','[email protected]')\n ->value('#address','University of Moratuwa')\n ->Value('#telephone','0716485403')\n ->Value('#password','123456789')\n ->value('#password-confirm','123456789')\n ->click('.checker')\n ->check('condition')\n ->click('button[type=\"submit\"]')\n ->assertSee('LensView Timeline')\n ->clickLink('View Profile')\n ->assertTitle('LensView | User Profile')\n ->click('#deleteButton')\n ->value('input[type=\"password\"]','123456789')\n ->click('.btn-red');\n\n //Photographer user registration testing\n $photographer->visit('/')\n ->clickLink('Register')\n ->assertSee('User Registration')\n ->value('#name','PhotographerTesting')\n ->value('#email','[email protected]')\n ->value('#address','University of Moratuwa')\n ->Value('#telephone','0716485403')\n ->click('.role2')\n ->Value('#password','123456789')\n ->value('#password-confirm','123456789')\n ->click('.checker')\n ->check('condition')\n ->click('button[type=\"submit\"]')\n ->assertSee(\"Photographer Dashboard\")\n ->clickLink('View Profile')\n ->assertTitle('LensView | User Profile')\n ->click('#deleteButton')\n ->value('input[type=\"password\"]','123456789')\n ->click('.btn-red');\n \n\n // Contest Organizer registration testing\n $organizer->visit('/')\n ->clickLink('Register')\n ->assertSee('User Registration')\n ->value('#name','OrganizerTesting')\n ->value('#email','[email protected]')\n ->value('#address','University of Moratuwa')\n ->Value('#telephone','0716485403')\n ->click('.role3')\n ->Value('#password','123456789')\n ->value('#password-confirm','123456789')\n ->click('.checker')\n ->check('condition')\n ->click('button[type=\"submit\"]')\n ->assertSee(\"Organizer Dashboard\")\n ->clickLink('View Profile')\n ->assertTitle('LensView | User Profile')\n ->click('#deleteButton')\n ->value('input[type=\"password\"]','123456789')\n ->click('.btn-red');\n });\n}", "public function testRegisterLongUsername() {\n\t\t$data = $this->getUserData(\n\t\t\t'testusr',\t\t\t\t\t// 7 chars\n\t\t\t$this->first_name,\n\t\t\t$this->surname,\n\t\t\t'[email protected]'\n\t\t);\n\t\t\n\t\t$response = $this->call('POST','v1/users', $data);\n\t\t$resp_data = $response->getData();\n\t\t\n\t\t$this->assertResponseStatus(400);\n\t\t$this->assertTrue($resp_data->error);\n\t\t$this->assertEquals(count($resp_data->messages), 1);\n\t}", "public function testGetUser()\n {\n\n }", "public function testCreateUser()\n {\n $rand = rand(1,999999);\n $data = [\n 'name' => 'name'.$rand,\n 'email' => 'email'.$rand.'@gmail.com',\n 'password' => 'password'\n ];\n\n User::create([\n 'name' => $data['name'],\n 'email' => $data['email'],\n 'password' => $data['password'],\n ]);\n\n $this->assertTrue(true);\n\n $user = User::where('name',$data['name']) -> first();\n $this -> assertEquals($data['email'],$user->email);\n $this -> assertEquals($data['password'],$user->password);\n\n }", "public function testUserSignupSuccess()\n {\n $faker = Faker::create();\n $email = $faker->email;\n\n $password = \"avoidvalidationerror\";\n\n $this->post('api/v1/signup', [\n \"firstName\" => $faker->firstName,\n \"lastName\" => $faker->lastName,\n \"email\" => $email,\n \"password\" => $password,\n \"phone\" => $faker->phoneNumber,\n \"password_confirmation\" => $password\n ]);\n\n $response = json_decode($this->response->getContent());\n\n $this->assertEquals(\n $response->user->email,\n $email\n );\n }", "public function testRegister()\n {\n $crawler = $this->client->request('GET', '/cliente/');\n $crawler = $this->client->followRedirect();\n\n $this->assertTrue($this->client->getContainer()->get('security.context')->isGranted('IS_AUTHENTICATED_ANONYMOUSLY'));\n $this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Acesse sua conta\")')->count());\n \n // validate form\n $form = $crawler->selectButton('Cadastrar')->form(array(\n 'marcoshoya_marquejogobundle_customer[username]' => '',\n ));\n \n $crawler = $this->client->submit($form);\n $this->assertGreaterThan(0, $crawler->filter('span:contains(\"Campo obrigatório\")')->count());\n \n $form = $crawler->selectButton('Cadastrar')->form(array(\n 'marcoshoya_marquejogobundle_customer[username]' => '[email protected]',\n ));\n \n $this->client->submit($form);\n $crawler = $this->client->followRedirect();\n\n // Check data in the show view\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Novo cadastro\")')->count());\n }", "public function testAdd() \n {\n $user = new User();\n\n $user->setUsername(\"Dirk\");\n $user->setPlainPassword(\"Kuijer\");\n \n $this->afdrukken($user->getUsername(), \"User\", get_class($user));\n $this->afdrukken($user->getPlainPassword(), \"User\", get_class($user));\n }", "public function test_is_new_user_can_register()\n {\n $data = factory('App\\User')->make();\n\n $this->post(route('register'), $data->toArray())\n ->assertRedirect(\"/\");\n }", "public function testCreateUser()\n {\n $response = create_user('Pico', 'Riley', '[email protected]', 'picoriley', '12341234', NULL, NULL, 0);\n $this->assertTrue($response, \"create_user returned false instead of true.\");\n \n //Check the database to ensure it worked\n $db = mysqli_connect(\"localhost\", \"quizard\", \"quest\", \"quizardQuest\");\n if (mysqli_connect_errno()) \n {\n printf(\"Connect failed: %s\\n\", mysqli_connect_errno());\n $this->fail(\"Couldn't connect to the database. Some database issue?\");\n }\n $result = mysqli_query($db, \"SELECT * FROM players WHERE username = 'picoriley';\");\n \n if ($result == FALSE)\n {\n $this->fail(\"Query failed! Something is wrong with the input query or the database structure.\");\n }\n while($row = mysqli_fetch_array($result))\n {\n $this->assertEquals($row['fName'], 'Pico', $row['fName'].' did not match Pico');\n $this->assertEquals($row['lName'], 'Riley', $row['lName'].' did not match Riley');\n }\n\n mysqli_close($db);\n \n }", "public function testCreation()\n {\n $this->module->enableRegistration = false;\n\n $this->specify(\"we have create user if registration disabled\", function () {\n $user = new User([\n 'email' => '[email protected]',\n 'password' => 'password',\n 'name' => 'Test user',\n ]);\n expect(\"we can create user if registration disabled\", $user->create())->true();\n $this->tester->dontSeeEmailIsSent();\n //create() on existing user throw \\RuntimeException\n $user->create();\n }, ['throws' => new \\RuntimeException]);\n\n $this->module->enableRegistration = true;\n $this->specify(\"we have create user with register email\", function () {\n $user = new User([\n 'email' => '[email protected]',\n 'password' => 'password',\n 'name' => 'Test user 2',\n ]);\n expect(\"we can create user if registration disabled\", $user->create(true))->true();\n /** @var TestMailer $message */\n /** @var yii\\swiftmailer\\Message $message */\n $this->tester->seeEmailIsSent();\n $message = $this->tester->grabLastSentEmail();\n expect(\"we must see email\", $message)->notNull();\n expect(\"we must see email to user\", $message->getTo())->hasKey($user->email);\n expect(\"we must see registration email\", $message->getSubject())->contains('register');\n });\n\n $this->specify(\"we have create user wit autogenerated password\", function () {\n $user = new User([\n 'email' => '[email protected]',\n 'name' => 'Test user',\n ]);\n expect(\"we can create user with autogenerated password\", $user->create())->true();\n });\n\n $this->specify(\"we have create user without name\", function () {\n $user = new User([\n 'email' => '[email protected]',\n 'password' => 'password',\n ]);\n expect(\"we can't create user without name\", $user->create())->false();\n expect(\"we can see error `name`\", $user->getErrors())->hasKey('name');\n });\n }", "public function testCreateUser()\n {\n $this->userService->createUser($this->credentials);\n $user = User::first();\n $this->assertEquals($user['firstName'], $this->credentials['firstName']);\n $this->assertEquals($user['lastName'], $this->credentials['lastName']);\n $this->assertEquals($user['email'], $this->credentials['email']);\n $this->assertTrue(Hash::check($this->credentials['password'], $user['password']));\n }", "public function testInsertUserTest()\n {\n\n\n $user = factory(User::class)->create(['name' => 'Test User']);\n $this->assertEquals($user->name, \"Test User\");\n\n\n }", "protected function setupUser(): void\n {\n $this->createTestUser(true, true);\n\n // Create test role\n $fm = $this->ci->factory;\n $fm->create(Group::class, [\n 'slug' => 'foo',\n 'name' => 'bar',\n ]);\n }", "public function testPositiveOfCreateUser()\n {\n $this->browse(function (Browser $browser) {\n $name = $this->faker->name;\n $browser->maximize()\n ->loginAs(User::first())\n ->visit('/users')\n ->pause(2000)\n ->clickLink('Create User')\n ->pause(2000)\n ->type('name', $name)\n ->type('email', $this->faker->email)\n ->type('password', 'mejikuhibiniuQwerty')\n ->type('phone', '089786757564')\n ->attach('avatar', __DIR__.'/face-test.jpg')\n ->type('address', $this->faker->address)\n ->press('Save')\n ->pause(3000)\n ->assertSee('User successfully created');\n });\n }", "public function testUserCreate() {\n $createUser = PromisePay::User()->create($this->userData);\n \n // Second, fetch its data\n $getUser = PromisePay::User()->get($createUser['id']);\n \n $this->assertNotNull($createUser['created_at']);\n $this->assertNotNull($createUser['updated_at']);\n $this->assertEquals($createUser['id'], $getUser['id']);\n $this->assertEquals($this->userData['first_name'] . ' ' . $this->userData['last_name'], $getUser['full_name']);\n }", "public function testRegisterButLogin(){\n $user = User::find(1);\n $this->be($user);\n\n $response =$this->get(route('register'));\n $response->assertRedirect(route('home'));\n }", "public function testApiRegistrationSimple()\n {\n $eventsFaker = Event::fake();\n $emailVerificationSend = Notification::fake();\n $uniqueData = $this->getTestRegisterData();\n $response = $this->withHeaders([ 'Authorization' => $this->getBearerClientToken() ])\n ->json('POST', $this->getRegisterRoute(), $uniqueData);\n\n $response->assertStatus(200)->assertJsonMissingValidationErrors();\n\n $responseArray = $response->decodeResponseJson()->json();\n $this->assertArrayNotHasKey('token_type', $responseArray);\n $this->assertArrayNotHasKey('expires_in', $responseArray);\n $this->assertArrayNotHasKey('access_token', $responseArray);\n $this->assertArrayNotHasKey('refresh_token', $responseArray);\n\n $user = CoreUser::byEmail($uniqueData[ 'email' ])->firstOrFail();\n $this->withoutExceptionHandling();\n\n if ( config('kit-auth.should_dispatch_registered_event') ) {\n $eventsFaker->assertDispatched(Registered::class,\n function (Registered $event) use ($emailVerificationSend) {\n app(ProcessEmailVerification::class)->handle($event);\n\n $emailVerificationSend->assertSentTo($event->user, VerifyEmail::class,\n function (VerifyEmail $notice) {\n $this->assertEquals($notice->requestSide, CoreUserContract::FRONTEND_REQUEST_SIDE);\n return $notice->tokens[ 'web' ] && $notice->tokens[ 'mobile' ];\n });\n\n return true;\n });\n } else {\n $eventsFaker->assertNotDispatched(Registered::class);\n }\n }", "public function setUp(): void\n {\n parent::setUp();\n\n self::$user['password'] = Hash::make(self::$password);\n User::updateOrCreate(\n ['email' => self::$user['email']],\n self::$user\n );\n }", "public function testCreateUser()\n {\n $user = factory(User::class)->make();\n $this->assertTrue($user->save());\n $this->assertNotEmpty($user->id);\n }", "public function testRegistrationNoUsername()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/add_user')\n ->type('username', '')\n ->type('first_name', 'Test')\n ->type('last_name', 'User')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcd1234')\n ->click('button[type=\"submit\"]')\n\n // we're still on the registration page\n ->assertSee('Save');\n });\n }", "public function testRegisterForm()\n {\n \\Cake\\Core\\Configure::write('CM.Register', true);\n\n $this->get('/register');\n\n $this->assertResponseSuccess();\n\n $this->assertNoRedirect();\n\n $this->assertResponseContains('<input type=\"email\" name=\"email\" required=\"required\" maxlength=\"255\" id=\"email\">');\n $this->assertResponseContains('<input type=\"password\" name=\"new_password\" required=\"required\" id=\"new-password\" value=\"\">');\n $this->assertResponseContains('<input type=\"password\" name=\"confirm_password\" required=\"required\" id=\"confirm-password\" value=\"\">');\n }", "public function test_1()\n {\n Storage::fake('avatars');\n $this->visit('/register')\n ->type('User 1', 'name') //Input the required information to create user\n ->type('[email protected]', 'email')\n ->type('testtest', 'password')\n ->type('testtest', 'password_confirmation')\n ->attach(UploadedFile::fake()->image('avatar.jpg'), 'avatar') //Upload profile photo\n ->press('Register')\n ->seePageIs('/home');\n }", "public function testRegistrationNoPassword()\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', '')\n ->type('password_confirmation', 'abcd1234')\n ->click('button[type=\"submit\"]')\n\n // we're still on the registration page\n ->assertSee('Save');\n });\n }", "public function testAddUserStore()\n {\n\n }", "public function testMemberRegistrationForm()\n {\n $response = $this\n ->get('/register-member')\n ->assertStatus(200);\n }", "public function testExample()\n {\n $this->browse(function ($browser) {\n $browser->visit('/register')\n ->type('surname', 'Surname')\n ->type('name', 'Name')\n ->type('login', '')\n ->type('phone_number' . '89999999999')\n ->type('email', '[email protected]')\n ->type('password', 'user_test')\n ->type('password_confirmation', 'user_test')\n ->press('Enter')\n ->assertPathIs('/');\n });\n }", "public function testaddSyncServiceUser(){\r\n $syncService = $this->container->get('SyncService');\r\n $user_id = $syncService->addUser(\"[email protected]\", \"AUTH_idiid\", 100);\r\n $this->assertNotNull($user_id);\r\n\r\n $syncService->deleteUser($user_id);\r\n\r\n }", "public function user_can_register_account_with_valid_details()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/register')\n ->assertSee('Register')\n ->type('name','keith')\n ->type('email','[email protected]')\n ->type('password','secret')\n ->type('password_confirmation','secret')\n ->press('Register')\n ->assertpathIs('/home')\n ->assertDontSeeIn('nav', 'Login')\n ->assertDontSeeIn('nav', 'register')\n ;\n });\n }", "public function testRegistrationNonUniqUsername()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/add_user')\n ->type('username', 'testuser1')\n ->type('first_name', 'aaaa')\n ->type('last_name', 'aaaa')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcd1234')\n ->click('button[type=\"submit\"]')\n\n // verify we've logged in and we've are on the list\n ->waitForText('The username has already been taken.')\n ->assertSee('The username has already been taken.');\n });\n }", "public function testProfileCheckIfUserExists()\n {\n\n }", "public function testCreateUser()\n { \n $userRepo = new UserRepository(new User);\n $user = $userRepo->create($this->data);\n\n $this->assertInstanceOf(User::class, $user);\n foreach ($this->data as $key => $value) {\n \t$this->assertEquals($value, $user->$key);\n }\n }", "public function testShouldSaveValidUser()\n {\n ConfideUser::$app['confide.repository'] = m::mock( 'ConfideRepository' );\n ConfideUser::$app['confide.repository']->shouldReceive('userExists')\n ->with( $this->confide_user )\n ->andReturn( 0 )\n ->once();\n\n $this->populateUser();\n $this->confide_user->confirmation_code = '';\n $this->confide_user->confirmed = false;\n\n $this->assertTrue( $this->confide_user->save() );\n }", "public function testPostCreateNewUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@view', array(''), 'POST', array(\n\t\t\t'id' => '',\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'Mior Muhammad Zaki',\n\t\t\t'password' => '123456',\n\t\t\t'roles' => array(2),\n\t\t));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::users'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t$user = Orchestra\\Model\\User::where_email('[email protected]')->first();\n\n\t\t$this->assertGreaterThan(0, $user->id);\n\t\t$this->assertEquals('[email protected]', $user->email);\n\t\t$this->assertEquals('Mior Muhammad Zaki', $user->fullname);\n\t\t$this->assertTrue(Hash::check('123456', $user->password));\n\n\t\t$user->delete();\n\t}", "public function testRegistrationNoConfirmPassword()\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', 'abcd1234')\n ->type('password_confirmation', '')\n ->click('button[type=\"submit\"]')\n\n // we're still on the registration page\n ->assertSee('Save');\n });\n }", "public function testRegistrationExtraFields(): void { }", "public function testSignUpForALarabookAccount()\n {\n $this->asGuest();\n\n $this->visit('/')\n ->click('Sign Up!')\n ->seePageIs('/register');\n\n $this->submitForm([\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'password' => 'secret',\n 'password_confirmation' => 'secret'\n ]);\n\n $this->seePageIs('/')\n ->see('Welcome to Larabook');\n\n $this->seeInDatabase('users', [\n 'name' => 'John Doe',\n 'email' => '[email protected]'\n ]);\n\n $this->assertTrue(Auth::check());\n }", "public function testWebinarRegistrantCreate()\n {\n }", "public function testGetUser()\n {\n if (PHP_SAPI === 'cli') {\n return;\n }\n\n $this->assertNotNull(rex::getUser(), 'user is not null');\n $this->assertInstanceOf('rex_user', rex::getUser(), 'returns a user of correct class');\n }", "public function testProfileUnilogin()\n {\n\n }", "public function testSubmitSignup()\n {\n $user = factory(User::class)->create(['drupal_id' => '123451']);\n\n // For testing, we'll mock a successful Phoenix API response.\n $this->phoenixMock->shouldReceive('createSignup')->with('123451', '123', 'test')->once()->andReturn(['1307']);\n $this->phoenixMock->shouldReceive('getSignup')->with('1307')->once()->andReturn([\n 'data' => [\n 'id' => '1307',\n // ...\n ],\n ]);\n\n // Make the request\n $this->asUserUsingLegacyAuth($user)->withLegacyApiKeyScopes(['user'])->json('POST', 'v1/signups', [\n 'campaign_id' => '123',\n 'source' => 'test',\n ]);\n\n // The response should return 201 Created & be valid JSON\n $this->assertResponseStatus(201);\n $this->seeJson();\n }", "public function testAddUser(){\n $em = $this->getContainer()->get('doctrine')->getManager();\n\n $this->connect();\n $client = $this->makeClient();\n\n $crawler = $client->request('GET', '/admin/user/add');\n $response = $client->getResponse();\n\n $this->assertStatusCode(200, $client);\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n\n // Post user\n $crawler = $client->request('GET', '/');\n $button = $crawler->filter('a:contains(\"Admin\")')->eq(0)->link();\n $this->assertTrue($button != null);\n\n $crawler = $client->click($button);\n $button = $crawler->filter('a:contains(\"Utilisateur\")')->eq(0)->link();\n $this->assertTrue($button != null);\n\n// $form = $crawler->selectButton('Ajouter')->form();\n// $form->setValues([\n// 'userbundle_user[username]' => 'boura',\n// 'userbundle_user[email]' => '[email protected]',\n// 'userbundle_user[plainPassword]' => 'bdiallo'\n//\n// ]);\n// $client->submit($form);\n// $this->assertStatusCode('200', $client);\n\n // Verify count of user saved\n// $this->assertCount(2, $em->getRepository('UserBundle:User')->findAll());\n }", "public function testSuitSuccess()\n {\n $this->visit('/register')\n ->type('Tester', 'name')\n ->type('[email protected]', 'email')\n ->type('password12', 'password')\n ->type('password12', 'password_confirmation')\n ->press('Register')\n ->seePageIs('/login');\n }" ]
[ "0.83806723", "0.8273252", "0.8236738", "0.7995631", "0.79933095", "0.7941538", "0.7811123", "0.7739545", "0.7726307", "0.7606139", "0.7586911", "0.75855273", "0.75614214", "0.7548537", "0.75220025", "0.7518394", "0.75045407", "0.74813235", "0.74752295", "0.7429607", "0.7429006", "0.7399118", "0.7384971", "0.7383124", "0.737931", "0.7350223", "0.73228556", "0.7317234", "0.7307273", "0.7298534", "0.7292374", "0.72888047", "0.7285049", "0.7253474", "0.7251126", "0.7170869", "0.7160476", "0.7116585", "0.7101181", "0.7099221", "0.7090768", "0.70764464", "0.7065586", "0.704541", "0.70392", "0.70391583", "0.70269287", "0.7025217", "0.70141417", "0.7008816", "0.69825697", "0.69798225", "0.69777036", "0.69771177", "0.6976827", "0.696283", "0.695379", "0.69511", "0.6941627", "0.6914608", "0.6913903", "0.687662", "0.68763626", "0.6874495", "0.68724686", "0.6860498", "0.68513954", "0.6838831", "0.6830646", "0.68219376", "0.6804986", "0.6795804", "0.67911255", "0.67857873", "0.6776542", "0.67615986", "0.67601883", "0.675429", "0.6753728", "0.67515826", "0.6745183", "0.6730086", "0.67126393", "0.6702278", "0.6694127", "0.66877973", "0.6687019", "0.66834974", "0.6683374", "0.6676493", "0.66691643", "0.6666078", "0.66621864", "0.6644216", "0.66404605", "0.6634737", "0.66194046", "0.6617106", "0.6609367", "0.6606019" ]
0.7809246
7
Add the design elements to the form
protected function _prepareForm() { $model = Mage::getModel('attributeSplash/rule'); $form = new Varien_Data_Form(); $form->setHtmlIdPrefix('rule_'); $form->setFieldNameSuffix('splash'); $renderer = Mage::getBlockSingleton('adminhtml/widget_form_renderer_fieldset') ->setTemplate('promo/fieldset.phtml') ->setNewChildUrl($this->getUrl('*/promo_catalog/newConditionHtml/form/rule_conditions_fieldset')); $fieldset = $form->addFieldset('conditions_fieldset', array( 'legend'=>Mage::helper('catalogrule')->__('Conditions (leave blank for all products)')) )->setRenderer($renderer); $fieldset->addField('conditions', 'text', array( 'name' => 'conditions', 'label' => Mage::helper('catalogrule')->__('Conditions'), 'title' => Mage::helper('catalogrule')->__('Conditions'), 'required' => true, ))->setRule($model)->setRenderer(Mage::getBlockSingleton('rule/conditions')); $form->setValues($this->_getFormData()); $this->setForm($form); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildForm()\n {\n $this\n ->addMeasureList()\n ->addAscendingList()\n ->addTitles(['class' => 'indicator_title_title_narrative', 'narrative_true' => true])\n ->addDescriptions(['class' => 'indicator_description_title_narrative'])\n ->addCollection('reference', 'Activity\\Reference', 'reference', [], trans('elementForm.reference'))\n ->addAddMoreButton('add_reference', 'reference')\n ->addBaselines()\n ->addPeriods()\n ->addAddMoreButton('add_period', 'period')\n ->addRemoveThisButton('remove_indicator');\n }", "private function addElements(): void\n {\n // Add additional form fields\n $this->add([\n 'name' => 'masterFile',\n 'type' => Checkbox::class,\n 'attributes' => [\n 'id' => 'masterFile',\n 'class' => 'form-check-input',\n ],\n 'options' => [\n 'label' => 'Create master export file',\n 'label_attributes' => [\n 'class' => 'form-check-label',\n ],\n ],\n ]);\n\n $this->add([\n 'name' => 'debugTranslations',\n 'type' => Checkbox::class,\n 'attributes' => [\n 'id' => 'debugTranslations',\n 'class' => 'form-check-input',\n ],\n 'options' => [\n 'label' => 'Create debug translations',\n 'label_attributes' => [\n 'class' => 'form-check-label',\n ],\n ],\n ]);\n }", "public function form_elements() {\n\n\t\t\t// Instantiate Widget Inputs\n\t\t\t$form_elements = new Layers_Form_Elements();\n\n\t\t\t// Return design bar\n\t\t\treturn $form_elements;\n\n\t\t}", "protected function addElements() \n {\n // Add \"email\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'title',\n 'options' => [\n 'label' => 'Title',\n ],\n ]);\n \n // Add \"parent_id\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'parent_id', \n 'options' => [\n 'label' => 'Full Name',\n ],\n ]);\n \n if ($this->scenario == 'create') {\n \n\n }\n \n // Add \"status\" field\n $this->add([ \n 'type' => 'select',\n 'name' => 'status',\n 'options' => [\n 'label' => 'Status',\n 'value_options' => [\n 1 => 'Active',\n 2 => 'Retired', \n ]\n ],\n ]);\n \n // Add the Submit button\n $this->add([\n 'type' => 'submit',\n 'name' => 'submit',\n 'attributes' => [ \n 'value' => 'Create'\n ],\n ]);\n }", "function form_init_elements()\r\n {\r\n // Swimmer handling\r\n $swimmer = new FERadioGroup(\"Swimmers\",\r\n array(\r\n ucfirst(FT_CREATE) => FT_CREATE\r\n ,ucfirst(FT_IGNORE) => FT_IGNORE)) ;\r\n $swimmer->set_br_flag(false) ;\r\n $this->add_element($swimmer) ;\r\n\r\n // Swim Meets handling\r\n $swimmeets = new FERadioGroup(\"Swim Meets\",\r\n array(\r\n ucfirst(FT_CREATE) => FT_CREATE\r\n ,ucfirst(FT_IGNORE) => FT_IGNORE)) ;\r\n $swimmeets->set_br_flag(false) ;\r\n $this->add_element($swimmeets) ;\r\n\r\n // Swim Teams handling\r\n $swimteams = new FERadioGroup(\"Swim Teams\",\r\n array(\r\n ucfirst(FT_CREATE) => FT_CREATE\r\n ,ucfirst(FT_IGNORE) => FT_IGNORE)) ;\r\n $swimteams->set_br_flag(false) ;\r\n $this->add_element($swimteams) ;\r\n }", "public function buildFormLayout()\n {\n $this->addColumn(6, function(FormLayoutColumn $column) {\n $column->withSingleField('title');\n })->addColumn(6, function(FormLayoutColumn $column) {\n $column->withSingleField('cover');\n $column->withSingleField('description');\n $column->withSingleField('price');\n $column->withSingleField('tags');\n });\n }", "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 buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: save PHP/CSS code');\r\n\r\n $code[] =& $this->createElement('checkbox', 'P', null, 'PHP');\r\n $code[] =& $this->createElement('checkbox', 'C', null, 'CSS');\r\n $this->addGroup($code, 'phpcss', 'PHP and/or StyleSheet source code:');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('next','apply'));\r\n }", "protected function addElements()\n {\n // Add \"latitude\" field\n $this->add([\n 'type' => 'text',\n 'name' => 'latitude',\n 'id' => 'latitude',\n 'options' => [\n 'label' => 'Latitude',\n ],\n ]);\n\n // Add \"longitude\" field\n $this->add([\n 'type' => 'text',\n 'name' => 'longitude',\n 'options' => [\n 'label' => 'Longitude',\n ],\n ]);\n\n // Add the Update button\n $this->add([\n 'type' => 'submit',\n 'name' => 'update',\n 'attributes' => [\n 'value' => 'Update'\n ],\n ]);\n }", "private function addElements()\n {\n $author = (new Text())\n ->setName('author')\n ->setLabel('Author')\n ->setAttribute('id', 'author');\n $this->add($author);\n\n $comment = (new Textarea())\n ->setName('comment')\n ->setLabel('Content')\n ->setAttribute('id', 'comment');\n $this->add($comment);\n\n $submit = (new Submit())\n ->setName('submit')\n ->setAttribute('value', 'Save')\n ->setAttribute('id', 'submitButton');\n $this->add($submit);\n }", "public function buildForm()\n {\n $this->add('organization_identifier_code', 'text', ['label' => trans('elementForm.organisation_identifier_code')])\n ->add('provider_activity_id', 'text', ['label' => trans('elementForm.provider_activity_id')])\n ->addSelect('type', $this->getCodeList('OrganisationType', 'Activity'), trans('elementForm.type'), $this->addHelpText('Activity_ParticipatingOrg-type'))\n ->addNarrative('provider_org_narrative')\n ->addAddMoreButton('add_provider_org_narrative', 'provider_org_narrative');\n }", "function form_init_elements()\r\n {\r\n $this->add_hidden_element(\"swimmeetid\") ;\r\n\r\n // This is used to remember the action\r\n // which originated from the GUIDataList.\r\n \r\n $this->add_hidden_element(\"_action\") ;\r\n\r\n\t\t// Org Code field\r\n\r\n $orgcode = new FEListBox(\"Organization\", true, \"150px\");\r\n $orgcode->set_list_data(SDIFCodeTableMappings::GetOrgCodes()) ;\r\n $this->add_element($orgcode) ;\r\n\r\n\t\t// Meet Name field\r\n\r\n $meetname = new FEText(\"Meet Name\", true, \"300px\");\r\n $this->add_element($meetname) ;\r\n\r\n\t\t// Meet Address 1 field\r\n\r\n $meetaddress1 = new FEText(\"Meet Address 1\", false, \"300px\");\r\n $this->add_element($meetaddress1) ;\r\n\r\n\t\t// Meet Address 2 field\r\n\r\n $meetaddress2 = new FEText(\"Meet Address 2\", false, \"300px\");\r\n $this->add_element($meetaddress2) ;\r\n\r\n // Meet State\r\n\r\n $meetstate = new FEUnitedStates(\"Meet State\", FT_US_ONLY, \"150px\");\r\n $this->add_element($meetstate) ;\r\n\r\n\t\t// Meet Postal Code field\r\n\r\n $meetpostalcode = new FEText(\"Meet Postal Code\", false, \"200px\");\r\n $this->add_element($meetpostalcode) ;\r\n\r\n // Meet Country\r\n\r\n $meetcountry = new FEListBox(\"Meet Country\", true, \"250px\");\r\n $meetcountry->set_list_data(SDIFCodeTableMappings::GetCountryCodes()) ;\r\n $meetcountry->set_readonly(FT_US_ONLY) ;\r\n $this->add_element($meetcountry) ;\r\n\r\n\t\t// Meet Code field\r\n\r\n $meetcode = new FEListBox(\"Meet Code\", true, \"150px\");\r\n $meetcode->set_list_data(SDIFCodeTableMappings::GetMeetCodes()) ;\r\n $this->add_element($meetcode) ;\r\n\r\n // Meet Start Field\r\n\r\n $meetstart = new FEDate(\"Meet Start\", true, null, null,\r\n \"Fdy\", date(\"Y\") - 3, date(\"Y\") + 7) ;\r\n $this->add_element($meetstart) ;\r\n\r\n // Meet End Field\r\n\r\n $meetend = new FEDate(\"Meet End\", true, null, null,\r\n \"Fdy\", date(\"Y\") - 3, date(\"Y\") + 7) ;\r\n $this->add_element($meetend) ;\r\n\r\n\t\t// Pool Altitude field\r\n\r\n $poolaltitude = new FENumber(\"Pool Altitude\", true, \"150px\") ;\r\n $this->add_element($poolaltitude) ;\r\n\r\n\t\t// Course Code field\r\n\r\n $coursecode = new FEListBox(\"Course Code\", true, \"150px\");\r\n $coursecode->set_list_data(SDIFCodeTableMappings::GetCourseCodes()) ;\r\n $this->add_element($coursecode) ;\r\n }", "function createForm(){\n\t\t$this->createFormBase();\n\t\t$this->addElement('reset','reset','Reset');\t\t\t\n\t\t$tab['seeker_0'] = '0';\n\t\t$this->setDefaults($tab);\n\t\t$this->addElement('submit','bouton_add_pi','Add a contact',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_contact'\"));\n\t\t$this->createVaFormResolution();\n\t\t$this->createFormGeoCoverage();\n\t\t$this->createFormGrid();\t\n\t\t//Required format\n\t\t$dformat = new data_format;\n\t\t$dformat_select = $dformat->chargeFormDestFormat($this,'required_data_format','Required data format','NetCDF');\n\t\t$this->addElement($dformat_select);\n\t\t$this->getElement('organism_0')->setLabel(\"Organism short name\");\n\t\t$this->getElement('project_0')->setLabel(\"Useful in the framework of\");\n\t\t$this->getElement('dats_abstract')->setLabel(\"Abstract \");\n\t\t$this->getElement('dats_purpose')->setLabel(\"Purpose\");\n\t\t$this->getElement('database')->setLabel(\"Data center\");\n\t\t$this->getElement('new_db_url')->setLabel(\"Data center url\");\n\t\t$this->getElement('dats_use_constraints')->setLabel(\"Access and use constraints\");\t\t\t\n\t\t$this->getElement('sensor_resol_tmp')->setLabel('Temporal (hh:mm:ss)');\t\t\t\n\t\t$this->getElement('place_alt_min_0')->setLabel(\"Altitude min\");\n\t\t$this->getElement('place_alt_max_0')->setLabel(\"Altitude max\");\n\t\t$this->getElement('data_format_0')->setLabel(\"Original data format\");\n\t\t$this->addElement('file','upload_doc','Attached document');\n\t\t$this->addElement('submit','upload','Upload');\n\t\t$this->addElement('submit','delete','Delete');\n\t\t\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->getElement('methode_acq_'.$i)->setLabel(\"Parameter processing related information\");\n\t\t}\n\t\t$this->addElement('submit','bouton_add_variable','Add a parameter',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_param'\"));\n\t\t\n\t\t$this->addElement('submit','bouton_add_projet','Add a project',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_general'\"));\n\t\t$option = array();\n\t\t$option['default'] = \"\";\n\t\t$option['model'] = \"Model\";\n\t\t$option['instrument'] = \"Instrument\";\n\t\t$option['satellite'] = \"Satellite\";\n\t\t$this->addElement('select','source_type','source type :',$option,array('onchange' => \"DeactivateButtonAddSource()\",'onclick' => \"DeactivateButtonAddSource();\",'onmouseover' => 'DeactivateButtonAddSource();' ));\n\t\t$this->addElement('submit','bouton_add_source','Add a source',array('disabled' => 'true','onclick' => \"document.getElementById('frmvadataset').action += '#a_source'\",'onmouseout' => 'DeactivateButtonAddSource();'));\n\t\t\n\t\tif (isset ( $this->dataset->dats_sensors ) && ! empty ( $this->dataset->dats_sensors )) {\n\t\t\t$this->dats_sensors = array();\n\t\t\t$this->dats_sensors = $this->dataset->dats_sensors ;\n\t\t}\n\t\tif (isset ( $this->dataset->sites ) && ! empty ( $this->dataset->sites )) {\n\t\t\t$this->sites = array();\n\t\t\t$this->sites = $this->dataset->sites;\n\t\t}\n\t\t\n\t\tif ( isset ( $this->dataset->dats_id ) && $this->dataset->dats_id > 0) {\n\t\t\tif (isset ( $this->dataset->nbModFormSensor )){\n\t\t\t\tif($this->dataset->nbModForm <= $this->dataset->nbModFormSensor ){\n\t\t\t\t\t$this->dataset->nbModForm = $this->dataset->nbModFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbSatFormSensor )){\n\t\t\t\t//$this->dataset->nbSatFormSensor = $this->dataset->nbSatFormSensor - 1;\n\t\t\t\tif($this->dataset->nbSatForm <= $this->dataset->nbSatFormSensor){\n\t\t\t\t\t$this->dataset->nbSatForm = $this->dataset->nbSatFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbInstruFormSensor )){\n\t\t\t\tif($this->dataset->nbInstruForm <= $this->dataset->nbInstruFormSensor){\n\t\t\t\t\t$this->dataset->nbInstruForm = $this->dataset->nbInstruFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->dataset->nbModForm > 0)\n\t\t\t$this->addMod();\n\t\tif($this->dataset->nbInstruForm > 0)\n\t\t\t$this->addInstru();\t\n\t\tif($this->dataset->nbSatForm > 0)\n\t\t\t$this->addSat();\n\t\t\n\t\t$this->dataset->dats_sensors = null ;\n\t\t$this->dataset->sites = null;\n\t}", "protected function addElements()\n {\n // Add \"email\" field\n $this->add([\n 'type' => 'text',\n 'name' => 'pin',\n 'options' => [\n 'label' => 'PIN'\n ],\n 'attributes' => [\n 'class' => 'form-control',\n 'id' => 'pin',\n 'maxlength' => 14\n ],\n ]);\n\n\n $this->add([\n 'name' => 'photo',\n 'type' => 'Zend\\Form\\Element\\File',\n 'attributes' => [\n 'type' => 'file',\n 'id' => 'user_photo_upload_form'\n ]\n ]);\n\n $this->add(array(\n 'type' => 'Zend\\Form\\Element\\Csrf',\n 'name' => 'csrf',\n ));\n\n\n // Add the Submit button\n $this->add([\n 'type' => 'submit',\n 'name' => 'submit',\n 'attributes' => [\n 'value' => 'Save',\n 'class' => 'btn btn-small btn-success',\n ],\n ]);\n }", "public function addForm() {\n $this->view->displayForm();\n }", "public function buildForm()\n {\n $this\n ->add(\n 'new_organization_group',\n 'collection',\n [\n 'type' => 'form',\n 'options' => [\n 'class' => 'App\\SuperAdmin\\Forms\\OrganizationGroupInformation',\n 'label' => false,\n ]\n ]\n )\n ->add(\n 'group_admin_information',\n 'collection',\n [\n 'type' => 'form',\n 'options' => [\n 'class' => 'App\\SuperAdmin\\Forms\\GroupAdmin',\n 'label' => false,\n ]\n ]\n )\n ->addSaveButton();\n }", "protected function addElements() \n { \n // Add \"nom\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'nom_parent',\n 'attributes' => [\n 'id' => 'nom_parent',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'Nom de famille:',\n ],\n ]);\n \n // Add \"prenom\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'prenom_parent',\n 'attributes' => [\n 'id' => 'prenom_parent',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'Prénom parent:',\n ],\n ]);\n \n // Add \"domicile\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'domicile',\n 'attributes' => [\n 'id' => 'domicile',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'Domicile:',\n ],\n ]);\n \n // Add \"telephone_number\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'telephone1',\n 'attributes' => [\n 'id' => 'telephone1'\n ],\n 'options' => [\n 'label' => 'Téléphone 1',\n ],\n ]);\n \n // Add \"telephone_number\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'telephone2',\n 'attributes' => [\n 'id' => 'telephone2'\n ],\n 'options' => [\n 'label' => 'Téléphone 2',\n ],\n ]);\n \n // Add \"code eleve \" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'email_parent',\n 'attributes' => [\n 'id' => 'email_parent',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'E-mail:',\n ],\n ]);\n \n // Add \"comment\" field\n $this->add([ \n 'type' => 'textarea',\n 'name' => 'commentaire',\n 'options' =>[\n 'label' => 'Commentaires:',\n ],\n 'attributes' => [\n 'id' => 'commentaire',\n 'style' => 'width: 50%'\n ], \n ]);\n \n // Add the submit button\n $this->add([\n 'type' => 'submit',\n 'name' => 'submit',\n 'attributes' => [ \n 'value' => 'Enregistrer',\n 'id' => 'submitbutton',\n ],\n ]); \n \n }", "public function form(){\n \t \tif($this->layoutWidgetInfo){\n \t\t$setting = json_decode($this->layoutWidgetInfo->setting, true);\n \t}\n\n \t//default option(type[text], cols[3-9], rows[1], label[$key], name[$key], value[$setting[$k]])\n \t//add option(class, id, stype, styleRow, required, placeholder, attr, [options, code])\n \t$settingForm = array(\n \t\t'layout_widget_id' \t=> array('type' => 'hidden', 'value' => $this->layoutWidgetInfo->layoutWidgetId),\n \t\t'widget_controller' => array('type' => 'hidden', 'value' => $this->widgetController),\n \t\t'header' \t=> array('type' => 'custom', 'value' => \"<h4 class='widget_header col-md-12'>{$this->widgetController}</h4>\", 'label' => ''),\n\n \t\t'title' => array(),\n \t\t'class'\t=> array(),\n 'bg_color'\t=> array('label' => 'Màu nền', 'class' => 'ColorPickerSliders',\n 'addElement' => '<a href=\"index.php?r=admin/help/view&helpId=4\" target=\"_blank\">Xem thêm</a>'),\n \t\t'category_id'\t=> array('type' => 'select_category', 'label' => 'Category', 'required' => true,\n \t\t\t\t'options' => CategoryExt::getCategoryList()),\n \t\t'style'\t=> array('type' => 'select', 'options' => $this->settingDefault['style']),\n \t\t'order_by' => array('type' => 'select', 'options' => $this->settingDefault['order_by']),\n \t\t'order_direction' => array('type' => 'select', 'options' => $this->settingDefault['order_direction']),\n \t);\n\n \t$settingAll = array(\n \t\t'cols' => '3-9'\n \t);\n\n \t//render setting from\n \tTemplateHelper::renderForm($settingForm, $setting, $settingAll);\n TemplateHelper::getTemplate('layout/_extra/add_setting.php', $setting);\n TemplateHelper::getTemplate('layout/_extra/color_picker.php');\n \t}", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: run demo');\r\n\r\n $this->addElement('static', 'progressBar',\r\n 'Your progress meter looks like:');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('reset','process'));\r\n }", "function buildForm(){\n\t\t# menampilkan form\n\t}", "public function setForm() {\n\t\t$translator = Zend_Registry::get('Zend_Translate');\n\t\t$this->setMethod('post');\n\t\t \n\t\t$this->addEnabled();\n\t\t$this->addRentDueDay();\n\t\t$this->addProrationType();\n\t\t$this->addProrationApplyMonth();\n\t\t$this->addSecondMonthDue();\n\t\t$this->addSubmitButton();\n\n\t\t$this->addDisplayGroup( $this->displayGroupArray, 'updateRentProrationSetting',array('legend' => 'rentProrationSettings'));\n\t\t$this->getDisplayGroup('updateRentProrationSetting')->setDecorators(array(\n 'FormElements',\n 'Fieldset', \n\t\t));\n\t}", "public function addMetaFieldsToAddForm()\n\t{\n\t\t$interval = $this->getMetaFields('interval');\n\t\t$animation = $this->getMetaFields('animation');\n\n\t\t?>\n\t\t\t<div class=\"form-field\">\n\t\t\t\t<label for=\"interval\">Tijd tussen slides</label>\n\t\t\t\t<input name=\"interval\" id=\"interval\" type=\"text\" value=\"<?php echo $interval;?>\" size=\"40\">\n\t\t\t\t<p class=\"description\">De tijd tussen slides in milliseconden (1000ms = 1s).</p>\n\t\t\t</div>\n\t\t\t<div class=\"form-field\">\n\t\t\t\t<label for=\"animation\">Animatie</label>\n\t\t\t\t<select name=\"animation\" id=\"animation\">\n\t\t\t\t\t<option <?php selected($animation, 'slide'); ?> value=\"slide\">Slide</option>\n\t\t\t\t\t<option <?php selected($animation, 'fade'); ?> value=\"fade\">Fade</option>\n\t\t\t\t</select>\n\t\t\t\t<p class=\"description\">Selecteer de animatie die gebruikt wordt door de slideshow.</p>\n\t\t\t</div>\n\t\t<?php\n\t}", "public function buildForm()\n {\n $this\n ->addNarrative('location_description_narrative')\n ->addAddMoreButton('add', 'location_description_narrative');\n }", "public function buildForm()\n {\n }", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: border properties');\r\n\r\n $borderpainted[] =& $this->createElement('radio', null, null, 'Yes', true);\r\n $borderpainted[] =& $this->createElement('radio', null, null, 'No', false);\r\n $this->addGroup($borderpainted, 'borderpainted', 'Display the border:');\r\n\r\n $this->addElement('text', 'borderclass', 'CSS class:', array('size' => 32));\r\n\r\n $borderstyle['style'] =& $this->createElement('select',\r\n 'style', 'style',\r\n array('solid' => 'Solid',\r\n 'dashed' => 'Dashed',\r\n 'dotted' => 'Dotted',\r\n 'inset' => 'Inset',\r\n 'outset' => 'Outset'));\r\n $borderstyle['width'] =& $this->createElement('text',\r\n 'width', 'width',\r\n array('size' => 2));\r\n $borderstyle['color'] =& $this->createElement('text',\r\n 'color', 'color',\r\n array('size' => 7));\r\n $this->addGroup($borderstyle, 'borderstyle', null, ' ');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('apply','process'));\r\n }", "public function addElements()\n {\n $this->add(array(\n 'name' => 'place',\n 'type' => 'Zend\\Form\\Element\\Text',\n 'attributes' => array(\n 'required' => true,\n 'id' => 'name',\n 'class' => 'form-control',\n 'placeholder' => 'Enter type name'\n ),\n 'options' => array(\n 'label' => 'Name',\n 'label_attributes' => array(\n 'class' => 'control-label'\n ),\n\n ),\n ));\n }", "public function init()\n {\n $this->addAttribs(array(\"class\" => \"form-horizontal\"))\n ->setDecorators(array(\n 'FormElements',\n 'Form'\n )); \n $this->addElement('hidden','idarticles'); \n \n $article_title = $this->createElement('text','article_title');\n $article_title->setLabel(\"Họ tên :\")\n ->setRequired()\n ->setAttribs(array(\"class\"=>\"large\"))\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n )); \n $this->addElement($article_title); \n \n $article_alias = $this->createElement('text','article_alias');\n $article_alias->setLabel(\"Yahoo :\")\n ->setRequired()\n ->setAttribs(array(\"class\"=>\"large\"))\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n )); \n $this->addElement($article_alias); \n\t\t\n\t\t\n $article_detail = $this->createElement('text','article_detail');\n $article_detail->setLabel(\"Skype :\")\n ->setRequired()\n ->setAttribs(array(\"class\"=>\"large\"))\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n )); \n $this->addElement($article_detail); \n\t\t\n $article_description = $this->createElement('text','article_description');\n $article_description->setLabel(\"Số điện thoại :\")\n ->setRequired()\n ->setAttribs(array(\"class\"=>\"large\"))\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n )); \n $this->addElement($article_description); \n \n $submit = $this->createElement(\"submit\",\"submit\");\n $submit->setLabel(\"Thêm\"); \n $this->addElement($submit); \n }", "public function uultra_load_wdiget_addition_form()\r\n\t{\r\n\t\t$html = '';\r\n\t\t$html .= '<div class=\"uultra-adm-widget-cont-add-new\" >';\r\n \r\n\t\t$html .= '<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td width=\"50%\"> '.__(\"Name: \",'xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\"><input name=\"uultra_add_mod_widget_title\" type=\"text\" id=\"uultra_add_mod_widget_title\" style=\"width:120px\" /> \r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t\t\t<td width=\"50%\"> '.__('Type:','xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\">\r\n\t\t\t\t<select name=\"uultra_add_mod_widget_type\" id=\"uultra_add_mod_widget_type\" size=\"1\">\r\n\t\t\t\t <option value=\"\" selected=\"selected\">'.__(\"Select Type: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"1\">'.__(\"Text: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"2\">Shortcode</option>\r\n\t\t\t\t</select>\r\n\r\n\t\t </td>\r\n\t\t\t </tr>\r\n\t\t<tr>\r\n\t\t\t\t<td width=\"50%\"> '.__('Editable by user:','xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\">\r\n\t\t\t\t<select name=\"uultra_add_mod_widget_editable\" id=\"uultra_add_mod_widget_editable\" size=\"1\">\r\n\t\t\t\t \r\n\t\t\t\t <option value=\"0\" selected=\"selected\">'.__(\"NO \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"1\">'.__(\"YES\",'xoousers').'</option>\r\n\t\t\t\t</select>\r\n\r\n\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t \r\n\t\t\t <tr>\r\n\t\t\t\t<td>'.__('Content:','xoousers').'</td>\r\n\t\t\t\t<td>&nbsp;</textarea> \r\n\t\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t \r\n\t\t\t <tr>\r\n\t\t\t\t\r\n\t\t\t\t<td colspan=\"2\"><textarea name=\"uultra_add_mod_widget_content\" id=\"uultra_add_mod_widget_content\" style=\"width:98%;\" rows=\"5\"></textarea> \r\n\t\t\t </td>\r\n\t\t\t </tr> \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t</table> '; \t\t\t\r\n\t\t\t \r\n\t\t\t$html .= ' <p class=\"submit\">\r\n\t\t\t\t\t<input type=\"button\" name=\"submit\" class=\"button uultra-widgets-add-new-close\" value=\"'.__('Close','xoousers').'\" /> <input type=\"button\" name=\"submit\" class=\"button button-primary uultra-widgets-add-new-confirm\" value=\"'.__('Submit','xoousers').'\" /> <span id=\"uultra-add-new-widget-m-w\" ></span>\r\n\t\t\t\t</p> ';\r\n\t\t\t\t\r\n\t\t\t$html .= '</div>';\r\n\t\t\t\t\r\n\t\t\techo $html;\r\n\t\t\tdie();\r\n\t\r\n\t}", "public function addform()\n\t{\n\t\t\t$this->setMethod('post');\n\n\t\t\t\n\t\t\t$this->addElement('radio', 'status', array(\n\t\t\t\t'required' => true,\n\t\t\t\t'multiOptions' => array(\n\t\t\t\t\t'1' => IN_PROGRESS,\n\t\t\t\t\t'2' => 'Closed'\n\t\t\t\t\t\n\t\t\t\t),\n\t\t\t\t'value' => '1' //key of multiOption\n\t\t\t));\n\t\t\n\t\t\n\n\t\t\t$this->addElement('textarea', 'Comment', array( \n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'maxlength' =>'50',\n\t\t\t\t\t\n\t\t\t\t\t'class' => 'validate[required] text-input',\n\t\t\t\t\t'decorators'=>Array(\n\t\t\t\t\t\t'ViewHelper','Errors'\n\t\t\t\t\t),\t\t \n\t\t\t));\n\n\t\t\t\n\n\t\t\t\n\n\n\t\n\t\t\t\t\n\t\t\t$this->addElement('submit', 'submit', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t\t\t'label' => 'Submit',\n\t\t\t));\n\t\t\t\n\t\t\t// And finally add some CSRF protection\n\t\t\t$this->addElement('hash', 'csrf', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t));\t\n\t}", "public function addFields($formelements){\r\n\t\t $this->formElements \t= $formelements;\r\n\t}", "public function addForm()\n {\n $this->getState()->template = 'displaygroup-form-add';\n $this->getState()->setData([\n 'help' => $this->getHelp()->link('DisplayGroup', 'Add')\n ]);\n }", "private function loadForm()\n {\n // init settings form\n $this->frm = new Form('settings');\n\n // add festival year\n $this->frm->addText('year', $this->get('fork.settings')->get($this->URL->getModule(), 'year'));\n\n // add fields for pagination\n $this->frm->addDropdown(\n 'overview_num_items',\n array_combine(range(1, 30), range(1, 30)),\n $this->get('fork.settings')->get($this->URL->getModule(), 'overview_num_items', 10)\n );\n $this->frm->addDropdown(\n 'recent_festival_list_num_items',\n array_combine(range(1, 30), range(1, 30)),\n $this->get('fork.settings')->get($this->URL->getModule(), 'recent_festival_list_num_items', 5)\n );\n\n // add functions fields\n $this->frm->addCheckbox('cover_image_enabled', $this->get('fork.settings')->get($this->URL->getModule(), 'cover_image_enabled', false));\n $this->frm->addCheckbox('cover_image_required', $this->get('fork.settings')->get($this->URL->getModule(), 'cover_image_required', false));\n $this->frm->addCheckbox('multi_images_enabled', $this->get('fork.settings')->get($this->URL->getModule(), 'multi_images_enabled', false));\n\n // add god user only fields\n if ($this->godUser) {\n $this->frm->addText('image_size_limit', (float) $this->get('fork.settings')->get($this->URL->getModule(), 'image_size_limit', 10));\n }\n }", "abstract function setupform();", "function buildSettingsForm() {}", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: main properties');\r\n\r\n $shape[] =& $this->createElement('radio', null, null, 'Horizontal', '1');\r\n $shape[] =& $this->createElement('radio', null, null, 'Vertical', '2');\r\n $this->addGroup($shape, 'shape', 'Shape:');\r\n\r\n $way[] =& $this->createElement('radio', null, null, 'Natural', 'natural');\r\n $way[] =& $this->createElement('radio', null, null, 'Reverse', 'reverse');\r\n $this->addGroup($way, 'way', 'Direction:');\r\n\r\n $autosize[] =& $this->createElement('radio', null, null, 'Yes', true);\r\n $autosize[] =& $this->createElement('radio', null, null, 'No', false);\r\n $this->addGroup($autosize, 'autosize', 'Best size:');\r\n\r\n $psize['width'] =& $this->createElement('text',\r\n 'width', 'width',\r\n array('size' => 4));\r\n $psize['height'] =& $this->createElement('text',\r\n 'height', 'height',\r\n array('size' => 4));\r\n $psize['left'] =& $this->createElement('text',\r\n 'left', 'left',\r\n array('size' => 4));\r\n $psize['top'] =& $this->createElement('text',\r\n 'top', 'top',\r\n array('size' => 4));\r\n $psize['position'] =& $this->createElement('text',\r\n 'position', 'position',\r\n array('disabled' => 'true'));\r\n $psize['bgcolor'] =& $this->createElement('text',\r\n 'bgcolor', 'bgcolor',\r\n array('size' => 7));\r\n $this->addGroup($psize, 'progresssize',\r\n 'Size, position and color:', ' ');\r\n\r\n $this->addElement('text', 'rAnimSpeed',\r\n array('Animation speed :',\r\n '(0-1000 ; 0:fast, 1000:slow)'));\r\n $this->addRule('rAnimSpeed',\r\n 'Should be between 0 and 1000',\r\n 'rangelength', array(0,1000), 'client');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('back','apply','process'));\r\n }", "public function buildFormFields()\n {\n $this->addFormField(\n SharpTextFormFieldConfig::create(\"titre\")\n ->setLabel(\"Titre\")\n );\n\n $this->addFormField(\n SharpTextFormFieldConfig::create(\"soustitre\")\n ->setLabel(\"Sous-titre\")\n );\n\n $this->addFormField(\n SharpTextFormFieldConfig::create(\"slug\")\n ->setLabel(\"Slug\")\n );\n\n $this->addFormField(\n SharpTextFormFieldConfig::create(\"url\")\n ->setLabel(\"URL du projet\")\n );\n\n $this->addFormField(\n SharpMarkdownFormFieldConfig::create(\"texte\")\n ->setLabel(\"Texte\")\n ->showToolbar(true)\n );\n\n $this->addFormField(\n SharpCheckFormFieldConfig::create(\"is_open_source\")\n ->setText(\"Projet Open-source\")\n );\n\n $this->addFormField(\n SharpPivotFormFieldConfig::create(\"technos\", SharpTechnoRepository::class)\n ->setLabel(\"Technologies\")\n ->setAddable(true)\n ->setSortable(true)\n ->setOrderAttribute(\"ordre\")\n ->setCreateAttribute(\"nom\")\n );\n\n $this->addFormField(\n SharpListFormFieldConfig::create(\"screenshots\")\n ->setLabel(\"Screenshots\")\n ->setSortable(true)->setOrderAttribute(\"ordre\")\n ->setAddable(true)->setAddButtonText(\"Ajouter un screenshot\")\n ->setRemovable(true)->setRemoveButtonText(\"Supprimer\")\n ->addItemFormField(\n SharpFileFormFieldConfig::create(\"fichier\")\n ->setFileFilterImages()\n ->setMaxFileSize(5)\n ->setThumbnail(\"100x100\")\n ->addGeneratedThumbnail(\"600x\"))\n ->addItemFormField(\n SharpTextFormFieldConfig::create(\"tag\")\n ->addAttribute(\"placeholder\", \"Tag\"))\n ->addItemFormField(\n SharpTextareaFormFieldConfig::create(\"legende\")\n ->setRows(3))\n ->setItemFormTemplate(\n SharpListItemFormTemplateConfig::create()\n ->addField(\"fichier\")\n ->addField(\"tag\")\n ->addField(\"legende\")\n )\n );\n\n $this->addFormTemplateColumn(\n SharpFormTemplateColumnConfig::create(7)\n ->addField(\"titre\")\n ->addField(\"soustitre\")\n ->addField([\"slug:5\", \"url:7\"])\n ->addField(\"technos\")\n ->addField(\"is_open_source\")\n\n )->addFormTemplateColumn(\n SharpFormTemplateColumnConfig::create(5)\n ->addField(\"texte\")\n ->addField(\"screenshots\")\n );\n }", "function form_init_elements() \r\n {\r\n //we want an confirmation page for this form.\r\n //$this->set_confirm();\r\n\r\n // Course Info \r\n $elemT1 = new FEText( \"courseName\", true, 10);\r\n $elemT1->set_style_attribute('align', 'left');\r\n $elemT1->set_attribute(\"id\",\"coursename\");\r\n $elemT1->set_attribute(\"accesskey\",\"n\"); \r\n $this->add_element($elemT1);\r\n\r\n $elemP1 = new FETextArea(\"coursedataDescripcion\", true, 10, 50, null, 300);\r\n $elemP1->set_style_attribute('align', 'left');\r\n $elemP1->set_attribute(\"id\",\"coursedatadescripcion\"); \r\n $elemP1->set_attribute(\"accesskey\",\"d\"); \r\n $this->add_element($elemP1);\r\n\r\n include(Util::app_Path(\"andromeda/include/classes/nls.inc.php\"));\r\n $language = $this->_formatElem(\"FEListBox\", \"courseLanguage\", \"courseLanguage\", FALSE, \"100px\", NULL, $nls['languages_form']);\r\n $language->set_style_attribute('align', 'left');\r\n $language->set_attribute(\"id\",\"courselanguage\");\r\n $language->set_attribute(\"accesskey\",\"l\"); \r\n $this->add_element($language);\r\n \r\n $elemT2 = new FEText( \"coursedataVersion\", FALSE, 10);\r\n $elemT2->set_style_attribute('align', 'left');\r\n $elemT2->set_attribute(\"id\",\"coursedataversion\");\r\n $elemT2->set_attribute(\"accesskey\",\"v\"); \r\n $this->add_element($elemT2);\r\n \r\n $elemP2 = new FETextArea(\"coursedataPalabrasClaves\", false, 10, 50, null, 300);\r\n $elemP2->set_style_attribute('align', 'left');\r\n $elemP2->set_attribute(\"id\",\"coursedatapalabrasclaves\");\r\n $elemP2->set_attribute(\"accesskey\",\"w\"); \r\n $this->add_element($elemP2);\r\n\r\n $elemT3 = new FEText( \"coursedataDestinatarios\", FALSE, 10);\r\n $elemT3->set_style_attribute('align', 'left');\r\n $elemT3->set_attribute(\"id\",\"coursedatadestinatarios\");\r\n $elemT3->set_attribute(\"accesskey\",\"u\"); \r\n $this->add_element($elemT3);\r\n \r\n $elemP3 = new FETextArea(\"coursedataConocimientosPrevios\", false, 10, 50, null, 300);\r\n $elemP3->set_style_attribute('align', 'left');\r\n $elemP3->set_attribute(\"id\",\"coursedataconocimientosprevios\");\r\n $elemP3->set_attribute(\"accesskey\",\"k\"); \r\n $this->add_element($elemP3);\r\n\r\n $elemT4 = new FEText( \"coursedataMetodologia\", FALSE, 10);\r\n $elemT4->set_style_attribute('align', 'left');\r\n $elemT4->set_attribute(\"id\",\"coursedatametodologia\");\r\n $elemT4->set_attribute(\"accesskey\",\"m\"); \r\n $this->add_element($elemT4);\r\n\r\n $elemCB1 = new FECheckBox('courseActive', agt('Poner el curso activo.') );\r\n $elemCB1->set_style_attribute('align', 'left');\r\n $elemCB1->set_attribute(\"id\",\"courseactive\"); \r\n $elemCB1->set_attribute(\"accesskey\",\"o\"); \r\n $this->add_element( $elemCB1 );\r\n\r\n $elemCB2 = new FECheckBox('courseAccess', agt('Poner el curso accesible.') ); \r\n $elemCB2->set_style_attribute('align', 'left');\r\n $elemCB2->set_attribute(\"id\",\"courseaccess\");\r\n $elemCB2->set_attribute(\"accesskey\",\"p\"); \r\n $this->add_element( $elemCB2 ); \r\n\r\n $submit = $this->_formatElem(\"base_SubmitButton\", \"Aceptar\", \"submit\", agt(\"Insertar Curso\"));\r\n $submit->set_attribute(\"id\",\"submit\"); \r\n $submit->set_attribute(\"accesskey\",\"e\"); \r\n $this->add_element($submit);\r\n }", "public function addform()\n\t{\n\t\t\t$this->setMethod('get');\n\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($_GET);\n\t\t\t//echo \"</pre>\";\n\t\t\t$this->addElement('radio', 'Status', array(\n\t\t\t\t'required' => true,\n 'separator' => '&nbsp;',\n\t\t\t\t'multiOptions' => array(\n\t\t\t\t\t'1' => IN_PROGRESS,\n\t\t\t\t\t'2' => 'Closed'\n\t\t\t\t\t\n\t\t\t\t),\n\t\t\t\t\t'separator' => '',\n\t\t\t\t'value' => '1' //key of multiOption\n\t\t\t));\n\n\t\t\n\t\t\n\t\t$this->addElement ( \n 'multiCheckbox', 'Functional_type', \n array (\n \n\t\t//'setrequired' => true,\n 'multiOptions' => array(\n '1' => 'Pre Installation',\n '2' => 'Installation',\n '3' => 'Post Installation'\n \n ),\n 'separator' => '',\n\t\t\t\t\t//'value' => '2' // select these 2 values\n )\n);\n\t\n\t\t\t\t\n\t\t\t$this->addElement('submit', 'submit', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t\t\t'label' => 'Submit',\n\t\t\t));\n\t\t\t\n\t\t\t// And finally add some CSRF protection\n\t\t\t$this->addElement('hash', 'csrf', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t));\t\n\t}", "public function displayForm()\r\n {\r\n $id_default_lang = $this->context->language->id;\r\n $languages = $this->context->language->getLanguages();\r\n\r\n $fields_form = array(\r\n 'fieldbrandslider-general' => array(\r\n 'form' => array(\r\n 'legend' => array(\r\n 'title' => $this->l('Manufacturer Carousel Options'),\r\n 'icon' => 'icon-cogs'\r\n ),\r\n 'input' => array(\r\n array(\r\n 'type' => 'text',\r\n 'name' => 'fieldbrand_title',\r\n 'label' => $this->l('Title'),\r\n 'desc' => $this->l('This title will appear just before the manufacturer carousel, leave it empty to hide it completely'),\r\n 'required' => false,\r\n 'lang' => true,\r\n ),\r\n array(\r\n 'type' => 'text',\r\n 'name' => 'fieldbrand_maxitem',\r\n 'label' => $this->l('Max item'),\r\n 'desc' => $this->l('The item number is showing on desstop screen'),\r\n 'suffix' => 'item',\r\n 'class' => 'fixed-width-xs',\r\n 'required' => false,\r\n 'lang' => false,\r\n ),\r\n array(\r\n 'type' => 'text',\r\n 'name' => 'fieldbrand_minitem',\r\n 'label' => $this->l('Min item'),\r\n 'desc' => $this->l('The item number is showing on mobile'),\r\n 'suffix' => 'item',\r\n 'class' => 'fixed-width-xs',\r\n 'required' => false,\r\n 'lang' => false,\r\n ),\r\n array(\r\n 'type' => 'switch',\r\n 'label' => $this->l('Auto scroll'),\r\n 'desc' => $this->l('Scroll the manufacturers automatically'),\r\n 'name' => 'fieldbrand_autoscroll',\r\n 'required' => false,\r\n 'is_bool' => true,\r\n 'values' => array(\r\n array(\r\n 'id' => 'autoscroll_on',\r\n 'value' => 1,\r\n 'label' => $this->l('On')\r\n ),\r\n array(\r\n 'id' => 'autoscroll_off',\r\n 'value' => 0,\r\n 'label' => $this->l('Off')\r\n )\r\n )\r\n ),\r\n array(\r\n 'type' => 'text',\r\n 'name' => 'fieldbrand_autoscrolldelay',\r\n 'label' => $this->l('Auto scroll delay'),\r\n 'desc' => $this->l('Delay between the auto scrolls'),\r\n 'suffix' => 'milliseconds',\r\n 'required' => false,\r\n 'lang' => false,\r\n ),\r\n array(\r\n 'type' => 'switch',\r\n 'label' => $this->l('Pause on hover'),\r\n 'desc' => $this->l('Pause the carousel on mouse hover'),\r\n 'name' => 'fieldbrand_pauseonhover',\r\n 'required' => false,\r\n 'is_bool' => true,\r\n 'values' => array(\r\n array(\r\n 'id' => 'pauseonhover_on',\r\n 'value' => 1,\r\n 'label' => $this->l('On')\r\n ),\r\n array(\r\n 'id' => 'pauseonhover_off',\r\n 'value' => 0,\r\n 'label' => $this->l('Off')\r\n )\r\n )\r\n ),\r\n array(\r\n 'type' => 'switch',\r\n 'label' => $this->l('Show pagination'),\r\n 'name' => 'fieldbrand_pagination',\r\n 'required' => false,\r\n 'is_bool' => true,\r\n 'values' => array(\r\n array(\r\n 'id' => 'pagination_on',\r\n 'value' => 1,\r\n 'label' => $this->l('On')\r\n ),\r\n array(\r\n 'id' => 'pagination_off',\r\n 'value' => 0,\r\n 'label' => $this->l('Off')\r\n )\r\n )\r\n ),\r\n array(\r\n 'type' => 'switch',\r\n 'label' => $this->l('Show navigation'),\r\n 'name' => 'fieldbrand_navigation',\r\n 'required' => false,\r\n 'is_bool' => true,\r\n 'values' => array(\r\n array(\r\n 'id' => 'navigation_on',\r\n 'value' => 1,\r\n 'label' => $this->l('On')\r\n ),\r\n array(\r\n 'id' => 'navigation_off',\r\n 'value' => 0,\r\n 'label' => $this->l('Off')\r\n )\r\n )\r\n ),\r\n array(\r\n 'type' => 'switch',\r\n 'label' => $this->l('Show manufacturers title'),\r\n 'name' => 'fieldbrand_mantitle',\r\n 'required' => false,\r\n 'is_bool' => true,\r\n 'values' => array(\r\n array(\r\n 'id' => 'mantitle_on',\r\n 'value' => 1,\r\n 'label' => $this->l('On')\r\n ),\r\n array(\r\n 'id' => 'mantitle_off',\r\n 'value' => 0,\r\n 'label' => $this->l('Off')\r\n )\r\n )\r\n )\r\n ),\r\n // Submit Button\r\n 'submit' => array(\r\n 'title' => $this->l('Save'),\r\n 'name' => 'saveFrontpageBlocksOptions'\r\n )\r\n )\r\n )\r\n );\r\n\r\n $helper = new HelperForm();\r\n\r\n $helper->module = $this;\r\n $helper->name_controller = $this->name;\r\n $helper->token = Tools::getAdminTokenLite('AdminModules');\r\n $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;\r\n\r\n $helper->default_form_language = $id_default_lang;\r\n $helper->allow_employee_form_lang = $id_default_lang;\r\n\r\n $helper->title = $this->displayName;\r\n $helper->show_toolbar = true;\r\n $helper->toolbar_scroll = true;\r\n $helper->submit_action = 'submit'.$this->name;\r\n\r\n foreach($languages as $language){\r\n $helper->languages[] = array(\r\n 'id_lang' => $language['id_lang'],\r\n 'iso_code' => $language['iso_code'],\r\n 'name' => $language['name'],\r\n 'is_default' => ($id_default_lang == $language['id_lang'] ? 1 : 0)\r\n );\r\n }\r\n\r\n // Load current values\r\n $helper->fields_value['fieldbrand_maxitem'] = Configuration::get($this->name . '_MAXITEM');\r\n $helper->fields_value['fieldbrand_minitem'] = Configuration::get($this->name . '_MINITEM');\r\n $helper->fields_value['fieldbrand_autoscroll'] = Configuration::get($this->name . '_AUTOSCROLL');\r\n $helper->fields_value['fieldbrand_autoscrolldelay'] = Configuration::get($this->name . '_AUTOSCROLLDELAY');\r\n $helper->fields_value['fieldbrand_pauseonhover'] = Configuration::get($this->name . '_PAUSEONHOVER');\r\n $helper->fields_value['fieldbrand_pagination'] = Configuration::get($this->name . '_PAGINATION');\r\n $helper->fields_value['fieldbrand_navigation'] = Configuration::get($this->name . '_NAVIGATION');\r\n $helper->fields_value['fieldbrand_mantitle'] = Configuration::get($this->name . '_MANTITLE');\r\n\r\n foreach($languages as $language){\r\n $helper->fields_value['fieldbrand_title'][$language['id_lang']] = Configuration::get($this->name . '_TITLE', $language['id_lang']);\r\n }\r\n\r\n return $helper->generateForm($fields_form);\r\n }", "function creaped() {\n\t\t// Esto debe hacerse por dataform\n\t\t$styles = \"\\n<!-- Estilos -->\\n\";\n\t\t$styles .= style('rapyd.css');\n\t\t$styles .= style('ventanas.css');\n\t\t$styles .= style('themes/proteo/proteo.css');\n\t\t$styles .= style(\"themes/ui.jqgrid.css\");\n\t\t$styles .= style(\"themes/ui.multiselect.css\");\n\t\t$styles .= style('layout1.css');\n\t\t$styles .= '<link rel=\"stylesheet\" href=\"'.base_url().'system/application/rapyd/elements/proteo/css/rapyd_components.css\" type=\"text/css\" />'.\"\\n\";\n\n\n\t\t$styles .= '\n<style type=\"text/css\">\n\tp {font-size:1em; margin: 1ex 0;}\n\tp.buttons {text-align:center;line-height:2.5em;}\n\tbutton {line-height: normal;}\n\t.hidden {display: none;}\n\tul {z-index:100000;margin:1ex 0;padding:0;list-style:none;cursor:pointer;border:1px solid Black;width:15ex;position:\trelative;}\n\tul li {background-color: #EEE;padding: 0.15em 1em 0.3em 5px;}\n\tul ul {display:none;position:absolute;width:100%;left:-1px;bottom:0;margin:0;margin-bottom: 1.55em;}\n\t.ui-layout-north ul ul {bottom:auto;margin:0;margin-top:1.45em;}\n\tul ul li { padding: 3px 1em 3px 5px; }\n\tul ul li:hover { background-color: #FF9; }\n\tul li:hover ul { display:block; background-color: #EEE; }\n\n\t#feedback { font-size: 0.8em; }\n\t#tablas .ui-selecting { background: #FECA40; }\n\t#tablas .ui-selected { background: #F39814; color: white; }\n\t#tablas { list-style-type: none; margin: 0; padding: 0; width: 90%; }\n\t#tablas li { margin: 1px; padding: 0em; font-size: 0.8em; height: 14px; }\n\n\ttable.tc td.header {padding-right: 1px;padding-left: 1px;font-weight: bold;font-size: 8pt;color: navy;background-color: #f4edd5;text-align:center;}\n\ttable.tc td.title{padding-right: 1px;padding-left: 1px;font-weight: bold;font-size: 8pt;color:navy;text-align:center;background-color: #fdffdf;}\n\ttable.tc td.resalte{border-left:solid 1px #daac00;border-top:solid 1px #daac00;text-align:center;font-weight: bold;}\n\ttable.tc td{ border-left:solid 1px #DAAC00;border-TOP:solid 1px #DAAC00;}\n\ttable.tc {border-right: #daac00 1px solid;padding-right: 0px;border-top: medium none;padding-left: 0px;padding-bottom: 0px;border-left: medium none;border-bottom: #daac00 1px solid;font-family: verdana;font-size:8pt;cellspacing: 0px}\n\ttable.tc td.sin_borde{border-left:solid 1px #DAAC00;border-TOP:solid 1px #DAAC00;text-align:center;border-right:solid 5px #f6f6f6;border-bottom:solid 5px #f6f6f6;}\n\n\t.custom-combobox {position: relative;display: inline-block;}\n\t.custom-combobox-toggle {position: absolute;top: 0;bottom: 0;margin-left: -1px;padding: 0;}\n\t.custom-combobox-input {margin: 0;padding: 5px 10px;}\n\n</style>\n';\n\n\t\t$title = \"\n<div id='encabe'>\n<table width='98%'>\n\t<tr>\n\t\t<td>\".heading('Generar Orden de Produccion').\"</td>\n\t\t<td align='right' width='40'>\".image('cerrar.png','Cerrar Ventana',array('onclick'=>'window.close()','height'=>'20')).\"</td>\n\t</tr>\n</table>\n</div>\n\";\n\t\t$script = \"\\n<!-- JQUERY -->\\n\";\n\t\t$script .= script('jquery-min.js');\n\t\t$script .= script('jquery-migrate-min.js');\n\t\t$script .= script('jquery-ui.custom.min.js');\n\n\t\t$script .= script(\"jquery.layout.js\");\n\t\t$script .= script(\"i18n/grid.locale-sp.js\");\n\n\t\t$script .= script(\"ui.multiselect.js\");\n\t\t$script .= script(\"jquery.jqGrid.min.js\");\n\t\t$script .= script(\"jquery.tablednd.js\");\n\t\t$script .= script(\"jquery.contextmenu.js\");\n\n\t\t$script .= script('plugins/jquery.numeric.pack.js');\n\t\t$script .= script('plugins/jquery.floatnumber.js');\n\t\t$script .= script('plugins/jquery.maskedinput.min.js');\n\n\t\t$script .= '\n<script type=\"text/javascript\">\n\t$(function(){\n\t\t$(\".inputnum\").numeric(\".\");\n\t});\n\t$(function() {\n\t\t$( \"input:submit, a, button\", \".botones\",\".otros\" ).button();\n\t});\n';\n\n\t\t$script .= '\n\t// set EVERY state here so will undo ALL layout changes\n\t// used by the Reset State button: myLayout.loadState( stateResetSettings )\n\tvar stateResetSettings = {\n\t\tnorth__size:\t\t\"auto\"\n\t,\tnorth__initClosed:\tfalse\n\t,\tnorth__initHidden:\tfalse\n\t,\tsouth__size:\t\t\"auto\"\n\t,\tsouth__initClosed:\tfalse\n\t,\tsouth__initHidden:\tfalse\n\t,\twest__size:\t\t\t200\n\t,\twest__initClosed:\tfalse\n\t,\twest__initHidden:\tfalse\n\t,\teast__size:\t\t\t100\n\t,\teast__initClosed:\ttrue\n\t,\teast__initHidden:\ttrue\n\n\t};\n\n\tvar myLayout;\n\n\t$(document).ready(function () {\n\n\t\t// this layout could be created with NO OPTIONS - but showing some here just as a sample...\n\t\t// myLayout = $(\"body\").layout(); -- syntax with No Options\n\n\t\tmyLayout = $(\"body\").layout({\n\n\t\t//\treference only - these options are NOT required because \"true\" is the default\n\t\t\tclosable: true,\tresizable:\ttrue, slidable:\ttrue, livePaneResizing:\ttrue\n\t\t//\tsome resizing/toggling settings\n\t\t,\tnorth__slidable: false, north__togglerLength_closed: \"100%\", north__spacing_closed:\t20\n\t\t,\tsouth__resizable:false,\tsouth__spacing_open:0\n\t\t,\tsouth__spacing_closed:20\n\t\t//\tsome pane-size settings\n\t\t,\twest__minSize: 100, east__size: 100, east__minSize: 50, east__maxSize: .5, center__minWidth: 100\n\t\t//\tsome pane animation settings\n\t\t,\twest__animatePaneSizing: false,\twest__fxSpeed_size:\t\"fast\",\twest__fxSpeed_open: 1000\n\t\t,\twest__fxSettings_open:{ easing: \"easeOutBounce\" },\twest__fxName_close:\"none\"\n\t\t//\tenable showOverflow on west-pane so CSS popups will overlap north pane\n\t\t//,\twest__showOverflowOnHover:\ttrue\n\t\t,\tstateManagement__enabled:true, showDebugMessages: true\n\t\t});\n\n\t\t$(function() {\n\t\t\t$(\"button\").button().click(function(event) {event.preventDefault();});\n\t\t\t//$( \"#almacen\" ).combobox();\n\t\t});\n\n\n \t});\n\n\tfunction sumar(j){\n\t\tvar nn = \\'[name=\"codigo_\\'+j+\\'\"]\\';\n\t\tvar k = 0;\n\t\tvar t;\n\t\tvar totalc = 0;\n\t\tvar maximo = 0;\n\n\t\t// Valida el maximo\n\t\t$(\"#resultados\").html(\"Maximo \"+maximo);\n\n\t\t$(nn).each( function() {\n\t\t\tk = $(this).val();\n\t\t\tt = Number($(\"#cana_\"+k).val());\n\t\t\tmaximo = Number($(\"#falta_\"+k).val());\n\t\t\tif ( t > maximo ){\n\t\t\t\tt = maximo;\n\t\t\t\t$(\"#cana_\"+k).val(maximo);\n\t\t\t}\n\t\t\ttotalc += t;\n\t\t});\n\t\t$(\\'#totalc_\\'+j).val(totalc);\n\t}\n\n\tfunction guardar(){\n\t\talert(\"Guardar\");\n\t\t$.post( \"'.base_url().'inventario/prdo/guardaoe\", $(\"#guardar\").serialize(),\n\t\t\tfunction(data) {\n\t\t\t\talert(data);\n\t\t\t\tlocation.reload();\n\t\t\t\twindow.opener.actualiza();\n\t\t\t}\n\t\t);\n\t}\n</script>\n';\n\n// ENCABEZADO\n$tabla = '\n<div class=\"ui-layout-north\" onmouseover=\"myLayout.allowOverflow(\\'north\\')\" onmouseout=\"myLayout.resetOverflow(this)\">\n<table width=\"100%\" bgcolor=\"#2067B5\">\n\t<tr>\n\t\t<td align=\"left\" width=\"80px\"><img src=\"'.base_url().'assets/default/css/templete_01.jpg\" width=\"120\"></td><td align=\"center\"><h1 style=\"font-size: 20px; color: rgb(255, 255, 255);\" onclick=\"history.back()\">ORDEN DE PRODUCCION</h1></td><td align=\"left\" width=\"100px\" nowrap=\"nowrap\"><font style=\"color:#FFFFFF;font-size:12px\">Usuario: '.$this->secu->usuario().'<br/>'.$this->secu->getnombre().'</font></td><td align=\"right\" width=\"28px\"></td>\n\t</tr>\n</table>\n</div>\n';\n\n// IZQUIERDO\n$tabla .= '\n<div class=\"ui-layout-west\">\n<form id=\"guardar\" >\n<center>\n<lable>Almacen</lable> ';\n$tabla .= $this->datasis->llenaopciones(\"SELECT ubica, ubides FROM caub WHERE gasto='N' ORDER BY ubica\", false, $id='almacen' );\n\n$tabla .= '\n\t<br><br>\n\t<lable>Instruciones</lable>\n\t<textarea rows=\"4\" cols=\"25\" id=\"instrucciones\" name=\"instrucciones\"></textarea>\n\t<br><br>\n\t<button type=\"button\" onclick=\"guardar()\">Guardar Orden</button>\n\t<div id=\"resultados\"></div>\n</center>\n</div>';\n\n// INFERIOR\n$tabla .= '\n<div class=\"ui-layout-south\">\n';\n\n$tabla .= $this->datasis->traevalor('TITULO1');\n\n$tabla .= '\n</div>\n';\n\n// DERECHA\n$tabla .= '\n<div class=\"ui-layout-east\">\n</div>\n';\n\n// CENTRO\n$norden = $this->datasis->dameval('SELECT MAX(id) maxi FROM prdo');\nif ($norden == '') $norden = 0;\n\n$tabla .= '\n<div class=\"ui-layout-center\">';\n\n$mSQL = '\nSELECT a.id, b.numero, b.fecha, b.cod_cli, b.nombre, a.codigoa, a.desca, a.cana, COALESCE(sum(e.ordenado),0) producido, a.cana-COALESCE(sum(e.ordenado),0) falta, COALESCE(sum(e.ordenado),0) ordenado, d.ruta, d.descrip\nFROM itpfac a\nJOIN pfac b ON a.numa = b.numero\nLEFT JOIN sclitrut c ON b.cod_cli=c.cliente\nLEFT JOIN sclirut d ON c.ruta=d.ruta\nLEFT JOIN itprdo e ON a.id = e.idpfac\nWHERE b.producir=\"S\" AND ( b.ordprod=\"\" OR b.ordprod IS NULL )\nGROUP BY a.id\nHAVING falta>0\nORDER BY a.codigoa, d.ruta, a.numa\n';\n\n$query = $this->db->query($mSQL);\n$ruta = 'XX0XX';\n$codigo = 'XXZZWWXXWWXXZZZZ';\n$i = 0;\n$c = 0;\nif ($query->num_rows() > 0){\n\tforeach ($query->result() as $row){\n\t\tif ( $codigo != $row->codigoa ){\n\t\t\tif ( $i > 0 ) $tabla .= \"</tbody></table><br>\\n\";\n\t\t\t$tabla .= '<table class=\"tc\" width=\"100%\">';\n\t\t\t$tabla .= \"<tbody>\\n\";\n\n\t\t\tif ( $i > 0 ) $c++;\n\n\t\t\t$tabla .= \"<tr style='background:#2067B5;color:#FFFFFF;'>\\n\";\n\t\t\t$tabla .= \"\t<td colspan='7'>Cod: \".$row->codigoa.\" Desc: \".$row->desca.\"</td>\\n\";\n\t\t\t//$tabla .= \"\t<td>&nbsp;</td>\\n\";\n\t\t\t$tabla .= \"\t<td><input class='inputnum' name='totalc_$c' id='totalc_$c' size='4' type='text' readonly></td>\\n\";\n\t\t\t$tabla .= \"</tr>\\n\";\n\n\t\t\t$tabla .= \"<tr bgcolor='#BEDCFD'>\\n\";\n\t\t\t$tabla .= \"\t<td >Ruta</td>\\n\";\n\t\t\t$tabla .= \"\t<td >Pedido</td>\\n\";\n\t\t\t$tabla .= \"\t<td >Fecha</td>\\n\";\n\t\t\t$tabla .= \"\t<td >Cliente</td>\\n\";\n\t\t\t$tabla .= \"\t<td >Nombre</td>\\n\";\n\t\t\t$tabla .= \"\t<td >Cantidad</td>\\n\";\n\t\t\t$tabla .= \"\t<td >Producido</td>\\n\";\n\t\t\t$tabla .= \"\t<td >Ordenado</td>\\n\";\n\t\t\t$tabla .= \"</tr>\\n\";\n\n\t\t\t$codigo = $row->codigoa;\n\t\t}\n\n\t\t$tabla .= \"<tr>\\n\";\n\t\t$tabla .= \"\t<td><a href='#' title='\".$row->descrip.\"'>\".$row->ruta.\"&nbsp;</a></td>\\n\";\n\t\t$tabla .= \"\t<td>\".$row->numero.\"</td>\\n\";\n\t\t$tabla .= \"\t<td>\".$row->fecha.\"</td>\\n\";\n\t\t$tabla .= \"\t<td>\".$row->cod_cli.\"</td>\\n\";\n\t\t$tabla .= \"\t<td>\".$row->nombre.\"</td>\\n\";\n\t\t$tabla .= \"\t<td align='right'>\".$row->cana.\"</td>\\n\";\n\t\t$tabla .= \"\t<td align='right'>\".$row->producido.\"</td>\\n\";\n\n\t\t$tabla .= \"\t<td>\\n\";\n\t\t$tabla .= \"\t\t<input class='inputnum' name='cana_$i' id='cana_$i' size='4' onkeyUp='sumar($c)' value='0.00' >\\n\";\n\t\t$tabla .= \"\t\t<input name='codigo_$c' id='codigo_$c' type='hidden' value='$i' >\\n\";\n\t\t$tabla .= \"\t\t<input name='idpfac_$i' id='idpfac_$i' type='hidden' value='\".$row->id. \"' >\\n\";\n\t\t$tabla .= \"\t\t<input name='falta_$i' id='falta_$i' type='hidden' value='\".$row->falta.\"' >\\n\";\n\t\t$tabla .= \"\t</td>\\n\";\n\n\t\t$tabla .= \"</tr>\\n\";\n\t\t$i++;\n\t}\n\t$tabla .= \"</table>\\n\";\n}\n\n$tabla .= '\n<input id=\"totalitem\" name=\"totalitem\" type=\"hidden\" value=\"'.$i.'\">\n</form>\n</div>\n';\n\t\t$data['content'] = $tabla;\n\t\t$data['title'] = $title;\n\t\t$data['head'] = $styles;\n\t\t$data['head'] .= $script;\n\t\t$this->load->view('view_ventanas_lite',$data);\n\t}", "public function form()\n {\n $this->switch('footer_remove', Support::trans('main.footer_remove'))\n ->default(admin_setting('footer_remove'));\n $defaultColors = [\n 'default' => '墨蓝',\n 'blue' => '蓝',\n 'blue-light' => '亮蓝',\n 'green' => '墨绿',\n ];\n foreach (explode(\",\", ServiceProvider::setting('additional_theme_colors')) as $value) {\n if (!empty($value)) {\n [$k, $v] = explode(\":\", $value);\n $defaultColors[$k] = $v;\n }\n }\n\n $this->radio('theme_color', Support::trans('main.theme_color'))\n ->options($defaultColors)\n ->default(admin_setting('theme_color'));\n $this->radio('sidebar_style', Support::trans('main.sidebar_style'))\n ->options([\n 'default' => '默认',\n 'sidebar-separate' => '菜单分离',\n 'horizontal_menu' => '水平菜单'\n ])\n ->default(admin_setting('sidebar_style'));\n $this->switch('grid_row_actions_right', Support::trans('main.grid_row_actions_right'))\n ->help('启用后表格行操作按钮将永远贴着最右侧。')\n ->default(admin_setting('grid_row_actions_right'));\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 }", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: string properties');\r\n\r\n $stringpainted[] =& $this->createElement('radio', null, null, 'Yes', true);\r\n $stringpainted[] =& $this->createElement('radio', null, null, 'No', false);\r\n $this->addGroup($stringpainted, 'stringpainted', 'Render a custom string:');\r\n\r\n $this->addElement('text', 'stringid', 'Id:', array('size' => 32));\r\n $this->addElement('text', 'stringclass', 'CSS class:', array('size' => 32));\r\n $this->addElement('text', 'stringvalue', 'Content:', array('size' => 32));\r\n\r\n $stringsize['width'] =& $this->createElement('text',\r\n 'width', 'width',\r\n array('size' => 4));\r\n $stringsize['height'] =& $this->createElement('text',\r\n 'height', 'height',\r\n array('size' => 4));\r\n $stringsize['left'] =& $this->createElement('text',\r\n 'left', 'left',\r\n array('size' => 4));\r\n $stringsize['top'] =& $this->createElement('text',\r\n 'top', 'top',\r\n array('size' => 4));\r\n $stringsize['bgcolor'] =& $this->createElement('text',\r\n 'bgcolor', 'bgcolor',\r\n array('size' => 7));\r\n $this->addGroup($stringsize, 'stringsize', 'Size, position and color:', ' ');\r\n\r\n $stringvalign[] =& $this->createElement('radio', null, null,\r\n 'Left', 'left');\r\n $stringvalign[] =& $this->createElement('radio', null, null,\r\n 'Right', 'right');\r\n $stringvalign[] =& $this->createElement('radio', null, null,\r\n 'Top', 'top');\r\n $stringvalign[] =& $this->createElement('radio', null, null,\r\n 'Bottom', 'bottom');\r\n $this->addGroup($stringvalign, 'stringvalign', 'Vertical alignment:');\r\n\r\n $stringalign[] =& $this->createElement('radio', null, null,\r\n 'Left', 'left');\r\n $stringalign[] =& $this->createElement('radio', null, null,\r\n 'Right', 'right');\r\n $stringalign[] =& $this->createElement('radio', null, null,\r\n 'Center', 'center');\r\n $this->addGroup($stringalign, 'stringalign', 'Horizontal alignment:');\r\n\r\n $stringfont['family'] =& $this->createElement('text',\r\n 'family', 'family',\r\n array('size' => 40));\r\n $stringfont['size'] =& $this->createElement('text',\r\n 'size', 'size',\r\n array('size' => 2));\r\n $stringfont['color'] =& $this->createElement('text',\r\n 'color', 'color',\r\n array('size' => 7));\r\n $this->addGroup($stringfont, 'stringfont', 'Font:', ' ');\r\n\r\n $stringweight[] =& $this->createElement('radio', null, null,\r\n 'normal', 'normal');\r\n $stringweight[] =& $this->createElement('radio', null, null,\r\n 'Bold', 'bold');\r\n $this->addGroup($stringweight, 'stringweight', 'Font weight:');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('apply','process'));\r\n }", "public function addform()\n\t{\n \n\t\t$this->setMethod('post');\n\t\t $this->setAttrib('enctype', 'multipart/form-data');\n\n\t\t$this->addElement('file', 'upload_image', array( \n\t\t\t'label' => '',\n 'required' => false\n ));\n\n // Add the submit button\n $this->addElement('submit', 'submit', array(\n 'ignore' => true,\n 'label' => 'Submit',\n ));\n\n // And finally add some CSRF protection\n $this->addElement('hash', 'csrf', array(\n 'ignore' => true,\n ));\n\n\n\t}", "function form_init_elements()\r\n {\r\n $this->add_hidden_element(\"swimmeetid\") ;\r\n\r\n // This is used to remember the action\r\n // which originated from the GUIDataList.\r\n \r\n $this->add_hidden_element(\"_action\") ;\r\n }", "public function buildFormFields()\n {\n $this->addField(\n SharpFormTextField::make('title')\n ->setLabel('Title')\n )->addField(\n SharpFormUploadField::make('cover')\n ->setLabel('Cover')\n ->setFileFilterImages()\n ->setCropRatio('1:1')\n ->setStorageBasePath('data/service')\n )->addField(\n SharpFormNumberField::make('price')\n ->setLabel('Price')\n )->addField(\n SharpFormMarkdownField::make('description')->setToolbar([\n SharpFormMarkdownField::B, SharpFormMarkdownField::I,\n SharpFormMarkdownField::SEPARATOR,\n SharpFormMarkdownField::IMG,\n SharpFormMarkdownField::SEPARATOR,\n SharpFormMarkdownField::A,\n ])\n )->addField(\n SharpFormTagsField::make('tags',\n Tag::orderBy('label')->get()->pluck('label', 'id')->all()\n )->setLabel('Tags')\n ->setCreatable(true)\n ->setCreateAttribute('name')\n );\n }", "public function renderForm()\n {\n $lang = $this->context->language;\n\n $inputs[] = [\n 'type' => 'switch',\n 'label' => $this->l(\"Active\"),\n 'name' => 'active',\n 'values' => [\n [\n 'id' => 'active_on',\n 'value' => 1,\n ],\n [\n 'id' => 'active_off',\n 'value' => 0,\n ],\n ]\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Page Name'),\n 'name' => 'name',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Title'),\n 'name' => 'meta_title_lang',\n 'required' => true,\n 'id' => 'name',\n 'lang' => true,\n 'class' => 'copyMeta2friendlyURL',\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Description'),\n 'name' => 'meta_description_lang',\n 'lang' => true,\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'tags',\n 'label' => $this->l('Meta Keywords'),\n 'name' => 'meta_keywords_lang',\n 'lang' => true,\n 'hint' => [\n $this->l('To add \"tags\" click in the field, write something, and then press \"Enter.\"'),\n $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ],\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Friendly URL'),\n 'name' => 'url',\n 'required' => true,\n 'hint' => $this->l('Only letters and the hyphen (-) character are allowed.'),\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Breadcrumb URL Parameters'),\n 'name' => 'breadcrumb_parameters',\n 'required' => false,\n 'hint' => $this->l('Parameters to be applied when rendering as a breadcrumb'),\n ];\n\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'css',\n 'label' => $this->l('Style'),\n 'name' => 'style',\n 'lang' => false,\n //'autoload_rte' => true,\n 'id' => 'style',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 50,\n ];\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'html',\n 'label' => $this->l('Content'),\n 'name' => 'content_lang',\n 'lang' => true,\n //'autoload_rte' => true,\n 'id' => 'content',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 70,\n ];\n\n\n $allPages = $this->module->getAllHTMLPages(true);\n array_unshift($allPages, '-');\n\n\n if ($this->display == 'edit') {\n $inputs[] = [\n 'type' => 'hidden',\n 'name' => 'id_page'\n ];\n $title = $this->l('Edit Page');\n $action = 'submitEditCustomHTMLPage';\n\n $pageId = Tools::getValue('id_page');\n\n $this->fields_value = $this->module->getHTMLPage($pageId);\n\n // Remove the current page from the list of pages\n foreach ($allPages as $i => $p) {\n if ($p != '-' && $p['id_page'] == $pageId) {\n unset($allPages[$i]);\n break;\n }\n }\n }\n else {\n\n }\n\n // Parent select\n $inputs[] = [\n 'type' => 'select',\n 'label' => $this->l('Parent'),\n 'name' => 'id_parent',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ]\n ];\n //$this->fields_value['id_relatedTo'] = [];\n\n array_shift($allPages);\n\n // List of Pages this Page is related to\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Show On ($page->related[])'),\n 'multiple' => true,\n 'name' => 'id_relatedTo',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ],\n 'hint' => $this->l('Makes this page show up on other pages (not as a child page but as a related page): $page->related[]')\n ];\n\n $inputs[] = [\n 'type' => 'html',\n 'html_content' => '<hr/>',\n 'name' => 'id_page',\n ];\n\n // List of Products\n $products = Product::getProducts($lang->id, 0, 1000, 'id_product', 'ASC');\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Products ($product or $products)'),\n 'name' => 'id_products',\n 'multiple' => true,\n 'options' => [\n 'query' => $products,\n 'id' => 'id_product',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $products. If only one is selected then $product will be populated'),\n ];\n\n // List of Categories\n $categories = Category::getCategories($lang->id, true, false);\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Categories ($category or $categories)'),\n 'name' => 'id_categories',\n 'multiple' => true,\n 'options' => [\n 'query' => $categories,\n 'id' => 'id_category',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $categories. If only one is selected then $category will be populated'),\n ];\n\n $this->fields_form = [\n 'legend' => [\n 'title' => $title,\n 'icon' => 'icon-cogs',\n ],\n 'input' => $inputs,\n 'buttons' => [\n 'save-and-stay' => [\n 'title' => $this->l('Save and Stay'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action.'AndStay',\n 'icon' => 'process-icon-save',\n 'type' => 'submit'\n ]\n\n ],\n 'submit' => [\n 'title' => $this->l('Save'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action,\n ],\n\n ];\n\n\n return parent::renderForm();\n }", "private function createMyForm()\n {\n $form = $this->Form();\n\n $form->setElement(\n 'select',\n 'paypalPlusCountries',\n array(\n 'label' => 'Länder bei denen „PayPal PLUS“ angezeigt wird',\n 'value' => array(2),\n 'store' => 'base.Country',\n 'multiSelect' => true,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n )\n );\n $form->setElement(\n 'boolean',\n 'paypalHidePaymentSelection',\n array(\n 'label' => 'Zahlungsart-Auswahl im Bestellabschluss ausblenden (Shopware 4)',\n 'value' => true,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n )\n );\n $form->setElement(\n 'text',\n 'paypalPlusDescription',\n array(\n 'label' => 'Zahlungsart-Bezeichnung überschreiben',\n 'value' => 'PayPal, Lastschrift oder Kreditkarte',\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n )\n );\n $form->setElement(\n 'text',\n 'paypalPlusAdditionalDescription',\n array(\n 'label' => 'Zahlungsart-Beschreibung ergänzen',\n 'value' => 'Zahlung per Lastschrift oder Kreditkarte ist auch ohne PayPal-Konto möglich.',\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n )\n );\n }", "public function renderForm() {\n\n $id_default_lang = $this->context->language->id;\n $id_shop = $this->context->shop->id;\n\n /* Render Form */\n $carousel_types = array(\n array(\n 'value' => 'featured',\n 'name' => $this->l('Featured products')\n ),\n array(\n 'value' => 'new',\n 'name' => $this->l('New products')\n ),\n array(\n 'value' => 'special',\n 'name' => $this->l('Special products')\n ),\n array(\n 'value' => 'category',\n 'name' => $this->l('All products from certain category')\n ),\n array(\n 'value' => 'custom',\n 'name' => $this->l('Custom products')\n )\n );\n\n // Get Categories\n $root_category = Category::getRootCategory($id_default_lang);\n $this->_getCategories($root_category->id_category, $id_shop);\n\n // Init Fields form array\n $this->fields_form = array(\n 'legend' => array(\n 'title' => $this->l('Carousel'),\n 'icon' => 'icon-cogs'\n ),\n // Inputs\n 'input' => array(\n array(\n 'type' => 'text',\n 'label' => $this->l('Carousel Title'),\n 'name' => 'title',\n 'desc' => $this->l('Must be less than 250 characters.'),\n 'size' => 50,\n 'required' => true,\n 'lang' => true\n ),\n array(\n 'type' => 'select',\n 'name' => 'carousel_type',\n 'label' => $this->l('Carousel Content'),\n 'required' => false,\n 'lang' => false,\n 'options' => array(\n 'query' => $carousel_types,\n 'id' => 'value',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'name' => 'select_category',\n 'label' => $this->l('Select a category'),\n 'required' => false,\n 'lang' => false,\n 'options' => array(\n 'query' => $this->_categorySelect,\n 'id' => 'value',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Add a product'),\n 'name' => 'product_autocomplete',\n 'size' => 50,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Carousel Content'),\n 'name' => 'carousel_content',\n 'size' => 50\n ),\n ),\n // Submit Button\n 'submit' => array(\n 'title' => $this->l('Save'),\n 'name' => 'saveProductCarousel'\n )\n );\n\n if (Shop::isFeatureActive()){\n $this->fields_form['input'][] = array(\n 'type' => 'shop',\n 'label' => $this->l('Shop association'),\n 'name' => 'checkBoxShopAsso',\n );\n }\n\n if (!($obj = $this->loadObject(true)))\n return;\n\n if ($obj && $obj->carousel_type == 'custom'){\n $carousel_content_products = array();\n $carousel_content = explode(',', $obj->carousel_content);\n\n foreach ($carousel_content as $pid) {\n $product = new Product($pid, false, $id_default_lang);\n $carousel_content_products[] = array(\n 'id' => $pid,\n 'name' => $product->name,\n 'ref' => $product->reference\n );\n }\n\n $this->tpl_form_vars['carousel_content_products'] = $carousel_content_products;\n }\n\n return parent::renderForm();\n }", "public function addFields()\n {\n // add field\n $this->addField(new DataObject([\n 'key' => 'css_class',\n 'type' => 'multiselect',\n 'values' => $this->cssClassRowModel->toOptionArray(),\n 'label' => __('CSS Class'),\n ]));\n\n // add save button\n $this->addField(new DataObject([\n 'key' => 'save',\n 'type' => 'note',\n 'label' => ' ',\n 'options' => [\n 'text' => $this->getButtonHtml(\n __('Save'),\n 'window.pageDesignerConfig.setSettings.bind(this)()',\n 'action-primary save-settings'\n ),\n ],\n ]));\n\n return $this;\n }", "public function addform() {\n require_once 'modeles/etudiant_modele.php';\n require_once 'vues/etudiants/etudiants_addform_vue.php';\n }", "function _setFormElements() {\n\t\t$jobCategories = $this->Job->JobCategory->find('list');\n\t\t$jobLocations = $this->Job->JobLocation->find('list');\n\t\t$this->set(compact('jobCategories', 'jobLocations'));\n\t}", "protected function loadForm(): void\n {\n $rbtHiddenValues = [\n ['label' => BL::lbl('Hidden'), 'value' => 1],\n ['label' => BL::lbl('Published'), 'value' => 0],\n ];\n $internalLinks = BackendSpotlightsModel::getInternalLinks();\n\n // create form\n $this->form = new BackendForm('add');\n\n $this->form->addText('title', null, null, 'form-control title', 'form-control danger title');\n $this->form->addEditor('text');\n $this->form->addText('link', null, null);\n $this->form->addDropdown('categories', $this->categories);\n $this->form->addImage('image');\n $this->form->addRadiobutton('hidden', $rbtHiddenValues, 0);\n $this->form->addText('link_title');\n $this->form->addCheckbox('external_link');\n $this->form->addText('external_url');\n $this->form->addDropdown('internal_url', $internalLinks, '',\n false,\n 'chzn-select'\n )->setDefaultElement('');\n\n // meta\n $this->meta = new BackendMeta($this->form, null, 'title', true);\n\n }", "function form_content()\r\n {\r\n $table = html_table($this->_width,0,4) ;\r\n $table->set_style(\"border: 1px solid\") ;\r\n\r\n $table->add_row($this->element_label(\"Organization\"),\r\n $this->element_form(\"Organization\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Name\"),\r\n $this->element_form(\"Meet Name\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Address 1\"),\r\n $this->element_form(\"Meet Address 1\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Address 2\"),\r\n $this->element_form(\"Meet Address 2\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet State\"),\r\n $this->element_form(\"Meet State\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Postal Code\"),\r\n $this->element_form(\"Meet Postal Code\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Country\"),\r\n $this->element_form(\"Meet Country\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Code\"),\r\n $this->element_form(\"Meet Code\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Start\"),\r\n $this->element_form(\"Meet Start\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet End\"),\r\n $this->element_form(\"Meet End\")) ;\r\n\r\n $table->add_row($this->element_label(\"Pool Altitude\"),\r\n $this->element_form(\"Pool Altitude\")) ;\r\n\r\n $table->add_row($this->element_label(\"Course Code\"),\r\n $this->element_form(\"Course Code\")) ;\r\n\r\n $this->add_form_block(null, $table) ;\r\n }", "function display_add() {\n $this->_addform->display();\n }", "public function render() {\n $formContainsRequiredFields = FALSE;\n $htmlElements = array();\n\n foreach($this->elements as $element) {\n if(!$this->getMarkRequiredFields()) {\n $element['object']->markIfRequired(FALSE);\n }\n\n if($element['object']->isRequired()) $formContainsRequiredFields = TRUE;\n $element['object']->render();\n if($element['object']->errorOccured()) $this->setError(TRUE);\n\n $htmlElements[] = $element['object']->fetch();\n $this->javascripts .= $element['object']->getJavaScripts();\n }\n\n $this->html = implode(\"\\n<span class=\\\"element_separator\\\">&nbsp;</span>\", $htmlElements);\n $preForm = (bool)$this->headline ? FORMWIZARD_PRE_FORM_HEADLINE : FORMWIZARD_PRE_FORM;\n\n $html = NULL;\n\n $html .= '<style type=\"text/css\">@import url('.FORMWIZARD_CSS_URL.\");</style>\\n\";\n $html .= str_replace('{headline}', $this->headline, $preForm);\n $html .= \"\\n\".'<form name=\"'.$this->name.'\" method=\"'.$this->method.'\" action=\"'.$this->action.'\" enctype=\"multipart/form-data\">';\n $html .= \"\\n\".'<input type=\"hidden\" name=\"__'.$this->name.'_submitted\" value=\"1\" />';\n $html .= \"\\n\".$this->html;\n $html .= \"\\n\".'</form>';\n $html .= \"\\n\".'<script type=\"text/javascript\">'.$this->javascripts.'</script>';\n\n if($formContainsRequiredFields && $this->markRequiredFields) {\n $html .= \"\\n\".FORMWIZARD_LEGEND_REQUIRED_FIELD;\n }\n\n $this->html = $html.\"\\n\".FORMWIZARD_POST_FORM;\n\n $this->isRendered = TRUE;\n }", "function form_content()\r\n {\r\n $table = html_table($this->_width,0,4) ;\r\n $table->set_style(\"border: 0px solid\") ;\r\n\r\n $table->add_row($this->element_label($this->getUploadFileLabel()),\r\n $this->element_form($this->getUploadFileLabel())) ;\r\n\r\n $td = html_td(null, null, $this->element_form('Override Z0 Record Validation')) ;\r\n $td->set_tag_attribute('colspan', 2) ;\r\n $table->add_row($td) ;\r\n\r\n $this->add_form_block(null, $table) ;\r\n }", "function minim_add_google_form_elements(&$vars) {\n $google_form = array(\n '#attached' => array(\n 'js' => array(\n '//docs.google.com/static/forms/client/js/1232204844-formviewer_prd.js' => array('type' => 'external'),\n drupal_get_path('theme', 'minim') . '/js/google/h5f.min.js',\n 1 => array(\n 'data' => 'H5F.setup(document.getElementById(\\'ss-form\\'));_initFormViewer(\"[100,\\x22#CCC\\x22,[[[1739364875,[[2,102,,\\x22\\x22]\\n]\\n]\\n]\\n]\\n]\\n\");', \n 'type' => 'inline',\n 'scope' => 'footer',\n ), \n ),\n 'css' => array(\n '//docs.google.com/static/forms/client/css/212514800-mobile_formview_ltr.css' => array('type' => 'external'),\n drupal_get_path('theme', 'minim') . '/css/google-form.css',\n ),\n ),\n );\n drupal_render($google_form);\n}", "function buildQuickForm( ) {\n // and the grades\n require_once 'School/Utils/Conference.php';\n $details = School_Utils_Conference::getReminderDetails( );\n $string = array();\n foreach ( $details as $name => $grade ) {\n $string[] = \"{$name} (Grade: {$grade})\";\n }\n $this->assign( 'conferenceTeachers',\n implode( ', ', $string ) );\n\n $this->addButtons(array( \n array ( 'type' => 'refresh', \n 'name' => ts( 'Send Reminder' ),\n 'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', \n 'isDefault' => true ), \n array ( 'type' => 'cancel', \n 'name' => ts('Cancel') ), \n )\n );\n }", "function build_basic_form()\r\n {\r\n $this->addElement('select', LanguagePack :: PROPERTY_BRANCH, Translation :: get('Branch'), LanguagePack :: get_branch_options());\r\n \r\n \t$this->addElement('file', 'file', Translation :: get('FileName'));\r\n $allowed_upload_types = array('zip');\r\n $this->addRule('file', Translation :: get('OnlyZIPAllowed'), 'filetype', $allowed_upload_types);\r\n $this->addRule('file', Translation :: get('ThisFieldIsRequired', null, Utilities :: COMMON_LIBRARIES), 'required');\r\n \r\n // Submit button\r\n //$this->addElement('submit', 'user_settings', 'OK');\r\n $buttons[] = $this->createElement('style_submit_button', 'submit', Translation :: get('Import', null, Utilities :: COMMON_LIBRARIES), array('class' => 'positive'));\r\n $buttons[] = $this->createElement('style_reset_button', 'reset', Translation :: get('Reset', null, Utilities :: COMMON_LIBRARIES), array('class' => 'normal empty'));\r\n \r\n $this->addGroup($buttons, 'buttons', null, '&nbsp;', false);\r\n }", "function form_content()\r\n {\r\n $table = html_table($this->_width,0,4) ;\r\n $table->set_style(\"border: 0px solid\") ;\r\n\r\n $msg = html_div(\"ft_form_msg\") ;\r\n $msg->add(html_p(html_b(\"Processing the SDIF Queue requires\r\n processing swimmers, swim meets, and/or swim teams which are\r\n not currently stored in the database. Specify how unknown\r\n data should be processed.\"), html_br())) ;\r\n\r\n $td = html_td(null, null, $msg) ;\r\n $td->set_tag_attribute(\"colspan\", \"2\") ;\r\n $table->add_row($td) ;\r\n $table->add_row($this->element_label(\"Swimmers\"), $this->element_form(\"Swimmers\")) ;\r\n $table->add_row($this->element_label(\"Swim Meets\"), $this->element_form(\"Swim Meets\")) ;\r\n $table->add_row($this->element_label(\"Swim Teams\"), $this->element_form(\"Swim Teams\")) ;\r\n\r\n $this->add_form_block(null, $table) ;\r\n }", "public function init() {\n $dcpr_id_processo_digital = new Zend_Form_Element_Hidden('DCPR_ID_PROCESSO_DIGITAL');\n $dcpr_id_processo_digital->setRequired(true)\n ->addValidator('StringLength', false, array(0, 5));\n\n $dcpr_id_documento = new Zend_Form_Element_Hidden('DCPR_ID_DOCUMENTO');\n $dcpr_id_documento->setRequired(true)\n ->addValidator('StringLength', false, array(0, 20));\n\n $dcpr_id_tp_vinculacao = new Zend_Form_Element_Select('DCPR_ID_TP_VINCULACAO');\n $dcpr_id_tp_vinculacao->setRequired(true)\n ->setLabel('Selecione o tipo de juntada:');\n\n $dcpr_dh_vinculacao_doc = new Zend_Form_Element_Text('DCPR_DH_VINCULACAO_DOC');\n $dcpr_dh_vinculacao_doc->setRequired(true)\n ->setLabel('Data e Hora da juntada:');\n\n $dcpr_ic_ativo = new Zend_Form_Element_Checkbox('DCPR_IC_ATIVO');\n $dcpr_ic_ativo->setRequired(true)\n ->setLabel('Ativo:')\n ->setOptions(array('S' => 'Sim', 'N' => 'Não'))\n ->setCheckedValue('S')\n ->setUncheckedValue('N');\n\n $this->addElements(array($dcpr_id_processo_digital\n , $dcpr_id_documento\n , $dcpr_id_tp_vinculacao\n , $dcpr_dh_vinculacao_doc\n , $dcpr_ic_ativo));\n }", "public function init() {\n $this->setDisableLoadDefaultDecorators(true);\n $this->addDecorator('FormElements');\n $this->addDecorator('Form');\n\n /* HIDDEN FORM ELEMENT ************************ */\n $lab_id = new Zend_Form_Element_Hidden(\"lab_id\");\n $lab_id->setDecorators(array('ViewHelper'));\n\n /* LAB NAME TEXT FIELD ************************** */\n $lab_name = new Zend_Form_Element_Text(\"lab_name\");\n $lab_name->setRequired(true)\n ->setDecorators(array('ViewHelper'))\n ->setFilters(array('StringTrim', 'StripTags'))\n ->setValidators(array(\n array('NotEmpty', true),\n array('StringLength', false, array(1, 35))\n ))\n ->setAttribs(array(\n 'maxlength' => '35',\n 'class' => 'form-element',\n 'size' => '50'\n ));\n\n /* DROP DOWN FOR LAB STATUS *************************** */\n $lab_active = new Zend_Form_Element_Select(\"lab_active\");\n $lab_active->setRequired(true)\n ->setDecorators(array('ViewHelper'))\n ->setValidators(array(new Zend_Validate_Digits(), array('NotEmpty', true)))\n ->setAttribs(array('class' => 'form-element'))\n ->addMultiOption(0, 'Inactive')\n ->addMultiOption(1, 'Active');\n\n /* SUBMIT BUTTON **************************************** */\n $submit = new Zend_Form_Element_Submit('submit', 'Submit');\n $submit->setAttrib('class', 'form-element')\n ->setDecorators(array('ViewHelper'));\n\n /* ADD ELEMENTS TO FORM ********************** */\n $this->addElements(array($lab_id, $lab_name, $lab_active, $submit));\n }", "public function init()\n {\n\n $this->setMethod('post');\n\n // Add the name element\n $this->addElement('text','name', array(\n 'label' => 'Sub-Section Name'\n , 'size' => 50\n , 'required' => true\n , 'filters' => array('StringTrim')\n ));\n\n My_Plugin_Form::setDefaultLayout($this->getElement('name'));\n\n // Add the submit button\n $this->addElement('submit', 'submit', array(\n 'ignore' => true,\n 'label' => 'Save Changes',\n 'disableLoadDefaultDecorators' => true,\n ));\n\n $label = $this->getElement('submit');\n $label->addDecorators(array(\n array('ViewHelper'),\n array('HtmlTag')\n ));\n\n // Add a hidden field to handle the application id\n $this->addElement('hidden','application_id');\n\n // Add a hidden field to handle the sub-section id\n $this->addElement('hidden','id');\n\n // And finally, add some CSRF protection\n $this->addElement('hash','csrf', array(\n 'ignore' => 'true',\n ));\n\n }", "function renderForm()\t{\n\n\t\t$fields[] = $this->renderField( $GLOBALS['LANG']->getLL('settings'), 'divider', '');\n\t\t$fields[] = $this->renderField( $GLOBALS['LANG']->getLL('spaceTitle'), 'text', 'title');\n\t\n\t\tif(count($this->error) > 0) {\n\t\t\t$form .= \"<span style='display:block;color:red;font-weight:bold;padding:10px;'>\" .\n\t\t\t\t\t\t\t implode(\"<br />\", $this->error) . \n\t\t\t\t\t \"</span>\";\t\n\t\t}\n\n\t\t$form .= \"<form action=\" . t3lib_div::getThisUrl() . \"><table border='0' cellpadding='7'>\";\n\t\t$form .= implode(\"\\n\", $fields);\n\t\t$form .= \"<tr><td colspan='2' align='right'>\" .\n\t\t\t\t \"<input type='hidden' name='formPosted' value='1'>\" . \n\t\t\t\t \"<input type='submit' value='\" . $GLOBALS['LANG']->getLL('createSpace') . \"'></td></tr></table></form>\";\n\n\t\treturn $form;\n\t}", "function renderConfigForm() {\n\t}", "protected function createFormFields() {\n\t}", "protected function initializeForm()\n {\n $this->form = new Form();\n $this->form->add(Element::create(\"FieldSet\",\"Report Format\")->add\n (\n Element::create(\"SelectionList\", \"File Format\", \"report_format\")\n ->addOption(\"Hypertext Markup Language (HTML)\",\"html\")\n ->addOption(\"Portable Document Format (PDF)\",\"pdf\")\n ->addOption(\"Microsoft Excel (XLS)\",\"xls\")\n ->addOption(\"Microsoft Word (DOC)\",\"doc\")\n ->setRequired(true)\n ->setValue(\"pdf\"),\n Element::create(\"SelectionList\", \"Page Orientation\", \"page_orientation\")\n ->addOption(\"Landscape\", \"L\")\n ->addOption(\"Portrait\", \"P\")\n ->setValue(\"L\"),\n Element::create(\"SelectionList\", \"Paper Size\", \"paper_size\")\n ->addOption(\"A4\", \"A4\")\n ->addOption(\"A3\", \"A3\")\n ->setValue(\"A4\")\n )->setId(\"report_formats\")->addAttribute(\"style\",\"width:50%\")\n );\n $this->form->setSubmitValue(\"Generate\");\n $this->form->addAttribute(\"action\",Application::getLink($this->path.\"/generate\"));\n $this->form->addAttribute(\"target\",\"blank\");\n }", "protected function form()\n {\n $form = new Form(new $this->currentModel);\n\n $form->tab('基本信息', function ($form) {\n\n //$form->display('id', 'ID');\n //$form->text('keyword', '关键词');\n $form->text('static_url', '静态地址')->help(\"如果输入:New-York-Downtown.html,则访问地址为:http://www.yinjispace.com/article/<span style='color:#F00;'>New-York-Downtown.html</span>\");\n $form->radio('article_status', '状态')->options(['0' => '草稿', '1' => '审核中', '2' => '已发布'])->default('0');\n $form->radio('display', '公开度')->options(['0' => '公开', '-1' => '保密'])->default('0');\n $form->datetime('release_time', '发布时间')->format('YYYY-MM-DD HH:mm:ss');\n // $form->datetime('created_at','发布时间')->format('YYYY-MM-DD HH:mm:ss');\n $form->multipleSelect('category_ids', '分类')->options(ArticleCategory::getSelectOptions());\n $form->multipleSelect('topic_ids', '专题')->options(Topic::getSelectOptions());\n $form->text('tag_ids', '标签(逗号分隔)');\n $form->text('view_num', '浏览数')->default(0);\n $form->text('like_num', '点赞数')->default(0);\n $form->text('favorite_num', '收藏数')->default(0);\n $form->text('vip_download', '下载地址');\n //$form->multipleSelect('designer_id', '设计师ID')->options(Designer::getSelectOptions());\n $form->multipleSelect('designer_id', '设计师')->options(function ($ids) {\n $designer = Designer::find($ids);\n if ($designer) {\n return $designer->pluck('title_cn', 'id');\n }\n\n })->ajax('/admin/article/get_designer_select_options');\n $form->text('article_source', '文章来源');\n $form->text('article_source_url', '文章来源URL');\n $form->image('custom_thum', '自定义封面')\n ->uniqueName()\n ->widen(880)\n ->move('public/photo/images/custom_thum/');\n $form->image('special_photo', '特色照片')\n ->uniqueName()\n ->widen(1920)\n ->move('public/photo/images/special_photo/');\n $form->text('seo_title', 'SEO标题');\n $form->text('seo_keyword', 'SEO关键词');\n $form->text('seo_desc', 'SEO描述');\n })->tab('中文', function ($form) {\n\n $form->text('title_designer_cn', '标题(设计师)');\n $form->text('title_name_cn', '标题(项目名称)');\n $form->text('title_intro_cn', '标题(项目介绍)');\n $form->text('description_cn', '自定义描述(中)');\n $form->text('location_cn', '地域(中)');\n $form->ckeditor('detail.content_cn', '正文(中)');\n\n })->tab('English', function ($form) {\n\n $form->text('title_designer_en', '标题(设计师)');\n $form->text('title_name_en', '标题(项目名称)');\n $form->text('title_intro_en', '标题(项目介绍)');\n $form->text('description_en', '自定义描述(英)');\n $form->text('location_en', '地域(英)');\n $form->ckeditor('detail.content_en', '正文(英)');\n\n });\n\n //保存前回调\n $form->saving(function (Form $form) {\n if (empty($form->model()->release_time)) {\n $form->release_time = date('Y-m-d H:i:s');\n }\n });\n\n $form->saved(function (Form $form) {\n $tags = explode(',', $form->tag_ids);\n foreach ($tags as $tag) {\n echo $tag;\n $ret = ArticleTag::firstOrCreate(['name_cn' => trim($tag)]);\n }\n\n });\n\n\n return $form;\n }", "protected function _prepareForm()\n\t{\n\t\tparent::_prepareForm();\n\n\t\t$oMainTab = $this->getTab('main');\n\t\t$oAdditionalTab = $this->getTab('additional');\n\n\t\t$windowId = $this->_Admin_Form_Controller->getWindowId();\n\n\t\t$oMainTab\n\t\t\t->add(Admin_Form_Entity::factory('Div')->class('row')\n\t\t\t\t->add($oDivLeft = Admin_Form_Entity::factory('Div')->class('col-xs-12 col-md-6 col-lg-7 left-block'))\n\t\t\t\t->add($oDivRight = Admin_Form_Entity::factory('Div')->class('col-xs-12 col-md-6 col-lg-5 right-block'))\n\t\t\t);\n\n\t\t\t$oMainTab\n\t\t\t->add(Admin_Form_Entity::factory('Script')\n\t\t\t\t->value('\n\t\t\t\t\t$(function(){\n\t\t\t\t\t\tvar timer = setInterval(function(){\n\t\t\t\t\t\t\tif ($(\"#' . $windowId . ' .left-block\").height())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclearInterval(timer);\n\n\t\t\t\t\t\t\t\t$(\"#' . $windowId . ' .right-block\").find(\"#' . $windowId . '_notes\").slimscroll({\n\t\t\t\t\t\t\t\t\theight: $(\"#' . $windowId . ' .left-block\").height() - 75,\n\t\t\t\t\t\t\t\t\tcolor: \"rgba(0, 0, 0, 0.3)\",\n\t\t\t\t\t\t\t\t\tsize: \"5px\"\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 500);\n\t\t\t\t\t});\n\t\t\t\t'));\n\n\t\t$oDivLeft\n\t\t\t->add($oMainRow1 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t->add($oMainRow2 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t->add($oMainRow3 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t->add($oMainRow4 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t;\n\n\t\t$oDivRight\n\t\t\t->add($oMainRowRight1 = Admin_Form_Entity::factory('Div')->class('row'));\n\n\t\t$sColorValue = ($this->_object->id && $this->getField('color')->value)\n\t\t\t? $this->getField('color')->value\n\t\t\t: '#aebec4';\n\n\t\t$this->getField('color')\n\t\t\t->colorpicker(TRUE)\n\t\t\t->value($sColorValue);\n\n\t\t$oMainTab\n\t\t\t->move($this->getField('name')->divAttr(array('class' => 'form-group col-xs-12')), $oMainRow1)\n\t\t\t->move($this->getField('description')->divAttr(array('class' => 'form-group col-xs-12'))->rows(10), $oMainRow2)\n\t\t\t->move($this->getField('datetime')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-4 col-lg-6')), $oMainRow3)\n\t\t\t->move($this->getField('deadline')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-4 col-lg-6')), $oMainRow3)\n\t\t\t->move($this->getField('color')->set('data-control', 'hue')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6')), $oMainRow4)\n\t\t\t->move($this->getField('completed')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-4 col-lg-6 margin-top-21')), $oMainRow4);\n\n\t\t$windowId = $this->_Admin_Form_Controller->getWindowId();\n\n\t\t$countNotes = $this->_object->Crm_Notes->getCount()\n\t\t\t? '<span class=\"badge badge-palegreen\">' . $this->_object->Crm_Notes->getCount() . '</span>'\n\t\t\t: '';\n\n\t\tob_start();\n\t\t?>\n\t\t<div class=\"tabbable\">\n\t\t\t<ul class=\"nav nav-tabs tabs-flat\" id=\"crmProjectTabs\">\n\t\t\t\t<li class=\"active\">\n\t\t\t\t\t<a data-toggle=\"tab\" href=\"#<?php echo $windowId?>_notes\" data-path=\"/admin/crm/project/note/index.php\" data-window-id=\"<?php echo $windowId?>_notes\" data-additional=\"crm_project_id=<?php echo $this->_object->id?>\">\n\t\t\t\t\t\t<?php echo Core::_(\"Crm_Project.tabNotes\")?> <?php echo $countNotes?>\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<div class=\"tab-content tabs-flat\">\n\t\t\t\t<div id=\"<?php echo $windowId?>_notes\" class=\"tab-pane in active\">\n\t\t\t\t\t<?php\n\t\t\t\t\tAdmin_Form_Entity::factory('Div')\n\t\t\t\t\t\t->controller($this->_Admin_Form_Controller)\n\t\t\t\t\t\t->id(\"crm-project-notes\")\n\t\t\t\t\t\t->add(\n\t\t\t\t\t\t\t$this->_object->id\n\t\t\t\t\t\t\t\t? $this->_addNotes()\n\t\t\t\t\t\t\t\t: Admin_Form_Entity::factory('Code')->html(\n\t\t\t\t\t\t\t\t\tCore_Message::get(Core::_('Crm_Project.enable_after_save'), 'warning')\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t->execute();\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\t$oMainRowRight1->add(Admin_Form_Entity::factory('Div')\n\t\t\t->class('form-group col-xs-12 margin-top-20')\n\t\t\t->add(\n\t\t\t\tAdmin_Form_Entity::factory('Code')\n\t\t\t\t\t->html(ob_get_clean())\n\t\t\t)\n\t\t);\n\n\t\t$this->title($this->_object->id\n\t\t\t? Core::_('Crm_Project.edit_title', $this->_object->name, FALSE)\n\t\t\t: Core::_('Crm_Project.add_title')\n\t\t);\n\n\t\treturn $this;\n\t}", "function load_fields() {\n\n\t\t// Back end form fields\n\t\t$this->fields = array(\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Title', 'publisher' ),\n\t\t\t\t'id' => 'title',\n\t\t\t\t'type' => 'text',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Buttons Style', 'publisher' ),\n\t\t\t\t'id' => 'style',\n\t\t\t\t'type' => 'image_select',\n\t\t\t\t'section_class' => 'style-floated-left',\n\t\t\t\t'value' => 'clean',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'button' => array(\n\t\t\t\t\t\t'label' => __( 'Button Style', 'publisher' ),\n\t\t\t\t\t\t'img' => bf_get_theme_uri( 'images/shortcodes/bs-social-share-button.png' )\n\t\t\t\t\t),\n\t\t\t\t\t'button-no-text' => array(\n\t\t\t\t\t\t'label' => __( 'Icon Button Style', 'publisher' ),\n\t\t\t\t\t\t'img' => bf_get_theme_uri( 'images/shortcodes/bs-social-share-button-no-text.png' )\n\t\t\t\t\t),\n\t\t\t\t\t'outline-button' => array(\n\t\t\t\t\t\t'label' => __( 'Outline Style', 'publisher' ),\n\t\t\t\t\t\t'img' => bf_get_theme_uri( 'images/shortcodes/bs-social-share-outline-button.png' )\n\t\t\t\t\t),\n\t\t\t\t\t'outline-button-no-text' => array(\n\t\t\t\t\t\t'label' => __( 'Icon Outline Style', 'publisher' ),\n\t\t\t\t\t\t'img' => bf_get_theme_uri( 'images/shortcodes/bs-social-share-outline-button-no-text.png' )\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Colored Style', 'publisher' ),\n\t\t\t\t'id' => 'colored',\n\t\t\t\t'type' => 'switch',\n\t\t\t\t'on-label' => __( 'Yes', 'publisher' ),\n\t\t\t\t'off-label' => __( 'No', 'publisher' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Active Sites', 'publisher' ),\n\t\t\t\t'id' => 'sites',\n\t\t\t\t'type' => 'sorter_checkbox',\n\t\t\t\t'deferred-options' => array(\n\t\t\t\t\t'callback' => 'publisher_social_share_option_list',\n\t\t\t\t),\n\t\t\t\t'section_class' => 'bs-theme-social-share-sorter',\n\t\t\t),\n\t\t);\n\n\t}", "public function init()\n {\n\r\n $this->setAttrib('horizontal', true);\r\n $this->setName('frm_termbill');\r\n\n\n $CurrentTerm = Content_Model_School::getCurrentTermYear(false);\n\r\n //must be the first element in all forms\r\n $this->addElement('hidden', 'isValid', array(\"value\"=>\"false\"));\r\n $this->addElement('hidden', 'cl_id');\n\n\n $this->addElement('text','description',array(\n 'label' => 'Description',\n 'required' => true,\n \t\t'autocomplete' => 'off',\n 'filters' => array(new Zend_Filter_StringTrim()),\n 'validators' => array(new Zend_Validate_NotEmpty())\n ));\n\n\n //entry fees are paid only on admission\n //Term fees are paid termly,\n //Monthly fees are paid monthly\n //Yearly fees are paid every 1st Term.\n $this->addElement('select','type', array(\r\n 'label' => 'Type of Fee',\r\n 'required' => true,\r\n 'multioptions' => array(0 => 'Entry Fee', 1 => 'Term Fee', 2 => 'Monthly Fee', 3=> 'Yearly Fee' ),\r\n 'validators' => array(new Zend_Validate_NotEmpty())\r\n ));\n\n $this->addElement('select','feegroup',array(\r\n 'label' => 'Fees Group',\r\n 'required' => true,\n \t\t'onchange' => '$.fn.loadBills2($(\"#feegroup option:selected\").val(),-100);$(\"#feegroupv option[value=\"+$(\"#feegroup option:selected\").val()+\"]\").attr(\"selected\",\"selected\");',\n 'multioptions' => array(null=>'--- Select an option ---',-1=>'Apply to All Classes', -2=>'No Category Bill') + Content_Model_FeeGroups::getFeeGroupsArray(),\r\n 'filters' => array(new Zend_Filter_StringTrim()),\r\n 'validators' => array(new Zend_Validate_NotEmpty())\r\n ));\n\n $this->addElement('select','specificgrades',array(\r\n 'label' => 'Specific Class ',\r\n 'required' => true,\r\n 'multioptions' => array(-1 => 'Not Applicable') + Content_Model_GradeLevels::gradelevels(),\r\n 'filters' => array(new Zend_Filter_StringTrim()),\r\n 'validators' => array(new Zend_Validate_NotEmpty())\r\n ));\n\n $this->addElement('select','stream', array(\n \t\t 'label' => 'Qualifying Stream',\n 'required' => true,\n //'multioptions' => array(-1 => 'Not Applicable', '0' => 'Non-Res./Day Student', '1' => 'Resident/Boarder', 2=> 'Part-Time', 3=> 'Evening Programme', 4=> 'Weekend Programme') ,\n 'multioptions' => array(-1 => 'All Streams', '0' => 'Non-Res./Day Student', '1' => 'Resident/Boarder') ,\n \t\t'filters' => array(new Zend_Filter_StringTrim()),\n 'validators' => array(new Zend_Validate_NotEmpty())\n ));\n\n $this->addElement('text','amount',array(\n 'label' => 'Amount',\n 'required' => true,\n 'data-mask' => \"9999\",\n 'data-placeholder' => '0',\n 'filters' => array(new Zend_Filter_StringTrim()),\n 'validators' => array(new Zend_Validate_NotEmpty(),\n new Zend_Validate_Digits(),\n new Zend_Validate_GreaterThan(000)\n )\n ));\n\n $this->addElement('select','mandatory', array(\n 'label' => 'Mandatory',\n 'required' => true,\n 'multioptions' => array(1 => 'Mandatory', 0 => 'Optional' ),\n 'validators' => array(new Zend_Validate_NotEmpty())\n ));\n\n\r\n $this->addElement('select','term', array(\r\n 'label' => 'Applicable Term',\r\n 'required' => true,\r\n 'multioptions' => array(1 => '1st Term', 2 => '2nd Term', 3 => '3rd Term' ),\r\n 'validators' => array(new Zend_Validate_NotEmpty()),\n \t\t'value' => $CurrentTerm->term\r\n ));\r\n\n\n $this->addElement('text', 'year', array(\n 'label' => 'Applicable Year',\n 'required' => true,\n 'data-mask' => \"2099/2099\",\n 'validators' => array(new Zend_Validate_NotEmpty()),\n 'filters' => array(new Zend_Filter_StringTrim()),\n \t\t'value' => $CurrentTerm->year\n ));\n\r\n $this->addElement(\"button\", \"return\",\r\n array(\"label\" => \"Cancel\",\r\n \"class\" => \"btn btn-small btn-danger\",\r\n \"onclick\" => \"$('a[href=\\\"#termbill\\\"]').click();\"));\r\n\r\n\n $this->addElement(\"submit\", \"register\",\n \t\t\t\t\tarray(\"label\" => \"Add Bill\",\n \t\t\t\t\t\t\t\"class\" => \"btn btn-success\",\n \t\t\t\t\t\t\t\"disabled\" => true\n \t\t\t\t\t));\n\n }", "function formCharts() {\n\t\t//$output .= $this->Params['meta'].' - '.$this->Params['value'].' : '.$this->Params['userID'];\n\t\t$accountingCode = $this->inputGroup(['label'=>'Accounting Code','type'=>'text','id'=>'code','name'=>'code','placeholder'=>'0-00000','value'=>$this->Params['value'],'required'=>'data-inputmask=\"\\'mask\\': \\'9-99999\\'\"']);\n\t\t$accountingTitle = $this->inputGroup(['label'=>'Accounting Title','type'=>'text','id'=>'title','name'=>'title','placeholder'=>'Accounting Title','value'=>'']);\n\t\t$accountingDescription = $this->inputGroup(['label'=>'Account Description','type'=>'textarea','id'=>'description','name'=>'description','placeholder'=>'Field Description','title'=>'Chart of account description','value'=>'']);\n\t\t$formField = \"<div class='x_panel no-padding'><div class='box_title'><h2 class='left'>Create Accounting Chart</h2></div><div class='x_content no-padding'>\";\n\t\t$formField .= \"<div class='half'><div class='form-group no-padding item'>{$accountingCode}</div><div class='form-group no-padding item'>{$accountingTitle}</div></div>\";\n\t\t$formField .= \"<div class='half'><div class='form-group no-padding item'>{$accountingDescription}</div></div>\";\n\t\t$formField .= \"</div></div>\";\n\n\t\t$output = \"\n <form id='createRecords' data-toggle='validator' name='{$this->Params['meta']}' class='form-label-left input_mask' novalidate>\n\t\t\t\t<input type='hidden' name='action' id='action' value='createRecords' />\n\t\t\t\t<input type='hidden' name='type' id='type' value='{$this->Params['value']}' />\n\t\t\t\t<input type='hidden' name='table' id='table' value='{$this->Params['table']}' />\n\t\t\t\t<input type='hidden' name='theID' id='theID' value='0' />\n\t\t\t\t{$formField}\n\t\t\t</form>\n \";\n\t\t$output .= \"<script>$(':input').inputmask();</script>\";\n\t\treturn $output;\n\t}", "private function viewBuilder() {\n $html = '';\n $file = false;\n // Create fields\n foreach ($this->formDatas as $field) {\n $type = $field['type'];\n switch ($type) {\n case 'text' :\n case 'password' :\n case 'hidden' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"' . $type . '\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n break;\n // Addon - 2013-07-31\n case 'date' :\n case 'datetime' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"text\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n\n\n if ($type == 'datetime') {\n $plugin = $this->addPlugin('widget', false);\n $plugin = $this->addPlugin('date');\n }\n $plugin = $this->addPlugin($type);\n if (!isset($this->js['script'])) {\n $this->js['script'] = '';\n }\n if ($type == 'datetime') {\n $this->js['script'] .= '\n <script type=\"text/javascript\">$(document).ready(function() {$(\"#' . $field['name'] . '\").datetimepicker({ dateFormat: \"yy-mm-dd\", timeFormat : \"HH:mm\"});});</script>';\n } else {\n $this->js['script'] .= '\n <script type=\"text/javascript\">$(document).ready(function() {$(\"#' . $field['name'] . '\").datepicker({ dateFormat: \"yy-mm-dd\"});});</script>';\n }\n break;\n // End Addon\n case 'select' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <select name=\"' . $field['name'] . '\">';\n // Add options\n foreach ($field['options'] as $option) {\n $html .= '\n <option value=\"' . $option . '\" <?php echo set_select(\"' . $field['name'] . '\", \"' . $option . '\"); ?>>' . $option . '</option>';\n }\n $html .= '\n </select>';\n break;\n case 'checkbox' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n ';\n // Add options\n foreach ($field['checkbox'] as $option) {\n $html .= '\n <input type=\"checkbox\" value=\"' . $option . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $option . '\"); ?>\"><span>' . $option . '</span>';\n }\n break;\n case 'radio' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n ';\n // Add options\n foreach ($field['radio'] as $option) {\n $html .= '\n <input type=\"radio\" value=\"' . $option . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $option . '\"); ?>\"><span>' . $option . '</span>';\n }\n break;\n case 'reset' :\n case 'submit' :\n $html .= '\n <input type=\"' . $type . '\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n break;\n case 'textarea' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <textarea name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\"><?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?></textarea>';\n break;\n case 'file' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"file\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" />';\n $file = true;\n break;\n }\n }\n\n $view = '\n <html>\n <head>\n <link type=\"text/css\" rel=\"stylesheet\" href=\"<?php echo base_url() ?>assets/css/generator/' . $this->cssName . '.css\">\n '; // Addon - 2013-07-31\n foreach ($this->css as $css) {\n $view .= $css . '\n ';\n }\n foreach ($this->js as $js) {\n $view .= $js . '\n ';\n }\n // End Addon\n $view .= '\n </head>\n <body>\n <?php\n // Show errors\n if(isset($error)) {\n switch($error) {\n case \"validation\" :\n echo validation_errors();\n break;\n case \"save\" :\n echo \"<p class=\\'error\\'>Save error !</p>\";\n break;\n }\n }\n if(isset($errorfile)) {\n foreach($errorfile as $name => $value) {\n echo \"<p class=\\'error\\'>File \\\"\".$name.\"\\\" upload error : \".$value.\"</p>\";\n }\n }\n ?>\n <form action=\"<?php echo base_url() ?>' . $this->formName . '\" method=\"post\" ' . ($file == true ? 'enctype=\"multipart/form-data\"' : '') . '>\n ' . $html . '\n </form>\n </body>\n </html>';\n return array(str_replace('<', '&lt;', $view), $view);\n }", "public function Form() {\n\t\t$fields = new FieldSet();\n\t\t$fieldValidation = array();\n\t\t$fieldValidationRules = array();\n\t\t$CustomDisplayRules = \"\";\n\t\t$defaults = \"\";\n\t\t$this->SubmitButtonText = ($this->SubmitButtonText) ? $this->SubmitButtonText : _t('UserDefinedForm.SUBMITBUTTON', 'Submit');\n\t\tif($this->Fields()) {\n\t\t\tforeach($this->Fields() as $field) {\n\t\t\t\n\t\t\t\t$fieldToAdd = $field->getFormField();\n\t\t\t\t\n\t\t\t\tif(!$fieldToAdd) break;\n\t\t\t\t\n\t\t\t\t$fieldValidationOptions = array();\n\t\t\t\t\n\t\t\t\t// Set the Error Messages\n\t\t\t\t$errorMessage = sprintf(_t('Form.FIELDISREQUIRED').'.', strip_tags(\"'\". ($field->Title ? $field->Title : $field->Name) . \"'\"));\n\t\t\t\t$errorMessage = ($field->CustomErrorMessage) ? $field->CustomErrorMessage : $errorMessage;\n\t\t\t\t$fieldToAdd->setCustomValidationMessage($errorMessage);\n\t\t\t\t\n\t\t\t\t// Is this field required\n\t\t\t\tif($field->Required) {\n\t\t\t\t\t$fieldValidation[$field->Name] = $errorMessage;\n\t\t\t\t\t$fieldValidationOptions['required'] = true;\n\t\t\t\t\t$fieldToAdd->addExtraClass('requiredField');\n\t\t\t\t\tif(UserDefinedForm::$required_identifier) {\n\t\t\t\t\t\t$title = $fieldToAdd->Title() .\" <span class='requiredIdentifier'>\". UserDefinedForm::$required_identifier . \"</span>\";\n\t\t\t\t\t\t$fieldToAdd->setTitle($title);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Add field to the form\n\t\t\t\t$fields->push($fieldToAdd);\n\t\t\t\t\n\t\t\t\t// Ask our form field for some more information on hour it should be validated\n\t\t\t\t$fieldValidationOptions = array_merge($fieldValidationOptions, $field->getValidation());\n\t\t\t\t\n\t\t\t\t// Check if we have need to update the global validation\n\t\t\t\tif($fieldValidationOptions) {\n\t\t\t\t\t$fieldValidationRules[$field->Name] = $fieldValidationOptions;\n\t\t\t\t}\n\t\t\t\t$fieldId = $field->Name;\n\t\t\t\t\n\t\t\t\tif($field->ClassName == 'EditableFormHeading') { \n\t\t\t\t\t$fieldId = 'Form_Form_'.$field->Name;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Is this Field Show by Default\n\t\t\t\tif(!$field->ShowOnLoad) {\n\t\t\t\t\t$defaults .= \"$(\\\"#\" . $fieldId . \"\\\").hide();\\n\";\n\t\t\t\t}\n\n\t\t\t\t// Check for field dependencies / default\n\t\t\t\tif($field->Dependencies()) {\n\t\t\t\t\tforeach($field->Dependencies() as $dependency) {\n\t\t\t\t\t\tif(is_array($dependency) && isset($dependency['ConditionField']) && $dependency['ConditionField'] != \"\") {\n\t\t\t\t\t\t\t// get the field which is effected\n\t\t\t\t\t\t\t$formName = Convert::raw2sql($dependency['ConditionField']);\n\t\t\t\t\t\t\t$formFieldWatch = DataObject::get_one(\"EditableFormField\", \"\\\"Name\\\" = '$formName'\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!$formFieldWatch) break;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// watch out for multiselect options - radios and check boxes\n\t\t\t\t\t\t\tif(is_a($formFieldWatch, 'EditableDropdown')) {\n\t\t\t\t\t\t\t\t$fieldToWatch = \"$(\\\"select[name='\".$dependency['ConditionField'].\"']\\\")\";\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// watch out for checkboxs as the inputs don't have values but are 'checked\n\t\t\t\t\t\t\telse if(is_a($formFieldWatch, 'EditableCheckboxGroupField')) {\n\t\t\t\t\t\t\t\t$fieldToWatch = \"$(\\\"input[name='\".$dependency['ConditionField'].\"[\".$dependency['Value'].\"]']\\\")\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$fieldToWatch = \"$(\\\"input[name='\".$dependency['ConditionField'].\"']\\\")\";\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// show or hide?\n\t\t\t\t\t\t\t$view = (isset($dependency['Display']) && $dependency['Display'] == \"Hide\") ? \"hide\" : \"show\";\n\t\t\t\t\t\t\t$opposite = ($view == \"show\") ? \"hide\" : \"show\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// what action do we need to keep track of. Something nicer here maybe?\n\t\t\t\t\t\t\t// @todo encapulsation\n\t\t\t\t\t\t\t$action = \"change\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($formFieldWatch->ClassName == \"EditableTextField\" || $formFieldWatch->ClassName == \"EditableDateField\") {\n\t\t\t\t\t\t\t\t$action = \"keyup\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// is this field a special option field\n\t\t\t\t\t\t\t$checkboxField = false;\n\t\t\t\t\t\t\tif(in_array($formFieldWatch->ClassName, array('EditableCheckboxGroupField', 'EditableCheckbox'))) {\n\t\t\t\t\t\t\t\t$action = \"click\";\n\t\t\t\t\t\t\t\t$checkboxField = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// and what should we evaluate\n\t\t\t\t\t\t\tswitch($dependency['ConditionOption']) {\n\t\t\t\t\t\t\t\tcase 'IsNotBlank':\n\t\t\t\t\t\t\t\t\t$expression = ($checkboxField) ? '$(this).attr(\"checked\")' :'$(this).val() != \"\"';\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'IsBlank':\n\t\t\t\t\t\t\t\t\t$expression = ($checkboxField) ? '!($(this).attr(\"checked\"))' : '$(this).val() == \"\"';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'HasValue':\n\t\t\t\t\t\t\t\t\t$expression = ($checkboxField) ? '$(this).attr(\"checked\")' : '$(this).val() == \"'. $dependency['Value'] .'\"';\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ValueLessThan':\n\t\t\t\t\t\t\t\t\t$expression = '$(this).val() < parseFloat(\"'. $dependency['Value'] .'\")';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ValueLessThanEqual':\n\t\t\t\t\t\t\t\t\t$expression = '$(this).val() <= parseFloat(\"'. $dependency['Value'] .'\")';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ValueGreaterThan':\n\t\t\t\t\t\t\t\t\t$expression = '$(this).val() > parseFloat(\"'. $dependency['Value'] .'\")';\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ValueGreaterThanEqual':\n\t\t\t\t\t\t\t\t\t$expression = '$(this).val() >= parseFloat(\"'. $dependency['Value'] .'\")';\n\n\t\t\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t$expression = ($checkboxField) ? '!($(this).attr(\"checked\"))' : '$(this).val() != \"'. $dependency['Value'] .'\"';\n\t\t\t\t\t\t\t\t\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\t// put it all together\n\t\t\t\t\t\t\t$CustomDisplayRules .= $fieldToWatch.\".$action(function() {\n\t\t\t\t\t\t\t\tif(\". $expression .\" ) {\n\t\t\t\t\t\t\t\t\t$(\\\"#\". $fieldId .\"\\\").\".$view.\"();\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$(\\\"#\". $fieldId .\"\\\").\".$opposite.\"();\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}\n\t\t$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';\n\t\t\n\t\t// Keep track of the referer\n\t\t$fields->push( new HiddenField( \"Referrer\", \"\", $referer ) );\n\t\t\t\t\n\t\t// Build actions\n\t\t$actions = new FieldSet(\n\t\t\tnew FormAction(\"process\", $this->SubmitButtonText)\n\t\t);\n\t\t\n\t\t// Do we want to add a clear form.\n\t\tif($this->ShowClearButton) {\n\t\t\t$actions->push(new ResetFormAction(\"clearForm\"));\n\t\t}\n\t\t\n\t\t// return the form\n\t\t$form = new Form($this, \"Form\", $fields, $actions, new RequiredFields(array_keys($fieldValidation)));\n\t\t$form->loadDataFrom($this->failover);\n\t\t\n\t\t$FormName = $form->FormName();\n\n\t\t// Set the Form Name\n\t\t$rules = $this->array2json($fieldValidationRules);\n\t\t$messages = $this->array2json($fieldValidation);\n\t\t\n\n\t\t// set the custom script for this form\n\t\tRequirements::customScript(<<<JS\n\t\t\t(function($) {\n\t\t\t\t$(document).ready(function() {\n\t\t\t\t\t$defaults\n\t\t\t\t\t$(\"#$FormName\").validate({\n\t\t\t\t\t\terrorClass: \"required\",\t\n\t\t\t\t\t\tmessages:\n\t\t\t\t\t\t\t$messages\n\t\t\t\t\t\t,\n\t\t\t\t\t\t\n\t\t\t\t\t\trules: \n\t\t\t\t\t\t \t$rules\n\t\t\t\t\t});\n\t\t\t\t\t$CustomDisplayRules\n\t\t\t\t});\n\t\t\t})(jQuery);\nJS\n);\n\n\t\treturn $form;\n\t}", "function form_init_elements() \r\n {\r\n //we want an confirmation page for this form.\r\n //$this->set_confirm();\r\n\r\n //Crea una caja de texto llamada nombre y longitud 50\r\n $elemT = new FEText(\"Asunto\", FALSE, 50);\r\n //$elemT->set_style_attribute('align', 'right');\r\n //Le asignamos el id nombre y la tecla de acceso n (ctrl+n)\r\n $elemT->set_attribute(\"id\",\"asunto\");\r\n $elemT->set_attribute(\"accesskey\",\"n\"); \r\n //Añade en el contenedor formulario el elemento creado e inicializado\r\n $this->add_element($elemT);\r\n\t\r\n //Creamos un Area de Texto llamada comentario\r\n $elemTA = new FETextArea(\"Comentario\", FALSE, 10, 60,\"500px\", \"100px\");\r\n $elemTA->set_attribute('wrap', 'physical');\r\n //Le asignamos el id email y la tecla de acceso c (ctrl+c) \r\n $elemTA->set_attribute(\"id\",\"comentario\");\r\n $elemTA->set_attribute(\"accesskey\",\"d\");\r\n //Añade en el contenedor formulario el elemento creado e inicializado\r\n $this->add_element($elemTA);\r\n\r\n //Añade un campo oculto llamado id. En ocasiones este campo se utiliza para indicar ciertas operaciones.\r\n //OJO!! es un punto sensible porque el usuario podría cambiar su valor de forma inexperada para el código.\r\n// $this->add_hidden_element(\"id\");\r\n\r\n //Añade un boton con la acción submit\r\n $submit = $this->_formatElem(\"base_SubmitButton\", \"Aceptar\", \"submit\", agt(\"miguel_Enter\"));\r\n //$submit->set_attribute('id',''); \r\n $submit->set_attribute('accesskey','e'); \r\n $this->add_element($submit); \r\n\t\t\t\t\r\n\t\t\t\t$this->add_hidden_element('status');\r\n \t\t$this->set_hidden_element_value('status', 'new');\r\n }", "public function renderForm()\n {\n $fields_form = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Configuration'),\n 'icon' => 'icon-gears'\n ),\n 'input' => array(\n array(),\n array(\n 'type' => 'text',\n 'label' => $this->l('API Key'),\n 'name' => 'SEND_SMS_API',\n 'desc' => $this->l('The API Key is used to authenticate in order to send SMS.'),\n 'required' => true\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Admin Mobile Number'),\n 'name' => 'ADMIN_MOBILE',\n 'required' => true\n )\n ),\n 'submit' => array(\n 'title' => $this->l('Save')\n )\n )\n );\n $fields_form = $this->setDefaultInput($fields_form);\n $helper = new HelperForm();\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $lang = new Language((int) Configuration::get('PS_LANG_DEFAULT'));\n $helper->default_form_language = $lang->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG')\n ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;\n $this->fields_form = array();\n $helper->id = (int) Tools::getValue('id_carrier');\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'btnSubmit';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false);\n $helper->currentIndex .= '&configure=' . $this->name . '&tab_module=' . $this->tab;\n $helper->currentIndex .= '&module_name=' . $this->name;\n $helper->currentIndex .= '&configuration=yes';\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFieldsValues(),\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id\n );\n \n return $helper->generateForm(array(\n $fields_form\n ));\n }", "function uultra_new_links_add_form()\r\n\t{\r\n\t\t\r\n\t\t$meta = 'uultra_link_content';\r\n\t\t$html = '<div id=\"#uultra-add-links-box\" class=\"uultra-links-content-edition-box \" title=\"Add New Link\">';\r\n\t\t\r\n\t\t$html .= '<input name=\"uultra-current-selected-widget-to-edit\" id=\"uultra-current-selected-widget-to-edit\" type=\"hidden\" />';\r\n\t\t\r\n\t\t\r\n\t\t$html .= '<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td width=\"50%\"> '.__(\"Name: \",'xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\"><input name=\"uultra_link_title\" type=\"text\" id=\"uultra_link_title\" /> \r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t\t\t<td width=\"50%\"> '.__(\"Slug: \",'xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\"><input name=\"uultra_link_slug\" type=\"text\" id=\"uultra_link_slug\" /> \r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t\t\t<td width=\"50%\"> '.__('Type:','xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\">\r\n\t\t\t\t<select name=\"uultra_link_type\" id=\"uultra_link_type\" size=\"1\">\r\n\t\t\t\t <option value=\"\" selected=\"selected\">'.__(\"Select Type: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"1\">'.__(\"Text: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"2\">Shortcode</option>\r\n\t\t\t\t</select>\r\n\r\n\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t\t\t \r\n\t\t\t <tr>\r\n\t\t\t\t<td>'.__('Content:','xoousers').'</td>\r\n\t\t\t\t<td>&nbsp;</textarea> \r\n\t\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t\r\n\t\t\t \r\n\t\t\t</table> '; \t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$html .= '<div class=\"uultra-field-msbox-div-history\" id=\"uultra-msg-history-list\">';\r\n\t\t\r\n\t\t$html .= $this->uultra_get_addlink_html_form($meta, $content);\r\n\t\t\r\n\t\t$html .= '</div>';\t\r\n\t\t\r\n\t\t\r\n\t\t\t \r\n\t\t$html .= ' <p class=\"submit\">\r\n\t\t\t\t\t<input type=\"button\" name=\"submit\" class=\"button uultra-links-add-new-close\" value=\"'.__('Close','xoousers').'\" /> <input type=\"button\" name=\"submit\" class=\"button button-primary uultra-links-add-new-confirm\" value=\"'.__('Submit','xoousers').'\" /> <span id=\"uultra-add-new-links-m-w\" ></span>\r\n\t\t\t\t</p> ';\t\t\r\n\t\t$html .= '</div>';\t\t\r\n\t\t\t\r\n\t\treturn $html;\r\n\t}", "function form_init_data()\r\n {\r\n $this->set_element_value(\"Swimmers\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Meets\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Teams\", FT_CREATE) ;\r\n }", "public function output_setup_form() {\n\t\t$this->output_controls_html( 'klicktipp' );\n\t}", "public function init() {\n $this->setMethod ( 'post' );\n\n // add an name element\n $this->addElement ( 'text', 'name', array ('label' => 'Your name:', 'required' => true, 'filters' => array ( 'StringTrim' ), 'validators' => array ('alnum') ) );\n \n //add surname\n $this->addElement ( 'text', 'surname', array ('label' => 'Your surname:', 'filters' => array ( 'StringTrim' ), 'validators' => array ('alnum', array ('regex', false, array ('/^[a-z]/i' ) ), array ('StringLength', false, array (3, 20 ) ) ), 'required' => true ) );\n\n //add company\n $this->addElement ( 'text', 'company', array ('label' => 'Your company:', 'filters' => array ( 'StringTrim' ), 'validators' => array ( array ('StringLength', false, array (2, 120 ) ) ), 'required' => false ) );\n\n // add an email element\n $this->addElement ( 'text', 'email', array ('label' => 'Your email:', 'required' => true, 'filters' => array ('StringTrim' ), 'validators' => array ('EmailAddress' ) ) );\n\n //add phonenumber\n $this->addElement ( 'text', 'phonenumber', array ('label' => 'Your phone number:', 'filters' => array ('StringTrim', 'StringToLower' ), 'validators' => array ('alnum', array ('StringLength', false, array (9, 30 ) ) ), 'required' => false ) );\n\n //add link reported\n $this->addElement ( 'text', 'linkreported', array ('label' => 'Please, insert the link to be reviewed:', 'filters' => array ('StringTrim', 'StringToLower' ), 'validators' => array ( array ('StringLength', false, array (9, 256 ) ) ), 'required' => true ) );\n\n //add url reported\n $this->addElement ( 'text', 'urlreported', array ('label' => 'Please, insert the url where this content appears:', 'filters' => array ('StringTrim', 'StringToLower' ), 'validators' => array ( array ('StringLength', false, array (9, 256 ) ) ), 'required' => true ) );\n\n //add reason\n $this->addElement ( 'text', 'reason', array ('label' => 'Reason of your complaint:', 'filters' => array ( 'StringTrim' ), 'validators' => array ( array ('StringLength', false, array (3, 100 ) ) ), 'required' => true ) );\n\n\n $this->addElement ( 'textarea', 'message', \n array ('label' => 'Your message:', 'validators' => array (array ('StringLength', false, array (20, 2000 ) ) ), 'required' => true, 'rows' => 4,'cols' => 60 )\n\n );\n\n $this->addElement ( 'captcha', 'captcha', array ('label' => 'Please, insert the 5 characters shown:', 'required' => true,\n 'captcha' => array ('captcha' => 'Image', 'wordLen' => 5, 'height' => 50, 'width' => 160, 'gcfreq' => 50, 'timeout' => 300,\n 'font' => APPLICATION_PATH . '/configs/antigonimed.ttf',\n 'imgdir' => FOOFIND_PATH . '/public/images/captcha' ) ) );\n\n\n $checkboxDecorator = array(\n 'ViewHelper',\n 'Errors',\n array(array('data' => 'HtmlTag'), array('tag' => 'span', 'class' => 'element')),\n array('Label', array('tag' => 'dt'),\n array(array('row' => 'HtmlTag'), array('tag' => 'span')),\n ));\n\n $this->addElement('checkbox', 'agree', array(\n 'decorators' => $checkboxDecorator,\n 'required' => true,\n 'checked' =>false\n ));\n\n\n // add the submit button\n $this->addElement ( 'submit', 'submit', array (\n 'label' => 'Send',\n 'class' => 'large magenta awesome') );\n }", "public function cs_generate_form() {\n global $post;\n }", "public function Populate() {\r\n\t\t$form_instance = $this->form_instance;\r\n\t\t// Retrieve the field data\r\n\t\t$_els = vcff_parse_container_data($form_instance->form_content);\r\n\t\t// If an error has been detected, return out\r\n\t\tif (!$_els || !is_array($_els)) { return; }\r\n\t\t// Retrieve the form instance\r\n\t\t$form_instance = $this->form_instance; \r\n\t\t// Loop through each of the containers\r\n\t\tforeach ($_els as $k => $_el) {\r\n\t\t\t// Retrieve the container instance\r\n\t\t\t$container_instance = $this->_Get_Container_Instance($_el);\r\n\t\t\t// Add the container to the form instance\r\n\t\t\t$form_instance->Add_Container($container_instance);\r\n\t\t}\r\n\t}", "protected function _prepareForm()\n {\n $form = new Varien_Data_Form(array(\n 'id' => 'add_form',\n 'action' => $this->getUrl('*/faq/save', array(\n 'ret' => Mage::registry('ret'),\n 'id' => $this->getRequest()->getParam('id')\n )\n ),\n 'method' => 'post'\n ));\n\n $fieldset = $form->addFieldset('faq_new_question', array(\n 'legend' => $this->__('New Question'),\n 'class' => 'fieldset-wide'\n ));\n\n $fieldset->addField('new_question', 'text', array(\n 'label' => Mage::helper('inchoo_faq')->__('New Question'),\n 'required' => true,\n 'name' => 'question'\n ));\n\n $fieldset->addField('new_answer', 'textarea', array(\n 'label' => Mage::helper('inchoo_faq')->__('Answer'),\n 'required' => false,\n 'name' => 'answer',\n 'style' => 'height:12em;',\n ));\n\n $form->setUseContainer(true);\n// $form->setValues();\n $this->setForm($form);\n\n// echo \"_prepareForm()\";\n\n return parent::_prepareForm();\n\n\n }", "public function init()\n {\n // set class to identify as p4cms-ui component\n $this->setAttrib('class', 'p4cms-ui')\n ->setAttrib('dojoType', 'p4cms.ui.grid.Form');\n\n // turn off CSRF protection - its not useful here (form data are\n // used for filtering the data grid and may be exposed in the URL)\n $this->setCsrfProtection(false);\n\n // call parent to publish the form.\n parent::init();\n }", "public function init(){\n\t\t//Additional information.\n\t\t$this->addElement('textarea', 'additional_information', array(\n\t\t\t\t'label' => 'Additional information',\n\t\t\t\t'required' => false,\n\t\t\t\t'filters' => array('StringTrim'),\n\t\t\t\t'validators' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'NotEmpty', true, array(\n\t\t\t\t\t\t\t\t\t\t'messages' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'isEmpty' => 'Please enter additional information',\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t));\n\n\t\t// Add declaration statement agree element\n\t\t$this->addElement('checkbox', 'confirmation_statement', array(\n\t\t\t\t'label' => '',\n\t\t\t\t'required' => true,\n\t\t\t\t'checkedValue' => '1',\n\t\t\t\t'uncheckedValue' => null, // Must be used to override default of '0' and force an error when left unchecked\n\t\t\t\t'validators' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'NotEmpty', true, array(\n\t\t\t\t\t\t\t\t\t\t'messages' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'isEmpty' => 'You must agree to confirmation statement to continue'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t));\n\n\t\t// Set custom subform decorator\n\t\t$this->setDecorators(array(\n\t\t\t\tarray('ViewScript', array('viewScript' => 'insurance/subforms/quote-my-additionaldetail.phtml'))\n\t\t));\n\n\t\t// Strip all tags to prevent XSS errors\n\t\t$this->setElementFilters(array('StripTags'));\n\n\n\t\t$this->setElementDecorators(array(\n\t\t\t\tarray('ViewHelper', array('escape' => false)),\n\t\t\t\tarray('Label', array('escape' => false))\n\t\t));\n\t}", "public function makeOutput()\n\t{\n\t\t$formId = $this->name;\n\t\t$enctype = 'application/x-www-form-urlencoded';\n\n\t\t$formHtml = new HtmlObject('form');\n\t\t$formHtml->property('method', $this->form->getMethod())->\n\t\t\t\t\tproperty('id', $formId)->\n\t\t\t\t\tproperty('action', $this->form->getAction());\n\n\t\t$jsStartup = array();\n\n\t\tforeach($this->inputs as $inputs) {\n\t\t\tforeach($inputs as $input) {\n\t\t\t\tif(($input->type == 'checkbox' || $input->type == 'radio') && isset($input->properties['value'])) {\n\t\t\t\t\t$inputId = $formId . '_' . $input->name . '_' . $input->properties['value'];\n\t\t\t\t} else {\n\t\t\t\t\t$inputId = $formId . '_' . $input->name;\n\t\t\t\t}\n\t\t\t\t$input->property('id', $inputId);\n\t\t\t}\n\t\t}\n\n\t\tforeach($this->inputs as $section => $inputs)\n\t\t{\n\t\t\t$sectionHtml = new HtmlObject('fieldset');\n\t\t\t$sectionHtml->property('id', $formId . \"_section_\" . $section);\n\n\t\t\tif(isset($this->sectionClasses[$section])) {\n\t\t\t\tforeach($this->sectionClasses[$section] as $class) {\n\t\t\t\t\t$sectionHtml->addClass($class);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->sectionClasses[$section] = array();\n\t\t\t}\n\n\t\t\tif(!in_array('mf-toggle-hide', $this->sectionClasses[$section]) && \n\t\t\t !in_array('mf-toggle-none', $this->sectionClasses[$section])) {\n\t\t\t\t$sectionHtml->addClass('mf-toggle-show');\n\t\t\t}\n\n\n\t\t\tif(isset($this->sectionLegends[$section]))\n\t\t\t\t$sectionHtml->insertNewHtmlObject('legend')->\n\t\t\t\t\twrapAround($this->sectionLegends[$section]);\n\n\t\t\t$sectionDiv = new HtmlObject('div');\n\t\t\t$sectionDiv->addClass('fieldset_contents')->\n\t\t\t\tproperty('id', $formId . \"_section_\" . $section . '_contents');\n\n\t\t\tif(isset($this->sectionIntro[$section]))\n\t\t\t\t$sectionDiv->insertNewHtmlObject('div')->\n\t\t\t\t\twrapAround($this->sectionIntro[$section])->\n\t\t\t\t\taddClass('fieldset_intro')->\n\t\t\t\t\tproperty('id', $formId . \"_section_\" . $section . '_intro');\n\n\t\t\t$sectionHtml->wrapAround($sectionDiv);\n\n\t\t\t$hasInputs = false;\n\n\t\t\t$controlsDiv = new HtmlObject('div');\n\t\t\t$controlsDiv->addClass('fieldset_controls')->\n\t\t\t\tproperty('id', $formId . \"_section_\" . $section . '_controls');\n\n\t\t\t$sectionDiv->wrapAround($controlsDiv);\n\n\t\t\tforeach($inputs as $input)\n\t\t\t{\n\t\t\t\t$inputId = $input->property('id');\n\n\t\t\t\tif($input->type === 'submit' && !$this->includeSubmit)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif($input->type === 'richtext') {\n\t\t\t\t\t$input->property($this->form->getMarkup(), 'true');\n\t\t\t\t\t$input->type = 'textarea';\n\t\t\t\t\t$input->addClass('fulltext');\n\t\t\t\t}\n\n\t\t\t\t$plugins = new Hook();\n\t\t\t\t$plugins->enforceInterface('FormToHtmlHook');\n\t\t\t\t$plugins->loadPlugins('Forms', 'HtmlConvert', 'Base');\n\t\t\t\t$plugins->loadPlugins('Forms', 'HtmlConvert', $input->type);\n\t\t\t\t$plugins->setInput($input);\n\n\t\t\t\t$jsStartup = array_merge_recursive($jsStartup,\n\t\t\t\t\t\t\t\tHook::mergeResults($plugins->getCustomJavaScript()));\n\n\t\t\t\tif(in_array(true, Hook::mergeResults($plugins->overrideHtml())))\n\t\t\t\t{\n\t\t\t\t\t$plugins->createOverriddingHtml($sectionHtml);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\n\t\t\t\tif($inputStartupJs = $this->getInputJavascript($input))\n\t\t\t\t\t$jsStartup = array_merge_recursive($jsStartup, $inputStartupJs);\n\n\t\t\t\t$inputHtml = $this->getInputHtmlByType($input);\n\t\t\t\t$plugins->setCustomHtml($inputHtml);\n\n\t\t\t\tif($inputOptions = $this->getInputMetaData($input) ) //count($inputOptions > 0))\n\t\t\t\t{\n\t\t\t\t\t$metaDataClass = json_encode($inputOptions);\n\t\t\t\t\t$inputHtml->addClass($metaDataClass);\n\t\t\t\t}\n\n\t\t\t\tif($input->type == 'file')\n\t\t\t\t\t$enctype = 'multipart/form-data';\n\n\t\t\t\tif($input->type == 'hidden') {\n\t\t\t\t\t$inputHtml->close(false);\n\t\t\t\t\t$formHtml->wrapAround($inputHtml);\n\t\t\t\t} else {\n\t\t\t\t\t$inputHtml->wrapAround($input->property('contents'));\n\n\t\t\t\t\t$labelHtml = new HtmlObject('label');\n\n\t\t\t\t\t$labelHtml->property('for', $inputId)->\n\t\t\t\t\t\tproperty('id', $inputId . '_label');\n\n\t\t\t\t\tif(isset($input->pretext))\n\t\t\t\t\t\t$controlsDiv->wrapAround($input->pretext);\n\n\t\t\t\t\tif(isset($input->label))\n\t\t\t\t\t{\n\t\t\t\t\t\t$labelHtml->wrapAround($input->label);\n\t\t\t\t\t\tif(isset($input->description))\n\t\t\t\t\t\t\t$labelHtml->property('title', $input->description);\n\t\t\t\t\t}\n\n\t\t\t\t\tif($input->type == 'radio' || $input->type == 'checkbox')\n\t\t\t\t\t\t$inputHtml->addClass('small_input');\n\n\t\t\t\t\tif(isset($input->labelAfter) && $input->labelAfter) {\n\t\t\t\t\t\t$labelHtml->addClass('label_after');\n\t\t\t\t\t\t$inputHtml->addClass('input_label_after');\n\n\t\t\t\t\t\t$controlsDiv->wrapAround($inputHtml)->\n\t\t\t\t\t\t\twrapAround($labelHtml);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$labelHtml->addClass('label_before');\n\t\t\t\t\t\t$inputHtml->addClass('input_label_before');\n\n\t\t\t\t\t\t$controlsDiv->wrapAround($labelHtml)->\n\t\t\t\t\t\t\twrapAround($inputHtml);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isset($this->errors[$input->name])) {\n\t\t\t\t\t\t$errorLabel = new HtmlObject('label');\n\t\t\t\t\t\t$errorLabel->addClass('error')->\n\t\t\t\t\t\t\tproperty('for', $inputId)->\n\t\t\t\t\t\t\tproperty('generated', true);\n\t\t\t\t\t\t$errorVal = '';\n\n\t\t\t\t\t\tforeach($this->errors[$input->name] as $error)\n\t\t\t\t\t\t\t$errorVal .= $error . ' ';\n\n\t\t\t\t\t\t$errorLabel->wrapAround(trim($errorVal));\n\t\t\t\t\t\t$controlsDiv->wrapAround($errorLabel);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isset($input->posttext))\n\t\t\t\t\t\t$controlsDiv->wrapAround($input->posttext);\n\n\t\t\t\t\tif(!isset($input->noBreak) || $input->noBreak === false)\n\t\t\t\t\t\t$controlsDiv->insertNewHtmlObject('br');\n\n\t\t\t\t\t$hasInputs = true;\n\t\t\t\t}\n\t\t\t}//foreach($this->inputs as $section => $inputs)\n\n\t\t\tif(isset($this->sectionOutro[$section]))\n\t\t\t\t$sectionDiv->insertNewHtmlObject('div')->\n\t\t\t\t\twrapAround($this->sectionOutro[$section])->\n\t\t\t\t\taddClass('fieldset_outro')->\n\t\t\t\t\tproperty('id', $formId . \"_section_\" . $section . '_outro');\n\n\t\t\tif($hasInputs)\n\t\t\t\t$formHtml->wrapAround($sectionHtml);\n\n\t\t\t$formHtml->property('enctype', $enctype);\n\t\t}\n\n\t\tif(!$this->submitButton && $this->includeSubmit)\n\t\t{\n\t\t\t$sectionHtml = new HtmlObject('div');\n\t\t\t$sectionHtml->property('id', $this->name . \"_section_\" . 'control');\n\t\t\t$inputHtml = new HtmlObject('input');\n\t\t\t$inputHtml->name = $input->name;\n\t\t\t$inputHtml->property('name', 'Submit')->property('type', 'Submit')->property('value', 'Submit');\n\n\t\t\t$labelHtml = new HtmlObject('label');\n\t\t\t$sectionHtml->wrapAround($labelHtml)->wrapAround($inputHtml)->wrapAround('<br>');\n\t\t\t$formHtml->wrapAround($sectionHtml);\n\t\t}\n\n\t\t$formHtml = (string) $formHtml;\n\n\t\t$output = $this->fullForm\n\t\t\t? (string) $formHtml\n\t\t\t: (string) $sectionHtml;\n\n\t\t$formJsOptions = array();\n\t\t$formJsOptions['validateOnLoad'] = $this->form->wasSubmitted();\n\t\t$jsStartup[] = '$(\"#' . $this->name . '\").MortarForm(' . json_encode($formJsOptions) . ');';\n\n\t\tif(class_exists('ActivePage', false))\n\t\t{\n\t\t\t$page = ActivePage::getInstance();\n\t\t\t$page->addStartupScript($jsStartup);\n\t\t}\n\t\treturn $output;\n\t}", "function hgr_minimalform_init() {\n\t\t\tif(function_exists('vc_map')) {\n\t\t\t\t/*\n\t\t\t\t\tparent element\n\t\t\t\t*/\n\t\t\t\tvc_map(\n\t\t\t\t\tarray(\n\t\t\t\t\t \"name\"\t\t\t\t\t\t=>\t__(\"HGR MinimalForm\", \"hgrextender\"),\n\t\t\t\t\t \"base\"\t\t\t\t\t\t=>\t\"hgr_minimal_form\",\n\t\t\t\t\t \"class\"\t\t\t\t\t\t=>\t\"\",\n\t\t\t\t\t \"icon\"\t\t\t\t\t\t=>\t\"hgr_minimal_form\",\n\t\t\t\t\t \"category\"\t\t\t\t\t=>\t__(\"HighGrade Extender\", \"hgrextender\"),\n\t\t\t\t\t \"as_parent\"\t\t\t\t\t=>\tarray(\"only\" =>\t\"hgr_minimal_input\"),\n\t\t\t\t\t \"description\"\t\t\t\t=>\t__(\"Minimal Form with advanced settings\", \"hgrextender\"),\n\t\t\t\t\t \"content_element\"\t\t\t=>\ttrue,\n\t\t\t\t\t \"show_settings_on_create\"\t=>\ttrue,\n\t\t\t\t\t \"params\"\t\t\t\t\t=>\tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"dropdown\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Form size settings:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"form_size\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\t\"Large\"\t\t\t\t=>\t\"large\",\n\t\t\t\t\t\t\t\t\t\t\"Medium\"\t\t\t=>\t\"medium\",\n\t\t\t\t\t\t\t\t\t\t\"Small\"\t\t\t \t=>\t\"small\",\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Choose from our 3 preset values.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"dropdown\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Form style settings:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"form_style\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\t\"Standard\"\t\t\t\t=>\t\"standard\",\n\t\t\t\t\t\t\t\t\t\t\"Advanced\"\t\t\t\t=>\t\"advanced\",\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Choose customization settings.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"number\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Label text size:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"label_text_size\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t'',\n\t\t\t\t\t\t\t\t\"min\"\t\t\t=>\t8,\n\t\t\t\t\t\t\t\t\"max\"\t\t\t=>\t80,\n\t\t\t\t\t\t\t\t\"suffix\"\t\t=>\t\"px\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Set label text size in pixels.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"dependency\"\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\"element\"\t=>\t\"form_style\",\n\t\t\t\t\t\t\t\t\t\"value\"\t\t=>\tarray( \"advanced\" ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"colorpicker\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Label text color:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"label_text_color\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Set label text color.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"dependency\"\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\"element\"\t=>\t\"form_style\",\n\t\t\t\t\t\t\t\t\t\"value\"\t\t=>\tarray( \"advanced\" ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"colorpicker\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Input text color:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"input_text_color\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Set input text color.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"dependency\"\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\"element\"\t=>\t\"form_style\",\n\t\t\t\t\t\t\t\t\t\"value\"\t\t=>\tarray( \"advanced\" )\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"colorpicker\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Next icon color:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"next_icon_color\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Set next icon color.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"dependency\"\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\"element\"\t=>\t\"form_style\",\n\t\t\t\t\t\t\t\t\t\"value\"\t\t=>\tarray( \"advanced\" ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t \"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t \"class\"\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t \"heading\"\t\t=>\t__(\"Confirmation text:\",\"hgrextender\"),\n\t\t\t\t\t\t\t\t \"param_name\"\t=>\t\"confirmation_text\",\n\t\t\t\t\t\t\t\t \"value\"\t\t=>\t\"Form has been submitted. Thank you for your time!\",\n\t\t\t\t\t\t\t\t \"description\"\t=>\t__(\"Thank you message after the form is submitted.\",\"hgrextender\"),\n\t\t\t\t\t\t\t\t \"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"number\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Confirmation text size:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"confirmation_text_size\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t'',\n\t\t\t\t\t\t\t\t\"min\"\t\t\t=>\t8,\n\t\t\t\t\t\t\t\t\"max\"\t\t\t=>\t80,\n\t\t\t\t\t\t\t\t\"suffix\"\t\t=>\t\"px\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Set confirmation text size in pixels.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"dependency\"\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\"element\"\t=>\t\"form_style\",\n\t\t\t\t\t\t\t\t\t\"value\"\t\t=>\tarray( \"advanced\" ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"colorpicker\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Confirmation text color:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"confirmation_text_color\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Set confirmation text color.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"dependency\"\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\"element\"\t=>\t\"form_style\",\n\t\t\t\t\t\t\t\t\t\"value\"\t\t=>\tarray( \"advanced\" ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"colorpicker\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Steps text color:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"steps_text_color\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Set steps text color.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"dependency\"\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\"element\"\t=>\t\"form_style\",\n\t\t\t\t\t\t\t\t\t\"value\"\t\t=>\tarray( \"advanced\" ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"colorpicker\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Form input background color:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"form_input_color\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Set color for input background.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"dependency\"\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\"element\"\t=>\t\"form_style\",\n\t\t\t\t\t\t\t\t\t\"value\"\t\t=>\tarray( \"advanced\" ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"colorpicker\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Progress bar background color:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"progress_bar_bgcolor\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Set the background color for progress bar.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"dependency\"\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\"element\"\t=>\t\"form_style\",\n\t\t\t\t\t\t\t\t\t\"value\"\t\t=>\tarray( \"advanced\" ),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'type' => 'css_editor',\n\t\t\t\t\t\t\t\t'heading' => __( 'Css', 'hgrextender' ),\n\t\t\t\t\t\t\t\t'param_name' => 'css',\n\t\t\t\t\t\t\t\t'group' => __( 'Design options', 'hgrextender' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\"js_view\"\t=>\t\"VcColumnView\"\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\tChild element\n\t\t\t\t*/\n\t\t\t\tvc_map(\n\t\t\t\t\tarray(\n\t\t\t\t\t \"name\"\t\t\t\t=>\t__(\"Input field\", \"hgrextender\"),\n\t\t\t\t\t \"holder\"\t\t\t=>\t\"div\",\n\t\t\t\t\t \"base\"\t\t\t\t=>\t\"hgr_minimal_input\",\n\t\t\t\t\t \"class\"\t\t\t\t=>\t\"\",\n\t\t\t\t\t \"icon\"\t\t\t\t=>\t\"\",\n\t\t\t\t\t \"content_element\"\t=>\ttrue,\n\t\t\t\t\t \"as_child\"\t\t\t=>\tarray(\"only\" =>\t\"hgr_minimal_form\"),\n\t\t\t\t\t \"params\"\t\t\t=>\tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Label text:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"label_text\",\n\t\t\t\t\t\t\t\t\"admin_label\" \t=> \ttrue,\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Set a label text (eg. First name, Address, Telephone).\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"dropdown\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Input type\",\"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"input_type\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\t\"Text\"\t\t=>\t\"text\",\n\t\t\t\t\t\t\t\t\t\t\"E-mail\"\t=>\t\"e-mail\",\n\t\t\t\t\t\t\t\t\t\t\"Telephone\"\t=>\t\"telephone\",\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Select input type. This will verify submitted data.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t )\n\t\t\t\t\t) \n\t\t\t\t);\n\t\t\t}\n\t\t}", "function insert() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm(TRUE);\n\t\t$tpl->setContent($form->getHTML());\n\t}", "protected function form()\n {\n $form = new Form(new Information);\n \n \n\n $form->text('name', __('项目名称'))->autofocus()->placeholder('例:上汽大众新能源汽车工厂项目')->required();\n $form->text('industry', __('行业类别'))->required();\n $form->currency('investment', __('投资金额'))->icon('fa-usd')->required(); \n $form->text('cont_name', __('资方联系人'))->placeholder('选填内容,可为空');\n $form->text('cont_phone', __('资方联系方式'))->placeholder('选填内容,可为空');\n $form->text('staff_name', __('工作人员姓名'));\n $form->text('staff_phone', __('工作人员电话'));\n $form->hidden('adminuser_id', __('adminuser_id'))->value(Admin::user()->id);\n $form->textarea('content', __('项目情况'))->required()->placeholder('请填写项目介绍(包括项目投资额度、产业类别等)、项目需求(如土地、排放、能耗等)、谈判进度等......');\n\n\n\n $form->tools(function (Form\\Tools $tools) {\n\n // 去掉`列表`按钮\n $tools->disableList();\n\n });\n\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n $footer->disableReset();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n $form->setAction('../admin/myinfo');\n\n return $form;\n }", "public function init() {\n $this->setMethod('post');\n $this->setAction($this->getView()->url());\n $this->_view->headScript()->appendFile($this->_view->baseUrl('media/js/collapsiblefields.js', 'text/javascript'));\n $this->_view->headScript()->appendFile($this->_view->baseUrl('media/js/toggledetails.js', 'text/javascript'));\n $this->_view->headScript()->appendFile($this->_view->baseUrl('media/js/erga/paketaergasias/paradotea.js', 'text/javascript'));\n\n $subform = new Dnna_Form_SubFormBase();\n $subform->setLegend('Στοιχεία Παραδοτέου');\n // Recordid\n $subform->addElement('hidden', 'recordid', array());\n // Κωδικός Παραδοτέου\n $subform->addElement('text', 'codename', array(\n 'label' => 'Κωδικός Παραδοτέου:',\n 'validators' => array(\n array('validator' => 'StringLength', 'options' => array(0, 15))\n ),\n 'required' => true,\n 'placeholder' => 'πχ. Π.1.1',\n )\n );\n // Τίτλος Παραδοτέου\n $subform->addElement('textarea', 'title', array(\n 'label' => 'Τίτλος Παραδοτέου:',\n 'validators' => array(\n array('validator' => 'StringLength', 'options' => array(0, $this->_textareaMaxLength))\n ),\n 'rows' => 1,\n 'cols' => $this->_textareaCols,\n 'required' => true,\n )\n );\n // Ποσό\n $subform->addElement('text', 'amount', array(\n 'label' => 'Ποσό:',\n 'validators' => array(\n array('validator' => 'Float')\n ),\n 'class' => 'formatFloat',\n 'required' => true,\n ));\n // Όρια ανα Κατηγορία Προσωπικού\n $project = $this->_view->getProject();\n if(isset($project) && $project->get_personnelcategories()->count() > 0) {\n $limitsform = new Dnna_Form_SubFormBase($this->_view);\n $i = 1;\n foreach($project->get_personnelcategories() as $curCategory) {\n $curlimitform = new Dnna_Form_SubFormBase($this->_view);\n // Recordid\n $curlimitform->addElement('hidden', 'recordid', array());\n // Id κατηγορίας\n $curlimitcategoryform = new Dnna_Form_SubFormBase($this->_view);\n $curlimitcategoryform->addElement('hidden', 'recordid', array(\n 'value' => $curCategory->get_recordid(),\n ));\n $curlimitform->addSubForm($curlimitcategoryform, 'personnelcategory', false);\n // Limit\n $curlimitform->addElement('text', 'limit', array(\n 'label' => 'Όριο ωρών για '.$curCategory->get_name().':',\n 'validators' => array(\n array('validator' => 'Float')\n ),\n 'required' => false,\n ));\n $curlimitform->set_empty(false);\n $limitsform->addSubForm($curlimitform, $i, false, 'default-limits');\n $i++;\n }\n $subform->addSubForm($limitsform, 'limits', false);\n }\n // Έναρξη\n $subform->addElement('text', 'startdate', array(\n 'label' => 'Ημερομηνία Έναρξης:',\n 'validators' => array(\n array('validator' => 'Date')\n ),\n 'class' => 'usedatepicker',\n 'required' => false,\n ));\n // Λήξη\n $subform->addElement('text', 'enddate', array(\n 'label' => 'Ημερομηνία Λήξης:',\n 'validators' => array(\n array('validator' => 'Date')\n ),\n 'class' => 'usedatepicker',\n 'required' => false,\n ));\n // Εγκριση αναθεσης απο επιτροπη ερευνων\n $subform->addElement('text', 'assignmentapprovaldate', array(\n 'label' => 'Έγκριση Ανάθεσης από Επιτροπή Ερευνών:',\n 'validators' => array(\n array('validator' => 'Date')\n ),\n 'class' => 'usedatepicker',\n ));\n // Εγκριση ολοκλήρωσης απο Επιτροπή Ερευνών\n $subform->addElement('text', 'completionapprovaldate', array(\n 'label' => 'Εγκριση Ολοκλήρωσης απο Επιτροπή Ερευνών:',\n 'validators' => array(\n array('validator' => 'Date')\n ),\n 'class' => 'usedatepicker',\n ));\n\n // Σχόλια\n $subform->addElement('textarea', 'comments', array(\n 'label' => 'Γενικές Πληροφορίες:',\n 'validators' => array(\n array('validator' => 'StringLength', 'options' => array(0, $this->_textareaMaxLength))\n ),\n 'rows' => $this->_textareaRows,\n 'cols' => $this->_textareaCols,\n ));\n\n $subsubform = new Dnna_Form_SubFormBase();\n if($this->_view->getSubProject()->get_subprojectdirectlabor() == \"1\") {\n $subsubform->setLegend('Συντάκτες');\n if(($this->_view->getSubProject()->get_employees() != null && count($this->_view->getSubProject()->get_employees()) > 0) ||\n ($this->_view->getProject() != null && $this->_view->getProject()->get_thisprojectemployees() != null && count($this->_view->getProject()->get_thisprojectemployees()) > 0)) {\n $this->addAuthorFields($subsubform, false);\n } else {\n $element = new Application_Form_Element_Note('noauthorsnote', array(\n 'value' => 'Δεν έχουν οριστεί απασχολούμενοι'\n ));\n $subsubform->addElement($element);\n }\n $subform->addSubForm($subsubform, 'authors');\n } else {\n $subsubform->setLegend('Ανάδοχος');\n if($this->_view->getSubProject()->get_contractors() != null && $this->_view->getSubProject()->get_contractors()->count() > 0) {\n $this->addContractorFields($subsubform, false);\n } else {\n $element = new Application_Form_Element_Note('noauthorsnote', array(\n 'value' => 'Δεν έχουν οριστεί ανάδοχοι'\n ));\n $subsubform->addElement($element);\n }\n $subform->addSubForm($subsubform, 'contractor');\n }\n $this->addSubForm($subform, 'default');\n $this->addSubmitFields();\n }", "function vistaportal_education_form($form, &$form_state) {\n include_once ('vistaportal.fields.inc');\n include_once ('vistaportal_functions.inc');\n drupal_add_library('system', 'drupal.ajax');\n drupal_add_library('system', 'jquery.form');\n //Set this to tree so we can access all dynamic form values\n $form['#tree'] = TRUE;\n $form['#attributes'] = array('enctype' => array(\"multipart/form-data\"));\n $date = date('Y-m-d H:m:s');\n $format = 'Y-m';\n $format1 = 'Y-m-d';\n //This is the pre-med education form\n $form['premed'] = array(\n '#type' => 'fieldset',\n '#title' => t('PRE-MEDICAL EDUCATION (OPTIONAL)'),\n '#collapsible' => FALSE,\n '#prefix' => '<div id=\"premed-fieldset-wrapper\">',\n '#suffix' => '</div>',\n );\n\n //This counter will be used to determine how many premed sections to add\n if (empty($form_state['p_num_schools'])) {\n $form_state['p_num_schools'] = 1;\n }\n\n for ($i = 0; $i < $form_state['p_num_schools']; $i++) {\n if ($i > 0) {\n $form['premed'][$i]['title-txt' . $i]['#prefix'] = '<div class=\"line-solid\"></div><h2> Pre-Medical Education ' . ($i + 1) . '</h2><br/>';\n }\n $form['premed'][$i]['school' . $i] = textfield('School of Graduation');\n $form['premed'][$i]['school' . $i]['#maxlength'] = 40;\n $form['premed'][$i]['school' . $i]['#prefix'] = '<div class = \"premed-school\">';\n $form['premed'][$i]['school' . $i]['#suffix'] = '</div>';\n $form['premed'][$i]['school' . $i]['#required'] = FALSE;\n $form['premed'][$i]['country' . $i] = country('Country');\n $form['premed'][$i]['country' . $i]['#prefix'] = '<div class = \"premed-country\">';\n $form['premed'][$i]['country' . $i]['#suffix'] = '</div>';\n $form['premed'][$i]['country' . $i]['#required'] = FALSE;\n $form['premed'][$i]['state' . $i] = state('State');\n $form['premed'][$i]['state' . $i]['#prefix'] = '<div class = \"premed-state\">';\n $form['premed'][$i]['state' . $i]['#suffix'] = '</div>';\n $form['premed'][$i]['state' . $i]['#required'] = FALSE;\n $form['premed'][$i]['city' . $i] = textfield('City');\n $form['premed'][$i]['city' . $i]['#maxlength'] = 20;\n $form['premed'][$i]['city' . $i]['#required'] = FALSE;\n $form['premed'][$i]['city' . $i]['#prefix'] = '<div class = \"premed-city\">';\n $form['premed'][$i]['city' . $i]['#suffix'] = '</div>';\n //This is the date\n $form['premed'][$i]['date' . $i] = array(\n '#prefix' => '<div class=\"premed-date\">',\n '#markup' => 'Dates Attended',\n '#suffix' => '</div>',\n );\n $form['premed'][$i]['date_from' . $i] = date_my('From');\n $form['premed'][$i]['date_from' . $i]['#required'] = FALSE;\n $form['premed'][$i]['date_from' . $i]['#prefix'] = '<div class = \"premed-date-from\">';\n $form['premed'][$i]['date_from' . $i]['#suffix'] = '</div>';\n $form['premed'][$i]['date_to' . $i] = date_my('To');\n $form['premed'][$i]['date_to' . $i]['#required'] = FALSE;\n $form['premed'][$i]['date_to' . $i]['#prefix'] = '<div class = \"premed-date-to\">';\n $form['premed'][$i]['date_to' . $i]['#suffix'] = '</div>';\n $form['premed'][$i]['degree' . $i] = edu('Degree');\n $form['premed'][$i]['degree' . $i]['#required'] = FALSE;\n $form['premed'][$i]['degree' . $i]['#prefix'] = '<div class = \"premed-degree\">';\n $form['premed'][$i]['degree' . $i]['#suffix'] = '</div>';\n }\n\n //Only allow 3 schools for the premed form\n if ($form_state['p_num_schools'] < 3) {\n $form['premed']['add_another'] = array(\n //'#prefix' => '<div class=\"edu-btn\">',\n '#type' => 'submit',\n '#value' => t('+ Add Pre-Medical Institution'),\n '#submit' => array('vistaportal_form_premed_add'),\n '#limit_validation_errors' => array(),\n '#ajax' => array(\n 'callback' => 'vistaportal_premed_form_add_school_callback',\n 'wrapper' => 'premed-fieldset-wrapper',\n 'method' => 'replaceWith',\n 'speed' => 'fast',\n ),\n );\n }\n\n //First school is mandatory\n if ($form_state['p_num_schools'] > 1) {\n $form['premed']['remove_school'] = array(\n '#type' => 'submit',\n '#value' => t('- Remove Pre-medical Institution'),\n '#submit' => array('vistaportal_form_premed_remove'),\n '#limit_validation_errors' => array(),\n '#ajax' => array(\n 'callback' => 'vistaportal_premed_form_add_school_callback',\n 'wrapper' => 'premed-fieldset-wrapper',\n ),\n );\n }\n\n //This is the line separator\n $form['p']['line3'] = array(\n '#prefix' => '<div class=\"line-solid\">',\n //'#markup' => '<hr>',\n '#attributes' => array('class' => array('line-solid')),\n '#suffix' => '</div>',\n );\n\n //This is the medical school form\n $form['med'] = array(\n '#type' => 'fieldset',\n '#title' => t('MEDICAL EDUCATION'),\n '#collapsible' => FALSE,\n '#prefix' => '<div id=\"med-fieldset-wrapper\">',\n '#suffix' => '</div>',\n );\n\n //This counter will be used to determine how many medical school sections to add\n if (empty($form_state['m_num_schools'])) {\n $form_state['m_num_schools'] = 1;\n }\n\n for ($i = 0; $i < $form_state['m_num_schools']; $i++) {\n if ($i > 0) {\n $form['med'][$i]['title-txt' . $i]['#prefix'] = '<div class=\"line-solid2\"></div><h2> Medical Education ' . ($i + 1) . '</h2><br/>';\n }\n $form['med'][$i]['school' . $i] = textfield('School of Graduation');\n $form['med'][$i]['school' . $i]['#maxlength'] = 40;\n $form['med'][$i]['school' . $i]['#prefix'] = '<div class = \"med-school\">';\n $form['med'][$i]['school' . $i]['#suffix'] = '</div>';\n $form['med'][$i]['country' . $i] = country('Country');\n $form['med'][$i]['country' . $i]['#prefix'] = '<div class = \"med-country\">';\n $form['med'][$i]['country' . $i]['#suffix'] = '</div>';\n $form['med'][$i]['state' . $i] = state('State');\n $form['med'][$i]['state' . $i]['#prefix'] = '<div class = \"med-state\">';\n $form['med'][$i]['state' . $i]['#suffix'] = '</div>';\n $form['med'][$i]['city' . $i] = textfield('City');\n $form['med'][$i]['city' . $i]['#maxlength'] = 20;\n $form['med'][$i]['city' . $i]['#prefix'] = '<div class = \"med-city\">';\n $form['med'][$i]['city' . $i]['#suffix'] = '</div>';\n\n //This is the date\n $form['med'][$i]['date' . $i] = array(\n '#prefix' => '<div class=\"med-date\">',\n '#markup' => 'Dates Attended',\n '#suffix' => '</div>',\n );\n $form['med'][$i]['date_from' . $i] = date_my('From');\n $form['med'][$i]['date_from' . $i]['#prefix'] = '<div class = \"med-date-from\">';\n $form['med'][$i]['date_from' . $i]['#suffix'] = '</div>';\n $form['med'][$i]['date_to' . $i] = date_my('To');\n $form['med'][$i]['date_to' . $i]['#prefix'] = '<div class = \"med-date-to\">';\n $form['med'][$i]['date_to' . $i]['#suffix'] = '</div>';\n $form['med'][$i]['degree' . $i] = edu('Degree');\n $form['med'][$i]['degree' . $i]['#prefix'] = '<div class = \"med-degree\">';\n $form['med'][$i]['degree' . $i]['#suffix'] = '</div>';\n /* $form['med'][$i]['ecfmg' . $i] = textfield('ECFMG CERTIFICATE #');\n $form['med'][$i]['ecfmg' . $i]['#maxlength'] = 20;\n $form['med'][$i]['ecfmg' . $i]['#attributes'] = array('class' => array('textfield-license'));\n $form['med'][$i]['ecfmg' . $i]['#prefix'] = '<div class = \"med-ecfmg\">';\n $form['med'][$i]['ecfmg' . $i]['#suffix'] = '</div>';*/\n\n //added fields\n $form['med'][$i]['valid' . $i] = array(\n '#prefix' => '<div class=\"var_label\">',\n '#markup' => t('Valid Indefinitely'),\n '#required' => TRUE,\n '#suffix' => '</div>',\n );\n $form['med'][$i]['valid-indef' . $i] = radios_yesno();\n $form['med'][$i]['valid-indef' . $i]['#prefix'] = '<div class = \"med-yes-no\">';\n $form['med'][$i]['valid-indef' . $i]['#suffix'] = '</div>';\n $form['med'][$i]['exp_date' . $i] = date_my('If no, state expiration date');\n $form['med'][$i]['exp_date' . $i]['#prefix'] = '<div class = \"med-exp-date\">';\n $form['med'][$i]['exp_date' . $i]['#suffix'] = '</div>';\n\n }\n\n //Only allow 3 schools for the med form\n if ($form_state['m_num_schools'] < 3) {\n $form['med']['add_another'] = array(\n '#type' => 'submit',\n '#value' => t('+ Add Medical Institution'),\n '#submit' => array('vistaportal_form_med_add'),\n '#limit_validation_errors' => array(),\n '#ajax' => array(\n 'callback' => 'vistaportal_med_form_add_school_callback',\n 'wrapper' => 'med-fieldset-wrapper',\n 'method' => 'replaceWith',\n ),\n );\n }\n\n //First school is mandatory\n if ($form_state['m_num_schools'] > 1) {\n $form['med']['remove_school'] = array(\n '#type' => 'submit',\n '#value' => t('- Remove Medical Institution'),\n '#submit' => array('vistaportal_form_med_remove'),\n '#limit_validation_errors' => array(),\n '#ajax' => array(\n 'callback' => 'vistaportal_med_form_add_school_callback',\n 'wrapper' => 'med-fieldset-wrapper',\n ),\n );\n }\n\n //this is a line at the bottom\n $form['last']['line'] = array(\n '#prefix' => '<div class=\"line_left\">',\n //'#markup' => '<hr>',\n '#suffix' => '</div>',\n );\n\n $form['last']['required_field'] = array(\n '#prefix' => '<div class=\"required_field2\">',\n '#markup' => 'Required Field',\n '#required' => TRUE,\n '#suffix' => '</div>',\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Submit'),\n '#name' => 'next',\n '#submit' => array('vistaportal_education_form_submit'),\n '#attributes' => array('class' => array('education-submit')),\n );\n\t\t\n\t\t$form['next'] = array(\n '#type' => 'submit',\n '#value' => t('Next'),\n '#limit_validation_errors' => array(),\n '#attributes' => array('class' => array('button')),\n '#submit' => array('vistaportal_next'),\n );\n\t\t$form['next']['#attributes'] = array('class' => array('next'));\n\t\t\n $form['save_logout'] = array(\n '#type' => 'submit',\n '#value' => t('Save & Logout'),\n '#limit_validation_errors' => array(),\n '#attributes' => array('class' => array('button')),\n '#submit' => array('vistaportal_save_logout'),\n );\n\n $form['prev'] = array(\n '#type' => 'submit',\n '#value' => t('Previous'),\n '#limit_validation_errors' => array(),\n '#attributes' => array('class' => array('button prev')),\n '#submit' => array('vistaportal_education_previous'),\n );\n\n $form['prev']['#attributes'] = array('class' => array('prev'));\n\n $form['#after_build'][] = 'vistaportal_education_form_afterbuild';\n return $form;\n }", "public function init()\n {\n $this->add(array(\n 'name' => 'name',\n 'options' => array(\n 'label' => __('Name*'),\n ),\n 'attributes' => array(\n 'type' => 'text',\n ),\n ));\n\n $this->add(array(\n 'name' => 'title',\n 'options' => array(\n 'label' => __('Title*'),\n ),\n 'attributes' => array(\n 'type' => 'text',\n ),\n ));\n $this->add(array(\n 'name' => 'company',\n 'options' => array(\n 'label' => __('Company*'),\n ),\n 'attributes' => array(\n 'type' => 'text',\n ),\n ));\n $this->add(array(\n 'name' => 'email',\n 'options' => array(\n 'label' => __('Email*'),\n ),\n 'attributes' => array(\n\n 'type' => 'text',\n ),\n ));\n $this->add(array(\n 'name' => 'phone',\n 'options' => array(\n 'label' => __('Phone*'),\n ),\n 'attributes' => array(\n 'type' => 'text',\n ),\n ));\n $this->add(array(\n 'name' => 'submit',\n 'attributes' => array(\n 'value' => __('Freetrial'),\n ),\n 'type' => 'submit',\n ));\n }", "protected function Form_Create() {\n\t\t\t$this->txtValue1 = new QTextBox($this);\n\t\t\t\n\t\t\t$this->txtValue2 = new QTextBox($this);\n\t\t\t\n\t\t\t$this->lstOperation = new QListBox($this);\n\t\t\t$this->lstOperation->AddItem('+', 'add');\n\t\t\t$this->lstOperation->AddItem('-', 'subtract');\n\t\t\t$this->lstOperation->AddItem('*', 'multiply');\n\t\t\t$this->lstOperation->AddItem('/', 'divide');\n\t\t\t\n\t\t\t$this->btnCalculate = new QButton($this);\n\t\t\t$this->btnCalculate->Text = 'Calculate';\n\t\t\t$this->btnCalculate->AddAction(new QClickEvent(), new QServerAction('btnCalculate_Click'));\n\t\t\t\n\t\t\t$this->lblResult = new QLabel($this);\n\t\t\t$this->lblResult->HtmlEntities = false;\n\t\t}", "public function form()\n {\n $this->switch('auto_df_switch', __('message.tikuanconfig.auto_df_switch'));\n $this->timeRange('auto_df_stime', 'auto_df_etime', '开启时间');\n $this->text('auto_df_maxmoney', __('message.tikuanconfig.auto_df_maxmoney'))->setWidth(2);\n $this->text('auto_df_max_count', __('message.tikuanconfig.auto_df_max_count'))->setWidth(2);\n $this->text('auto_df_max_sum', __('message.tikuanconfig.auto_df_max_sum'))->setWidth(2);\n\n }", "public function init()\n {\n // Set the method for the display form to POST\n $this->setMethod('post');\n \n // Add table tag\n $this->setDecorators(array(\n 'FormElements',\n array('HtmlTag', array('tag' => 'table')),\n 'Form'\n ));\n \n $this->setElementDecorators(array(\n 'ViewHelper',\n 'Errors',\n array(array('data' => 'HtmlTag'), array('tag' => 'td')),\n array('Label', array('tag' => 'td')),\n array(array('row' => 'HtmlTag'), array('tag' => 'tr'))\n ));\n\n // Add the email element\n $this->addElement('text', 'email', array(\n 'label' => 'User email:',\n 'required' => true,\n 'filters' => array('StringTrim'),\n 'validators' => array(\n 'NotEmpty',\n )\n ));\n\n // Add the submit button\n $this->addElement('submit', 'invite', array(\n 'ignore' => true,\n 'label' => 'invite',\n ));\n\n // And finally add some CSRF protection\n $this->addElement('hash', 'csrf', array(\n 'ignore' => true,\n ));\n }", "protected function form()\n {\n $form = new Form(new Goodss);\n $form->switch('is_enable','状态')->options([\n 'on' => ['value' => 1, 'text' => '正常', 'color' => 'primary'],\n 'off' => ['value' => 0, 'text' => '禁止', 'color' => 'default'],\n ]);\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n //$footer->disableReset();\n\n // 去掉`提交`按钮\n //$footer->disableSubmit();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n return $form;\n }", "public function set_fields() {\n\n $this->add_field( (new acf_fields\\repeater(\"Documents - {$this->label}\", 'call_off_schedule', '202205171525a', [\n 'button_label' => 'Add Document'\n ]))\n ->add_sub_field( new acf_fields\\text( 'Document Name', 'document_name', '202205171525b', [\n 'required' => 1,\n ] ) )\n \n ->add_sub_field( new acf_fields\\file( 'Document', 'document', '202205171525c', [\n 'wrapper' => array (\n 'width' => '33',\n 'class' => '',\n 'id' => ''),\n 'required' => 1,\n ] ) )\n \n ->add_sub_field( new acf_fields\\radio( 'Document type', 'document_type', '202205171525d', [\n 'wrapper' => array (\n 'width' => '33',\n 'class' => '',\n 'id' => ''),\n 'choices' => array(\n 'essential'\t=> 'Essential document',\n 'optional'\t=> 'Optional document',\n ),\n 'required' => 1,\n ] ) )\n \n ->add_sub_field( new acf_fields\\radio( 'Document Usage', 'document_usage', '202205171525e', [\n 'wrapper' => array (\n 'width' => '33',\n 'class' => '',\n 'id' => ''),\n 'choices' => array(\n 'read_only'\t=> 'Read only',\n 'enter_detail'\t=> 'You will need to enter details in this document',\n 'enter_detail_optional'\t=> 'If you use this schedule, you will need to enter details in this document',\n ),\n 'required' => 1,\n ] ) )\n \n ->add_sub_field( new acf_fields\\wysiwyg( 'Document Description', 'document_description', '202205171525f',[\n 'required' => 1,\n ] ) )\n );\n\n }", "public function buildForm() {\n\t\techo \"<!DOCTYPE html>\n\t\t<html>\n\t\t<head>\n\t\t\t<title>$this->title</title>\n\t\t</head>\n\t\t<body>\n\t\t<form method=\\\"$this->method\\\">\";\n\t\tforeach ($this->_inputs as $key => $input) {\n\t\t\t// Check if email validation is required.\n\t\t\tif (isset($input['rule']) && in_array('email', $input['rule'])) {\n\t\t\t\t$input['inputType'] = 'email';\n\t\t\t}\n\n\t\t\techo \"<label>\".$input['label'].\"</label><input type=\\\"\".$input['inputType'].\"\\\" id=\\\"\".$input['name'].\"\\\" name=\\\"\".$input['name'].\"\\\" value=\\\"\".$input['defaultValue'].\"\\\"\";\n\n\t\t\t// Check if field was required.\n\t\t\tif (isset($input['rule']) && in_array('required', $input['rule'])) {\n\t\t\t\techo \" required\";\n\t\t\t}\n\n\t\t\techo \"><br></form>\";\n\t\t}\n\t}", "function _setupForm(){\n\n //Defines the call back function for HTML Quickform to use when validating the form.\n $this->form->addFormRule(array(&$this,'XINValidate'));\n\n // display test name\n $this->form->addElement('header', 'instrument_title', \"Radiology Review Form\");\n\n // automatically adds examiner & date of administration\n $this->_addMetadataFields();\n\n $yes_no_option= array(NULL=>\"\", \"no\"=>\"No\", \"yes\"=>\"Yes\", \"not_answered\"=>\"Not Answered\");\n \t$normal_option= array(NULL=>\"\", \"normal\"=>\"Normal\",\"abnormal\"=>\"Abnormal\", \"atypical\"=>\"Atypical\", \"not_answered\"=>\"Not Answered\");\n \t$exclusionaryOrNot = array(NULL=>\"\", \"exclusionary\"=>\"Exclusionary\", \"non_exclusionary\"=>\"Non-Exclusionary\", \"not_answered\"=>\"Not Answered\");\n\n $this->form->addElement('header', null, '3D T1 MP-Rage');\n $this->form->addElement('select', 'Scan_done', 'Was an MRI performed?', $yes_no_option);\n \t$this->form->addElement('static', null, 'If Yes?'); \n\n \t//These date fields were first not added to $this->dateTimeFields so they weren't saving.\n// $this->form->addElement('date', 'MRI_date', 'Date of MRI acquisition');\n//\t $this->form->addElement('date', 'Review_date', 'Date of local radiology review');\n\n $this->addDateElement('MRI', 'Date of MRI acquisition');\n $this->XINRegisterRule(\"MRI_date\", array(\"Scan_done{@}=={@}yes\"), \"Please enter the scan information\", \"MRI_date_group\");\n $this->addDateElement('Review', 'Date of local radiology review');\n $this->XINRegisterRule(\"Review_date\", array(\"Scan_done{@}=={@}yes\"), \"Please enter the scan information\", \"Review_date_group\");\n\n $this->form->addElement('select', 'Review_results', 'Results of local radiology review?', $normal_option);\n $this->XINRegisterRule(\"Review_results\", array(\"Scan_done{@}=={@}yes\"), \"Please enter the scan information\");\n\n $this->form->addElement('select', 'abnormal_atypical_exclusionary', $this->indent . \"If the results are ABNORMAL or ATYPICAL:\", $exclusionaryOrNot);\n $this->XINRegisterRule('abnormal_atypical_exclusionary', array('Review_results{@}=={@}abnormal|atypical'), \"Please indicate if the Abnormal or Atypical review is Exclusionary or Not.\");\n \n \t$this->form->addElement('static', null, $this->indent . $this->indent . 'If Abnormal or Atypical, describe incidental finding(s)'); \n// $this->form->addElement('textarea', 'Incidental_findings', 'Description of incidental findings:');\n $this->addTextAreaElement('Incidental_findings', $this->indent . $this->indent . 'Description of incidental findings:', array(\"Review_results{@}=={@}abnormal\"), \"Please describe the abnormality\");\n }", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: cell properties');\r\n\r\n $this->addElement('text', 'cellid', 'Id mask:', array('size' => 32));\r\n $this->addElement('text', 'cellclass', 'CSS class:', array('size' => 32));\r\n\r\n $cellvalue['min'] =& $this->createElement('text',\r\n 'min', 'minimum',\r\n array('size' => 4));\r\n $cellvalue['max'] =& $this->createElement('text',\r\n 'max', 'maximum',\r\n array('size' => 4));\r\n $cellvalue['inc'] =& $this->createElement('text',\r\n 'inc', 'increment',\r\n array('size' => 4));\r\n $this->addGroup($cellvalue, 'cellvalue', 'Value:', ' ');\r\n\r\n $cellsize['width'] =& $this->createElement('text',\r\n 'width', 'width',\r\n array('size' => 4));\r\n $cellsize['height'] =& $this->createElement('text',\r\n 'height', 'height',\r\n array('size' => 4));\r\n $cellsize['spacing'] =& $this->createElement('text',\r\n 'spacing', 'spacing',\r\n array('size' => 2));\r\n $cellsize['count'] =& $this->createElement('text',\r\n 'count', 'count',\r\n array('size' => 2));\r\n $this->addGroup($cellsize, 'cellsize', 'Size:', ' ');\r\n\r\n $cellcolor['active'] =& $this->createElement('text',\r\n 'active', 'active',\r\n array('size' => 7));\r\n $cellcolor['inactive'] =& $this->createElement('text',\r\n 'inactive', 'inactive',\r\n array('size' => 7));\r\n $cellcolor['bgcolor'] =& $this->createElement('text',\r\n 'bgcolor', 'background',\r\n array('size' => 7));\r\n $this->addGroup($cellcolor, 'cellcolor', 'Color:', ' ');\r\n\r\n $cellfont['family'] =& $this->createElement('text',\r\n 'family', 'family',\r\n array('size' => 32));\r\n $cellfont['size'] =& $this->createElement('text',\r\n 'size', 'size',\r\n array('size' => 2));\r\n $cellfont['color'] =& $this->createElement('text',\r\n 'color', 'color',\r\n array('size' => 7));\r\n $this->addGroup($cellfont, 'cellfont', 'Font:', ' ');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('apply','process'));\r\n }" ]
[ "0.73032796", "0.7283289", "0.71298903", "0.7002598", "0.69715345", "0.68959975", "0.6882561", "0.6866493", "0.6820501", "0.6819052", "0.67373186", "0.67331034", "0.67300344", "0.67072266", "0.669307", "0.6660284", "0.6646351", "0.66074127", "0.6582341", "0.65642667", "0.6518308", "0.65056354", "0.64939296", "0.6463446", "0.6437975", "0.6429238", "0.6401865", "0.63689464", "0.63605964", "0.6342572", "0.6303147", "0.6287794", "0.6287158", "0.6286464", "0.6282768", "0.62818307", "0.62806165", "0.62730813", "0.6260437", "0.62555075", "0.62338084", "0.62227553", "0.6216018", "0.61930954", "0.6161076", "0.6156414", "0.6153321", "0.61506605", "0.61190933", "0.6118423", "0.61058325", "0.61038774", "0.61036116", "0.6097804", "0.60963464", "0.609521", "0.60920185", "0.6079225", "0.60724604", "0.60720944", "0.60705644", "0.60680676", "0.60629684", "0.60590714", "0.60590017", "0.6051311", "0.6043324", "0.603611", "0.6030008", "0.60279226", "0.60199696", "0.6016895", "0.6013736", "0.6001254", "0.5999495", "0.5997375", "0.59916663", "0.5987861", "0.5981054", "0.5973676", "0.59565336", "0.59533405", "0.5950551", "0.5937123", "0.59220076", "0.59167427", "0.59102917", "0.590814", "0.5907549", "0.59025884", "0.58936983", "0.5891067", "0.5891051", "0.58906853", "0.5890119", "0.58880526", "0.58851403", "0.58847433", "0.5874292", "0.5871873", "0.5869542" ]
0.0
-1
Prepare content for tab
public function getTabLabel() { return Mage::helper('attributeSplash')->__('Conditions'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeTab($title,$content) {\n\t\t$placeholders = array(\n\t\t\t\"[+title+]\" => $title,\n\t\t\t\"[+tab_content+]\" => $content,\n\t\t);\n\t\treturn str_replace( array_keys( $placeholders ), array_values( $placeholders ), $this->templates[\"tab\"]);\n\t}", "protected function createTabs() {}", "function ch_widget_tabcontent($args, $number = 1) {\n\textract($args);\n\t$options = get_option('widget_tabcontent');\n\t\n\tinclude(TEMPLATEPATH . '/tabcontent.php');\n\t\n}", "function add_from_tab_content () {\n require_once dirname(__FILE__).'/templates/form-tab-content.php';\n }", "function echotheme_tab_func( $atts, $content = null ) {\n extract(shortcode_atts(array(\n\t 'title'\t=> '',\n ), $atts));\n global $tabs;\n $tabs[] = array('title' => $title, 'content' => trim(wpautop(do_shortcode($content))));\n return $tabs;\n}", "public function create_tab_content( $key, $tab ) {\n $this->print_download_link_html();\n }", "function render_tab($key,$tab){\n global $post;\n echo '<h2>'.apply_filters('GWP_custom_tab_title',$tab['title'],$tab,$key).'</h2>';\n echo apply_filters('GWP_custom_tab_content',$tab['content'],$tab,$key);\n }", "function scb_tabx($atts, $content){\n\t$tabid='';\n\t$tabclass = $atts['class'];\n\t$tabmode = ' nav-tabs';\n\t$tablia = ''; $tabCont = '';\n\t\n\tif($atts['id'] !=''){\n\t\t$tabid = ' id=\"'.$atts['id'].'\"'; \n\t}\n\t\n\tif($atts['mode'] !=''){\n\t\t$tabmode = ' nav-'.$atts['mode']; \n\t}\n\t\n\t$menu = explode('[/tab_content]', $content);\n\t$tabTitle='';\n\t\n\tfor($i=0; $i<count($menu)-1;$i++){\n\t\t$tabTitle = explode(':',explode(']',$menu[$i])[0])[1];\n\t\tadd_shortcode('content:'.str_replace(' ','',$tabTitle), 'tabMenuCont_sc');\n\t}\n\t\n\tfor($i=0; $i<count($menu)-1;$i++){\n\t\t$tabTitle = explode(':',explode(']',$menu[$i])[0])[1];\n\t\t$tabSCName = explode(']',$menu[$i])[0];\n\t\t$renscName = '[tab_content:'.str_replace(' ','',$tabTitle);\n\t\t$scName = str_replace($tabSCName, $renscName ,$menu[$i]);\n\t\t$tablia .= '<li role=\"presentation\" '.($i==0?'class=\"active\"':'').'><a href=\"#dv'.$attrs['id'].'_'.$i.'\" data-toggle=\"tab\" role=\"tab\" aria-expanded=\"true\">'.$tabTitle.'</a></li>';\n\t\t\n\t\t$tabCont .= '<div id=\"dv'.$attrs['id'].'_'.$i.'\" class=\"tab-pane '.($i==0?'active':'').'\" >'.do_shortcode(trim($scName)).'</div>';\n\t}\n\t\n\t$retVal = '<div'.$tabid.'><ul class=\"nav'.$tabmode.'\">'.$tablia.'</ul><div class=\"tab-content\">'.$tabCont.'</div></div>';\n\treturn $retVal;\n}", "public function page_content() {\n\t\t$tab = empty( $_REQUEST['tab'] ) ? 'new' : wp_strip_all_tags( wp_unslash( $_REQUEST['tab'] ) ); // Input var okay.\n\t\t$paged = ! empty( $_REQUEST['paged'] ) ? (int) $_REQUEST['paged'] : 1; // Input var okay.\n\n\t\t$tab = esc_attr( $tab );\n\t\t$paged = esc_attr( $paged );\n\n\t\t$filters = _appthemes_get_addons_mp_page_args( $this->args['page_slug'], 'filters' );\n\t\t$defaults = _appthemes_get_addons_mp_page_args( $this->args['page_slug'], 'defaults' );\n\n\t\t$args = array(\n\t\t\t'tab' => $tab,\n\t\t\t'page' => $paged,\n\t\t\t'filters' => $filters,\n\t\t\t'defaults' => $defaults,\n\t\t);\n\n\t\t$table = $this->create_list_table( $this->args['page_slug'], $this->args['parent'], $args );\n\n\t\t// Outputs the tabs, filters and search bar.\n\t\t$table->views();\n\n\t\t/**\n\t\t * Fires on the Add-ons browser tab after the top navigation bar.\n\t\t *\n\t\t * The dynamic part of the hook name refers to the tab slug (i.e. new or popular)\n\t\t *\n\t\t * @param APP_Addons_List_Table $table The content generator instance.\n\t\t */\n\t\tdo_action( \"appthemes_addons_mp_{$tab}\", $table );\n\t}", "public function contents_tab_content() {\n\t\techo '<h2>Contents</h2>';\n\t\t$content = get_post_meta( get_the_ID(), 'contents', true );\n\t\t$content = htmlspecialchars_decode( $content );\n\t\t$content = wpautop( $content );\n\t\techo $content;\n\t}", "function cmc_framework_markets_landing_tab_section_content($i) {\n \n $fieldset_key = 'tab' . $i;\n $title_key = 'cmc_framework_markets_tab' . $i;\n $content_key = 'cmc_framework_markets_tab' . $i . '_content';\n $pricing_key = 'cmc_framework_markets_tab' . $i . '_pricing';\n $image_key = 'cmc_framework_markets_tab' . $i . '_image';\n \n \n $content = variable_get($content_key, t('Content'));\n \n $edit_link = '';\n if (user_access('administer cmc_markets_landing')) {\n $edit_link = l('Edit Content', 'admin/config/cmc/markets_landing');\n }\n \n $pricing = '';\n $pricing_nid = variable_get($pricing_key, '');\n if ($pricing_nid) {\n \n $pricing_node = node_load($pricing_nid);\n $instruments = cmc_pricing_node_get_instruments($pricing_node);\n\n $data = array(\n 'node' => $pricing_node,\n 'instruments' => $instruments,\n 'i' => $i,\n 'edit_link' => '',\n );\n \n if (user_access('administer cmc_pricing')) {\n $options = array(\n 'attributes' => array(\n 'class' => 'pricing-edit',\n ),\n 'query' => array('destination' => $_GET['q']),\n );\n $data['edit_link'] = l('Edit Pricing Panel', 'node/' . $pricing_node->nid . '/edit', $options);\n }\n \n $pricing = theme('cmc_pricing_panel', $data);\n }\n \n \n $tab = array(\n 'title' => variable_get($title_key, t('Title')),\n 'content' => check_markup($content['value'], $content['format']),\n 'pricing' => $pricing,\n 'edit_link' => $edit_link,\n );\n \n // add in the image if one is uploaded\n $image_fid = variable_get($image_key, '');\n $image = file_load($image_fid);\n \n if (!empty($image->fid)) {\n $imagedata = array(\n 'path' => file_create_url($image->uri),\n );\n $tab['image'] = theme('image', $imagedata);\n }\n \n return $tab;\n}", "public static function preRenderTabContent(array $element) {\n // Build content array.\n $element['content'] = [\n '#theme' => 'contacts_dash_tabs',\n '#weight' => -1,\n '#tabs' => [],\n '#manage_mode' => $element['#manage_mode'],\n '#attached' => [\n 'library' => ['contacts/tabs'],\n ],\n ];\n\n foreach ($element['#tabs'] as $tab_id => $tab) {\n $element['content']['#tabs'][$tab_id] = [\n 'text' => $tab['label'],\n 'link' => Url::fromRoute('page_manager.page_view_contacts_dashboard_contact', [\n 'user' => $element['#user']->id(),\n 'subpage' => $tab['path'],\n ]),\n ];\n\n // Add the drag icon.\n if ($element['#manage_mode']) {\n $element['content']['#tabs'][$tab_id]['link_attributes']['class'][] = 'manage-tab';\n }\n\n // Swap links for AJAX request links.\n if ($element['#ajax']) {\n $element['content']['#tabs'][$tab_id]['link_attributes']['data-ajax-url'] = Url::fromRoute('contacts.ajax_subpage', [\n 'user' => $element['#user']->id(),\n 'subpage' => $tab['path'],\n ])->toString();\n $element['content']['#tabs'][$tab_id]['link_attributes']['class'][] = 'use-ajax';\n $element['content']['#tabs'][$tab_id]['link_attributes']['data-ajax-progress'] = 'fullscreen';\n }\n\n // Add tab id to attributes.\n $element['content']['#tabs'][$tab_id]['attributes']['data-contacts-drag-tab-id'] = $tab_id;\n $element['content']['#tabs'][$tab_id]['link_attributes']['data-contacts-tab-id'] = $tab_id;\n\n // Add active class to current tab.\n if ($tab['path'] == $element['#subpage']) {\n $element['content']['#tabs'][$tab_id]['attributes']['class'][] = 'is-active';\n $element['content']['#tabs'][$tab_id]['link_attributes']['class'][] = 'is-active';\n }\n }\n\n return $element;\n }", "private function renderContent()\n {\n $this->tabs[$this->currentlyActiveTab()]->view()->render();\n }", "public function prepare( $tabs ) {\n\t\t$tabs[ $this->key_name ] = array(\n\t\t\t'title' => __( 'Polylang', 'custom-sidebars' ),\n\t\t\t'cat_name' => __( 'Language', 'custom-sidebars' ),\n\t\t);\n\t\treturn $tabs;\n\t}", "function shortcodes_tab_child($atts, $content = null) {\n\t\textract(shortcode_atts(array(\n\t\t\t'title' => ''\n\t\t), $atts));\n\n\t\t$output = '<li class=\"flavour-tabs-tab\" role=\"tabpanel\">';\n\t\t$output .= '<h3 class=\"flavour-tabs-tab-title\">'.$title.'</h3>';\n\t\t$output .= do_shortcode($content);\n\t\t$output .= '</li>';\n\t\treturn $output;\n\t}", "function pexeto_show_tabs( $atts, $content = null ) {\r\n\t\textract( shortcode_atts( array(\r\n\t\t\t\t\t'titles' => '',\r\n\t\t\t\t\t'width' => 'medium'\r\n\t\t\t\t), $atts ) );\r\n\t\t$titlearr=explode( ',', $titles );\r\n\t\t$html='<div class=\"tabs-container\"><ul class=\"tabs \">';\r\n\t\tif ( $width=='small' ) {\r\n\t\t\t$wclass='w1';\r\n\t\t}elseif ( $width=='big' ) {\r\n\t\t\t$wclass='w3';\r\n\t\t}else {\r\n\t\t\t$wclass='w2';\r\n\t\t}\r\n\t\tforeach ( $titlearr as $title ) {\r\n\t\t\t$html.='<li class=\"'.$wclass.'\"><a href=\"#\">'.$title.'</a></li>';\r\n\t\t}\r\n\t\t$html.='</ul><div class=\"panes\">'.do_shortcode( $content ).'</div></div>';\r\n\t\treturn $html;\r\n\t}", "abstract protected function tabs();", "function echotheme_tabs_func( $atts, $content = null ) {\n global $tabs;\n $tabs = array(); // clear the array\n\tdo_shortcode($content); // execute the '[tab]' shortcode first to get the title and content\n\n $tabs_nav = '<div class=\"clear\"></div>';\n $tabs_nav .= '<div class=\"tabs-wrapper\">';\n $tabs_nav .= '<ul class=\"tabs\">';\n\t$tabs_content .= '<ul class=\"tabs-content\">';\n \n\tforeach ($tabs as $tab => $tab_atts) {\n\t\t$id = str_replace(' ', '-', $tab_atts['title']);\n\t\t$default = ( $tab == 0 ) ? ' class=\"active\"' : '';\n\t\n\t\t$tabs_nav .= '<li><a href=\"#'.$id.'\"'.$default.'>'.$tab_atts['title'].'</a></li>';\n\t\t$tabs_content .= '<li id=\"'.$id.'\"'.$default.'>'.$tab_atts['content'].'</li>';\n }\n\n $tabs_nav .= '</ul>';\n\t$tabs_content .= '</ul>';\n $tabs_output .= $tabs_nav . $tabs_content;\n $tabs_output .= '</div><!-- tabs-wrapper end -->';\n $tabs_output .= '<div class=\"clear\"></div>';\n\t\n return $tabs_output;\n}", "public function tab1() {\n $output = '<p>' . $this->t('This is the content of Tab 1') . '</p>';\n\n if ($this->currentUser->hasPermission('administer nodes')){\n $output .= '<p>' . $this->t('This extra text is only displayed if the current user can administer nodes.') . '</p>';\n }\n\n return ['#markup' => $output];\n }", "public function tab_containers()\n\t{\n\t\t$html = '';\n\t\t$tabs = $this->tabs;\n\n\t\tforeach($tabs as $tab)\n\t\t{\n\t\t\tif(isset($tab['render']))\n\t\t\t{\n\t\t\t\t$tpl = $tab['render']();\n\t\t\t\tif(is_object($tpl))\n\t\t\t\t{\n\t\t\t\t\t$renderer = Kostache_Layout::factory();\n\t\t\t\t\t$renderer->set_layout('admin/user/tab');\n\t\t\t\t\t$tpl->id = $tab['id'];\n\n\t\t\t\t\tif(!isset($tpl->title))\n\t\t\t\t\t{\n\t\t\t\t\t\t$tpl->title = $tab['title'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$html .= $renderer->render($tpl);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$html .= $tpl;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $html;\n\t}", "function shortcodes_tab_parent($atts, $content = null) {\n\t\textract(shortcode_atts(array(), $atts));\n\t\t$output = '';\n\t\tpreg_match_all('/flavour_tab *?title=\"([^\\\"]+)\"/i', $content, $matches);\n\t\tif(sizeof($matches[1])) {\n\t\t\t$output .= '<div class=\"flavour-tabgroup\">';\n\t\t\t$output .= '<ul class=\"flavour-tabgroup-tabs\" role=\"tablist\">';\n\t\t\tforeach ($matches[1] as $tab) {\n\t\t\t\t$output .= '<li role=\"presentation\" class=\"flavour-tabgroup-tab\"><span role=\"tab\" aria-selected=\"false\">'.$tab.'</span></li>';\n\t\t\t}\n\t\t\t$output .= '</ul>';\n\t\t\t$output .= '<ul class=\"flavour-tabs\">';\n\t\t\t$output .= do_shortcode($content);\n\t\t\t$output .= '</ul>';\n\t\t\t$output .= '</div>';\n\t\t}\n\t\treturn $output;\n\t}", "public function get_markup () {\r\n\t\t$data = $this->properties_to_array();\r\n\r\n\t\t// Ensure tab title\r\n\t\t// Do shortcode\r\n\t\tforeach($data['tabs'] as $index=>$tab) {\r\n\t\t\t$ttl = trim(str_replace(\"\\n\", '', $tab['title']));\r\n\t\t\tif (empty($ttl)) {\r\n\t\t\t\t$tab['title'] = 'Tab ' . ($index + 1);\r\n\t\t\t}\r\n\t\t\t$tab['content'] = $this->_do_shortcode($tab['content']);\r\n\t\t\t$data['tabs'][$index] = $tab;\r\n\t\t}\r\n\r\n\t\tif (!$data['preset']) {\r\n\t\t\t$data['preset'] = 'default';\r\n\t\t}\r\n\r\n\t\t$data['wrapper_id'] = str_replace('utabs-object-', 'wrapper-', $data['element_id']);\r\n\r\n\t\t$markup = upfront_get_template('utabs', $data, dirname(dirname(__FILE__)) . '/tpl/utabs.html');\r\n\r\n\t\t// upfront_add_element_style('upfront_tabs', array('css/utabs.css', dirname(__FILE__)));\r\n\t\tupfront_add_element_script('upfront_tabs', array('js/utabs-front.js', dirname(__FILE__)));\r\n\r\n\t\treturn $markup;\r\n\t}", "public function create_tabs_script(){\n\t\treturn $this->style.'\n<script>\n\tjQuery(function () {\n\t\tjQuery(\".nav-tab-wrapper a\").click(function (e) {\n\t\t\te.preventDefault();\n\t\t\tvar tab_class = jQuery(this).data(\"tab\"); \n\t\t\tvar target = jQuery(this).data(\"target\");\n\t\t\tvar title = jQuery(this).text();\n\n\t\t\tjQuery(\".tabs-title\").fadeOut(function(){\n\t \tjQuery(\".tabs-title\").text(title).fadeIn();\n\t })\n\n\t\t\tjQuery(this).parent().find(\".nav-tab\").removeClass(\"nav-tab-active\");\n\t\t\tjQuery(this).addClass(\"nav-tab-active\");\n\t\t\n\t\t\tjQuery(\".tab\").not(\".\"+tab_class).parentsUntil(\".cmb-repeat-group-wrap\").fadeOut(600);\n\t\t\tjQuery(\".\"+tab_class).parentsUntil(\".cmb-repeat-group-wrap\").fadeIn(1000);\n\n\t\t});\n\t\tjQuery(\".hide-clone\").parentsUntil(\".cmb-row\").fadeOut();\n\t\tjQuery(\".hide-remove\").parentsUntil(\".cmb-remove-field-row\").fadeOut();\n\t});\n</script>\n<style>\n\t.page, .component{\n\t\tbackground:#6bb1a3;\n\t\tborder-radius: 10px 10px 0px 0px;\n\t\tborder:solid 2px gray;\n\t\tcolor:white;\n\n\t}\n\t.page:hover, .component:hover{\n\t\tbackground:#4b9183;\n\t\tcolor:black;\n\n\t}\n\t.component{\n\t\tbackground:#8bd1c3;\n\t}\n</style>';\n\t}", "public function initContent() {\n $this->initTabModuleList();\n $this->initToolbar();\n $this->initPageHeaderToolbar();\n\n if ($this->display == 'edit' || Tools::getValue('display') == 'formPlayer') {\n if (!$this->loadObject(true)) {\n return;\n }\n $this->content = $this->renderForm();\n $this->content.= $this->generateListPlayerLevels();\n $this->content.= $this->generateListPlayerHistory();\n $deletePlayers = false;\n }\n elseif (Tools::isSubmit('addCustomAction')) {\n $this->content = $this->generateFormCustomAction();\n $deletePlayers = false;\n }\n else {\n $this->content = $this->renderList();\n $deletePlayers = true;\n }\n\n // This are the real smarty variables\n $this->context->smarty->assign(\n array(\n 'content' => $this->content,\n 'tab' => 'Players',\n 'loyalty_name' => Configuration::get('krona_loyalty_name', $this->context->language->id, $this->id_shop_group, $this->id_shop),\n 'import' => Configuration::get('krona_import_customer', null, $this->id_shop_group, $this->id_shop),\n 'dont' => Configuration::get('krona_dont_import_customer', null, $this->id_shop_group, $this->id_shop),\n 'deletePlayers' => $deletePlayers,\n 'show_page_header_toolbar' => $this->show_page_header_toolbar,\n 'page_header_toolbar_title' => $this->page_header_toolbar_title,\n 'page_header_toolbar_btn' => $this->page_header_toolbar_btn,\n )\n );\n\n $tpl = $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'genzo_krona/views/templates/admin/main.tpl');\n\n $this->context->smarty->assign(array(\n 'content' => $tpl, // This seems to be anything inbuilt. It's just chance that we both use content as an assign variable\n ));\n\n }", "public function tab_contents() {\n\t\techo 'test';\n\t}", "function render_tabs( $attributes ) {\n\t\t\t\tglobal $post;\n\t\t\t\t// If a page, then do split\n\t\t\t\t// Get ids of children\n\t\t\t\t$children = get_pages( array(\n\t\t\t\t\t\t'child_of' => $post->ID\n\t\t\t\t\t\t, 'parent' => $post->ID\n\t\t\t\t\t\t, 'sort_column' => 'menu_order'\n\t\t\t\t) );\n\n\t\t\t\t$child_titles = array();\n\t\t\t\t$child_contents = \"\n\";\n// TODO: start jquery 'loading' action here.\n\n\t\t\t\t$child_tablinks = \"\n<div id='subpage-tabs' class='ui-tabs'>\n\t<ul>\n\";\n\t\t\t\tforeach ( $children as $child ) {\n\t\t\t\t\t$child_tablinks .= \"\t\t<li><a href='#ctab-$child->ID'>$child->post_title</a></li>\n\";\n\t\t\t\t\t// Render any shortcodes\n\t\t\t\t\t$new_content = do_shortcode( $child->post_content );\n\t\t\t\t\t$child_contents .= \"<div id='ctab-$child->ID' class='ui-tabs-hide'>\n$new_content\n</div>\n\";\n\t\t\t\t}\n\t\t\t\t$child_tablinks .= \"\t</ul>\n\";\n\t\t\t\t$child_contents .= \"</div>\n<script type='text/javascript'>\n/*<![CDATA[*/\njQuery(\n\tfunction(){\n\t\tjQuery('#subpage-tabs').tabs();\n }\n);\n/*]]>*/\n</script>\n\";\n// TODO: destroy jquery 'loading' action here.\n\n\t\t\t\t$content = $child_tablinks . $child_contents;\n\t\t\t\treturn $content;\n\t\t}", "private function metabox_style_tabs() {\n $help_sidebar = $this->get_sidebar();\n\n $help_class = '';\n if ( ! $help_sidebar ) :\n $help_class .= ' no-sidebar';\n endif;\n\n // Time to render!\n ?>\n\n <div class=\"tabbed\">\n <div class=\"tabbed-sections\">\n <ul class=\"tr-tabs alignleft\">\n <?php\n $class = ' class=\"active\"';\n $tabs = $this->get_tabs();\n foreach ( $tabs as $tab ) :\n $link_id = \"tab-link-{$tab['id']}\";\n $panel_id = (!empty($tab['url'])) ? $tab['url'] : \"#tab-panel-{$tab['id']}\";\n ?>\n <li id=\"<?php echo esc_attr( $link_id ); ?>\"<?php echo $class; ?>>\n <a href=\"<?php echo esc_url( \"$panel_id\" ); ?>\">\n <?php echo esc_html( $tab['title'] ); ?>\n </a>\n </li>\n <?php\n $class = '';\n endforeach;\n ?>\n </ul>\n </div>\n\n <?php if ( $help_sidebar ) : ?>\n <div class=\"tabbed-sidebar\">\n <?php echo $help_sidebar; ?>\n </div>\n <?php endif; ?>\n\n <div class=\"tr-sections clearfix\">\n <?php\n $classes = 'tab-section active';\n foreach ( $tabs as $tab ):\n $panel_id = \"tab-panel-{$tab['id']}\";\n ?>\n\n <div id=\"<?php echo esc_attr( $panel_id ); ?>\" class=\"<?php echo $classes; ?>\">\n <?php\n // Print tab content.\n echo $tab['content'];\n\n // If it exists, fire tab callback.\n if ( ! empty( $tab['callback'] ) )\n call_user_func_array( $tab['callback'], array( $this, $tab ) );\n ?>\n </div>\n <?php\n $classes = 'tab-section';\n endforeach;\n ?>\n </div>\n </div>\n <?php\n }", "protected function register_dynamic_templates()\n\t\t{\n\t\t\t\n\t\t\t/**\n\t\t\t * Content Tab\n\t\t\t * ===========\n\t\t\t */\n\t\t\t\n\t\t\t$c = array(\n\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t\t'name'\t\t=> __( 'Button Title', 'avia_framework' ),\n\t\t\t\t\t\t\t'desc'\t\t=> __( 'This is the text that appears on your button.', 'avia_framework' ),\n\t\t\t\t\t\t\t'id'\t\t=> 'label',\n\t\t\t\t\t\t\t'type'\t\t=> 'input',\n\t\t\t\t\t\t\t'std'\t\t=> __( 'Click me', 'avia_framework' ),\n\t\t\t\t\t\t\t'lockable'\t=> true,\n\t\t\t\t\t\t\t'tmpl_set_default'\t=> false\n\t\t\t\t\t\t),\n\t\t\t\t\n\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t\t'name'\t\t=> __( 'Additional Description Position', 'avia_framework' ),\n\t\t\t\t\t\t\t'desc'\t\t=> __( 'Select, where to show an additional description', 'avia_framework' ),\n\t\t\t\t\t\t\t'id'\t\t=> 'description_pos',\n\t\t\t\t\t\t\t'type'\t\t=> 'select',\n\t\t\t\t\t\t\t'std'\t\t=> '',\n\t\t\t\t\t\t\t'lockable'\t=> true,\n\t\t\t\t\t\t\t'subtype'\t=> array(\t\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'No description', 'avia_framework' )\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'Description above title', 'avia_framework' )\t=> 'above',\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'Description below title', 'avia_framework' )\t=> 'below',\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'name' \t=> __( 'Additional Description', 'avia_framework' ),\n\t\t\t\t\t\t\t'desc' \t=> __( 'Enter an additional description', 'avia_framework' ),\n\t\t\t\t\t\t\t'id' \t=> 'content',\n\t\t\t\t\t\t\t'type' \t=> 'textarea',\n\t\t\t\t\t\t\t'std' \t=> '',\n\t\t\t\t\t\t\t'lockable'\t=> true,\n\t\t\t\t\t\t\t'tmpl_set_default'\t=> false,\n\t\t\t\t\t\t\t'required'\t=> array( 'description_pos', 'not', '' )\n\t\t\t\t\t\t),\n\t\t\t\t\n\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t\t'name' \t=> __( 'Button Icon', 'avia_framework' ),\n\t\t\t\t\t\t\t'desc' \t=> __( 'Should an icon be displayed at the left side of the button', 'avia_framework' ),\n\t\t\t\t\t\t\t'id' \t=> 'icon_select',\n\t\t\t\t\t\t\t'type' \t=> 'select',\n\t\t\t\t\t\t\t'std' \t=> 'yes-left-icon',\n\t\t\t\t\t\t\t'lockable'\t=> true,\n\t\t\t\t\t\t\t'subtype'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'No Icon', 'avia_framework' )\t\t\t\t\t\t\t\t\t\t=> 'no',\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'Yes, display Icon to the left of the title', 'avia_framework' )\t=> 'yes-left-icon' ,\t\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'Yes, display Icon to the right of the title', 'avia_framework' )\t=> 'yes-right-icon',\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\n\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t\t'name' \t=> __( 'Button Icon', 'avia_framework' ),\n\t\t\t\t\t\t\t'desc' \t=> __( 'Select an icon for your Button below', 'avia_framework' ),\n\t\t\t\t\t\t\t'id' \t=> 'icon',\n\t\t\t\t\t\t\t'type' \t=> 'iconfont',\n\t\t\t\t\t\t\t'std' \t=> '',\n\t\t\t\t\t\t\t'lockable'\t=> true,\n\t\t\t\t\t\t\t'locked'\t=> array( 'icon', 'font' ),\n\t\t\t\t\t\t\t'required'\t=> array( 'icon_select', 'not_empty_and', 'no' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\n\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t\t'name' \t=> __( 'Icon Visibility', 'avia_framework' ),\n\t\t\t\t\t\t\t'desc' \t=> __( 'Check to only display icon on hover', 'avia_framework' ),\n\t\t\t\t\t\t\t'id' \t=> 'icon_hover',\n\t\t\t\t\t\t\t'type' \t=> 'checkbox',\n\t\t\t\t\t\t\t'std' \t=> '',\n\t\t\t\t\t\t\t'lockable'\t=> true,\n\t\t\t\t\t\t\t'required'\t=> array( 'icon_select', 'not_empty_and', 'no' )\n\t\t\t\t\t\t)\n\t\t\t\t\n\t\t\t\t);\n\t\t\t\n\t\t\t$template = array(\n\t\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t\t\t'type'\t\t\t=> 'template',\n\t\t\t\t\t\t\t\t'template_id'\t=> 'toggle',\n\t\t\t\t\t\t\t\t'title'\t\t\t=> __( 'Button', 'avia_framework' ),\n\t\t\t\t\t\t\t\t'content'\t\t=> $c \n\t\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\n\t\t\tAviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'content_button' ), $template );\n\t\t\t\n\t\t\t$c = array(\n\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t\t'type'\t\t\t=> 'template',\n\t\t\t\t\t\t\t'template_id'\t=> 'linkpicker_toggle',\n\t\t\t\t\t\t\t'name'\t\t\t=> __( 'Button Link?', 'avia_framework' ),\n\t\t\t\t\t\t\t'desc'\t\t\t=> __( 'Where should your button link to?', 'avia_framework' ),\n\t\t\t\t\t\t\t'subtypes'\t\t=> array( 'manually', 'single', 'taxonomy' ),\n\t\t\t\t\t\t\t'target_id'\t\t=> 'link_target',\n\t\t\t\t\t\t\t'lockable'\t\t=> true\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\n\t\t\tAviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'content_link' ), $c );\n\t\t\t\n\t\t\t/**\n\t\t\t * Styling Tab\n\t\t\t * ===========\n\t\t\t */\n\t\t\t\n\t\t\t$c = array(\n\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t\t'name'\t\t=> __( 'Button Title Attribute', 'avia_framework' ),\n\t\t\t\t\t\t\t'desc'\t\t=> __( 'Add a title attribute for this button.', 'avia_framework' ),\n\t\t\t\t\t\t\t'id'\t\t=> 'title_attr',\n\t\t\t\t\t\t\t'type'\t\t=> 'input',\n\t\t\t\t\t\t\t'std'\t\t=> '',\n\t\t\t\t\t\t\t'lockable'\t=> true\n\t\t\t\t\t\t)\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t);\n\t\t\t\n\t\t\t$template = array(\n\t\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t\t\t'type'\t\t\t=> 'template',\n\t\t\t\t\t\t\t\t'template_id'\t=> 'toggle',\n\t\t\t\t\t\t\t\t'title'\t\t\t=> __( 'Appearance', 'avia_framework' ),\n\t\t\t\t\t\t\t\t'content'\t\t=> $c \n\t\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\n\t\t\tAviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'styling_appearance' ), $template );\n\t\t\t\n\t\t\t$c = array(\n\t\t\t\t\n\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t\t'type'\t\t\t=> 'template',\n\t\t\t\t\t\t\t'template_id'\t=> 'button_colors',\n\t\t\t\t\t\t\t'lockable'\t\t=> true,\n\t\t\t\t\t\t\t'ids'\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'bg'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'color'\t\t=> 'color',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'custom'\t=> 'custom',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'custom_id'\t=> 'custom_bg',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'gradient'\t=> 'btn_custom_grad'\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'bg_hover'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'color'\t\t=> 'color_hover',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'custom'\t=> 'custom',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'custom_id'\t=> 'custom_bg_hover',\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'font'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'color'\t\t=> 'color_font',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'custom'\t=> 'custom',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'custom_id'\t=> 'custom_font',\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'font_hover' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'color'\t\t=> 'color_font_hover',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'custom'\t=> 'custom',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'custom_id'\t=> 'custom_font_hover',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\n\t\t\t\t);\n\t\t\t\n\t\t\t$template = array(\n\t\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t\t\t'type'\t\t\t=> 'template',\n\t\t\t\t\t\t\t\t'template_id'\t=> 'toggle',\n\t\t\t\t\t\t\t\t'title'\t\t\t=> __( 'Colors', 'avia_framework' ),\n\t\t\t\t\t\t\t\t'content'\t\t=> $c \n\t\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\n\t\t\tAviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'styling_colors' ), $template );\n\t\t\t\n\t\t}", "function prk_ac_single( $atts, $content = null ) {\n\t\t$defaults = array( 'title' => 'Tab' );\n\t\textract( shortcode_atts( $defaults, $atts ) );\n\t\t//MAKE TAB ID MATCH THE CONTENT TAB ID\n\t\treturn '<div class=\"prk_ac_single\">'. do_shortcode( $content ) .'</div>';\n\t}", "function buildTabs()\r\n {\r\n $this->_formBuilt = true;\r\n\r\n // Here we get all page names in the controller\r\n $pages = array();\r\n $myName = $current = $this->getAttribute('id');\r\n while (null !== ($current = $this->controller->getPrevName($current))) {\r\n $pages[] = $current;\r\n }\r\n $pages = array_reverse($pages);\r\n $pages[] = $current = $myName;\r\n while (null !== ($current = $this->controller->getNextName($current))) {\r\n $pages[] = $current;\r\n }\r\n // Here we display buttons for all pages, the current one's is disabled\r\n foreach ($pages as $pageName) {\r\n $disabled = ($pageName == $myName ? array('disabled' => 'disabled')\r\n : array());\r\n\r\n $tabs[] = $this->createElement('submit',\r\n $this->getButtonName($pageName),\r\n ucfirst($pageName),\r\n array('class' => 'flat') + $disabled);\r\n }\r\n $this->addGroup($tabs, 'tabs', null, '&nbsp;', false);\r\n }", "protected function getTabContent(string $tab) {\n /** @var \\Drupal\\group\\Entity\\GroupInterface $group */\n $group = $this->getContextValue('group');\n\n $build = [];\n switch ($tab) {\n case 'members':\n $group_ids = [$group->id()];\n if ($group->hasField('circles')) {\n $group_ids = array_merge($group_ids, array_column($group->get('circles')->getValue(), 'target_id'));\n }\n $build['members'] = $this->getMembersViewRender(implode('+', $group_ids));\n $build['contact'] = $this->getContactActionsRender($group);\n $build['export'] = $this->getExportActionsViewRender($group);\n break;\n\n case 'admins':\n $build['members'] = $this->getMembersViewRender($group->id(), TRUE);\n break;\n\n case 'inherit':\n if ($this->moduleHandler->moduleExists('living_spaces_subgroup')) {\n $build['tree'] = $this->getGroupTreeRender($group);\n }\n\n /** @var \\Drupal\\group\\Entity\\Storage\\GroupRoleStorageInterface $role_storage */\n $role_storage = $this->entityTypeManager->getStorage('group_role');\n $roles = $role_storage->loadByUserAndGroup($this->currentUser, $group);\n $current_is_admin = FALSE;\n foreach ($roles as $role) {\n if ($role->get('is_space_admin')) {\n $current_is_admin = TRUE;\n break;\n }\n }\n\n if ($this->moduleHandler->moduleExists('living_spaces_circles') &&\n (\n $current_is_admin ||\n $this->currentUser->hasPermission('manage circle spaces') ||\n $group->hasPermission('manage circle spaces', $this->currentUser)\n )\n ) {\n $build['circle'] = $this->getCircleFormRender($group);\n\n $url = Url::fromRoute('entity.group.add_form', [\n 'group_type' => 'circle',\n ], [\n 'query' => ['space' => $group->id()],\n ]);\n\n $build['add_cricle'] = [\n '#type' => 'link',\n '#url' => $url,\n '#title' => $this->t('Add circle'),\n '#attributes' => ['class' => ['btn', 'btn-primary']],\n ];\n }\n break;\n\n }\n\n return $build;\n }", "private function tabs_panels() {\n\t\t\tforeach ( $this->tabs as $key => $tab ) {\n\t\t\t\t$active = ( $key === 0 );\n\n\t\t\t\t$panel_class = [ 'wpseo-local-meta-section' ];\n\t\t\t\tif ( $active ) {\n\t\t\t\t\t$panel_class[] = 'active';\n\t\t\t\t}\n\n\t\t\t\techo '<div role=\"tabpanel\" id=\"wpseo-local-tab-' . $tab['id'] . '\" class=\"' . implode( ' ', $panel_class ) . '\">';\n\t\t\t\techo '<div class=\"wpseo-local-metabox-content\">';\n\t\t\t\tdo_action( 'wpseo-local-panel-content-' . $tab['id'] );\n\t\t\t\techo '</div>';\n\t\t\t\techo '</div>';\n\t\t\t}\n\t\t}", "public function getTabTitle()\n {\n return Mage::helper('magna_news')->__('Content');\n }", "function bpfit_walk_subtab_function_to_show_content() {\n\t\t\tinclude 'profile-menu/walk/bpfit-my-walk.php';\n\t\t}", "private function build_factory_meta_tab_widget($_meta, $_ptype = \"wccpf\") {\r\n \t/* Accordian wrapper starts here */\r\n \t$html = '<div class=\"wcff-factory-tab-container\">';\r\n \t\r\n \t/* Left side header panel starts here */\r\n \t$html .= '<div class=\"wcff-factory-tab-left-panel\">';\r\n \t$html .= '<ul>';\r\n \tforeach ($_meta[\"tabs\"] as $tab) {\r\n \t\t$html .= '<li data-box=\"' . $tab[\"header\"][\"target\"] . '\" class=\"' . $tab[\"header\"][\"css_class\"] . '\">' . $tab[\"header\"][\"title\"] . '</li>';\r\n \t}\r\n \t$html .= '</ul>';\r\n \t$html .= '</div>';\r\n \t/* Left side header anel ends here */\r\n \t\r\n \t/* Left side header panel starts here */\r\n \t$html .= '<div class=\"wcff-factory-tab-right-panel\">';\r\n \tforeach ($_meta[\"tabs\"] as $tab) {\r\n \t\t/* Tab content section starts here */\r\n \t\t$html .= '<div id=\"' . $tab[\"content\"][\"container\"] . '\" class=\"wcff-factory-tab-content\">';\r\n \t\t\r\n \t\tforeach ($tab[\"content\"][\"fields\"] as $field) {\r\n \t\t\t/* Meta field's wrapper starts here */\r\n \t\t\t$html .= '<div class=\"wcff-field-types-meta\" data-type=\"' . $field[\"type\"] . '\" data-param=\"' . $field[\"param\"] . '\">';\r\n \t\t\t$html .= $this->build_factory_meta_field($field, $_ptype);\r\n \t\t\t$html .= '</div>';\r\n \t\t\t/* Meta field's wrapper ends here */\r\n \t\t}\r\n \t\t\r\n \t\t$html .= '</div>';\r\n \t\t/* Tab content section ends here */\r\n \t}\r\n \t$html .= '</div>';\r\n \t/* Left side header anel ends here */\r\n \t\r\n \t$html .= '</div>';\r\n \t/* Accordian wrapper ends here */\r\n \treturn $html;\r\n }", "private function createTab() {\n\t\t$moduleToken = t3lib_formprotection_Factory::get()->generateToken('moduleCall', self::MODULE_NAME);\n\t\treturn $this->doc->getTabMenu(\n\t\t\tarray('M' => self::MODULE_NAME, 'moduleToken' => $moduleToken, 'id' => $this->id),\n\t\t\t'tab',\n\t\t\tself::IMPORT_TAB,\n\t\t\tarray(self::IMPORT_TAB => $GLOBALS['LANG']->getLL('import_tab'))\n\t\t\t) . $this->doc->spacer(5);\n\t}", "public function removeAddTabsContent($content){\n $searchfor = array();\n $searchfor[] = \"\\$this->getLayout()->getBlock('head')\";\n// $searchfor[] = \"\\$this->_addContent(\\$this->getLayout()->createBlock(\";\n// $searchfor[] = \"->_addLeft(\\$this->getLayout()->createBlock(\";\n for($i = 0; $i < count($searchfor);$i++){\n $pattern = preg_quote($searchfor[$i], '/');\n $pattern = \"/^.*$pattern.*\\$/m\";\n if(preg_match_all($pattern, $content, $matches)){\n foreach($matches as $match){\n $content = str_replace($match[0],'',$content);\n }\n }\n }\n return $content;\n }", "function onPrepareContent(&$article, &$params, $limitstart=0)\n\t{\n\t\t\n\t\t// regular expression\n\t\t$regex = \"#{magictabs(?:\\s?(.*?)?)?}(.*?){/magictabs}#is\";\n\n\t\tif (!preg_match($regex, $article->text)) return false;\n\t\t\n\t\t// Scriptegrator check\n\t\tif (!class_exists('JScriptegrator')) {\n\t\t\tJError::raiseNotice('', JText::_('CDMT_ENABLE_SCRIPTEGRATOR'));\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$message = JScriptegrator::check('1.3.8', 'jquery', 'site');\n\t\t\tif ($message) {\n\t\t\t JError::raiseNotice('', $message);\n\t\t\t return false;\n \t\t}\n\t\t}\n\n\t\t$document = &JFactory::getDocument(); // set document for next usage\n\t\t$live_path = JURI::base(true) . '/'; // define live site\n//\t\t$document->addScript($live_path.\"plugins/system/cdscriptegrator/libraries/jquery/js/ui/ui.tabs.js\");\n//\t\t$document->addScript($live_path.\"plugins/system/cdscriptegrator/libraries/jquery/js/ui/ui.core.js\");\t\n\t\n\t\t$document->addStyleSheet($live_path . 'plugins/content/cdmagictabs/css/cdmagictabs.css', 'text/css');\n\t\t\n\t\t\n\t\t// add general stylesheet\n\n\t\tJScriptegrator::importUI('ui.tabs');\n\t\t\n\t\t// Explication:\n\t\t// $match[1]\t-> parameters\n\t\t// $match[2]\t-> text to tabs\n\n\t\t// replacement regular expression\n\t\t$article->text = preg_replace_callback($regex, array($this, 'replacer'), $article->text);\n\n\t}", "function render($cTabs,$title,$base_path) {\n\t\tglobal $modx;\n\t\t$content = \"\";\n\t\tforeach ($cTabs as $name=>$tab_content) {\n\t\t\t$content .= $this->makeTab($name,$tab_content);\n\t\t}\n\t\t$placeholders = array(\n\t\t\t\"[+ditto_base_url+]\" => $base_path,\n\t\t\t\"[+base_url+]\" => $modx->config[\"site_url\"].\"manager\",\n\t\t\t\"[+theme+]\" => $modx->config[\"manager_theme\"],\n\t\t\t\"[+title+]\" => $title,\n\t\t\t\"[+content+]\" => $content,\n\t\t\t\"[+charset+]\" => $modx->config[\"modx_charset\"],\n\t\t);\n\t\n\t\treturn str_replace( array_keys( $placeholders ), array_values( $placeholders ), $this->templates[\"main\"]);\n\t}", "private function renderTabs()\n {\n ?>\n <h2 class=\"nav-tab-wrapper wp-clearfix\">\n <?php\n array_walk(\n $this->tabs,\n [$this, 'renderTab'],\n $this->currentlyActiveTab()\n );\n ?>\n </h2>\n <?php\n }", "private function _createTab()\r\n {\r\n $response = true;\r\n\r\n // First check for parent tab\r\n $parentTabID = Tab::getIdFromClassName('AdminFieldMenu');\r\n\r\n if ($parentTabID) {\r\n $parentTab = new Tab($parentTabID);\r\n } else {\r\n $parentTab = new Tab();\r\n $parentTab->active = 1;\r\n $parentTab->name = array();\r\n $parentTab->class_name = \"AdminFieldMenu\";\r\n foreach (Language::getLanguages() as $lang){\r\n $parentTab->name[$lang['id_lang']] = \"FIELDTHEMES\";\r\n }\r\n $parentTab->id_parent = 0;\r\n $parentTab->module = '';\r\n $response &= $parentTab->add();\r\n }\r\n// Check for parent tab2\r\n\t\t\t$parentTab_2ID = Tab::getIdFromClassName('AdminFieldMenuSecond');\r\n\t\t\tif ($parentTab_2ID) {\r\n\t\t\t\t$parentTab_2 = new Tab($parentTab_2ID);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$parentTab_2 = new Tab();\r\n\t\t\t\t$parentTab_2->active = 1;\r\n\t\t\t\t$parentTab_2->name = array();\r\n\t\t\t\t$parentTab_2->class_name = \"AdminFieldMenuSecond\";\r\n\t\t\t\tforeach (Language::getLanguages() as $lang) {\r\n\t\t\t\t\t$parentTab_2->name[$lang['id_lang']] = \"FieldThemes Configure\";\r\n\t\t\t\t}\r\n\t\t\t\t$parentTab_2->id_parent = $parentTab_2->id;\r\n\t\t\t\t$parentTab_2->module = '';\r\n\t\t\t\t$response &= $parentTab_2->add();\r\n\t\t\t}\r\n\t\t\t// Created tab\r\n $tab = new Tab();\r\n $tab->active = 1;\r\n $tab->class_name = \"AdminFieldBrandSlider\";\r\n $tab->name = array();\r\n foreach (Language::getLanguages() as $lang){\r\n $tab->name[$lang['id_lang']] = \"Configuge brands\";\r\n }\r\n $tab->id_parent = $parentTab_2->id;\r\n $tab->module = $this->name;\r\n $response &= $tab->add();\r\n\r\n return $response;\r\n }", "function template_tabs($tabs = array(), $active = 0){\n $content = '';\n $top = '';\n $i =0;\n foreach($tabs as $id=>$tab){\n if ($i == $active){$class = 'active';}\n $top .= \"\\t\" . '<li><a class=\"'.$class.'\" href=\"#'.$id.'\">' . $tab['title'] . '</a></li>' . \"\\n\";\n $content .= \"\\t\" . '<li id=\"'.$id.'\" class=\"'.$class.'\">' . $tab['content'] . '</li>' . \"\\n\"; \n $i++;\n $class = '';\n }\n $return = '<ul class=\"tabs\">' . \"\\n\" . $top . '</ul>' . \"\\n\";\n $return .= '<ul class=\"tabs-content\">' . \"\\n\" . $content . '</ul>';\n return $return;\n \n}", "function setTabs(){\n global $ilTabs, $ilCtrl, $ilAccess, $ilLocator;\n\n // show current quiz round inlcuding link and QR code (deadline)\n if ($ilAccess->checkAccess(\"read\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"showCurrentRound\", $this->txt(\"tabmenu_showCurrentRound\"), $ilCtrl->getLinkTarget($this, \"showCurrentRound\"));\n }\n\n // tab for the \"edit quiz\" command\n if ($ilAccess->checkAccess(\"write\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"editQuiz\", $this->txt(\"tabmenu_edit_quiz\"), $ilCtrl->getLinkTarget($this, \"editQuiz\"));\n }\n\n // show round results\n if ($ilAccess->checkAccess(\"write\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"showResults\", $this->txt(\"tabmenu_show_result\"), $ilCtrl->getLinkTarget($this, \"showResults\"));\n }\n\n // a \"properties\" tab\n if ($ilAccess->checkAccess(\"write\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"properties\", $this->txt(\"tabmenu_properties\"), $ilCtrl->getLinkTarget($this, \"editProperties\"));\n $this->addPermissionTab();\n }\n\n // information Tab\n if ($ilAccess->checkAccess(\"write\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"info\", $this->txt(\"tabmenu_info\"), $ilCtrl->getLinkTarget($this, \"info\"));\n }\n\n }", "protected function setContent() {}", "private function _createTab()\r\n {\r\n $response = true;\r\n\r\n // First check for parent tab\r\n $parentTabID = Tab::getIdFromClassName('AdminFieldMenu');\r\n\r\n if ($parentTabID) {\r\n $parentTab = new Tab($parentTabID);\r\n } else {\r\n $parentTab = new Tab();\r\n $parentTab->active = 1;\r\n $parentTab->name = array();\r\n $parentTab->class_name = \"AdminFieldMenu\";\r\n foreach (Language::getLanguages() as $lang){\r\n $parentTab->name[$lang['id_lang']] = \"Fieldthemes\";\r\n }\r\n $parentTab->id_parent = 0;\r\n $parentTab->module = '';\r\n $response &= $parentTab->add();\r\n }\r\n\t// Check for parent tab2\r\n\t\t\t$parentTab_2ID = Tab::getIdFromClassName('AdminFieldMenuSecond');\r\n\t\t\tif ($parentTab_2ID) {\r\n\t\t\t\t$parentTab_2 = new Tab($parentTab_2ID);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$parentTab_2 = new Tab();\r\n\t\t\t\t$parentTab_2->active = 1;\r\n\t\t\t\t$parentTab_2->name = array();\r\n\t\t\t\t$parentTab_2->class_name = \"AdminFieldMenuSecond\";\r\n\t\t\t\tforeach (Language::getLanguages() as $lang) {\r\n\t\t\t\t\t$parentTab_2->name[$lang['id_lang']] = \"FieldThemes Configure\";\r\n\t\t\t\t}\r\n\t\t\t\t$parentTab_2->id_parent = $parentTab->id;\r\n\t\t\t\t$parentTab_2->module = '';\r\n\t\t\t\t$response &= $parentTab_2->add();\r\n\t\t\t}\r\n\t\t\t// Created tab\r\n $tab = new Tab();\r\n $tab->active = 1;\r\n $tab->class_name = \"AdminFieldFeaturedProductSlider\";\r\n $tab->name = array();\r\n foreach (Language::getLanguages() as $lang){\r\n $tab->name[$lang['id_lang']] = \"Configure featured products\";\r\n }\r\n $tab->id_parent = $parentTab_2->id;\r\n $tab->module = $this->name;\r\n $response &= $tab->add();\r\n\r\n return $response;\r\n }", "function contentActions() { ?>\n\t\t<ul class=\"nav nav-tabs\"><?php\n\t\t\tforeach($this->data['content_actions'] as $key => $tab) {\n\t\t\t\techo $this->makeListItem( $key, $tab );\n\t\t\t}; ?>\n\t\t</ul><?php\n\t}", "function tpps_details_tabs(array &$state) {\n $output = '<ul class=\"nav nav-tabs\" role=\"tablist\">\n <li class=\"nav-item\"><a class=\"nav-link active\" role=\"tab\" data-toggle=\"tab\" href=\"#species\">Species</a></li>\n <li class=\"nav-item\"><a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#study\">Study Details</a></li>\n <li class=\"nav-item\"><a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#trees\">Plants</a></li>';\n $p_exist = FALSE;\n $g_exist = FALSE;\n $mass_spectro_exist = FALSE;\n for ($i = 1; $i <= $state['stats']['species_count']; $i++) {\n if (!empty($state['saved_values'][TPPS_PAGE_4][\"organism-$i\"]['phenotype'])) {\n $p_exist = TRUE;\n }\n if (!empty($state['saved_values'][TPPS_PAGE_4][\"organism-$i\"]['genotype'])) {\n $g_exist = TRUE;\n }\n if ($state['saved_values'][TPPS_PAGE_4][\"organism-$i\"]['phenotype']['iso-check'] == TRUE) {\n $mass_spectro_exist = TRUE;\n }\n }\n \n $output .= $p_exist ? '<li class=\"nav-item\"><a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#phenotype\">Phenotypes / Environments</a></li>' : \"\";\n $output .= $g_exist ? '<li class=\"nav-item\"><a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#genotype\">Genotypes</a></li>' : \"\";\n $output .= $mass_spectro_exist ? '<li class=\"nav-item\"><a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#mass_spectrometry\">Mass Spectrometry</a></li>' : \"\";\n $output .= '</ul><div id=\"tab-content\" class=\"tab-content\">';\n\n $output .= \"<div id=\\\"species\\\" role=\\\"tabpanel\\\" class=\\\"tab-pane fade in active\\\"></div>\";\n $output .= \"<div id=\\\"study\\\" role=\\\"tabpanel\\\" class=\\\"tab-pane fade\\\"></div>\";\n $output .= \"<div id=\\\"trees\\\" role=\\\"tabpanel\\\" class=\\\"tab-pane fade\\\"></div>\";\n\n $output .= $p_exist ? \"<div id=\\\"phenotype\\\" role=\\\"tabpanel\\\" class=\\\"tab-pane fade\\\"></div>\" : \"\";\n $output .= $g_exist ? \"<div id=\\\"genotype\\\" role=\\\"tabpanel\\\" class=\\\"tab-pane fade\\\"></div>\" : \"\";\n $output .= $mass_spectro_exist ? \"<div id=\\\"mass_spectrometry\\\" role=\\\"tabpanel\\\" class=\\\"tab-pane fade\\\"></div>\" : \"\";\n\n $output .= '</div>';\n return $output;\n}", "function bp_dynamic_tab_content() {\n\treturn BP_Dynamic_User_Tab_Content::get_instance();\n}", "private function tab_navigation() {\n\t\t\techo '<div class=\"wpseo-local-metabox-menu\">';\n\t\t\techo '<ul role=\"tablist\" class=\"yoast-seo-local-aria-tabs\" aria-label=\"Yoast SEO: Local\">';\n\t\t\tforeach ( $this->tabs as $key => $tab ) {\n\t\t\t\t$active = ( $key === 0 );\n\n\t\t\t\t$link_class = [ 'wpseo-local-meta-section-link' ];\n\t\t\t\tif ( $active ) {\n\t\t\t\t\t$link_class[] = 'yoast-active-tab';\n\t\t\t\t}\n\n\t\t\t\techo '<li role=\"presentation\" ' . ( ( $active ) ? 'class=\"active\"' : '' ) . '>';\n\t\t\t\techo '<a role=\"tab\" href=\"#wpseo-local-tab-' . $tab['id'] . '\" class=\"' . implode( ' ', $link_class ) . '\" id=\"wpseo-local-tab-' . $tab['id'] . '-content\">';\n\t\t\t\techo '<span class=\"dashicons dashicons-' . $tab['icon'] . '\"></span>';\n\t\t\t\techo $tab['title'];\n\t\t\t\techo '</a>';\n\t\t\t\techo '</li>';\n\t\t\t}\n\t\t\techo '</ul>';\n\t\t\techo '</div> <!-- .wpseo-metabox-menu -->';\n\t\t}", "function parseTabs(&$field, &$item) {\r\n\t\t$editorarea_per_tab = $field->parameters->get('editorarea_per_tab', 0);\r\n\r\n\t\t$start_of_tabs_pattern = $field->parameters->get('start_of_tabs_pattern');\r\n\t\t$end_of_tabs_pattern = $field->parameters->get('end_of_tabs_pattern');\r\n\t\t\r\n\t\t$start_of_tabs_default_text = $field->parameters->get('start_of_tabs_default_text'); // Currently unused\r\n\t\t$default_tab_list = $field->parameters->get('default_tab_list'); // Currently unused\r\n\t\t\r\n\t\t$title_tab_pattern = $field->parameters->get('title_tab_pattern');\r\n\t\t$start_of_tab_pattern = $field->parameters->get('start_of_tab_pattern');\r\n\t\t$end_of_tab_pattern = $field->parameters->get('end_of_tab_pattern');\r\n\t\t\r\n\t\t$field_value = & $field->value[0];\r\n\t\t$field->tabs_detected = false;\r\n\t\t\r\n\t\t// MAKE MAIN TEXT FIELD OR TEXTAREAS TABBED\r\n\t\tif ( $editorarea_per_tab ) {\r\n\t\t\t\r\n\t\t\t//echo 'tabs start: ' . preg_match_all('/'.$start_of_tabs_pattern.'/u', $field_value ,$matches) . \"<br />\";\r\n\t\t\t//print_r ($matches); echo \"<br />\";\r\n\t\t\t\r\n\t\t\t//echo 'tabs end: ' . preg_match_all('/'.$end_of_tabs_pattern.'/u', $field_value ,$matches) . \"<br />\";\r\n\t\t\t//print_r ($matches); echo \"<br />\";\r\n\t\t\t\r\n\t\t\t$field->tabs_detected = preg_match('/' .'(.*)('.$start_of_tabs_pattern .')(.*)(' .$end_of_tabs_pattern .')(.*)'. '/su', $field_value ,$matches);\r\n\t\t\t\r\n\t\t\tif ($field->tabs_detected) {\r\n\t\t\t\t$field->tab_info = new stdClass();\r\n\t\t\t\t$field->tab_info->beforetabs = $matches[1];\r\n\t\t\t\t$field->tab_info->tabs_start = $matches[2];\r\n\t\t\t\t$insidetabs = $matches[3];\r\n\t\t\t\t$field->tab_info->tabs_end = $matches[4];\r\n\t\t\t\t$field->tab_info->aftertabs = $matches[5];\r\n\t\t\t\t\r\n\t\t\t\t//echo 'tab start: ' . preg_match_all('/'.$start_of_tab_pattern.'/u', $insidetabs ,$matches) . \"<br />\";\r\n\t\t\t\t//echo \"<pre>\"; print_r ($matches); echo \"</pre><br />\";\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//echo 'tab end: ' . preg_match_all('/'.$end_of_tab_pattern.'/u', $insidetabs ,$matches) . \"<br />\";\r\n\t\t\t\t//print_r ($matches); echo \"<br />\";\r\n\t\t\t\t\r\n\t\t\t\t$tabs_count = preg_match_all('/('.$start_of_tab_pattern .')(.*?)(' .$end_of_tab_pattern .')/su', $insidetabs ,$matches) . \"<br />\";\r\n\t\t\t\t\r\n\t\t\t\tif ($tabs_count) {\r\n\t\t\t\t\t$tab_startings = $matches[1];\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach ($tab_startings as $i => $v) {\r\n\t\t\t\t\t\t$title_matched = preg_match('/'.$title_tab_pattern.'/su', $tab_startings[$i] ,$title_matches) . \"<br />\";\r\n\t\t\t\t\t\t//echo \"<pre>\"; print_r($title_matches); echo \"</pre>\";\r\n\t\t\t\t\t\t$tab_titles[$i] = $title_matches[1];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$tab_contents = $matches[2];\r\n\t\t\t\t\t$tab_endings = $matches[3];\r\n\t\t\t\t\t//foreach ($tab_titles as $tab_title) echo \"$tab_title &nbsp; &nbsp; &nbsp;\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo \"FALIED while parsing tabs<br />\";\r\n\t\t\t\t\t$field->tabs_detected = 0;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$field->tab_info->tab_startings = & $tab_startings;\r\n\t\t\t\t$field->tab_info->tab_titles = & $tab_titles;\r\n\t\t\t\t$field->tab_info->tab_contents = & $tab_contents;\r\n\t\t\t\t$field->tab_info->tab_endings = & $tab_endings;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function authors_tab_content() {\n\t\techo '<h2>Authors</h2>';\n\t\t$content = get_post_meta( get_the_ID(), 'authordesc', true );\n\t\t$content = htmlspecialchars_decode( $content );\n\t\t$content = wpautop( $content );\n\t\techo $content;\n\t}", "function change_tabs($tabs){\n $tabs['additional_information']['title'] = 'Характеристики';\n return $tabs;\n}", "function sp_content_tabgroup_sc( $atts, $content = null ) {\n\n\t\tif( !$GLOBALS['tabs_groups'] )\n\t\t\t$GLOBALS['tabs_groups'] = 0;\n\t\t\t\n\t\t$GLOBALS['tabs_groups']++;\n\n\t\t$GLOBALS['tab_count'] = 0;\n\n\t\t$tabs_count = 1;\n\n\t\tdo_shortcode( $content );\n\n\t\tif( is_array( $GLOBALS['tabs'] ) ) {\n\n\t\t\tforeach( $GLOBALS['tabs'] as $tab ) {\n\n\t\t\t\t$tabs[] = '<li><a href=\"#tab-' . $GLOBALS['tabs_groups'] . '-' . $tabs_count . '\">' . $tab['title'] . '</a></li>';\n\t\t\t\t$panes[] = '<div id=\"tab-' . $GLOBALS['tabs_groups'] . '-' . $tabs_count++ . '\" class=\"tab-content\">' . do_shortcode( $tab['content'] ) . '</div>';\n\n\t\t\t}\n\n\t\t\t$return = \"\\n\". '<ul class=\"tabs-nav\">' . implode( \"\\n\", $tabs ) . '</ul>' . \"\\n\" . '<div class=\"tabs-container\">' . implode( \"\\n\", $panes ) . '</div>' . \"\\n\";\n\t\t}\n\n\t\treturn $return;\n\n\t}", "private function installModuleTabs()\n {\n foreach ($this->admin_tabs as $value) {\n @copy(_PS_MODULE_DIR_ . $this->name . '/logo.png', _PS_IMG_DIR_ . 't/' . $value['class'] . '.png');\n $parent_tab = new Tab();\n $parent_tab->name[$this->context->language->id] = $this->l($value['title']);\n $parent_tab->class_name = $value['class'];\n $parent_tab->id_parent = 0; // Home tab\n $parent_tab->module = $this->name;\n $parent_tab->add();\n \n if (isset($value['children'])) {\n foreach ($value['children'] as $k => $v) {\n $tab = new Tab();\n // Need a foreach for the language\n foreach (Language::getLanguages(true) as $lang)\n $tab->name[$lang['id_lang']] = $this->l($v);\n \n $tab->class_name = $k;\n $tab->id_parent = $parent_tab->id;\n $tab->module = $this->name;\n $tab->add();\n }\n \n foreach ($value['hidden'] as $k => $v) {\n $tab = new Tab();\n // Need a foreach for the language\n foreach (Language::getLanguages(true) as $lang)\n $tab->name[$lang['id_lang']] = $this->l($v);\n \n $tab->class_name = $k;\n $tab->id_parent = - 1;\n $tab->module = $this->name;\n $tab->add();\n }\n }\n }\n \n return true;\n }", "private function _createTab()\r\n {\r\n $response = true;\r\n\r\n // First check for parent tab\r\n $parentTabID = Tab::getIdFromClassName('AdminFieldMenu');\r\n\r\n if ($parentTabID) {\r\n $parentTab = new Tab($parentTabID);\r\n } else {\r\n $parentTab = new Tab();\r\n $parentTab->active = 1;\r\n $parentTab->name = array();\r\n $parentTab->class_name = \"AdminFieldMenu\";\r\n foreach (Language::getLanguages() as $lang){\r\n $parentTab->name[$lang['id_lang']] = \"Fieldthemes\";\r\n }\r\n $parentTab->id_parent = 0;\r\n $parentTab->module = '';\r\n $response &= $parentTab->add();\r\n }\r\n// Check for parent tab2\r\n\t\t\t$parentTab_2ID = Tab::getIdFromClassName('AdminFieldMenuSecond');\r\n\t\t\tif ($parentTab_2ID) {\r\n\t\t\t\t$parentTab_2 = new Tab($parentTab_2ID);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$parentTab_2 = new Tab();\r\n\t\t\t\t$parentTab_2->active = 1;\r\n\t\t\t\t$parentTab_2->name = array();\r\n\t\t\t\t$parentTab_2->class_name = \"AdminFieldMenuSecond\";\r\n\t\t\t\tforeach (Language::getLanguages() as $lang) {\r\n\t\t\t\t\t$parentTab_2->name[$lang['id_lang']] = \"FieldThemes Configure\";\r\n\t\t\t\t}\r\n\t\t\t\t$parentTab_2->id_parent = $parentTab->id;\r\n\t\t\t\t$parentTab_2->module = '';\r\n\t\t\t\t$response &= $parentTab_2->add();\r\n\t\t\t}\r\n\t\t\t// Created tab\r\n $tab = new Tab();\r\n $tab->active = 1;\r\n $tab->class_name = \"AdminFieldSpecialProduct\";\r\n $tab->name = array();\r\n foreach (Language::getLanguages() as $lang){\r\n $tab->name[$lang['id_lang']] = \"Configure specials products\";\r\n }\r\n $tab->id_parent = $parentTab_2->id;\r\n $tab->module = $this->name;\r\n $response &= $tab->add();\r\n\r\n return $response;\r\n }", "function bpfit_weight_subtab_function_to_show_content() {\n\t\t\tinclude 'profile-menu/weight/bpfit-my-weight.php';\n\t\t}", "function generateTabs($pScreenName, $pRestriction = ''){\n if(0 == count($this->getScreens())){\n return '';\n }\n\n $content = '';\n $tabs = array();\n $Screens =& $this->getScreens();\n\n if (\"List\" == $pScreenName){\n if(empty($this->addNewName)){\n $addNewName = $this->SingularRecordName;\n } else {\n $addNewName = $this->addNewName;\n }\n\t\t\t$content = '';\n if($this->AllowAddRecord){\n if('view' == $pRestriction){\n //$content = \"\\$tabs['New'] = array(\\\"\\\", gettext(\\\"No Add New|You cannot add a new {$addNewName} because you don't have permission\\\"), 'disabled');\";\n } else {\n //get first edit screen and insert a tab link to it as \"new\"\n foreach ($Screens as $Screen){\n if ('editscreen' == strtolower(get_class($Screen))){\n\t\t\t\t\t\t\t$content = \"\\$tabs['New'] = array(\\\"edit.php?mdl={$this->ModuleID}&amp;scr={$Screen->name}\\\", gettext(\\\"Add New|Add a new \\\").gettext(\\\"{$addNewName}\\\"));\";\t\n break; //exits loop\n }\n }\n }\n } else {\n // $content = \"\\$tabs['New'] = array(\\\"\\\", gettext(\\\"No Add New|To add a new {$addNewName} you must go to a parent module\\\"), 'disabled');\";\n }\n \n\n //get search screen and insert a tab link to it\n if(count($Screens)){\n foreach ($Screens as $Screen){\n if ('searchscreen' == strtolower(get_class($Screen))){\n $content .= \"\\$tabs['Search'] = array(\\\"search.php?mdl={$this->ModuleID}\\\", gettext(\\\"Search|Search in \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n //$content .= \"\\$tabs['Reports'] = array(\\\"reports.php?mdl={$this->ModuleID}\\\", gettext(\\\"Reports|Reports for \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\tif( true == $this->areChartsDefined() ){\n\t\t\t\t\t\t\t$content .= \"\\$tabs['Charts'] = array(\\\"charts.php?mdl={$this->ModuleID}\\\", gettext(\\\"Charts|Charts for \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\t}\n } \n }\n }\n if($this->dataCollectionForm){\n $content .= \"\\$tabs['DataCollection'] = array(\\\"dataCollectionForm.php?mdl={$this->ModuleID}\\\", gettext(\\\"Blank Form|Blank form for \\\").gettext(\\\"{$this->PluralRecordName}\\\"), 'download');\";\n }\n } elseif (\"ListCtxTabs\" == $pScreenName){\n\t\t\n//$tabs['List'] = Array(\"list.php?$qs\", gettext(\"List|View the list of /**plural_record_name**/\"));\n\t\t\t$content = \"\\$tabs['List'] = array(\\\"list.php?\\$qs\\\", gettext(\\\"List|View the list of \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\tif(empty($this->addNewName)){\n $addNewName = $this->SingularRecordName;\n } else {\n $addNewName = $this->addNewName;\n }\n\n if($this->AllowAddRecord){\n if('view' == $pRestriction){\n // $content .= \"\\$tabs['New'] = array(\\\"\\\", gettext(\\\"No Add New|You cannot add a new {$addNewName} because you don't have permission\\\"), 'disabled');\";\n } else {\n //get first edit screen and insert a tab link to it as \"new\"\n foreach ($Screens as $Screen){\n if ('editscreen' == strtolower(get_class($Screen))){\n\t\t\t\t\t\t\t$content .= \"\\$tabs['New'] = array(\\\"edit.php?mdl={$this->ModuleID}&amp;scr={$Screen->name}\\\", gettext(\\\"Add New|Add a new \\\").gettext(\\\"{$addNewName}\\\"));\";\t\n\n break; //exits loop\n }\n }\n }\n } else {\n //$content = \"\\$tabs['New'] = array(\\\"\\\", gettext(\\\"No Add New|To add a new {$addNewName} you must go to a parent module\\\"), 'disabled');\";\n }\n \n\n //get search screen and insert a tab link to it\n if(count($Screens)){\n foreach ($Screens as $Screen){\n if ('searchscreen' == strtolower(get_class($Screen))){\n $content .= \"\\$tabs['Search'] = array(\\\"search.php?mdl={$this->ModuleID}\\\", gettext(\\\"Search|Search in \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\t//$content .= \"\\$tabs['Reports'] = array(\\\"reports.php?mdl={$this->ModuleID}\\\", gettext(\\\"Reports|Reports for \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\tif( true == $this->areChartsDefined() ){\n\t\t\t\t\t\t\t$content .= \"\\$tabs['Charts'] = array(\\\"charts.php?mdl={$this->ModuleID}\\\", gettext(\\\"Charts|Charts for \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n }\n }\n if($this->dataCollectionForm){\n $content .= \"\\$tabs['DataCollection'] = array(\\\"dataCollectionForm.php?mdl={$this->ModuleID}\\\", gettext(\\\"Blank Form|Blank form for \\\").gettext(\\\"{$this->PluralRecordName}\\\"), 'download');\";\n }\n\t\t}elseif( \"EditScreenPermissions\" == $pScreenName ){\n\t\t\t$content = '';\n\t\t\tforeach ($Screens as $Screen){\t\t\t\n\t\t\t\tif( 'editscreen' == strtolower(get_class($Screen)) AND isset($Screen->EditPermission) ){\n\t\t\t\t\t$content .= \"\\$EditScrPermission['{$Screen->name}'] = '{$Screen->EditPermission}';\\n\";\t\n\t\t\t\t}\n }\n\t\t\tif( $content != '' ){\n\t\t\t\tforeach ($Screens as $Screen){\t\t\t\n\t\t\t\t\tif( 'editscreen' == strtolower(get_class($Screen)) AND !isset($Screen->EditPermission) ){\n\t\t\t\t\t\t$content .= \"\\$EditScrPermission['{$Screen->name}'] = '{$this->ModuleID}';\\n\";\t\n\t\t\t\t\t}\n }\n\t\t\t}\n\t\t\n\t\t}elseif( \"ListRecordMenu\" == $pScreenName ){ \n\t\t \n\t\t\t$recordMenuCounter = 0;\n\t\t\t\t\n\t\t\tforeach ($Screens as $Screen){\n $linkTo = '';\n $tab = '';\n\t\t\t\t$recordMenu = '';\n\t\t\t\t$recordMenuEntries = '';\n\t\t\t\t\n switch( strtolower(get_class($Screen)) ){\n case \"viewscreen\":\n $handler = \"view.php\"; \n $phrase = \"View|View summary information about a record of type \\\").gettext(\\\"\". $this->SingularRecordName;\n break;\n case \"editscreen\":\n if(!empty($Screen->linkToModuleID)){\n $linkTo = $Screen->linkToModuleID;\n }\n $handler = \"edit.php\";\n\n if (empty($Screen->phrase)){\n $phrase = $Screen->name;\n } else {\n $phrase = $Screen->phrase;\n }\n break;\n case \"searchscreen\":\n $handler = \"search.php\";\n $phrase = \"Search|Search in \\\").' '.gettext(\\\"\". $this->PluralRecordName;\n break;\n case \"listscreen\":\n $handler = \"list.php\";\n $phrase = \"List|View the list of \\\").' '.gettext(\\\"\". $this->PluralRecordName;\n break;\n case \"recordreportscreen\":\n $handler = \"reports.php\";\n $phrase = $Screen->phrase;\n break;\n case \"listreportscreen\":\n $handler = \"reports.php\";\n $phrase = $Screen->phrase;\n break;\n case \"anoneditscreen\":\n continue;\n break;\n default:\n print_r($Screens);\n die(\"unknown screen type: '\".get_class($Screen).\"'\\n\");\n }\n\n\t\t\t\t$recordMenu = '$recordMenuEntries['.$Screen->name.']='.\"'{ text: \\\"'.strip_tags( ShortPhrase( gettext(\\\"{$phrase}\\\") ) ).'\\\" }';\\n\";\n\n $tabConditionModuleID = '';\n if(!empty($Screen->tabConditionModuleID)){\n $tabConditionModuleID = \", '{$Screen->tabConditionModuleID}'\";\n }\n\n\t\t\t\tif( ( \"view\" == $pRestriction && \"viewscreen\" == strtolower(get_class($Screen)) ) \n\t\t\t\t || (\"view\" != $pRestriction) ){\n\t\t\t\t\tif($linkTo == ''){\t\t\t\t\t\t\n\t\t\t\t\t\t$recordMenuURL = '$recordMenuURL['.$Screen->name.']= '.\"\\\"$handler?scr={$Screen->name}&mdl={$this->ModuleID}\\\";\\n\"; \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$recordMenuURL = '$recordMenuURL['.$Screen->name.']= '.\"\\\"$handler?scr={$Screen->name}&mdl=$linkTo\\\";\\n\"; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\n if( in_array(strtolower(get_class($Screen)), array('viewscreen', 'editscreen', 'recordreportscreen')) ){ \n\t\t\t\t\t$recordMenuList .= $recordMenu;\n\t\t\t\t\t$recordMenuURLList .= $recordMenuURL;\t\t\t\t\t\n }\n }\t\t\t\n\t\t\t\n\t\t\t$content = $recordMenuList.$recordMenuURLList;\n\t\n\t\t}else {\n print \"m. GenerateTabs: current screen $pScreenName\\n\";\n\n $currentScreen = $this->getScreen($pScreenName);\n\n foreach ($Screens as $Screen){\n $linkTo = '';\n $tab = '';\n switch(strtolower(get_class($Screen))){\n case \"viewscreen\":\n $handler = \"view.php\";\n /* if(in_array($this->SingularRecordName[0], array('a','e','i','o','h','y','A','E','I','O','H','Y'))){\n $a = 'an';\n } else {\n $a = 'a';\n } */\n $phrase = \"View|View summary information about a record of type \\\").gettext(\\\"\". $this->SingularRecordName;\n break;\n case \"editscreen\":\n if(!empty($Screen->linkToModuleID)){\n $linkTo = $Screen->linkToModuleID;\n }\n $handler = \"edit.php\";\n\n if (empty($Screen->phrase)){\n $phrase = $Screen->name;\n } else {\n $phrase = $Screen->phrase;\n }\n break;\n case \"searchscreen\":\n $handler = \"search.php\";\n $phrase = \"Search|Search in \\\").' '.gettext(\\\"\". $this->PluralRecordName;\n break;\n case \"listscreen\":\n $handler = \"list.php\";\n $phrase = \"List|View the list of \\\").' '.gettext(\\\"\". $this->PluralRecordName;\n break;\n case \"recordreportscreen\":\n $handler = \"reports.php\";\n $phrase = $Screen->phrase;\n break;\n case \"listreportscreen\":\n $handler = \"reports.php\";\n $phrase = $Screen->phrase;\n break;\n case \"anoneditscreen\":\n continue;\n break;\n default:\n print_r($Screens);\n die(\"unknown screen type: '\".get_class($Screen).\"'\\n\");\n }\n\n $tabConditionModuleID = '';\n if(!empty($Screen->tabConditionModuleID)){\n $tabConditionModuleID = \", '{$Screen->tabConditionModuleID}'\";\n }\n\n if ($pScreenName != $Screen->name){\n if ( ( \"view\" == $pRestriction \n\t\t\t\t\t && ( \"viewscreen\" == strtolower( get_class($Screen) ) \n\t\t\t\t\t || \"recordreportscreen\" == strtolower( get_class($Screen) ) ) ) \n\t\t\t\t\t || (\"view\" != $pRestriction) ){\n\n //insert link\n if($linkTo == ''){\n $tab = \" \\$tabs['{$Screen->name}'] = array( \\\"$handler?scr={$Screen->name}&amp;\\$tabsQS\\\", gettext(\\\"{$phrase}\\\") $tabConditionModuleID);\\n\";\n } else {\n $tab = \" \\$tabs['{$Screen->name}'] = array( \\\"$handler?mdl=$linkTo&amp;rid=\\$recordID\\\", gettext(\\\"{$phrase}\\\") $tabConditionModuleID);\\n\";\n }\n }\n } else {\n //Current screen: insert name only\n $tab = \" \\$tabs['{$Screen->name}'] = array( \\\"\\\", gettext(\\\"{$phrase}\\\") $tabConditionModuleID);\\n\";\n }\n\n if(in_array(strtolower(get_class($Screen)), array('viewscreen', 'editscreen', 'recordreportscreen'))){\n $content .= $tab;\n }\n }\n }\n\n return $content;\n }", "function wpbootstrap_navtabs($content) {\r\n\t$pattern = \"/<h2 ?.*>(.*)<\\/h2>/\"; // grab all H2 elements\r\n\tpreg_match_all($pattern, $content, $headings);\r\n\t// $headings[0] returns each element w/tag\r\n\t// $headings[1] returns the innerHTML of tag\t\r\n\r\n\tif ($headings[1][0] != '') { // if there's somethin here\r\n\t\t$x = 0; //counter\r\n\t\t// build navbar\r\n\t\t$navbar .= '<ul class=\"nav nav-tabs\">';\r\n\t\tforeach ($headings[1] as $item) {\r\n\t\t\tif ($x == 0) { $active = ' class=\"active\"'; } else { $active = ''; }\r\n\t\t\t$navbar .= '<li' . $active . '><a data-toggle=\"tab\" href=\"#' . slugify($item) . '\">' . $item . '</a></li>';\r\n\t\t\t$x++;\r\n\t\t}\r\n\t\t$navbar .= '</ul><div class=\"tab-content\">';\r\n\t\t\r\n\t\t$x = 0;\r\n\t\tforeach ($headings[1] as $item) { // print $navbar right before first panel, so we can have pre-material if wanted.\r\n\t\t\t// edit the H2 Tags themselves\r\n\t\t\t$search = \"/<h2 ?.*>\" . $item . \"<\\/h2>/\";\r\n\t\t\tif ($x == 0) {\r\n\t\t\t\t$replace = $navbar . '<div id=\"' . slugify($item) . '\" class=\"tab-pane fade active in\"><h2>' . $item . '</h2>';\r\n\t\t\t} else {\r\n\t\t\t\t$replace = '</div><div id=\"' . slugify($item) . '\" class=\"tab-pane fade\"><h2>' . $item . '</h2>';\r\n\t\t\t}\r\n\t\t\t$content = preg_replace( $search, $replace, $content );\r\n\t\t\t$x++;\r\n\t\t}\r\n\t\t$content .= $content . '</div></div>'; // gotta close off the last tab & container.\r\n\t}\r\n\techo $content;\r\n}", "function mmpm_theme_sections_generator(){\n\t\t$out = '';\n\t\t$out .= mmpm_ntab(4) . '<div class=\"'. MMPM_PREFIX . '_theme_options row bootstrap no_x_margin\">';\n\t\t$out .= mmpm_ntab(5) . '<ul id=\"'. MMPM_PREFIX . '_navigation\" class=\"'. MMPM_PREFIX . '_navigation nav nav-tabs col-lg-2 col-sm-3 col-xs-12\">';\n\t\tforeach ( mmpm_theme_options_array() as $key => $section ) {\n\t\t\t$out .= mmpm_ntab(6) . '<li class=\"menu_item' . ( ( $key == 0) ? ' active' : '' ) . '\">';\n\t\t\t$out .= mmpm_ntab(7) . '<a href=\"#' . $section['key'] . '\" data-toggle=\"tab\"><i class=\"' . ( ( isset( $section['icon'] ) ) ? $section['icon'] : 'empty-icon' ) . '\"></i> ' . $section['title'] . '</a></li>';\n\t\t\t$out .= mmpm_ntab(6) . '</li>';\n\t\t}\n\t\t$out .= mmpm_ntab(5) . '</ul><!-- class=\"'. MMPM_PREFIX . '_navigation\" -->';\n\t\t$out .= mmpm_ntab(5) . '<div id=\"'. MMPM_PREFIX . '_content\" class=\"tab-content '. MMPM_PREFIX . '_content col-lg-10 col-sm-9 col-xs-12\">';\n\t\tforeach ( mmpm_theme_options_array() as $key => $section ) {\n\t\t\t$out .= mmpm_ntab(6) . '<div class=\"tab-pane fade' . ( ( $key == 0) ? ' active in' : '' ) . '\" id=\"' . $section['key'] . '\">';\n\t\t\t$mmpm_saved_theme_options = get_option( MMPM_OPTIONS_DB_NAME, array( 'empty' ) );\n\t\t\tforeach ( $section['options'] as $option ) {\n\t\t\t\t$option['key'] = isset( $option['key'] ) ? $option['key'] : 'key_no_set';\n\t\t\t\t$mmpm_saved_value = isset( $mmpm_saved_theme_options[ $option[ 'key' ] ] ) \n\t\t\t\t\t? $mmpm_saved_theme_options[ $option[ 'key' ] ] \n\t\t\t\t\t: false;\n\t\t\t\t$option['key'] = MMPM_OPTIONS_NAME . '[' . $option['key'] . ']';\n\t\t\t\t$out .= mmpm_options_generator( $option, $mmpm_saved_value );\n\t\t\t}\n\t\t\t$out .= mmpm_ntab(6) . '</div><!-- class=\"tab-pane fade\" id=\"' . $section['key'] . '\" -->';\n\t\t}\n\t\t$out .= mmpm_ntab(5) . '</div><!-- id=\"'. MMPM_PREFIX . '_content\" class=\"tab-content\" -->';\n\t\t$out .= mmpm_ntab(4) . '</div><!-- class=\"'. MMPM_PREFIX . '_theme_options\" -->';\n\t\treturn $out;\n\t}", "function moduleContent()\t{\n\t\t$this->content .= $this->makeList();\n\t}", "function tab_add_instance($tab) {\n global $CFG, $DB;\n\n require_once(\"$CFG->libdir/resourcelib.php\");\n\n $cmid = $tab->coursemodule;\n $tab->timemodified = time();\n\n\n //insert tabs and content\n if ($tab->id = $DB->insert_record(\"tab\", $tab)) {\n\n // we need to use context now, so we need to make sure all needed info is already in db\n $DB->set_field('course_modules', 'instance', $tab->id, array('id' => $cmid));\n $context = context_module::instance($cmid);\n $editoroptions = array('subdirs' => 1, 'maxbytes' => $CFG->maxbytes, 'maxfiles' => -1, 'changeformat' => 1, 'context' => $context, 'noclean' => 1, 'trusttext' => true);\n\n foreach ($tab->tabname as $key => $value) {\n $value = trim($value);\n if (isset($value) && $value <> '') {\n $option = new stdClass();\n $option->tabname = $value;\n $option->tabid = $tab->id;\n\n if (isset($tab->content[$key]['format'])) {\n $option->contentformat = $tab->content[$key]['format'];\n }\n\n if (isset($tab->tabcontentorder[$key])) {\n $option->tabcontentorder = $tab->tabcontentorder[$key];\n }\n\n if (isset($tab->content[$key]['externalurl'])) {\n $option->externalurl = $tab->content[$key]['externalurl'];\n }\n $option->timemodified = time();\n //Must get id number from inserted record to update the editor field (tabcontent)\n $newtab_content_id = $DB->insert_record(\"tab_content\", $option);\n\n //tab content is now an array due to the new editor\n //In order to enter file information from the editor\n //We must now update the record once it has been created\n\n if (isset($tab->content[$key]['text'])) {\n $draftitemid = $tab->content[$key]['itemid'];\n if ($draftitemid) {\n $tabcontentupdate = new stdClass();\n $tabcontentupdate->id = $newtab_content_id;\n $tabcontentupdate->tabcontent = file_save_draft_area_files($draftitemid, $context->id, 'mod_tab', 'content', $newtab_content_id, $editoroptions, $tab->content[$key]['text']);\n $DB->update_record('tab_content', $tabcontentupdate);\n }\n }\n }\n }\n }\n return $tab->id;\n}", "public function describeTabs();", "public function set_tabs() {\n\t\t\t$tabs = [\n\t\t\t\t[\n\t\t\t\t\t'id' => 'business_info',\n\t\t\t\t\t'title' => __( 'Business info', 'yoast-local-seo' ),\n\t\t\t\t\t'icon' => 'admin-home',\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'id' => 'opening_hours',\n\t\t\t\t\t'title' => __( 'Opening hours', 'yoast-local-seo' ),\n\t\t\t\t\t'icon' => 'clock',\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'id' => 'maps_settings',\n\t\t\t\t\t'title' => __( 'Map settings', 'yoast-local-seo' ),\n\t\t\t\t\t'icon' => 'location-alt',\n\t\t\t\t],\n\t\t\t];\n\n\t\t\t$tabs = apply_filters( 'wpseo-local-location-meta-tabs', $tabs );\n\n\t\t\t$this->tabs = $tabs;\n\t\t}", "public function registerTabs()\n {\n\n Tab::put('promotion.promotion-code', function (TabItem $tab) {\n $tab->key('promotion.promotion-code.info')\n ->label('avored::system.tab.basic_info')\n ->view('avored::promotion.promotion-code._fields');\n });\n\n Tab::put('catalog.product', function (TabItem $tab) {\n $tab->key('catalog.product.info')\n ->label('avored::system.basic_info')\n ->view('avored::catalog.product.cards._fields');\n });\n\n Tab::put('catalog.product', function (TabItem $tab) {\n $tab->key('catalog.product.image')\n ->label('avored::system.images')\n ->view('avored::catalog.product.cards.images');\n });\n\n Tab::put('catalog.product', function (TabItem $tab) {\n $tab->key('catalog.product.property')\n ->label('avored::system.property')\n ->view('avored::catalog.product.cards.property');\n });\n\n // Tab::put('catalog.product', function (TabItem $tab) {\n // $tab->key('catalog.product.attribute')\n // ->label('avored::system.tab.attribute')\n // ->view('avored::catalog.product.cards.attribute');\n // });\n\n /****** CATALOG CATEGORY TABS *******/\n Tab::put('catalog.category', function (TabItem $tab) {\n $tab->key('catalog.category.info')\n ->label('avored::system.basic_info')\n ->view('avored::catalog.category._fields');\n });\n\n /****** CATALOG PROPERTY TABS *******/\n Tab::put('catalog.property', function (TabItem $tab) {\n $tab->key('catalog.property.info')\n ->label('avored::system.basic_info')\n ->view('avored::catalog.property._fields');\n });\n\n /****** CATALOG ATTRIBUTE TABS *******/\n Tab::put('catalog.attribute', function (TabItem $tab) {\n $tab->key('catalog.attribute.info')\n ->label('avored::system.basic_info')\n ->view('avored::catalog.attribute._fields');\n });\n\n /******CMS PAGES TABS *******/\n Tab::put('cms.page', function (TabItem $tab) {\n $tab->key('cms.page.info')\n ->label('avored::system.basic_info')\n ->view('avored::cms.page._fields');\n });\n\n /******ORDER ORDER STATUS TABS *******/\n Tab::put('order.order-status', function (TabItem $tab) {\n $tab->key('order.order-status.info')\n ->label('avored::system.basic_info')\n ->view('avored::order.order-status._fields');\n });\n\n /****** CUSTOMER GROUPS TABS *******/\n Tab::put('user.customer-group', function (TabItem $tab) {\n $tab->key('user.customer-group.info')\n ->label('avored::system.tab.basic_info')\n ->view('avored::user.customer-group._fields');\n });\n\n Tab::put('user.customer', function (TabItem $tab) {\n $tab->key('user.customer.info')\n ->label('avored::system.tab.basic_info')\n ->view('avored::user.customer._fields');\n });\n\n Tab::put('user.customer', function (TabItem $tab) {\n $tab->key('user.customer.address')\n ->label('avored::system.addresses')\n ->view('avored::user.customer._addresses');\n });\n\n Tab::put('user.address', function (TabItem $tab) {\n $tab->key('user.customer.info')\n ->label('avored::system.tab.basic_info')\n ->view('avored::user.customer.show');\n });\n Tab::put('user.address', function (TabItem $tab) {\n $tab->key('user.customer.address')\n ->label('avored::system.addresses')\n ->view('avored::user.address._fields');\n });\n\n /******USER ADMIN USER TABS *******/\n Tab::put('user.staff', function (TabItem $tab) {\n $tab->key('user.staff.info')\n ->label('avored::system.basic_info')\n ->view('avored::user.staff._fields');\n });\n Tab::put('user.subscriber', function (TabItem $tab) {\n $tab->key('user.subscriber.info')\n ->label('avored::system.basic_info')\n ->view('avored::user.subscriber._fields');\n });\n\n /******SYSTEM CURRENCY TABS *******/\n Tab::put('system.currency', function (TabItem $tab) {\n $tab->key('system.currency.info')\n ->label('avored::system.tab.basic_info')\n ->view('avored::system.currency._fields');\n });\n\n /******SYSTEM STATE TABS *******/\n Tab::put('system.state', function (TabItem $tab) {\n $tab->key('system.state.info')\n ->label('avored::system.tab.basic_info')\n ->view('avored::system.state._fields');\n });\n\n /******SYSTEM ROLE TABS *******/\n Tab::put('system.role', function (TabItem $tab) {\n $tab->key('system.role.info')\n ->label('avored::system.basic_info')\n ->view('avored::system.role._fields');\n });\n\n /******SYSTEM ROLE TABS *******/\n Tab::put('system.language', function (TabItem $tab) {\n $tab->key('system.language.info')\n ->label('avored::system.tab.basic_info')\n ->view('avored::system.language._fields');\n });\n\n /******SYSTEM CONFIGURATION TABS *******/\n Tab::put('system.configuration', function (TabItem $tab) {\n $tab->key('system.configuration.basic')\n ->label('avored::system.basic_configuration')\n ->view('avored::system.configuration.cards.basic');\n });\n\n // Tab::put('system.configuration', function (TabItem $tab) {\n // $tab->key('system.configuration.user')\n // ->label('avored::system.tab.user_configuration')\n // ->view('avored::system.configuration.cards.user');\n // });\n // Tab::put('system.configuration', function (TabItem $tab) {\n // $tab->key('system.configuration.tax')\n // ->label('avored::system.tax_configuration')\n // ->view('avored::system.configuration.cards.tax');\n // });\n\n // Tab::put('system.configuration', function (TabItem $tab) {\n // $tab->key('system.configuration.shipping')\n // ->label('avored::system.tab.shipping_configuration')\n // ->view('avored::system.configuration.cards.shipping');\n // });\n // Tab::put('system.configuration', function (TabItem $tab) {\n // $tab->key('system.configuration.payment')\n // ->label('avored::system.tab.payment_configuration')\n // ->view('avored::system.configuration.cards.payment');\n // });\n }", "private function createTab()\n {\n try {\n if (LengowMain::compareVersion()) {\n $tabParent = new Tab();\n $tabParent->name[Configuration::get('PS_LANG_DEFAULT')] = 'Lengow';\n $tabParent->module = 'lengow';\n $tabParent->class_name = 'AdminLengow';\n $tabParent->id_parent = 0;\n $tabParent->add();\n } else {\n $tabParent = new Tab(Tab::getIdFromClassName('AdminCatalog'));\n $tab = new Tab();\n $tab->name[Configuration::get('PS_LANG_DEFAULT')] = 'Lengow';\n $tab->module = 'lengow';\n $tab->class_name = 'AdminLengowHome14';\n $tab->id_parent = $tabParent->id;\n $tab->add();\n $tabParent = $tab;\n }\n foreach ($this->tabs as $name => $values) {\n if (_PS_VERSION_ < '1.5' && $values['name'] === 'AdminLengowHome') {\n continue;\n }\n $tab = new Tab();\n if (_PS_VERSION_ < '1.5') {\n $tab->class_name = $values['name'] . '14';\n $tab->id_parent = $tabParent->id;\n } else {\n $tab->class_name = $values['name'];\n $tab->id_parent = $tabParent->id;\n $tab->active = $values['active'];\n }\n $tab->module = $this->lengowModule->name;\n $languages = Language::getLanguages(false);\n foreach ($languages as $language) {\n $tab->name[$language['id_lang']] = LengowMain::decodeLogMessage($name, $language['iso_code']);\n }\n $tab->add();\n LengowMain::log(\n LengowLog::CODE_INSTALL,\n LengowMain::setLogMessage('log.install.install_tab', array('class_name' => $tab->class_name))\n );\n }\n return true;\n } catch (Exception $e) {\n return false;\n }\n }", "function init_tab_contracthtml_content($contract) {\n\t$CI = &get_instance();\n\tif(has_permission('teampassword','','view') || is_admin() || is_client_logged_in()){\n\n\t\tif(is_client_logged_in()){\n\t\t\tif(get_option('hide_password_from_client_area') == 0){\n\t\t\t\techo '<div role=\"tabpanel\" class=\"tab-pane\" id=\"items_relate\">';\n\t\t\t\t\n\t\t\t\t require \"modules/team_password/views/items_relate.php\";\n\t\t\t\t\n\t\t\t\techo '</div>';\n\t\t\t}\n\t\t}else{\n\t\t\techo '<div role=\"tabpanel\" class=\"tab-pane\" id=\"items_relate\">';\n\t\t\t\n\t\t\t require \"modules/team_password/views/items_relate.php\";\n\t\t\t\n\t\t\techo '</div>';\n\t\t}\n\t}\n}", "public function getTabLabel()\n {\n return Mage::helper('magna_news')->__('Content');\n }", "public function tabsShortcode($atts) {\n ob_start();\n ?>\n <div class=\"row\">\n <div class=\"col s12\">\n <ul class=\"tabs\">\n <li class=\"tab col s3\"><a href=\"#test1\">Test 1</a></li>\n <li class=\"tab col s3\"><a class=\"active\" href=\"#test2\">Test 2</a></li>\n <li class=\"tab col s3 disabled\"><a href=\"#test3\">Disabled Tab</a></li>\n <li class=\"tab col s3\"><a href=\"#test4\">Test 4</a></li>\n </ul>\n </div>\n <div id=\"test1\" class=\"col s12\">Test 1</div>\n <div id=\"test2\" class=\"col s12\">Test 2</div>\n <div id=\"test3\" class=\"col s12\">Test 3</div>\n <div id=\"test4\" class=\"col s12\">Test 4</div>\n </div>\n <?php\n return ob_get_clean();\n\n }", "public function reviews_tab_content() {\n\t\techo '<h2>Reviews</h2>';\n\t\t$content = get_post_meta( get_the_ID(), 'heweb17reviews', true );\n\t\t$content = htmlspecialchars_decode( $content );\n\t\t$content = wpautop( $content );\n\t\techo $content;\n\t}", "function woocommerce_product_write_panel_tabs(){\n ?>\n <li class=\"custom_tab\">\n <a href=\"#custom_tab_data_ctabs\">\n <?php _e('Custom Tabs', 'GWP'); ?>\n </a>\n </li>\n <?php\n }", "protected function content_template() {}", "protected function content_template() {}", "public function saveTabData()\n\t{\n\t\tee()->load->library('api');\n\t\tee()->legacy_api->instantiate('channel_fields');\n\n\t\tforeach ($this->getModulesWithTabs() as $name => $info)\n\t\t{\n\t\t\tee()->load->add_package_path($info->getPath(), FALSE);\n\n\t\t\tinclude_once($info->getPath() . '/tab.' . $name . '.php');\n\t\t\t$class_name = ucfirst($name) . '_tab';\n\t\t\t$OBJ = new $class_name();\n\n\t\t\tif (method_exists($OBJ, 'save') === TRUE)\n\t\t\t{\n\t\t\t\t$fields = $OBJ->display($this->channel_id, $this->entry_id);\n\n\t\t\t\t$values = array();\n\t\t\t\tforeach(array_keys($fields) as $field)\n\t\t\t\t{\n\t\t\t\t\t$property = $name . '__' . $field;\n\n\t\t\t\t\tif ($this->$property)\n\t\t\t\t\t{\n\t\t\t\t\t\t$values[$field] = $this->$property;\n\t\t\t\t\t}\n\t\t\t\t\telseif ($this->hasCustomField($property))\n\t\t\t\t\t{\n\t\t\t\t\t\t$values[$field] = $this->getCustomField($property)->getData();\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$values[$field] = NULL;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$OBJ->save($this, $values);\n\t\t\t}\n\n\t\t\t// restore our package and view paths\n\t\t\tee()->load->remove_package_path($info->getPath());\n\t\t}\n\t}", "abstract protected function view_generatePageContent();", "protected function setHtmlContent() {}", "function cs_pb_tabs($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$tabs_element_size = '50';\n\t\t$tab_title = '';\n\t\t$tab_text = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$tabs_element_size = $cs_node->tabs_element_size;\n\t\t\t$tab_title = $cs_node->tab_title;\n\t\t\t$tab_text = $cs_node->tab_text;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $tabs_element_size?>\" item=\"tabs\" data=\"<?php echo element_size_data_array_index($tabs_element_size)?>\" >\n \t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"tabs_element_size[]\" class=\"item\" value=\"<?php echo $tabs_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> &nbsp; \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp; \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n \t<div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Tabs Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n\t\t\t\t<div class=\"wrapptabbox\">\n <div class=\"clone_append\">\n <?php\n\t\t\t\t\t\t$tabs_num = 0;\n if ( isset($cs_node) ){\n\t\t\t\t\t\t\t$tabs_num = count($cs_node->tab);\n foreach ( $cs_node->tab as $tab ){\n\t\t\t\t\t\t\t\tif ( $tab->tab_active == \"yes\" ) { $tab_active = \"selected\"; }\n\t\t\t\t\t\t\t\telse { $tab_active = \"\"; }\n\t\t\t\t\t\t\t\techo \"<div class='clone_form'>\";\n\t\t\t\t\t\t\t\t\techo \"<a href='#' class='deleteit_node'>Delete it</a>\";\n\t\t\t\t\t\t\t\t\techo '<label>Tab Title:</label> <input class=\"txtfield\" type=\"text\" name=\"tab_title[]\" value=\"'.$tab->tab_title.'\" />';\n\t\t\t\t\t\t\t\t\techo '<label>Tab Text:</label> <textarea class=\"txtfield\" name=\"tab_text[]\">'.$tab->tab_text.'</textarea>';\n\t\t\t\t\t\t\t\t\techo '<label>Title Icon:</label> <input class=\"txtfield\" type=\"text\" name=\"tab_title_icon[]\" value=\"'.$tab->tab_title_icon.'\" />';\n\t\t\t\t\t\t\t\t\techo '<label>Active:</label> <select name=\"tab_active[]\"><option>no</option><option '.$tab_active.'>yes</option></select> ';\n\t\t\t\t\t\t\t\techo \"</div>\";\n }\n }\n ?>\n </div>\n <div class=\"opt-conts\">\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label></label></li>\n <li class=\"to-field\"><a href=\"#\" class=\"addedtab\">Add Tab</a></li>\n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n <input type=\"hidden\" name=\"tabs_num[]\" value=\"<?php echo $tabs_num?>\" class=\"fieldCounter\" />\n <input type=\"hidden\" name=\"cs_orderby[]\" value=\"tabs\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n \t</div>\n \n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "protected function init_tabs() {\r\n\t\t$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'firstrun' ), $_SERVER['REQUEST_URI'] );\r\n\r\n\t\tadd_action( 'qc_settings_head', 'qc_status_colors_css' );\r\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );\r\n\r\n\t\t$this->tabs->add( 'general', __( 'General', APP_TD ) );\r\n\r\n\t\t$this->tab_sections['general']['main'] = array(\r\n\t\t\t'title' => __( 'General Settings', APP_TD ),\r\n\t\t\t'fields' => array(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'title' => __( 'Permissions', APP_TD ),\r\n\t\t\t\t\t'type' => 'radio',\r\n\t\t\t\t\t'name' => 'assigned_perms',\r\n\t\t\t\t\t'values' => array(\r\n\t\t\t\t\t\t'protected' => __( 'Users can only view their own tickets and tickets they are assigned to.', APP_TD ),\r\n\t\t\t\t\t\t'read-only' => __( 'Users can view all tickets.', APP_TD ),\r\n\t\t\t\t\t\t'read-write' => __( 'Users can view and updated all tickets.', APP_TD ),\r\n\t\t\t\t\t),\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'title' => __( 'Lock Site from Visitors', APP_TD ),\r\n\t\t\t\t\t'name' => 'lock_site',\r\n\t\t\t\t\t'type' => 'checkbox',\r\n\t\t\t\t\t'desc' => __( 'Yes', APP_TD ),\r\n\t\t\t\t\t'tip' => __( 'Visitors will be asked to login, and will not be able to browse site. Also content of the sidebars and menus will be hidden.', APP_TD ),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t);\r\n\r\n\t\t$this->tab_sections['general']['states'] = array(\r\n\t\t\t'title' => __( 'States', APP_TD ),\r\n\t\t\t'fields' => array(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'title' => __( 'Default State', APP_TD ),\r\n\t\t\t\t\t'desc' => __( 'This state will be selected by default when creating a ticket.', APP_TD ),\r\n\t\t\t\t\t'type' => 'select',\r\n\t\t\t\t\t'sanitize' => 'absint',\r\n\t\t\t\t\t'name' => 'ticket_status_new',\r\n\t\t\t\t\t'values' => $this->ticket_states(),\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'title' => __( 'Resolved State', APP_TD ),\r\n\t\t\t\t\t'desc' => __( 'Tickets in this state are assumed to no longer need attention.', APP_TD ),\r\n\t\t\t\t\t'type' => 'select',\r\n\t\t\t\t\t'sanitize' => 'absint',\r\n\t\t\t\t\t'name' => 'ticket_status_closed',\r\n\t\t\t\t\t'values' => $this->ticket_states(),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t);\r\n\t\t$this->tab_sections['general']['colors'] = array(\r\n\t\t\t'fields' => $this->status_colors_options(),\r\n\t\t\t'renderer' => array( $this, 'render_status_colors' ),\r\n\t\t);\r\n\r\n\t\t$this->tab_sections['general']['modules'] = array(\r\n\t\t\t'title' => __( 'Modules', APP_TD ),\r\n\t\t\t'fields' => array(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'title' => __( 'Enable Modules', APP_TD ),\r\n\t\t\t\t\t'type' => 'checkbox',\r\n\t\t\t\t\t'name' => 'modules',\r\n\t\t\t\t\t'values' => array(\r\n\t\t\t\t\t\t'assignment' => __( 'Assignment', APP_TD ),\r\n\t\t\t\t\t\t'attachments' => __( 'Attachments', APP_TD ),\r\n\t\t\t\t\t\t'categories' => __( 'Categories', APP_TD ),\r\n\t\t\t\t\t\t'changesets' => __( 'Changesets', APP_TD ),\r\n\t\t\t\t\t\t'milestones' => __( 'Milestones', APP_TD ),\r\n\t\t\t\t\t\t'priorities' => __( 'Priorities', APP_TD ),\r\n\t\t\t\t\t\t'tags' => __( 'Tags', APP_TD ),\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'tip' => __( 'Choose the modules that you want to use on your site.', APP_TD ),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t);\r\n\r\n\t}", "public function initContent()\n {\n $aps_params = Tools::getAllValues();\n if (isset($aps_params['content_only'])) {\n if (1 == $aps_params['content_only']) {\n $this->context->smarty->assign('nobots', true);\n $this->setTemplate('module:amazonpaymentservices/views/templates/hook/payment_valu_term.tpl');\n }\n }\n parent::initContent();\n }", "function qode_lms_single_course_tabs( $tabs = array() ) {\n\t\tglobal $post;\n\t\t\n\t\t$course_sections = get_post_meta( get_the_ID(), 'qode_course_curriculum', true );\n\t\t$member_list = get_post_meta( get_the_ID(), 'qode_course_members_meta', true );\n\t\t$forum_id = get_post_meta( get_the_ID(), 'qode_course_forum_meta', true );\n\t\t\n\t\t$show_content = $post->post_content ? true : false;\n\t\tif( qode_lms_is_elementor_installed() ){\n if ( \\Elementor\\Plugin::$instance->preview->is_preview_mode() ) {\n $show_content = true;\n }\n }\n\t\t$show_curriculum = ! empty( $course_sections );\n\t\t$show_reviews = qode_lms_show_reviews();\n\t\t$show_members = ! empty( $member_list );\n\t\t$show_forum = ! empty( $forum_id );\n\t\t\n\t\tif ( ! empty( $forum_id ) ) {\n\t\t\t$forum_link = get_permalink( $forum_id );\n\t\t}\n\t\t\n\t\t// Description tab - shows course content\n\t\tif ( $show_content ) {\n\t\t\t$tabs['description'] = array(\n\t\t\t\t'title' => __( 'Description', 'qode-lms' ),\n\t\t\t\t'priority' => 10,\n\t\t\t\t'template' => 'content'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Curriculum tab - shows course curriculum\n\t\tif ( $show_curriculum ) {\n\t\t\t$tabs['curriculum'] = array(\n\t\t\t\t'title' => __( 'Curriculum', 'qode-lms' ),\n\t\t\t\t'priority' => 20,\n\t\t\t\t'template' => 'curriculum'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Reviews tab - shows reviews\n\t\tif ( $show_reviews ) {\n\t\t\t$tabs['reviews'] = array(\n\t\t\t\t'title' => __( 'Reviews', 'qode-lms' ),\n\t\t\t\t'priority' => 30,\n\t\t\t\t'template' => 'reviews-list'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Member tab - shows members\n\t\tif ( $show_members ) {\n\t\t\t$tabs['members'] = array(\n\t\t\t\t'title' => __( 'Members', 'qode-lms' ),\n\t\t\t\t'priority' => 40,\n\t\t\t\t'template' => 'members'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Forum tab - shows forum\n\t\tif ( $show_forum ) {\n\t\t\t$tabs['forum'] = array(\n\t\t\t\t'title' => __( 'Forum', 'qode-lms' ),\n\t\t\t\t'priority' => 40,\n\t\t\t\t'template' => 'forum',\n\t\t\t\t'link' => $forum_link\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $tabs;\n\t}", "public function getPageContent($page, $tab, $showAnchors = true) {\n $this->loadTemplatePart('content', array(\n 'page' => $page,\n 'tab' => $tab,\n 'showAnchors' => $showAnchors\n ));\n }", "function __construct()\n {\n\t $this->tabs = array( \n//\t array ( 'tab_id' => 'properties',\t\t'tab_op' => 'administration.customization_properties.edit', \t'tab_name' => 'Application properties'),\n\t array ( 'tab_id' => 'fields',\t\t\t'tab_op' => 'administration.customization_fields.edit', \t\t'tab_name' => 'Field properties'),\n\t array ( 'tab_id' => 'searches', \t\t'tab_op' => 'administration.customization_searches.edit',\t\t'tab_name' => 'Search filters'),\n\t array ( 'tab_id' => 'results', \t\t\t'tab_op' => 'administration.customization_results.edit',\t\t'tab_name' => 'Search results'),\n\t array ( 'tab_id' => 'bulk',\t\t\t\t'tab_op' => 'administration.customization_bulk.edit', \t\t\t'tab_name' => 'Bulk form'),\t \n\t array ( 'tab_id' => 'view', \t\t\t'tab_op' => 'administration.customization_view.edit',\t\t\t'tab_name' => 'View form'),\n\t array ( 'tab_id' => 'edit', \t\t\t'tab_op' => 'administration.customization_edit.edit',\t\t\t'tab_name' => 'Edit form'),\n\t array ( 'tab_id' => 'linked', \t\t\t'tab_op' => 'administration.customization_linked.edit',\t\t\t'tab_name' => 'Linked applications'),\n\t array ( 'tab_id' => 'linked_view', \t\t'tab_op' => 'administration.customization_linked_view.edit',\t'tab_name' => 'Linked view form'),\n\t array ( 'tab_id' => 'popup_searches', \t'tab_op' => 'administration.customization_popup_searches.edit',\t'tab_name' => 'Popup search filters'),\n\t array ( 'tab_id' => 'popup_results', \t'tab_op' => 'administration.customization_popup_results.edit',\t'tab_name' => 'Popup search results'),\n\t array ( 'tab_id' => 'popup_view', \t\t'tab_op' => 'administration.customization_popup_view.edit',\t\t'tab_name' => 'Popup view form'),\n\t array ( 'tab_id' => 'popup_edit', \t\t'tab_op' => 'administration.customization_popup_edit.edit',\t\t'tab_name' => 'Popup edit form')\n\t ); \n\n\t\tparent::__construct();\n }", "protected function prepareTwoLevelTabList(): void\n {\n // create group\n $this->createGroup();\n\n foreach ($this->twoLevelTabList as $k => $item) {\n if (!is_string($item) && $item->id == self::ACTIVITY_GROUP_ID) {\n foreach ($this->items as $v) {\n if (!in_array($v, $item->items)) {\n $this->twoLevelTabList[$k]->items[] = $v;\n }\n }\n }\n }\n }", "function dt_sc_single_product_tabs( $attrs, $content = null ) {\n\t\tglobal $woocommerce, $product;\n\t\t$output = '';\n\t\tif(!is_object($woocommerce) || !is_object($woocommerce->query) || empty($product)) return;\n\t\t\n\t\t$tabs = woocommerce_default_product_tabs(); \n\t\tunset($tabs['description']);\t\n\t\t\n\t\tif ( ! empty( $tabs ) ) :\n\t\t\t$output .= \"<div class='single-product-tabs-container'>\";\n\t\t\t$output .= '\t<div class=\"woocommerce-tabs wc-tabs-wrapper\">';\n\t\t\t$output .= '\t\t<ul class=\"tabs wc-tabs\" role=\"tablist\">';\n\t\t\t\t\t\t\t\tforeach ( $tabs as $key => $tab ) :\n\t\t\t\t\t\t\t\t\t$output .= '<li id=\"tab-title-'.esc_attr( $key ).'\" class=\"'.esc_attr( $key ).'_tab\" role=\"tab\" aria-controls=\"tab-'.esc_attr( $key ).'\">';\n\t\t\t\t\t\t\t\t\t$output .= '\t<a href=\"#tab-'.esc_attr( $key ).'\">'.apply_filters( 'woocommerce_product_' . $key . '_tab_title', esc_html( $tab['title'] ), $key ).'</a>';\n\t\t\t\t\t\t\t\t\t$output .= '</li>';\n\t\t\t\t\t\t\t\tendforeach;\n\t\t\t$output\t.= '\t\t</ul>';\n\t\t\t\t\t\t\t\tforeach ( $tabs as $key => $tab ) :\n\t\t\t\t\t\t\t\t\t$output .= '<div id=\"tab-'.esc_attr( $key ).'\" class=\"panel entry-content wc-tab woocommerce-Tabs-panel woocommerce-Tabs-panel--'.esc_attr( $key ).'\" role=\"tabpanel\" aria-labelledby=\"tab-title-'.esc_attr( $key ).'\">';\n\t\t\t\t\t\t\t\t\tob_start();\n\t\t\t\t\t\t\t\t\tcall_user_func( $tab['callback'], $key, $tab );\n\t\t\t\t\t\t\t\t\t$output .= ob_get_clean();\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$output .= '</div>';\n\t\t\t\t\t\t\t\tendforeach;\n\t\t\t$output .= '\t</div>';\n\t\t\t$output .= '</div>';\n\t\tendif;\t\t\n\n\t\treturn $output;\t\t\t\t\n\t}", "function siteorigin_panels_add_help_tab_content(){\n\tinclude 'tpl/help.php';\n}", "public function register_data_tab( $tabs ) {\r\n $tabs['tm_extra_product_options'] = array(\r\n 'label' => __( 'TM Extra Product Options', TM_EPO_TRANSLATION ),\r\n 'target' => 'tm_extra_product_options',\r\n 'class' => array( 'tm_epo_class', 'hide_if_grouped' )\r\n );\r\n return $tabs;\r\n }", "public function __construct()\n {\n parent::__construct();\n $this->setTemplate('bs_meda/edit/tab/info.phtml');\n }", "private function _tabModelCreateData()\n {\n return [\n 'designTabsModel' => [\n 'containerDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'tabDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'tabDesignTextModel' => [\n 'size' => 20\n ],\n 'contentDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n ],\n 'textModel' => [\n 'designTextModel' => [\n 'size' => 10\n ],\n 'designBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'type' => 1,\n 'hasEditor' => false,\n ],\n 'isShowEmpty' => true,\n 'isLazyLoad' => true,\n ];\n }", "function content() {\r\n\t\t/* Reimplement this function in subclasses. */\r\n\t}", "protected function setup_tabs() {\n\n\t\t// If there's a remote info file give it priority and override any existing parameters.\n\t\tif ( $url = $this->browser_args['remote_info'] ) {\n\t\t\t$info = $this->get_remote_info( $url );\n\n\t\t\tif ( ! empty( $info ) ) {\n\t\t\t\t$this->browser_args = wp_parse_args( $info, $this->browser_args );\n\t\t\t}\n\n\t\t}\n\n\t\t// Display the 'popular' tab if enabled.\n\t\tif ( 'true' == $this->browser_args['show_popular'] ) {\n\n\t\t\t$this->browser_args['tabs']['popular'] = array(\n\t\t\t\t'name' => __( 'Popular', 'wp-shp-browser' ),\n\t\t\t\t'url' => ''\n\t\t\t);\n\n\t\t}\n\n\t\t// Set the default tab if not already set.\n\t\tif ( ! $this->browser_args['default_tab'] ) {\n\t\t\t$default_tab = array_keys( $this->browser_args['tabs'] );\n\t\t\t$default_tab = $default_tab[0];\n\n\t\t\t$this->browser_args['default_tab'] = $default_tab;\n\t\t}\n\n\t}", "public function display_tablenav( $which ) \n{\n ?>\n <div class=\"tablenav <?php echo esc_attr( $which ); ?>\">\n\n <div class=\"alignleft actions\">\n <?php $this->bulk_actions(); ?>\n </div>\n <?php\n $this->extra_tablenav( $which );\n $this->pagination( $which );\n ?>\n <br class=\"clear\" />\n </div>\n <?php\n}", "function dw_index_tab_fields($cf)\n{\n global $post;\n $tab_num = get_post_meta($post->ID, 'guidance_tabs', true);\n if (is_numeric($tab_num)) {\n for ($t = 0; $t < $tab_num; $t++) {\n $cf[] = 'guidance_tabs_' . $t . '_tab_title';\n\n $section_num = get_post_meta($post->ID, 'guidance_tabs_'.$t.'_sections', true);\n\n if (is_numeric($section_num)) {\n for ($s = 0; $s < $section_num; $s++) {\n $cf[] = 'guidance_tabs_' . $t . '_sections_' . $s . '_section_title';\n $cf[] = 'guidance_tabs_' . $t . '_sections_' . $s . '_section_html_content';\n }\n }\n\n $links_num = get_post_meta($post->ID, 'guidance_tabs_'.$t.'_links', true);\n\n if (is_numeric($links_num)) {\n for ($l = 0; $l < $links_num; $l++) {\n $cf[] = 'guidance_tabs_' . $t . '_links_' . $l . '_link_title';\n }\n }\n }\n }\n\n return $cf;\n}", "function bpfit_walk_subtab_show_screen() {\n\t\t\tadd_action( 'bp_template_title', array($this, 'bpfit_walk_subtab_function_to_show_title') );\n\t\t\tadd_action( 'bp_template_content', array($this, 'bpfit_walk_subtab_function_to_show_content') );\n\t\t\tbp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );\n\t\t}", "private function createTablesTab()\n {\n $tab = $this->createTab(\n 'tables_tab',\n '__responsive_tab_tables__',\n [\n 'attributes' => [\n 'autoScroll' => true,\n ],\n ]\n );\n\n $attributes = array_merge($this->fieldSetDefaults, ['height' => 200]);\n $fieldSetTables = $this->createFieldSet(\n 'tables_fieldset',\n '__responsive_tab_tables_fieldset_tables__',\n ['attributes' => $attributes]\n );\n\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'panel-table-header-bg',\n '@panel-table-header-bg',\n $this->themeColorDefaults['panel-table-header-bg']\n )\n );\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'panel-table-header-color',\n '@panel-table-header-color',\n $this->themeColorDefaults['panel-table-header-color']\n )\n );\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'table-row-bg',\n '@table-row-bg',\n $this->themeColorDefaults['table-row-bg']\n )\n );\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'table-row-color',\n '@table-row-color',\n $this->themeColorDefaults['table-row-color']\n )\n );\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'table-row-highlight-bg',\n '@table-row-highlight-bg',\n $this->themeColorDefaults['table-row-highlight-bg']\n )\n );\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'table-header-bg',\n '@table-header-bg',\n $this->themeColorDefaults['table-header-bg']\n )\n );\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'table-header-color',\n '@table-header-color',\n $this->themeColorDefaults['table-header-color']\n )\n );\n\n $tab->addElement($fieldSetTables);\n\n $attributes = array_merge($this->fieldSetDefaults, ['height' => 200]);\n $fieldSetBadges = $this->createFieldSet(\n 'badges_fieldset',\n '__responsive_tab_tables_fieldset_badges__',\n ['attributes' => $attributes]\n );\n\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-discount-bg',\n '@badge-discount-bg',\n $this->themeColorDefaults['badge-discount-bg']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-discount-color',\n '@badge-discount-color',\n $this->themeColorDefaults['badge-discount-color']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-newcomer-bg',\n '@badge-newcomer-bg',\n $this->themeColorDefaults['badge-newcomer-bg']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-newcomer-color',\n '@badge-newcomer-color',\n $this->themeColorDefaults['badge-newcomer-color']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-recommendation-bg',\n '@badge-recommendation-bg',\n $this->themeColorDefaults['badge-recommendation-bg']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-recommendation-color',\n '@badge-recommendation-color',\n $this->themeColorDefaults['badge-recommendation-color']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-download-bg',\n '@badge-download-bg',\n $this->themeColorDefaults['badge-download-bg']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-download-color',\n '@badge-download-color',\n $this->themeColorDefaults['badge-download-color']\n )\n );\n\n $tab->addElement($fieldSetBadges);\n\n return $tab;\n }", "public function woo_product_tabs_layout_output() {\n\t\t\tinclude_once ASTRA_ADDON_EXT_WOOCOMMERCE_DIR . '/templates/single-product-tab-layout.php';\n\t\t}", "function add_from_tab() {\n ?>\n <a href=\"#wpuf-metabox-qr-code\" class=\"nav-tab\" id=\"wpuf-qr-code-tab\"><?php _e( 'QR Code', 'wpuf-pro' ); ?></a>\n <?php\n }", "public function setContent(){\n\n\t\t$jContent='';\n\t\t$jContent.=$this->brand();\n\t\t$jContent.=$this->navigation->jTabs();\n\t\treturn $this->jQuery_DocReady().$this->vendor->setJS_Group('footer');\n\t\t\n\t}", "protected function filter_bar_content_template()\n {\n }", "private function content() {\n $this->checkPost();\n\n if (isset($_SESSION['CREATE'])) {\n\n switch ($_SESSION['CREATE']['page']) {\n case 0:\n $this->pageAgreement();\n break;\n case 1:\n $this->pageNameIntro();\n break;\n case 2:\n $this->pageMark();\n break;\n case 3:\n $this->pageFinal();\n break;\n default:\n echo '<h1>Error: Page Invalid<h1>';\n break;\n }\n\n }else\n echo '<h1>Error: Session invalid</h1>';\n }", "private function help_style_tabs() {\n $help_sidebar = $this->get_sidebar();\n\n $help_class = '';\n if ( ! $help_sidebar ) :\n $help_class .= ' no-sidebar';\n endif;\n\n // Time to render!\n ?>\n <div id=\"screen-meta\" class=\"tr-options metabox-prefs\">\n\n <div id=\"contextual-help-wrap\" class=\"<?php echo esc_attr( $help_class ); ?>\" >\n <div id=\"contextual-help-back\"></div>\n <div id=\"contextual-help-columns\">\n <div class=\"contextual-help-tabs\">\n <ul>\n <?php\n $class = ' class=\"active\"';\n $tabs = $this->get_tabs();\n foreach ( $tabs as $tab ) :\n $link_id = \"tab-link-{$tab['id']}\";\n $panel_id = (!empty($tab['url'])) ? $tab['url'] : \"#tab-panel-{$tab['id']}\";\n ?>\n <li id=\"<?php echo esc_attr( $link_id ); ?>\"<?php echo $class; ?>>\n <a href=\"<?php echo esc_url( \"$panel_id\" ); ?>\">\n <?php echo esc_html( $tab['title'] ); ?>\n </a>\n </li>\n <?php\n $class = '';\n endforeach;\n ?>\n </ul>\n </div>\n\n <?php if ( $help_sidebar ) : ?>\n <div class=\"contextual-help-sidebar\">\n <?php echo $help_sidebar; ?>\n </div>\n <?php endif; ?>\n\n <div class=\"contextual-help-tabs-wrap\">\n <?php\n $classes = 'help-tab-content active';\n foreach ( $tabs as $tab ):\n $panel_id = \"tab-panel-{$tab['id']}\";\n ?>\n\n <div id=\"<?php echo esc_attr( $panel_id ); ?>\" class=\"inside <?php echo $classes; ?>\">\n <?php\n // Print tab content.\n echo $tab['content'];\n\n // If it exists, fire tab callback.\n if ( ! empty( $tab['callback'] ) )\n call_user_func_array( $tab['callback'], array( $this, $tab ) );\n ?>\n </div>\n <?php\n $classes = 'help-tab-content';\n endforeach;\n ?>\n </div>\n </div>\n </div>\n </div>\n <?php\n }", "function hankart_add_custom_fields_content_to_desc_tab( $content ){\n\n\tif( is_product() ) { // I recommend to always use this condition\n // add_action( 'woocommerce_after_template_part', 'ankart_add_product_layouts_area', 100 );\n $content .= hankart_add_product_layouts_area();\n }\n\n\treturn $content;\n\n}", "function set_sections() {\n\t\t\n\t\t$this->sections[] = '<script type=\"text/javascript\" charset=\"utf-8\">$(\"#accessoryTabs a.'.$this->id.'\").parent().remove();</script>';\n\n\t\tif($this->EE->input->get('C') == 'admin_content' && $this->EE->input->get('M') == 'category_edit' ) {\n\n\t\t\t// help!\n\t\t\trequire_once(PATH_THIRD.'dm_eeck/includes/eeck_helper.php');\n\t\t\t$this->helper = new eeck_helper();\n\n\t\t\t// we'll need the settings from the Editor field type\n\t\t\t$this->eeck_settings = $this->helper->load_editor_settings();\n\n\t\t\t$this->helper->include_editor_js($this->eeck_settings['eeck_ckepath'], $this->eeck_settings['eeck_ckfpath']);\n\t\t\t\n\t\t\t// get our settings for this field\n\t\t\t$myConf = $this->eeck_settings['eeck_config_settings'];\n\t\t\t\n\t\t\t// load out config file\n\t\t\t$conf = $this->load_config_file($myConf);\n\t\t\tif($conf != '') $conf .= ',';\n\n\t\t\t// add on integration for CK finder\n\t\t\t$conf .= $this->integrate_ckfinder($this->eeck_settings['eeck_ckfpath'],'Images','Files','Flash');\n\n\t\t\t$str = 'CKEDITOR.replace( \"cat_description\",{'.$conf.'});';\n\t\t\t$this->sections[] = '<script type=\"text/javascript\" charset=\"utf-8\">'.$str.'</script>';\n\t\t}\n\t}" ]
[ "0.6952522", "0.6912797", "0.6694052", "0.6679739", "0.6615526", "0.6513808", "0.6511204", "0.6450648", "0.63813317", "0.6346944", "0.63421804", "0.633378", "0.6329703", "0.62873757", "0.6256779", "0.6246608", "0.61718535", "0.61619717", "0.6145952", "0.6095048", "0.60541433", "0.6018927", "0.60123897", "0.59949213", "0.59861887", "0.59736377", "0.59306306", "0.59040475", "0.58934176", "0.58594334", "0.5817686", "0.5806951", "0.5797422", "0.5791299", "0.57772803", "0.5754047", "0.5752033", "0.5740096", "0.5736971", "0.57352805", "0.57090074", "0.57020473", "0.56989247", "0.5688482", "0.56884676", "0.5683203", "0.5681523", "0.56662804", "0.5663839", "0.5663625", "0.56589544", "0.5643855", "0.56417257", "0.5639313", "0.563747", "0.56304055", "0.56295174", "0.5606997", "0.5593011", "0.55905783", "0.5585921", "0.5573458", "0.55611634", "0.5560024", "0.5541874", "0.55371815", "0.55339694", "0.5524925", "0.5520692", "0.55204916", "0.5517969", "0.5517969", "0.55172527", "0.55155075", "0.5513678", "0.55085933", "0.5496077", "0.5495497", "0.54882693", "0.54815406", "0.5477703", "0.5458624", "0.54572713", "0.5450449", "0.54493827", "0.54425824", "0.54407126", "0.54372364", "0.54294384", "0.5428116", "0.54276764", "0.54180944", "0.5414678", "0.5413727", "0.53909785", "0.53854626", "0.53707176", "0.53640133", "0.53576297", "0.5355169", "0.5354528" ]
0.0
-1
Prepare title for tab
public function getTabTitle() { return Mage::helper('attributeSplash')->__('Conditions'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function titleTab($title = \"\"){\n \t$title .= \"\";\n \treturn $title;\n }", "public function getTabTitle()\r\n {\r\n return Mage::helper('slideshow')->__('Slide Information');\r\n }", "public function getTabTitle()\n {\n return Mage::helper('lavi_news')->__('News Info');\n }", "public function getTabTitle()\n {\n return Mage::helper('magna_news')->__('Content');\n }", "public function getTabTitle()\n {\n return __('Slider Details');\n }", "public function get_title()\n {\n return __('Vertical Tabs', 'hslanding-elementor');\n }", "public function getTabTitle()\n {\n return __('Slider Information');\n }", "public function getTabTitle()\r\n\t{\r\n\t\treturn Mage::helper('slider')->__('Banner Info');\r\n\t}", "public function getTabTitle()\n {\n return __('Single Page Details');\n }", "function makeTab($title,$content) {\n\t\t$placeholders = array(\n\t\t\t\"[+title+]\" => $title,\n\t\t\t\"[+tab_content+]\" => $content,\n\t\t);\n\t\treturn str_replace( array_keys( $placeholders ), array_values( $placeholders ), $this->templates[\"tab\"]);\n\t}", "public function getTabTitle()\n {\n return __('Home Page Banners');\n }", "public function getTabTitle()\n {\n return Mage::helper('cms')->__('CSS & JS');\n }", "function parse_title($title='')\n\t\t{\n\t\t\t$this->t->set_block('run_activity', 'block_title_zone', 'title_zone');\n\t\t\t\n\t\t\tif (($this->conf['use_automatic_parsing']) && ($this->conf['show_activity_title']))\n\t\t\t{\n\t\t\t\t$this->t->set_var(array('activity_title'=> $title));\n\t\t\t\t$this->t->parse('title_zone', 'block_title_zone', true);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->t->set_var(array( 'title_zone' => ''));\n\t\t\t}\n\t\t}", "public function getTabTitle() {\r\n return Mage::helper('amlanding')->__('Links');\r\n }", "public function getTabTitle()\n {\n return Mage::helper('temando')->__('General');\n }", "public function getTabTitle()\n {\n return Mage::helper('gri_cms')->__('Versions');\n }", "public function getTabTitle()\n {\n return __('Staff Profile');\n }", "protected function renderPageTitle() {}", "public function getTabTitle()\r\n {\r\n return __('Template Information');\r\n }", "public function adaptPageTitle(&$title)\n {}", "public function getTabTitle()\n\t{\n\t\treturn __('Qa Info');\n\t}", "public function getTabTitle()\r\n {\r\n return __('Designer Information');\r\n }", "public function getTabTitle()\r\n {\r\n return __('Design');\r\n }", "public function getTabTitle()\n {\n return __('EVENTS');\n }", "function title($title, $tabs = 2)\n{\n /**\n * Add a title into the html file.\n *\n * Args:\n * $title (str): the title to add\n * $tabs (int): number of tabs for indentation, default is 2\n */\n start_tag('title', Tab($tabs), false) ;\n echo $title ;\n close_tag('title', '', true) ;\n}", "public function getTabTitle()\r\n {\r\n return __('Conditions');\r\n }", "public function getTabTitle()\n {\n return Mage::helper('recomiendo_recipes')->__('Ingredients');\n }", "public static function title();", "public function getTabTitle() {\n return $this->__('Click here for GlobalLink Translation');\n }", "function setup_title() {\n\t\tglobal $bp;\n\n\t\tif ( bp_is_messages_component() ) {\n\t\t\tif ( bp_is_my_profile() ) {\n\t\t\t\t$bp->bp_options_title = __( 'My Messages', 'buddypress' );\n\t\t\t} else {\n\t\t\t\t$bp->bp_options_avatar = bp_core_fetch_avatar( array(\n\t\t\t\t\t'item_id' => bp_displayed_user_id(),\n\t\t\t\t\t'type' => 'thumb',\n\t\t\t\t\t'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )\n\t\t\t\t) );\n\t\t\t\t$bp->bp_options_title = bp_get_displayed_user_fullname();\n\t\t\t}\n\t\t}\n\n\t\tparent::setup_title();\n\t}", "private function generate_title()\r\n\t\t{\r\n\t\t\treturn $this->c_title;\r\n\t\t}", "protected function makeTitle()\n {\n $this->setY($this->layout['titleMarginTop']);\n $this->setFont('', 'B', $this->layout['titleFontSize']);\n $this->write($this->layout['titleCellHeight'], $this->content['title']);\n $this->setFont('', '', $this->layout['fontSize']);\n }", "public function protected_title_format()\n {\n }", "public function protected_title_format()\n {\n }", "public function protected_title_format()\n {\n }", "public function getTabTitle()\n {\n return $this->_getHelper()->__('General Information');\n }", "function od_set_page_title($orig_title) {\n\t\treturn \"Map | \"; // set the page title (could be improved, eg based on filters. Might be something the user wants to set\n\t}", "protected function regeneratePageTitle() {}", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->getTabLabel();\n }", "public function getTabTitle()\n {\n return $this->__('Click here to view data of supplier subscribtion plans');\n }", "public function getTabTitle()\n {\n return __('General information');\n }", "private function _getTitle()\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\treturn '<h1>' . t( 'themer.admin.module.title', t( 'themer.admin.module.title.' . $action . ( $task ? '.' . $task : '' ) ) ) . '</h1>';\r\n\t}", "public function getTabTitle()\n {\n return Mage::helper('sc_cmsblockmanagement')->__('Versions');\n }", "public function getTabTitle()\n {\n return Mage::helper('blog')->__('Comment Information');\n }", "private function setTitle()\n {\n $this->title = $this->start_date;\n\n if ($this->start_date != $this->end_date) {\n $this->title .= ' - '.$this->end_date;\n }\n }", "public function getTabTitle()\n {\n return Mage::helper('catalogrule')->__('Conditions');\n }", "function MyApp_Interface_HEAD_Title()\n {\n $comps=preg_split('/::/',parent::MyApp_Interface_HEAD_Title());\n $keys=array(\"Initials\",\"Name\",\"Title\");\n \n $unit=$this->Unit();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($unit,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n \n $event=$this->Event();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($event,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n\n return join(\"::\",array_reverse($comps)); \n }", "public function getTabTitle()\n {\n return __('Subscription Information');\n }", "private function renderTitle()\n\t{\n\t\treturn '<h1 class=\"block-new-title\">' . $this->title . '</h1>';\n\t}", "function title() {\n parent::title();\n\n if (Session::haveRight('internet', UPDATE)\n && Session::canViewAllEntities()) {\n\n echo \"<div class='spaced' id='tabsbody'>\";\n echo \"<table class='tab_cadre_fixe'>\";\n\n echo \"<tr><td class='center'>\";\n Html::showSimpleForm(IPNetwork::getFormURL(), 'reinit_network',\n __('Reinit the network topology'));\n\n echo \"</td></tr>\";\n\n echo \"</table>\";\n echo \"</div>\";\n }\n }", "public function getTabTitle()\n {\n return __('General Information');\n }", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "function getTitle() ;", "function rename_tab( $tabs ) \n{\n\t$tabs['additional_information']['title'] = __( 'O Produto' );\n\treturn $tabs;\n}", "function title(){\n\t\t\techo $mytitle= \"Profile. Car Parking Website\";\n\t\t\t\n\t\t}", "function get_title()\n {\n }", "public function title(){\n if (func_num_args() > 0){\n $this->title = func_get_arg(0);\n }\n \n return $this->title;\n }", "protected function _buildTitle()\n\t{\n\t\tif ($this->_task)\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER_' . strtoupper($this->_task));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER');\n\t\t}\n\t\t\\Document::setTitle($title);\n\t}", "public function getTabTitle()\n {\n return $this->__('Hot Offers');\n }", "public function title(){\r\n\r\n echo ISSET($this->pageSettings->page_title)?$this->pageSettings->page_title:'';\r\n\r\n }", "function wpvideocoach_custom_support_title()\r\n{\r\n\tglobal $wpvideocoach_help_tabs_title;\r\n\treturn $wpvideocoach_help_tabs_title;\r\n}", "public function buildTitle()\r\n\t{\r\n\t\t$data\t= '<h1>' . t( 'intouch.admin.title', t( 'intouch.admin.title.' . $this->action . '.' . $this->task ) ) . '</h1>';\r\n\t\treturn $data;\r\n\t}", "public function getTabTitle()\n {\n return __('Paypal Payment Information');\n }", "public function getTabTitle()\n {\n return __('General');\n }", "public function getTabTitle()\n {\n return __('Configuration');\n }", "function setTitle( $title )\n {\n $title = trim( $title );\n $this->properties['TITLE'] = $title;\n }", "private static final function getPageTitle () {\r\n // Execute the <title tag> .tp file;\r\n $webHeaderString = new FileContent (FORM_TP_DIR . _S . 'frm_web_header_title.tp');\r\n return $webHeaderString->doToken ('[%TITLE_REPLACE_STRING%]',\r\n implode (_DCSP, ((self::$objPageTitleBackward->toInt () == 1) ? (self::$objPageTitle->arrayReverse ()->toArray ()) :\r\n self::$objPageTitle->toArray ())));\r\n }", "function prepend_title($title){\r\n\t\t$this->_title = \"{$title} - {$this->_title}\";\r\n\t}", "public function restoration_title($title) {\n\t\techo '<h2>'.$title.'</h2>';\n\t}", "public function title();", "public function title();", "protected function _buildTitle()\n\t{\n\t\tif (!$this->_title)\n\t\t{\n\t\t\t$this->_title = Lang::txt(strtoupper($this->_option));\n\t\t\tif ($this->_task)\n\t\t\t{\n\t\t\t\tswitch ($this->_task)\n\t\t\t\t{\n\t\t\t\t\tcase 'browse':\n\t\t\t\t\tcase 'submit':\n\t\t\t\t\tcase 'start':\n\t\t\t\t\tcase 'intro':\n\t\t\t\t\t\tif ($this->_task_title)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_title .= ': ' . $this->_task_title;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'serve':\n\t\t\t\t\tcase 'wiki':\n\t\t\t\t\t\t$this->_title .= ': ' . Lang::txt('COM_PUBLICATIONS_SERVING_CONTENT');\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->_title .= ': ' . Lang::txt(strtoupper($this->_option . '_' . $this->_task));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tDocument::setTitle($this->_title);\n\t}", "function tsk_title_placeholder_text ( $title ) {\n\t\tif ( get_post_type() == 'project' ) {\n\t\t\t$title = __( 'Project Name' );\n\t\t} else if ( get_post_type() == 'piece' ) {\n\t $title = __( 'Piece Name' );\n\t\t}\n\t\treturn $title;\n\t}", "function page_title($title = ''){\r\n\tglobal $eqdkp, $user;\r\n\t$pt_prefix\t\t= (defined('IN_ADMIN')) ? $user->lang['admin_title_prefix'] : $user->lang['title_prefix'];\r\n\t$main_title\t\t= sprintf($pt_prefix, $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']);\r\n\treturn sanitize((( $title != '' ) ? $title.' - ' : '').$main_title, TAG);\r\n}", "function title($title) {\r\n\t\tif (!defined('IS_UWR1RESULTS_VIEW')) {\r\n\t\t\treturn $title;\r\n\t\t}\r\n\r\n\t\t$season = Uwr1resultsController::season();\r\n\t\t$season = $season.'/'.($season+1); // TODO: make a function for that\r\n\r\n\t\t$view = Uwr1resultsController::WhichView();\r\n\t\tif ('index' == $view) {\r\n\t\t\t$title = 'Unterwasserrugby Liga Ergebnisse der Saison '.$season;\r\n\t\t} else if ('league' == $view) {\r\n\t\t\t$title = 'Ergebnisse der ' . Uwr1resultsModelLeague::instance()->name() . ' (Saison ' . $season . ')';\r\n\t\t} else if ('tournament' == $view) {\r\n\t\t\t$title = 'Ergebnisse des UWR Turniers ' . Uwr1resultsModelLeague::instance()->name();\r\n\t\t}\r\n\t\treturn $title;\r\n\t}", "abstract protected function getTitle();", "public function getTabTitle()\n {\n return Mage::helper('chirpify_seller')->__('Product');\n }", "private function _generateTitle()\n {\n $title = '';\n foreach ($this->_contents as $content)\n {\n $title = ('' == $title) ? $content->myGetSeoTitleTag() : $content->myGetSeoTitleTag().' | '.$title;\n }\n return $title;\n }", "public function computedTitle();", "public function getTabTitle()\n {\n return __('Message');\n }", "public static function setTitle(string $title) {}", "private function makeCalendarTitle()\n\t{\n\t\tif(strlen($this->headerTitle) > 0) {\n\t\t\t$this->calWeekDays .= \"\\t<tr>\\n\\t\\t<th class=\\\"headerTitle\\\" colspan=\\\"7\\\">\".$this->headerTitle.\"</th>\\n\\t</tr>\";\n\t\t\t$this->outArray['title'] = $this->headerTitle;\n\t\t}\n\t}", "protected function setPageTitle() {\r\n\t\t$pageTitleText = (empty($this->settings['news']['semantic']['general']['pageTitle']['useAlternate'])) ? $this->newsItem->getTitle() : $this->newsItem->getAlternativeTitle();\r\n\t\t$pageTitleAction = $this->settings['news']['semantic']['general']['pageTitle']['action'];\r\n\r\n\t\tif (!empty($pageTitleAction)) {\r\n\t\t\tswitch ($pageTitleAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$pageTitleText .= ': ' . $GLOBALS['TSFE']->page['title'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$pageTitleText = $GLOBALS['TSFE']->page['title'] . ': ' . $pageTitleText;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t\t$this->pageTitle = html_entity_decode($pageTitleText, ENT_QUOTES, \"UTF-8\");\r\n\t\t\t$GLOBALS['TSFE']->page['title'] = $this->pageTitle;\r\n\t\t\t$GLOBALS['TSFE']->indexedDocTitle = $this->pageTitle;\r\n\t\t}\r\n\t}", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();" ]
[ "0.81280273", "0.72819954", "0.7275596", "0.718621", "0.7168587", "0.7132194", "0.71102154", "0.70983636", "0.70758915", "0.70720655", "0.7045234", "0.70391387", "0.70316243", "0.70116305", "0.6996202", "0.69777715", "0.6975736", "0.69642615", "0.69376856", "0.6929819", "0.69027853", "0.6889834", "0.6887165", "0.68244785", "0.6815642", "0.6813814", "0.68121815", "0.680729", "0.68064654", "0.68002796", "0.6798673", "0.67972463", "0.6794331", "0.6794331", "0.6794331", "0.6793337", "0.6787132", "0.6758815", "0.67587966", "0.67587966", "0.67587966", "0.67587966", "0.67587966", "0.67587966", "0.67587966", "0.675385", "0.67499167", "0.67325413", "0.67264134", "0.6723474", "0.67202806", "0.67106557", "0.6705268", "0.66849375", "0.6664104", "0.66636366", "0.66589576", "0.6652693", "0.6652693", "0.6652693", "0.6652693", "0.6652693", "0.6652693", "0.6652693", "0.6651294", "0.6640773", "0.66348904", "0.6634739", "0.66334975", "0.66268873", "0.660854", "0.66061306", "0.6592255", "0.6585009", "0.65816396", "0.65778285", "0.65747404", "0.6559504", "0.6557401", "0.6549274", "0.6547366", "0.65471977", "0.65471977", "0.6536069", "0.65337026", "0.65271974", "0.6521834", "0.65214384", "0.65111405", "0.65093446", "0.65067065", "0.6498686", "0.64886236", "0.64817005", "0.6481613", "0.647384", "0.647384", "0.647384", "0.647384", "0.647384" ]
0.7054877
10
Returns status flag about this tab can be showen or not
public function canShowTab() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canShowTab() {\r\n return true;\r\n }", "public function canShowTab() {\r\n return true;\r\n }", "public function canShowTab() {\n return true;\n }", "public function canShowTab() {\n return true;\n }", "public function canShowTab()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function canShowTab() {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return true;\n }", "public function canShowTab()\n {\n return $this->_getCurrentTheme()->isVirtual() && $this->_getCurrentTheme()->getId();\n }", "public function canShowTab()\n {\n $integrationData = $this->_coreRegistry->registry(\n Integration::REGISTRY_KEY_CURRENT_INTEGRATION\n );\n\n if (isset($integrationData['integration_id']) &&\n isset($integrationData['endpoint']) &&\n (str_contains($integrationData['endpoint'], 'extend.com') &&\n str_contains($integrationData['endpoint'], 'integ-mage'))\n ) {\n return true;\n }\n }", "public function canShowTab()\n {\n $customer = Mage::registry('current_customer');\n return $customer->getId()&& Mage::helper('storecreditpro')->moduleEnabled();\n }", "public function canShowTab()\n {\n if ($this->_scopeConfig->getValue('brainacts_storelocator/item/separate_page')) {\n return true;\n }\n return false;\n }", "public function canShow(){\n\t\tif (Mage::getStoreConfig('logicbroker_edi_section/logicbroker_edi_group1/notificationstatus') == 0) {\n\t\t\t$this->setConfigValue(array(\n\t\t\t\t'scope' => 'default',\n\t\t\t\t'scope_id' => '0',\n\t\t\t\t'path' => 'logicbroker_edi_section/logicbroker_edi_group1/notificationstatus',\n\t\t\t\t'value' => '1',\n\t\t\n\t\t\t\t));\n\t\t\treturn true;\n }else{\n \treturn false;\n }\n\t}", "function wpvideocoach_show_help_tabs() {\r\n\tglobal $wpvideocoach_help_tabs;\r\n\tif($wpvideocoach_help_tabs == 0){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}", "public function is_active(): bool;", "public function canShowInfo() {}", "protected static function showTab($name) {\n\t\t\n\t\t$show_tab_setting = elgg_get_plugin_setting(\"group_listing_{$name}_available\", 'group_tools');\n\t\t\n\t\treturn ($show_tab_setting !== '0');\n\t}", "protected function _canBeShown()\n {\n if (!Mage::helper('factfinder_campaigns')->getIsResultListingPage()) {\n return false;\n }\n\n return (bool) Mage::helper('factfinder')->isEnabled('campaigns');\n }", "public function isVisible(): bool\n {\n return $this->scopeConfig->getValue('helloworld/general/enable');\n }", "public function getIsRunning();", "function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && !parent::isEnabled();\n }", "function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && $this->isEnabled();\n }", "public function is_active();", "public function canShowTab()\n {\n if (!$this->getPage()->getId()\n || !Mage::helper('gri_cms/hierarchy')->isEnabled()\n || !Mage::getSingleton('admin/session')->isAllowed('cms/hierarchy'))\n {\n return false;\n }\n return true;\n }", "public function getFunctionCanShow();", "public function getVisible() {\r\n return $this->bVisible;\r\n }", "public function get_status() {\n\t\t//Returns true or false. Values are set in their object ($switches, $thermometers, etc)\n\t\treturn $this->_get_status();\n\t}", "function getIsActive() ;", "public function isEnabled()\n {\n\t\tif($this->actif == 1) return true;\n \telse return false;\n }", "public function isShowActivator() {\n\t\t$cache = WP_Helper::getCache();\n\t\tif ( $cache->get( 'wdf_isActivated', false ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\tif ( get_site_transient( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tif ( get_site_option( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$keys = [\n\t\t\t'wp_defender',\n\t\t\t'wd_scan_settings',\n\t\t\t'wd_hardener_settings',\n\t\t\t'wd_audit_settings',\n\t\t\t'wd_2auth_settings',\n\t\t\t'wd_masking_login_settings'\n\t\t];\n\t\tforeach ( $keys as $key ) {\n\t\t\t$option = get_site_option( $key );\n\t\t\tif ( is_array( $option ) ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 1;\n\t}", "public function is_inactive(): bool;", "public function is_visible() {\n\t\treturn true;\n\t}", "public function getWatchStatus()\n\t\t{\n\t\t\treturn ($this->getModel()->is_watched == 'yes');\n\t\t}", "private function is_show() {\n\n\t\tif ( 'avada-fusion-patcher' === $this->current_screen || ( ( 'avada-registration' === $this->current_screen || 'avada-plugins' === $this->current_screen || 'avada-demos' === $this->current_screen ) && class_exists( 'Avada' ) && Avada()->registration->is_registered() ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isStatus()\n {\n return $this->getStatus();\n }", "public function isInformation() {\n return (1 === $this->getStatusClass());\n }", "public function isShowActions()\n {\n return $this->isShowActions;\n }", "public function displayInAdmin()\n {\n return self::_enabled();\n }", "function is_visible()\n\t{\n\t\treturn $this->visible;\n\t}", "public function setting_show_on_dashboard() {\n\t\t$show_on_dashboard = get_option( 'simple_history_show_on_dashboard', 1 );\n\t\t$show_on_dashboard = apply_filters( 'simple_history_show_on_dashboard', $show_on_dashboard );\n\t\treturn (bool) $show_on_dashboard;\n\t}", "public function status();", "public function status();", "public function hasStatus(){\n return $this->_has(19);\n }", "public function getIsActive() {}", "public function display_status() {\n\t\t$banner_status = get_option( 'cookieproCCPASettingsPreview' );\n\t\t$banner_behavior_status = get_option( 'cookieproCCPABehaviorSettingsPreview' );\n\t\t$this->settings_status = 'Draft';\n\t\t$this->settings_publish_time = '';\n\t\tif( ! empty( $banner_status ) && ! empty( $banner_behavior_status ) ){\n\t\t\tif ( 'Published' === $banner_status['publishStatus'] && 'Published' === $banner_behavior_status['publishStatus'] ) {\n\t\t\t\t$this->settings_status = 'Published';\n\t\t\t}\n\t\t\t$this->settings_publish_time = $banner_status['lastPublished'];\n\t\t}\n\t\treturn array(\n\t\t\t'status' => $this->settings_status,\n\t\t\t'lastpublished' => $this->settings_publish_time,\n\t\t);\n\t}", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function hasStatus(){\n return $this->_has(10);\n }", "public function isEnabled(){\n return $this->activo;\n }", "function isVisible() {\n\t\t$worker = CerberusApplication::getActiveWorker();\n\t\t\n\t\tif(empty($worker)) {\n\t\t\treturn false;\n\t\t} elseif($worker->is_superuser) {\n\t\t\treturn true;\n\t\t}\n\t}", "function getStatus() \n {\n return $this->instance->getStatus();\n }", "public function getIsActive();", "public function hasStatuses(){\n return $this->_has(1);\n }", "public function get_status() \n {\n $sess_stat= Session::instance()->get(\"hana_status\", array());\n if(!empty($sess_stat)) $this->status=$sess_stat;\n return $this->status;\n }", "public function isActive()\n\t{\n\t\treturn $this->status;\n\t}", "function visible () {\n\t\treturn isadmin();\n\t}", "function status(){\n return ($this -> is_approved())?\"Approved\":\"Unapproved\";\n }", "public static function status()\n {\n return [\n '1' => Yii::t('rbacp', '启用'),\n '2' => Yii::t('rbacp', '禁用'),\n ];\n }", "function wpvideocoach_hide_help_tabs() {\r\n\tglobal $wpvideocoach_help_tabs;\r\n\tif($wpvideocoach_help_tabs == 1){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}", "function GetStatus() {\n if ($this->buttons['lunch_end']) {\n return \"Out to lunch.\";\n }\n if ($this->buttons['work_start']) {\n return \"Not working.\";\n }\n else {\n return \"Working.\";\n }\n }", "public function isAcitve()\n\t{\n\t\treturn $this->status == AdFox::OBJECT_STATUS_ACTIVE;\n\t}", "function isVisible() {\n return ($this->entry->staff_id || $this->entry->user_id)\n && $this->entry->type != 'R' && $this->isEnabled();\n }", "public function getIsActive(): bool;", "public function getIsActive(): bool;", "public function getIsActive(): bool;", "function isActive(){\n\t\treturn $this->getSessionID() == $this->getUser()->getShift() && $this->getStatus() == '1' ? true : false;\n\t}", "public function IsActive()\n {\n return true;\n }", "public function can_activate(): bool;", "public function getTab()\n {\n if ($this->_auth->hasIdentity()) {\n return ' Authorized';\n } else {\n return ' Not Authorized';\n }\n }", "public function hasStatuses()\n\t{\n\t\treturn true;\n\t}", "public function isVisible()\n {\n return $this->attribute('state') != self::STATUS_MODERATED;\n }", "function isVisible() {\n return $this->entry->flags & ThreadEntry::FLAG_EDITED;\n }" ]
[ "0.72131264", "0.72131264", "0.7177188", "0.7177188", "0.7150729", "0.71446264", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.7135569", "0.71110266", "0.6877427", "0.6658162", "0.65853703", "0.6528749", "0.6403075", "0.6379534", "0.63470906", "0.63072574", "0.6289354", "0.6287959", "0.625976", "0.62009346", "0.6194193", "0.6181298", "0.6166758", "0.6147158", "0.61356115", "0.6118964", "0.611005", "0.6107926", "0.60891277", "0.60876185", "0.60874635", "0.6083469", "0.6076619", "0.6070691", "0.6064407", "0.6051804", "0.6040062", "0.6032846", "0.6030648", "0.6025845", "0.6025845", "0.60195255", "0.60188603", "0.60143137", "0.60079414", "0.60079414", "0.60079414", "0.60079414", "0.60079414", "0.60079414", "0.60079414", "0.60079414", "0.60079414", "0.60079414", "0.5996178", "0.59946585", "0.5988141", "0.59877706", "0.5984462", "0.5982189", "0.59766877", "0.5969067", "0.596647", "0.5955334", "0.59459877", "0.59454864", "0.59430414", "0.5931931", "0.5922655", "0.5918526", "0.5918526", "0.5918526", "0.59165514", "0.5912332", "0.5895135", "0.5891786", "0.5889228", "0.5888407", "0.58771944" ]
0.7200399
3
Returns status flag about this tab hidden or not
public function isHidden() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHiddenFlag() {}", "public function isHidden()\n {\n return $this->is_hidden;\n }", "function is_hidden() {\n return $this->hidden;\n }", "function is_hidden() {\n return $this->hidden;\n }", "function is_hidden() {\n return $this->hidden;\n }", "public function getHidden(): bool;", "public function isHidden();", "public function isHidden();", "public function isHidden();", "public function isHidden();", "public function getHidden()\n {\n return isset($this->hidden) ? $this->hidden : false;\n }", "public function getInvisibleFlag() {}", "public function getVisible() {\r\n return $this->bVisible;\r\n }", "public function isHidden(): bool\n {\n return false;\n }", "public function isHidden() {\r\n return false;\r\n }", "public function isHidden() {\r\n return false;\r\n }", "function isHidden()\n {\n return $this->_hidden;\n }", "function isHidden();", "protected function getHidden()\n {\n return $this->hidden;\n }", "public function isHidden() {\n return false;\n }", "public function isHidden(): bool\n {\n return $this->hidden;\n }", "public function isHidden(): bool\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function isHidden()\n {\n return false;\n }", "public function getHidden()\n\t{\n\t\treturn $this->hidden;\n\t}", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function getHidden() {\n\t\treturn $this->hidden;\n\t}", "public function getHidden() {\n\t\treturn $this->hidden;\n\t}", "public function isHidden()\n\t{\n\t\treturn (bool)$this->_hidden;\n\t}", "public function isHidden()\r\n\t{\r\n\t\treturn false;\r\n\t}", "public static function isHidden(): bool\n {\n return !empty(static::HIDDEN);\n }", "public function getOpac_hide()\n {\n return $this->opac_hide;\n }", "public function getHidden(){\n return $this->_hidden;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getIsLabelHidden(): bool;", "public static function isWindowHidden() : bool {}", "public function getInvisible()\n\t{\n\t\treturn $this->invisible;\n\t}", "public function is_inactive(): bool;", "public function getHidden()\n {\n $this->parseDocBlock();\n return $this->hasAnnotation('hidden');\n }", "function is_hidden_status( $user_id ) {\n\t\t$_hide_online_status = get_user_meta( $user_id, '_hide_online_status', true );\n\t\tif ( $_hide_online_status == 1 || ( isset( $_hide_online_status[0] ) && $_hide_online_status[0] == 'no' ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isHidden()\n\t{\n\t\t$hiddenModules = array('servermanager','serverclient','users','groups','modules','postfixadmin');\n\t\treturn in_array($this->name, $hiddenModules);\n\t}", "public function isHidden() {\n\t\tif ($this->displayCondition == null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn !$this->displayCondition->isOk();\n\t}", "public function isHidden() {\n\t\tif ($this->displayCondition == null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn !$this->displayCondition->isOk();\n\t}", "public function is_visible() {\n\t\treturn true;\n\t}", "function wpvideocoach_hide_help_tabs() {\r\n\tglobal $wpvideocoach_help_tabs;\r\n\tif($wpvideocoach_help_tabs == 1){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}", "function is_visible()\n\t{\n\t\treturn $this->visible;\n\t}", "public function isVisible()\n {\n return $this->visible;\n }", "public function isVisible()\n {\n return $this->visible;\n }", "function isVisible() {\n return $this->entry->flags & ThreadEntry::FLAG_EDITED;\n }", "public function isVisible()\n {\n return $this->attribute('state') != self::STATUS_MODERATED;\n }", "public function getVisibility()\n {\n return $this->visibility;\n }", "public function getVisibility()\n {\n return $this->visibility;\n }", "public function getVisibility()\n {\n return $this->visibility;\n }", "function getVisible() { return $this->readVisible(); }", "public function isInvisible(): bool\n {\n return $this->bIsInvisible;\n }", "public function get_visibility()\n {\n }", "function wiki_shown_hidden($post){\n\t\t\n\t\t$status = get_post_meta($post->ID,'wiki-contributons-status',true);\n\t\t\n\t?>\t\n\t\tTo hide the table check the box &nbsp;\n\t\t\n\t\t<input type=\"checkbox\" value=\"hide\" name=\"wiki-tabel-shownorhide\" <?php checked('hide',$status); ?> /> \n\t\n\t<?php\t\n\t}", "public function isInvisible() {\n return !$this->isVisible();\n }", "function getVisible() { return $this->readVisible(); }", "function getVisibility() {\n if($this->visibility === false) {\n $this->visibility = $this->canSeePrivate() ? VISIBILITY_PRIVATE : VISIBILITY_NORMAL;\n } // if\n return $this->visibility;\n }", "public function isVisible() {\n\t\tif ($this->hidden === TRUE) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function is_visible() {\n\t\tif ($this->visibility=='hidden') return false;\n\t\tif ($this->visibility=='visible') return true;\n\t\tif ($this->visibility=='search' && is_search()) return true;\n\t\tif ($this->visibility=='search' && !is_search()) return false;\n\t\tif ($this->visibility=='catalog' && is_search()) return false;\n\t\tif ($this->visibility=='catalog' && !is_search()) return true;\n\t}", "public function isVisible() {\n return ($this->visible && $this->state != \"unavailable\");\n }", "function getVisible() {return $this->readVisible();}", "public function isHidden()\n {\n $isHidden = false;\n if ($this->forumNode()->IsHidden)\n {\n $isHidden = true;\n }\n \n return $isHidden;\n }", "static public function isVisible(): bool\n {\n return static::$visible;\n }", "public function canShowTab()\r\n {\r\n return true;\r\n }", "public function canShowTab()\r\n {\r\n return true;\r\n }", "public function canShowTab()\r\n {\r\n return true;\r\n }", "public function canShowTab() {\r\n return true;\r\n }", "public function canShowTab() {\r\n return true;\r\n }", "public function canShowTab()\n {\n return $this->_getCurrentTheme()->isVirtual() && $this->_getCurrentTheme()->getId();\n }", "public static function hidden()\n {\n return [];\n }" ]
[ "0.71917105", "0.6858247", "0.6856843", "0.6856843", "0.6856843", "0.6804854", "0.6728868", "0.6728868", "0.6728868", "0.6728868", "0.66520506", "0.6642177", "0.66403043", "0.6624169", "0.6620116", "0.6620116", "0.6593707", "0.656507", "0.6564115", "0.65536904", "0.65513283", "0.65513283", "0.6545821", "0.6545821", "0.6545821", "0.6545821", "0.654541", "0.65333", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.6528228", "0.65069103", "0.65069103", "0.65003926", "0.6499182", "0.6392246", "0.6389683", "0.6378243", "0.6241446", "0.6241446", "0.6241446", "0.6241446", "0.6241446", "0.6241446", "0.6228057", "0.62160814", "0.6212712", "0.6197563", "0.61888975", "0.61873484", "0.6156124", "0.6129991", "0.6129991", "0.6125695", "0.6119755", "0.60662156", "0.6047441", "0.6047441", "0.60459995", "0.6044753", "0.6038453", "0.6038453", "0.6038453", "0.6027492", "0.6027379", "0.6004774", "0.5990786", "0.5989835", "0.59859973", "0.5978544", "0.59685427", "0.5956003", "0.58611655", "0.5857035", "0.5832684", "0.5827646", "0.582508", "0.582508", "0.582508", "0.5822307", "0.5822307", "0.5798306", "0.57974297" ]
0.65999854
18
Returns the view that displays list of users present in the organisation.
public function index() { $users = $this->userService->all(session('org_id')); $dbRoles = DB::table('role')->whereNotNull('permissions')->orderBy('role', 'desc')->get(); $roles = []; foreach ($dbRoles as $role) { $roles[$role->id] = $role->role; } return view('lite.users.index', compact('users', 'roles')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $users = $this->userService->getUserWithPaginate();\n return view('admin.user.list', compact('users'));\n }", "public function list() {\n $users = User::orderBy('name')->paginate(10);\n $repository = new Repository(compact('users'));\n \n $layout = Layout::blank([\n Layout::view('vendor.platform.users.list')\n ]);\n \n return $layout->build($repository);\n }", "public function index()\n {\n return view('admin.users.index', ['users' => $this->repository->getSortableListViaPagination()]);\n }", "public function users()\n\t{\n\t\treturn View::make('admin.users')\n\t\t\t\t->with('users', $this->user->all());\n\t}", "public function getUsers()\n\t{\n\t\t$users = User::all();\t\n\t\treturn View::make('admin.users')->with('users',$users );\n\t}", "public function listUsers()\n {\n $users = User::all();\n\n return view('listUsers', ['users' => User::all()]);\n\n }", "public function index()\n {\n $view = view('portal.users.index');\n $view->users = User::paginate(25);\n\n return $view;\n }", "public function index()\n {\n $users = $this->userService::getAll();\n\n return view('admin.pages.users')->with(compact('users'));\n }", "public function index()\n {\n $users = $this->users->with('roles')->get();\n return \\View::make('admin.users.index', [\n 'users' => $users,\n 'title' => 'list',\n ]);\n }", "public function index()\n {\n $users = $this->userRepository->getAllWithPaginate();\n\n return view('admin.users.index', compact('users'));\n }", "public function index()\n {\n return view('admin.users',[\n 'users'=>User::all(),\n 'currentPage'=>'Our Team',\n 'middlePage'=>null,\n 'job_titles'=>JobTitle::all(),\n 'polyvalent'=>PolyvalentToggle::first(),\n ]);\n }", "public function index()\n {\n return view('administration::user.index')\n ->withUsers($this->user->all());\n }", "public function index()\n {\n $pagintaionEnabled = true;\n if ($pagintaionEnabled) {\n $users = User::paginate(config('usersmanagement.paginateListSize'));\n } else {\n $users = User::all();\n }\n $roles = Role::all();\n\n return View('pages.admin.users.show-users', compact('users', 'roles'));\n }", "public function index()\n {\n $users = $this->userRepository->getPaginate();\n \n return view('admin.users.index', compact('users'));\n }", "public function index()\n {\n $this->data['users'] = $this->model->getAllUsers();\n return view('pages.admin.users', $this->data);\n }", "public function listofUser()\n {\n return view('Admin.ShowallUser');\n }", "public function index() {\n\t\t$this->accessible();\n\t\t$users = User::paginate(5);\n\n\t\treturn view('users.list', compact('users'));\n\t}", "public function index(){\n\t\treturn view(Config::get('boxtar.viewUsers'))->with('users', User::latest()->get());\n\t}", "public function index()\n {\n $users = $this->user->all();\n return View::make('RoleManager::users.index', compact('users'));\n }", "public function index()\n {\n $data['users'] = $this->user->all();\n return view('backend.user.list')->with($data);\n }", "public function indexAction()\n {\n $users = UsersDev::find();\n \n $this->view->setVars(\n [\n 'users' => $users,\n ]\n );\n return $this->view;\n }", "public function index() {\n $rows = AdminUser::paginate(10);\n return View::make(\"CoreCms::user.listing\")->with(\"models\", $rows);\n }", "public function index()\n {\n $users = $this->model->all();\n return view('admin/users/user', compact('users'));\n }", "public function index()\n {\n $users = User::all()->map->only(['id', 'name', 'email', 'created_at']);\n\n return View::component('Users', ['users' => $users]);\n }", "public function index()\n {\n $content = [\n 'users' => User::all()\n ];\n\n return view('admin.users.view', $content);\n }", "public function showUsers()\r\n\t{\r\n\t\t$users = User::paginate(10);\r\n\r\n\t\treturn view('admin/users', compact('users'));\r\n\t}", "public function showUsers()\n {\n $title = 'Usuários';\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n $users = $this->repository->all();\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'data' => $users,\n ]);\n }\n\n return view('users.list-users', compact('title', 'users'));\n }", "public function index()\n {\n $result = $this->usersService->index();\n\n return view('index', ['items' => $result['users'], 'roles' => $result['roles'], 'links' => true]);\n }", "public function index()\n {\n $users = Base::user()->paginate();\n\n return view('admin::auth.users.index')->with(compact('users'));\n }", "public function index()\n\t{\n $users = User::\n select(DB::raw('users.id, users.username, users.email'))\n ->leftJoin('assigned_roles', 'users.id', '=', 'assigned_roles.id')\n ->groupBy('users.id')\n ->paginate(5);\n\t\treturn View::make('users.index')\n ->with('users', $users);\n\t}", "public function listUsers() {\n \t$data['users'] = User::all();\n \treturn view('backend.users.index', $data);\n }", "public function showUsers()\n {\n $userRepo = $this->getDoctrine()->getRepository(User::class);\n $users = $userRepo->getUsersOrderByAsc();\n\n return $this->render('admin/list-of-users.html.twig', [\n 'users' => $users\n ]);\n }", "public function indexAction()\n {\n // Get a query of listing all users from user service\n $pages = $this->get('app.user.service')->getUsers();\n \n // Get pagination\n $pagination = $this->get('app.service')->paginate($pages);\n \n // Render and return the view\n return $this->render(\n '::admin/user/users.html.twig',\n array(\n 'pagination' => $pagination\n )\n );\n }", "public function index()\n {\n\n $users = $this->user->paginate(10);\n\n return view('admin.users.index', compact('users'));\n }", "public function getAllUsers() {\n self::isAdmin404();\n\n $users = User::get();\n\n return view('users', ['users' => $users]);\n }", "public function index()\n {\n $users = $this->userRepo->getDataPaginate($this->limit);\n\n return view('admin.user.index', compact('users'));\n }", "public function showUsers() { \n\t\n return View('admin.users');\n\t\t\t\n }", "public function index()\n {\n $users = User::order('created_at')->get();\n\n return view('users.list', compact('users'))->with(['mainmenu' => $this->mainmenu, 'submenu' => $this->submenu]);\n }", "public function index() \n {\n $users = $this->userRepo->listUser();\n return view('backend.pages.user.list', compact('users'));\n }", "public function index()\n {\n $title = 'Usuários';\n\n $users = $this->_user->paginate($this->_totalPage);\n\n return view('panel.users.index', compact('title', 'users'));\n }", "public function index()\n {\n $users = $this->usersRepo->paginate();\n return view('CMS::users.index', compact('users'));\n }", "public function listUsers()\n {\n $users = $this->apiHeaderNav();\n return view('user.userListAll',['data'=>$users]);\n }", "public function index()\n {\n $users = $this->user->get();\n $roles = Role::all();\n\n return view('chuckcms::backend.users.index', compact('users', 'roles'));\n }", "public function index()\n\t{\n\t\treturn view('users')->with('users', User::All());\n\t}", "public function index()\n {\n $users = Auth::user()->company->users;\n return view('dashboard.users.index', compact('users'));\n }", "public function index()\n {\n //\n $_users = User::all();\n return view('admin.users.list', ['users' => $_users ]);\n }", "public function index()\n {\n $this->authorize('viewAny', User::class);\n $users = User::paginate(40);\n return view('admin.users.index', compact('users'));\n }", "public function index()\n {\n $client = new Client($this->data);\n\n $response = $client->get('users');\n\n $body = $response->getBody();\n\n $users = json_decode($body);\n\n return view('users.list')->with(compact('users'));\n }", "public function index()\n {\n $this -> checkAllowAccess('view_user');\n $view['add_user']=$this -> checkAllowAccessWithoutException('edit_user') && ModuleAvailabilityService ::availabilityCount('User');\n $users = User ::nonDevelopers() -> orderBy('name') -> get();\n $roles = Role ::get();\n foreach($users as $user) {\n $roleArray = [];\n foreach($user -> roles as $userRole)\n array_push($roleArray, $userRole -> id);\n foreach($roles as $role) {\n $user[$role -> name] = 0;\n if(in_array($role -> id, $roleArray))\n $user[$role -> name] = 1;\n }\n }\n $userCounterparties = User ::nonDevelopers() -> with('counterparties') -> where(['active_status' => 1, 'verified' => 1]) -> orderBy('name') -> get();\n $counterparties = Counterparty ::entity() -> orderBy('short_name') -> get();\n foreach($userCounterparties as $user) {\n $counterpartyArray = [];\n foreach($user -> counterparties as $userCounterparty)\n array_push($counterpartyArray, $userCounterparty -> id);\n foreach($counterparties as $counterparty) {\n $user[$counterparty -> short_name] = 0;\n if(in_array($counterparty -> id, $counterpartyArray))\n $user[$counterparty -> short_name] = 1;\n }\n\n }\n return view('User.users.index', compact('users', 'roles', 'counterparties', 'userCounterparties','view'));\n }", "public function index()\n {\n $users = User::all();\n return view('users.userslist')->withUsers($users);\n }", "public function index()\n {\n return view(\"users.users\")->with([\"read_users\"=>User::all()->where('company_id',\\Auth::user()->company_id),'title'=>\"List of users\"]);\n }", "public function _list()\n\t{\n\t\t_root::getRequest()->setAction('list');\n\t\t$tUsers = model_user::getInstance()->findAll();\n\n\t\t$oView = new _view('users::list');\n\t\t$oView->tUsers = $tUsers;\n\t\t$oView->showGroup = true;\n\t\t$oView->title = 'Tous les utilisateurs';\n\n\t\t$this->oLayout->add('work', $oView);\n\t}", "public function index()\n {\n $users = User::paginate();\n\n return view('automotores.usuarios.index', compact('users'));\n }", "public function index()\n {\n $users = User::with('roles')->get();\n \n return view('panel.user.index', compact('users'));\n }", "public function index()\n {\n\n $usersList = User::all();\n\n return view('dash.users')->with( compact('usersList') );\n }", "public function index()\n {\n $users = $this->userRepository->all();\n\n return view('users.index', compact('users'));\n }", "public function index()\n {\n $this->user->pushCriteria(new UserOrderCriteria());\n $users = $this->user->all();\n\n return view('user::backend.users.index', compact('users', 'currentUser'));\n }", "public function index()\n {\n \n return view('users.users_list');\n }", "public function showListAction() {\n $users = $this->getDoctrine()\n ->getRepository(User::class)\n ->findAll();\n return $this->render(':Security\\User:users.html.twig', [\n 'users' => $users\n ]);\n }", "public function index()\n {\n $users = \\App\\User::paginate(20);\n\n return view('admin.users', ['users' => $users]);\n }", "public function users ()\n {\n return view('admin.users');\n }", "public function index()\n\t{\n\t\t$searchKeyword = Input::get('q', '');\n\t\t$searchRoles = Input::get('roles', array());\n\n\t\t// Get Users (with roles) and limit it to only 30 results for\n\t\t// pagination. Don't you just love it when pagination simply works.\n\t\t$eloquent = App::make('orchestra.user')->search($searchKeyword, $searchRoles)->paginate();\n\t\t$roles = App::make('orchestra.role')->lists('name', 'id');\n\n\t\t// Build users table HTML using a schema liked code structure.\n\t\t$table = $this->presenter->table($eloquent);\n\n\t\tEvent::fire('orchestra.list: users', array($eloquent, $table));\n\n\t\t// Once all event listening to `orchestra.list: users` is executed,\n\t\t// we can add we can now add the final column, edit and delete \n\t\t// action for users.\n\t\t$this->presenter->actions($table);\n\n\t\tSite::set('title', trans('orchestra/foundation::title.users.list'));\n\n\t\treturn View::make('orchestra/foundation::users.index', array(\n\t\t\t'eloquent' => $eloquent,\n\t\t\t'roles' => $roles, \n\t\t\t'searchKeyword' => $searchKeyword,\n\t\t\t'searchRoles' => $searchRoles,\n\t\t\t'table' => $table, \n\t\t));\n\t}", "public function index()\n {\n $users = $this->user->getUserList();\n return view('home')->with('users', $users);\n }", "public function listAction()\n {\n return new ViewModel([\n 'users' => $this->table->fetchAll(),\n ]);\n }", "public function index()\n {\n $this->checkAdmin();\n $users = $this->userRepository->getPaginate(parent::$nbrPerPage);\n $links = $users->setPath('')->render();\n\n return view('users/index', compact('users', 'links'));\n }", "public function index()\n {\n $users = $this->userRepository->getPaginate($this->nbrPerPage);\n $links = $users->render();\n\n return view('users.index', compact('users','links'));\n }", "public function index()\n {\n $users = User::paginate();\n return view('manage.users.index')->withUsers($users);\n }", "public function listUsers()\n {\n try {\n $data['users'] = User::join('user_roles', 'users.id', '=', 'user_roles.user_id')->select('users.*')->where('user_roles.role_id', 3)->get();\n $data['active'] = 'users';\n return view('UserGroup.list_users', $data);\n } catch(\\Exception $e) {\n Log::error(\"Error in listUsers on UserController \". $e->getMessage());\n return back()->with('error', 'Oops! Something went wrong.');\n }\n }", "public function index()\n\t{\n\t\t$users = $this->user->active()->paginate(10);\n\n\t\treturn $this->view->make('users.index', compact('users'));\n\t}", "public function index()\n {\n $users = $this->users->sortable(['created_at' => 'desc'])->paginate(10);\n\n return view('admin.users.index', ['users' => $users]);\n }", "public function index()\n {\n $users = $this->users->sortable(['created_at' => 'desc'])->paginate(10);\n\n return view('admin.users.index', ['users' => $users]);\n }", "public function index()\n {\n $users = $this->model->paginate();\n return view('menu-maker::users.index', compact('users'));\n }", "public function index()\n {\n $users = User::all();\n //show the users list, mostly advanced users\n return view('users.index')->with('users', $users);\n }", "public function user_list()\n {\n \n \t$users = User::all();\n\n $data = array('users' => $users);\n\n return view('manage.user_list')->with($data);;\n }", "public function index()\n {\n $users = $this->user->all();\n\n return view('users.index', compact('users'));\n }", "public function list()\n {\n $listUsers = AppUser::findAll();\n $this->show('back/user/list', [\"users\" => $listUsers]);\n }", "public function listUser()\n {\n $user = User::where('id', '=', 1)->first();\n return view('listUser', [\n 'user' => $user\n ]);\n }", "public function index()\n {\n $users = User::sortable()->orderBy('created_at', 'desc')->paginate(config('paginate.number_users'));\n return view('admin.pages.users.index', compact('users'));\n }", "public function users() {\n $data = ['title' => 'Available Users'];\n return view('pages.admin.users', $data)->with([\n 'users' => $this->users\n ]);\n }", "public function index()\n {\n $userdata = User::all()->toArray();\n \n return view('admins.userlist',compact('userdata'));\n }", "public function index()\n {\n $users = $this->user->all();\n\n return view('users.index')->with('users', $users);\n }", "public function index()\n {\n\n if (! Access::userAuthorized(['Super Admin'])) {\n App::abort(403, 'Unauthorized action.');\n }\n\n $users = $this->users->all();\n $roles = $this->roles->allWithoutExclusions();\n\n return View::make('users.index', ['users' => $users, 'roles' => $roles]);\n }", "public function users()\r\n {\r\n return view('admin.users');\r\n }", "public function index()\n {\n $users = $this->repository->getUsers();\n $role = $this->roleRepo->getRoles();\n\n return view('admin.users.index', compact('users','role'));\n }", "public function index()\n {\n $title = 'Usuarios';\n\n $users = $this->user->paginate($this->totalPage);\n\n return view('panel.users.index', compact('title','users'));\n \n }", "public function index()\n\t{\n\t\t$countrow = User::get()->count();\n\t\t$users = User::with('roles')->paginate($countrow);\n\n\t\treturn View::make('users.index', compact('users'));\n\t}", "public function users(){\n $users = User::paginate(10);\n return View('admin.users', compact('users'));\n }", "public function index()\n {\n $users = User::All();\n\n return view('userview.user')->with('users', $users);\n }", "public function index()\n {\n // Get all users\n $users = User::paginate(5);\n $objNav = new Navigation;\n $nav = $objNav->getParent();\n return View::make('admin.manage_user.index', ['users' => $users], ['nav' => $nav]);\n }", "public function index()\n {\n $client = new Client($this->data);\n\n $response = $client->get('user');\n\n $body = $response->getBody();\n\n $users = json_decode($body);\n\n return view('user.list')->with(compact('users'));\n }", "public function index()\n {\n return view('backend.user.list_user');\n }", "public function index()\n {\n $users = User::allowed()->get();\n return view('admin.users.index',compact('users'));\n }", "public function index()\n {\n $users = User::all();\n return view('users.usersList', compact('users'));\n\n }", "public function index()\n {\n $users = User::latest()->select('username', 'email')->paginate(10);\n\n return view('admin.users.index', compact('users'));\n }", "public function index()\n {\n $usuarios = User::simplePaginate(10);\n return view('admin.usuarios', compact(\"usuarios\"));\n }", "public function index()\n {\n $this->authorize('index', User::class);\n return view('theme.backoffice.pages.user.index', [\n 'users' => auth()->user()->visible_users()\n ]);\n }", "public function index()\n {\n // user search\n\n $name = $this->request->name;\n $email = $this->request->email;\n\n $users = new User;\n\n if (!empty($name)) {\n \t$users = $users->name($name);\n }\n\n if (!empty($email)) {\n \t$users = $users->email($email);\n }\n\n $users = $users->paginate(5);\n\n return view('admin.users.index',compact('users'));\n }", "public function index()\n {\n $users = User::get();\n return view('users',compact('users'));\n }", "function view() \n {\n $api = new Module_UserManagement_API();\n\n /* TODO: Check if administrator */\n $users = $api->getUsers();\n $view = Core_View::factory('users');\n\n $view->users = $users;\n echo $view->render();\n }", "public function index()\n {\n $users = $this->cache->get('sm-users');\n\n return view(\"{$this->adminPath}.users.index\", compact('users'));\n }", "public function index()\n {\n return view('admin.users.index')->with('users', User::all());\n }" ]
[ "0.7630778", "0.7630725", "0.7535559", "0.74612916", "0.743326", "0.7425221", "0.7424249", "0.74077857", "0.7406706", "0.7399565", "0.7389657", "0.73824614", "0.73771065", "0.73644125", "0.73339576", "0.7325637", "0.7321465", "0.73177254", "0.7317648", "0.7315963", "0.73067814", "0.7305882", "0.7292508", "0.7291993", "0.72902554", "0.7285413", "0.72791517", "0.7278202", "0.7276854", "0.7270747", "0.72700286", "0.72698766", "0.7269077", "0.7257292", "0.7255977", "0.72552896", "0.725342", "0.7247395", "0.7242407", "0.72401905", "0.72399044", "0.723501", "0.722927", "0.7229096", "0.72250783", "0.7221018", "0.7215885", "0.7211253", "0.7208918", "0.72067666", "0.7202939", "0.7200885", "0.71939886", "0.71912414", "0.7189267", "0.71886337", "0.71856695", "0.7182015", "0.71819764", "0.7169469", "0.7168926", "0.716532", "0.7163633", "0.7157478", "0.71568155", "0.7154039", "0.71473515", "0.71453893", "0.7144598", "0.7143813", "0.7143813", "0.713983", "0.7137536", "0.7136299", "0.713594", "0.71349555", "0.7130523", "0.7125489", "0.7124427", "0.71234757", "0.7122525", "0.71196586", "0.71164525", "0.71152365", "0.71136683", "0.7110981", "0.7110561", "0.7101871", "0.7095586", "0.7094892", "0.70845026", "0.7077896", "0.7076618", "0.7074979", "0.70746773", "0.7071068", "0.70687884", "0.7068325", "0.70661235", "0.706435", "0.7062055" ]
0.0
-1
Return form to create the user.
public function create() { $form = $this->userForm->form(); $organizationIdentifier = auth()->user()->organization->user_identifier; return view('lite.users.create', compact('form', 'organizationIdentifier')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n $this->generateParams();\n return view('backend.pages.user._form', compact('gender', 'type', 'city'));\n }", "public function create()\n {\n return view(\"users.usersform\");\n }", "public function create()\n {\n return view('users.form', ['user' => new User]);\n }", "public function showUserCreationForm()\n {\n return view('admin.user_create');\n }", "public function create() // abre un formulario de creacion\n {\n \n return view('user.create');\n }", "public function create()\n {\n return view('users.form');\n }", "public function create()\n {\n return view('users.form');\n }", "public function create()\n {\n return view('admin.adminuser.userForm', [\n\t\t\t'bdb'\t=> [['name'=>'后台用户管理'], ['name'=>'添加用户'],], \n\t\t\t'roles'\t=> Role::all(),\n\t\t\t]);\n }", "public function create()\n {\n $this->authorize('create', User::class);\n return view('user.form')->with('user', new User())->with('roles', UserRole::getRoleList());\n }", "public function formUserCreate(){\n // Access-controlled resource\n if (!$this->_app->user->checkAccess('create_account')){\n $this->_app->notFound();\n }\n \n $get = $this->_app->request->get();\n \n if (isset($get['render']))\n $render = $get['render'];\n else\n $render = \"modal\";\n \n // Get a list of all groups\n $groups = GroupLoader::fetchAll();\n \n // Get a list of all locales\n $locale_list = $this->_app->site->getLocales();\n \n // Get default primary group (is_default = GROUP_DEFAULT_PRIMARY)\n $primary_group = GroupLoader::fetch(GROUP_DEFAULT_PRIMARY, \"is_default\");\n \n // Get the default groups\n $default_groups = GroupLoader::fetchAll(GROUP_DEFAULT, \"is_default\");\n \n // Set default groups, including default primary group\n foreach ($groups as $group_id => $group){\n $group_list[$group_id] = $group->export();\n if (isset($default_groups[$group_id]) || $group_id == $primary_group->id)\n $group_list[$group_id]['member'] = true;\n else\n $group_list[$group_id]['member'] = false;\n }\n \n $data['primary_group_id'] = $primary_group->id;\n // Set default title for new users\n $data['title'] = $primary_group->new_user_title;\n // Set default locale\n $data['locale'] = $this->_app->site->default_locale;\n \n // Create a dummy user to prepopulate fields\n $target_user = new User($data); \n \n if ($render == \"modal\")\n $template = \"components/user-info-modal.html\";\n else\n $template = \"components/user-info-panel.html\";\n \n // Determine authorized fields for those that have default values. Don't hide any fields\n $fields = ['title', 'locale', 'groups', 'primary_group_id'];\n $show_fields = [];\n $disabled_fields = [];\n $hidden_fields = [];\n foreach ($fields as $field){\n if ($this->_app->user->checkAccess(\"update_account_setting\", [\"user\" => $target_user, \"property\" => $field]))\n $show_fields[] = $field;\n else\n $disabled_fields[] = $field;\n } \n \n // Load validator rules\n $schema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-create.json\");\n $validators = new \\Fortress\\ClientSideValidator($schema, $this->_app->translator); \n \n $this->_app->render($template, [\n \"box_id\" => $get['box_id'],\n \"box_title\" => \"Create User\",\n \"submit_button\" => \"Create user\",\n \"form_action\" => $this->_app->site->uri['public'] . \"/users\",\n \"target_user\" => $target_user,\n \"groups\" => $group_list,\n \"locales\" => $locale_list,\n \"fields\" => [\n \"disabled\" => $disabled_fields,\n \"hidden\" => $hidden_fields\n ],\n \"buttons\" => [\n \"hidden\" => [\n \"edit\", \"enable\", \"delete\", \"activate\"\n ]\n ],\n \"validators\" => $validators->formValidationRulesJson()\n ]); \n }", "public function create()\n {\n return view('webcontrol.user.add');\n }", "public function create()\n\t{\n\t\t$eloquent = App::make('orchestra.user');\n\t\t$form = $this->presenter->form($eloquent, 'create');\n\n\t\t$this->fireEvent('form', array($eloquent, $form));\n\t\tSite::set('title', trans('orchestra/foundation::title.users.create'));\n\n\t\treturn View::make('orchestra/foundation::users.edit', compact('eloquent', 'form'));\n\t}", "public function create()\n {\n // show form create user \n return view('user.create');\n }", "public function create()\n {\n return view('administration::user.create');\n }", "public function create()\n {\n return view(\"backend.user.create\");\n }", "public function create()\n {\n //return view ('admin.user-table.new-user-form');\n }", "public function actionCreate()\n {\n $model = new UserForm();\n $model->setScenario('create');\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n if (Yii::$app->request->isGet) {\n $model->status = User::STATUS_ACTIVE;\n $model->roles = User::ROLE_USER;\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'roles' => ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name')\n ]);\n }", "public function create()\n {\n return view('sys_user.create');\n }", "public function create()\n\t{\n\t\treturn view('admin.createuser');\n\t}", "public function create()\n {\n return view('backend.pages.user.create-user');\n }", "public function create()//mostra formulário de criação de usuários\n {\n $form = \\FormBuilder::create(UserForm::class,[\n 'url' => route('admin.users.store'),\n 'method' => 'POST'\n ]); //classe de formulario, url de ação do formulario e método http\n\n return view('admin.users.create', compact('form'));\n }", "public function create()\n {\n Gate::authorize('app.users.create');\n\n $roles = Role::getForSelect();\n return view('layouts.backend.users.form', [\n 'roles'=> $roles,\n ]);\n }", "public function create () {\n return view('backend.user.create');\n }", "public function create()\n {\n $User = User::get();\n view()->share('elements', $User);\n\n $UserRoles = UserRoles::get();\n view()->share('UserRoles', $UserRoles);\n\n return view('users.form');\n }", "public function create()\n {\n return view(\"user.create\");\n }", "public function create() {\n // TODO: Admin Policy\n return view('auth.user_add');\n }", "public function create()\n {\n return view('backend.user.create');\n }", "public function create()\n {\n return view('backend.user.create');\n }", "public function create()\n {\n return view('backend.user.create');\n }", "public function create()\n {\n return view('backend.user.create');\n }", "public function create()\n\t{\n\t\treturn view('admin.user.create');\n\t}", "public function create()\n {\n return view('add_user');\n //\n }", "public function create()\n {\n return $this->renderOutputAdmin(\"users.form\", [\n \"route\" => route(\"admin.users.store\")\n ]);\n }", "function create() {\n return view('admin.user.create');\n }", "public function create()\n\t{\n\t\treturn view('kagi::users.create');\n\t}", "public function create()\n {\n return view('user.create', [\n 'action' => route('user.store'),\n 'method' => 'post'\n ]);\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function newUserAction()\n {\n $user = new User();\n\n $form = $this->createForm(UserType::class, $user);\n\n return $this->render('GrtResBundle:User:form.html.twig', array(\n 'form' => $form->createView()\n ));\n }", "public function create() {\n return view('admin.user.create');\n }", "public function create()\n {\n return view('admin.user.create');\n }", "public function create()\r\n {\r\n return view('admin.user.create');\r\n }", "public function create()\n {\n return view('admin.create-user');\n }", "public function create()\n {\n return view('admin.page.user.create');\n }", "public function create()\n {\n return view('Admin.user.useradd');\n }", "public function create()\n {\n return view('user::create');\n }", "public function create()\n {\n return view('user::create');\n }", "public function create()\n {\n return view('user::create');\n }", "public function create()\n {\n return view('pages.admin.user.create');\n }", "public function create()\n {\n return view('pages.admin.user.create');\n }", "public function create()\n {\n return view('pages.admin.user.create');\n }", "public function create()\n {\n\treturn view('user.createuser');\n }", "public function create() {\n return View::make('user.create');\n }", "public function create()\n {\n return view('admin.user.user-add');\n }", "public function create()\n {\n return view('codeeduuser::users.create');\n }", "public function create()\n {\n return view('admin.user.create');\n }", "public function create()\n {\n return view('admin.user.create');\n }", "public function create()\n {\n return view('admin.user.create');\n }", "public function create()\n {\n return view('admin.user.create');\n }", "public function create()\n {\n return view('admin.user.create');\n }", "public function create()\n {\n return view('user_create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n $roles = Role::all();\n\n $title = __('Crear Usuario');\n $user = new User;\n return view('user.form', compact('user', 'title','roles'));\n }", "public function create()\n {\n return view('admin::auth.users.create');\n }", "public function create()\n {\n //Create User Page\n return view('admin.user.create');\n }", "public function create()\n {\n \t $this->pass_data['page_heading'] = \"Add User\";\n return view('backend.user.create', $this->pass_data);\n }", "public function create()\n {\n //\n return view('admin.user.create');\n }", "public function create()\n {\n return View::make('admin.user.create');\n }", "public function create() {\n return view('admin/user.create');\n }", "public function create()\n {\n return view('users.create_user');\n }", "public function create()\n {\n return view(\"backend.users.create\");\n }", "public function create()\n {\n \n return view('user.create') ;\n }", "public function create()\n {\n return view('admin-master.user.input');\n }", "public function create()\n\t{\n\t\t\n\t\t\treturn view('user/create');\n\t}", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('user.create');\n }", "public function create()\n {\n return view('backend::users.create');\n }", "public function create()\n {\n // dd( $user->roles );\n $form[ 'formUrl' ] = url('users');\n $form[ 'formMethod' ] = 'post';\n $form[ 'blank' ] = 'blank';\n $formFields = User::getFormData( );\n unset( $formFields['_password'] );\n unset( $formFields['_password_confirmation'] );\n $form[ 'content' ] = view('layouts.templates.forms.form_fields', [ 'formFields' => $formFields ] );\n $form = view('layouts.templates.forms.form', $form );\n \n $this->data[ 'contents' ] = $form ;\n\n $this->data[ 'message_alert' ] = Session::get('message');\n $this->data[ 'page_title' ] = 'User management';\n $this->data[ 'header' ] = 'Tambah User';\n $this->data[ 'sub_header' ] = '';\n return $this->render( );\n }", "public function create()\n\t{\n\t\treturn view('backend.users.create');\n\t}", "protected function form()\n {\n return Admin::form(User::class, function (Form $form) {\n\n $form->display('id', '序号');\n $form->select('role', '用户类型')->options(User::getRoleDisplayMap());\n $form->display('created_at', '创建时间');\n $form->display('updated_at', '更新时间');\n });\n }", "public function create()\n {\n return view('users.newUser');\n }", "public function create()\n {\n return view('CMS::users.create');\n }", "public function create()\n {\n return view('admin.user.add');\n }" ]
[ "0.81066155", "0.80927336", "0.80706894", "0.8062279", "0.80217445", "0.79997617", "0.79997617", "0.7983612", "0.7973048", "0.7965198", "0.79638153", "0.79063886", "0.78895026", "0.7870233", "0.7829156", "0.782604", "0.77807796", "0.7773937", "0.7770224", "0.776783", "0.77614", "0.7760714", "0.7744568", "0.7740188", "0.773783", "0.7732102", "0.771384", "0.771384", "0.771384", "0.771384", "0.7707904", "0.7690442", "0.76821357", "0.76788014", "0.7676024", "0.7665977", "0.76630366", "0.76629037", "0.76496416", "0.76396435", "0.76334536", "0.7633337", "0.76317596", "0.7627307", "0.76205456", "0.76205456", "0.76205456", "0.762033", "0.762033", "0.762033", "0.76191354", "0.7617813", "0.76162267", "0.76131964", "0.76053435", "0.76053435", "0.76053435", "0.76053435", "0.76053435", "0.7596616", "0.75954115", "0.7583814", "0.75766706", "0.75760853", "0.7575588", "0.7572483", "0.7570724", "0.7569212", "0.75684756", "0.7566814", "0.7565867", "0.7565593", "0.7562941", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.7553839", "0.75505465", "0.75497013", "0.75421387", "0.75352085", "0.7532296", "0.7522771", "0.7521663" ]
0.7664946
36
Stores user details in the database.
public function store(Request $request) { if (!$this->validation->passes($request->all(), self::ENTITY, session('version'))) { return redirect()->back()->with('errors', $this->validation->errors())->withInput($request->all()); } if ($this->userService->save($request->except(['_token', 'password_confirmation']))) { return redirect()->route('lite.users.index')->withResponse(['type' => 'success', 'code' => ['created', ['name' => trans('lite/global.user')]]]); } return redirect()->back()->withResponse(['type' => 'danger', 'code' => ['save_failed', ['name' => trans('lite/global.user')]]]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n {\n // Save post data in $user var\n $user = $_POST;\n \n // Create a password, set created_by ID and set the date of creation\n $user['password'] = password_hash('Gorilla1!', PASSWORD_DEFAULT);\n $user['created_by'] = Helper::getUserIdFromSession();\n $user['created'] = date('Y-m-d H:i:s');\n\n // Save the record to the database\n UserModel::load()->store($user);\n }", "public function store()\n\t{\n\t\t$user = $this->user->store( Input::all() );\n\t}", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'username' => $this->username,\n 'password_hash' => $this->password_hash,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'user_type' => $this->user_type,\n 'bio' => $this->bio,\n 'creation_date' => $this->creation_date,\n 'gender' => $this->gender,\n 'color' => $this->color\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save()\n {\n if ($this->uid)\n {\n $query = sprintf('UPDATE %sUSER SET USERNAME = \"%s\", ' .\n 'PASSWORD = \"%s\", EMAIL_ADDR = \"%s\", IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive,\n $this->userId);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO %sUSER (USERNAME, PASSWORD, ' .\n 'EMAIL_ADDR, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", %d)',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->uid = mysql_insert_id($GLOBALS['DB']);\n }\n }", "public function store()\n {\n $attributes = request()->validate([\n 'name' => 'required|max:255',\n 'username' => 'required|unique:users,username',\n 'email' => 'required|email|max:255|unique:users,email',\n 'password' => 'required',\n ]);\n $user = User::create($attributes);\n\n // Auth facades\n auth()->login($user);\n }", "public function save()\n {\n if ($this->id)\n {\n $query = sprintf('UPDATE USERS SET USERNAME = \"%s\", ' .\n 'PASSWORD = \"%s\", EMAIL_ADDR = \"%s\", FIRST_NAME = \"%s\", LAST_NAME = \"%s\", IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n mysql_real_escape_string($this->firstName, $GLOBALS['DB']),\n mysql_real_escape_string($this->lastName, $GLOBALS['DB']),\n $this->isActive,\n $this->id);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO USERS (USERNAME, PASSWORD, ' .\n 'EMAIL_ADDR, FIRST_NAME, LAST_NAME, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", %d)',\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n mysql_real_escape_string($this->firstName, $GLOBALS['DB']),\n mysql_real_escape_string($this->lastName, $GLOBALS['DB']),\n $this->isActive);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->id = mysql_insert_id($GLOBALS['DB']);\n }\n }", "function save() {\n $conn = \\DB\\getConnection();\n\n $query = sprintf(\"INSERT INTO Payments (uid, typeid, token, amount)\n VALUES (%u, %u, '%s', %f)\",\n $this->uid, $this->typeid, $conn->escape_string($this->token), $this->amount);\n\n \n\n $result = $conn->query($query);\n\n // If this is a newly created user, then update the id with the\n // newly created one\n if (!isset($this->id)) {\n $this->id = $result->insert_id;\n }\n }", "public function saveUser()\n {\n $connection = \\Yii::$app->db;\n $command = $connection->createCommand()\n ->update('users', [\n 'name' => $this->name,\n 'email' => $this->email,\n ], 'id='.$this->id);\n $command->execute();\n }", "public function store()\n\t{\n\t\t// Validate the form input\n\t\t$this->userUpdateForm->validate(Input::all());\n\n\t\textract(Input::only('username', 'email', 'password', 'first_name', 'last_name'));\n\n\t\t$user = $this->execute(\n\t\t\tnew RegisterUserCommand($username, $email, $password, $first_name, $last_name)\n\t\t);\n\n\t\tFlash::success($user->username . ' was successfully created');\n\t\treturn Redirect::back();\n\t}", "public function save()\n {\n $this->validate();\n $this->user->save();\n\n $this->toast('Your information has been updated!', 'success');\n }", "public function saveToDatabase() {\n if($this->id != 0) {\n $dbResult = System::database()->query('update :table_users \n set `role_id` = :role_id, \n `login` = :login, \n `password` = :password, \n `auth_key` = :auth_key, \n `auth_expire` = :auth_expire, \n `last_login` = :last_login\n where `id` = :id');\n \n $dbResult->bindInt(':id', $this->id);\n $dbResult->bindValue(':auth_key', $this->authKey);\n $dbResult->bindInt(':auth_expire', $this->authExpired);\n $dbResult->bindInt(':last_login', $this->lastLoginTime);\n } else {\n $dbResult = System::database()->query('insert into :table_users (`role_id`, `login`, `password`)\n values (:role_id, :login, :password);');\n }\n $dbResult->bindTable(':table_users', TABLE_USERS);\n $dbResult->bindInt(':role_id', $this->role['id']);\n $dbResult->bindValue(':login', $this->login);\n $dbResult->bindValue(':password', $this->password);\n\n $dbResult->execute();\n }", "public function store()\n\t {\n\t\t User::register([\n\t\t\t\t'username' => 'Jefdsasfrey',\n\t\t\t\t'email' => '[email protected]',\n\t\t\t\t'password' => bcrypt('pass')\n\t\t ]);\n\n\t\t // send them a welcome email\n\n\t\t // monitor campaign for newsletter\n\n\t\t // Schedule a follow up email\n\n\t\t // update stats \n\t }", "public function store()\n\t{\n\t\t// save the new user\n\t\t// TODO : limit the admin to 3 accounts only\n\t\t$this->user->create(array(\n\t\t\t\t\t\t\t\t\t'user_username' =>\tInput::get('user_username'),\n\t\t\t\t\t\t\t\t\t'user_password_md5' => \tmd5(Input::get('user_password')),\n\t\t\t\t\t\t\t\t\t'password' => \tHash::make(Input::get('user_password')),\n\t\t\t\t\t\t\t\t\t'user_role' \t=>\tInput::get('user_role')\n\t\t\t\t\t\t\t));\n\n\t\t$users = $this->user->all();\n\t\treturn Redirect::to('settings/system-users')\n\t\t\t\t\t\t->with('users',$users)\n\t\t\t\t\t\t->with('flash_msg','User has been successfully created !');\n\t}", "public static function store()\n {\n $user = User::getUser(Authentication::$user_email);\n Tutor::create_tutor($user->getEmail(), '', 0);\n }", "public function saveUser()\n {\n $this->_initUser();\n\n $this->generateSecurePassword();\n\n return $this->save(\n [\n 'username' => $this->username,\n 'password' => $this->password,\n 'salt' => $this->_salt,\n 'email' => $this->email,\n 'name' => $this->name,\n 'lastname' => $this->lastname,\n 'sw_active' => 1\n ], true\n );\n }", "public function store() \n\t{\n\t\t$input = Input::all();\n\t\t$validation = $this->validator->on('create')->with($input);\n\n\t\tif ($validation->fails())\n\t\t{\n\t\t\treturn Redirect::to(handles(\"orchestra::users/create\"))\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->withErrors($validation);\n\t\t}\n\n\t\t$user = App::make('orchestra.user');\n\t\t$user->status = User::UNVERIFIED;\n\t\t$user->password = $input['password'];\n\n\t\t$this->saving($user, $input, 'create');\n\n\t\treturn Redirect::to(handles('orchestra::users'));\n\t}", "public function store()\n {\n // Validate form\n $validator = User::registrationValidation();\n $this->validate(request(), $validator);\n\n // Register user\n $registrationParams = User::registrationParams();\n $user = User::create(request($registrationParams));\n\n // Log in user\n User::loginUser($user);\n\n // Redirect to home page\n return redirect('/');\n }", "public function save_user()\n\t{\n $user= new Users();\n $user->setNom($_POST['nom']);\n $user->setPrenom($_POST['prenom']);\n $user->setDate_naissance($_POST['date_naiss']);\n $user->setEmail($_POST['mail']);\n $user->setPassword($_POST['pwd']); \n\n $user->Create_user();\n\t}", "public function save() {\n $db = Db::instance();\n // omit id \n $db_properties = array(\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'description' => $this->description,\n 'user' => $this->user,\n 'password' => $this->password,\n 'image' => $this->image,\n 'gender' => $this->gender,\n 'topic_id' => $this->topic_id,\n 'topic_id1' => $this->topic_id1,\n 'role_id' => $this->role_id,\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function store()\n {\n request()->validate([\n 'first_name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'phone' => 'required|numeric|digits:10|unique:users',\n 'password' => 'required|string|min:8|confirmed',\n ]);\n\n User::create(request()->only('first_name', 'last_name', 'email', 'phone') + [\n 'type' => 'user',\n 'password' => Hash::make(request()->password),\n ]);\n\n return redirect('users')->with('status', 'User created.');\n }", "public function saveNewUser() {\n\t\t$db = $this->getDatabaseConnection();\n\n\t\t// Prepare the SQL\n\t\t$sql =\"INSERT INTO users (email, password, first_name, last_name, username)\n\t\t\t\tVALUES (:email, :password, :first_name, :last_name, :username)\";\n\n\t\t$statement = $db->prepare($sql);\n\n\t\t// Bind the form data to the SQL query\n\t\t$statement->bindValue(':email', $_POST['email']);\n\t\t$statement->bindValue(':password', $_POST['password']);\n\t\t$statement->bindValue(':first_name', $_POST['first_name']);\n\t\t$statement->bindValue(':last_name', $_POST['last_name']);\n\t\t$statement->bindValue(':username', $_POST['username']);\n\n\t\t// Run the query\n\t\t$result = $statement->execute();\n\n\t\t//Confirm tht it worked\n\t\tif( $result == true) {\n\t\t\t// Yay!\n\n\t\t\t$_SESSION['user_id'] = $db->lastInsertID();\n\t\t\t$_SESSION['privilege'] = 'user';\n\t\t\t$_SESSION['first_name'] = $_POST['first_name'];\n\t\t\t$_SESSION['last_name'] = $_POST['last_name'];\n\t\t\t$_SESSION['username'] = $_POST['username'];\n\t\t\t$_SESSION['email'] = $_POST['email'];\n\n\t\t\theader('Location: index.php?page=account');\n\t\t} else {\n\t\t\t// Uh oh...\n\t\t}\n\n\t\t//If it did, log the user in and redirect to their \n\t\t// new account page\n\t}", "public function store()\n {\n $valid = User::isValid(Input::all());\n \n if($valid === true) {\n // Ensure that password is set\n if(Input::get('password') == null) {\n return $this->respondConflict(\"password must be set\");\n }\n \n // Check for if user has already been created\n try {\n User::create(array(\n \"firstname\" => Input::get(\"first\"),\n \"lastname\" => Input::get(\"last\"),\n \"email\" => Input::get(\"email\"),\n \"password\" => Hash::make(Input::get(\"password\"))\n ));\n } catch (Exception $e) {\n return $this->respondConflict(\"User already exists\");\n }\n \n return $this->respond(array(\"message\" => \"User Created\"));\n \n } else {\n return $this->respondConflict($valid);\n }\n }", "public function store()\n {\n // Save post data in $user var\n $user = $_POST;\n\n if ($user['country'] == \"\"){$user['country'] = 156;}\n\n // Create a password, set created_by ID and set the date of creation\n $user['password'] = password_hash('Gorilla1!', PASSWORD_DEFAULT);\n $user['created_by'] = Helper::getUserIdFromSession();\n $user['created'] = date('Y-m-d');\n\n // Save the record to the database\n UserModel::load()->store($user);\n return view::redirect('/');\n }", "public function store()\n\t{\n $user = new User();\n $user->name = Input::get('name');\n $user->email = Input::get('email');\n $user->mobile = Input::get('mobile');\n $user->save();\n echo json_encode(array('msg' => 'success', 'id' => $user->id));\n\t}", "public function insert() {\n\t\t$this->insert_user();\n\t}", "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 store()\n\t{\n\t\t$activate_data = array(\n\t\t\t\"activate\" => 1,\n\t\t\t\"activated_at\" => $this->datetime->format(\"Y-m-d H:i:s\")\n\t\t);\n\n\t\t$user = $this->user->create(array_merge(Input::all(), $activate_data));\n\n\t\tif($user)\n\t\t{\n\t\t\treturn Redirect::route(\"users.index\");\n\t\t}\n\n\t\treturn Redirect::back()->withInput()->withErrors($this->user->errors());\n\t}", "public function store()\n {\n if( Session::get('level') == '1' && Session::get('fingerprint') == md5($_SERVER['HTTP_USER_AGENT'] . $_SERVER['REMOTE_ADDR']) )\n { \n $postData = Input::All();\n\n $messages = [\n 'fullname.required' => 'กรุณากรอก', \n 'username.required' => 'กรุณากรอก', \n 'password.required' => 'กรุณากรอก', \n ];\n\n $rules = [\n 'fullname' => 'required', \n 'username' => 'required',\n 'password' => 'required',\n ];\n\n $validator = Validator::make($postData, $rules, $messages);\n if ($validator->fails()) { \n return Redirect::route('user.create')->withInput()->withErrors($validator);\n }\n else\n {\n $data = Request::all(); \n\n if($this->checkuser($data['username']) == 0){\n $user = new User();\n $user->fullname = $data['fullname'];\n $user->username = $data['username'];\n $user->password = Hash::make($data['password']);\n $user->id_dep = $data['id_dep'];\n $user->level = $data['level'];\n $user->activated = $data['activated'];\n\n DB::transaction(function() use ($user) {\n $user->save(); \n }); \n\n Session::flash( 'savedata', save_data );\n }else{\n Session::flash( 'nosavedata', \"\" );\n }\n\n return Redirect::to('user');\n }\n }\n else\n {\n return Redirect::to('/');\n }\n }", "public function Save()\r\n\t\t{\r\n\t\t\t$db = new Db();\r\n\t\t\t$sql = \"INSERT INTO tbl_users (naam, voornaam, email, wachtwoord)\r\n\t\t\tVALUES ('\".$db->conn->real_escape_string($this->m_sName).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sFirstname).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sEmail).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sPassword).\"'\r\n\t\t\t)\";\r\n\t\t\t$db->conn->query($sql);\r\n\r\n\t\t\t//user_id van de geregistreerde gebruiker in de session variabele opslaan\r\n\t\t\t$user_id = $db->conn->insert_id;\r\n\t\t\t$_SESSION['user_id'] = $user_id;\r\n\t\t}", "public function store()\n {\n\n request()->validate([\n 'uname'=> 'required',\n 'useremail'=> 'required',\n 'fname'=>'required',\n 'lname'=> 'required',\n 'pasword' => 'required',\n 'userroll' => 'required'\n\n ]);\n\n $user = new userprofiles();\n\n $user->uname = request('uname');\n $user->useremail = request('useremail');\n $user->fname = request('fname');\n $user->lname = request('lname');\n $user->pasword = request('pasword');\n $user->userroll = request('userroll');\n\n $user->save();\n\n redirect('/add-new');\n\n\n }", "public function store_user_data() {\n\n\t\t$user = User::where('mobile_number', session('phone_number'))->where('type', 0)->get();\n\n\t\tif (count($user)) {\n\t\t\tflash_message('danger', trans('messages.driver.this_number_already_have_account_please_login'));\n\t\t\treturn redirect()->route('login');\n\t\t} else {\n\t\t\t$user = new User;\n\t\t\t$user->mobile_number = session('phone_number');\n\t\t\t$user->name = session('user_name');\n\t\t\t$user->type = 0;\n\t\t\t$user->password = bcrypt(session('password'));\n\t\t\t$user->country_code = session('country_code');\n\t\t\t$user->email = session('email_address');\n\t\t\t$user->status = \"1\";\n\t\t\t$user->save();\n\n\t\t\tif (Auth::guard()->attempt(['mobile_number' => session('phone_number'), 'password' => session('password')])) {\n\t\t\t\t$intended_url = session('url.intended');\n\t\t\t\tif ($intended_url) {\n\t\t\t\t\t//create new order use session values\n\t\t\t\t\tadd_order_data();\n\t\t\t\t\treturn redirect()->route($intended_url); // Redirect to intended url page\n\t\t\t\t} else {\n\t\t\t\t\treturn redirect()->route('search'); // Redirect to search page\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\treturn redirect()->route('login'); // Redirect to login page\n\t\t\t}\n\t\t}\n\t}", "public function store()\n\t{\n\t\t//\n\t\t$dataUser = Input::only(['username','email','password', 'password_confirmation']);\n\t\t$dataUserDetails = Input::only(['first_name','last_name','phone_number', 'address']);\n\t\t\n\t\t$validatorUser = Validator::make(\n\t\t\t\t$dataUser,\n\t\t\t\t[\n\t\t\t\t'username' => 'required',\n\t\t\t\t'email' => 'required|email',\n\t\t\t\t'password' => 'required|min:5|confirmed',\n\t\t\t\t'password_confirmation'=> 'required|min:5'\n\t\t\t\t]\n\t\t);\n\t\t\n\t\tif($validatorUser->fails()){\n\t\t\treturn Redirect::route('user.create')->withErrors($validatorUser)->withInput();\n\t\t}\n\t\t$validatorUserDetail = Validator::make(\n\t\t\t\t$dataUserDetails,\n\t\t\t\t[\n\t\t\t\t'first_name' => 'required',\n\t\t\t\t'last_name' => 'required',\n\t\t\t\t'phone_number' => 'required|regex:/^0[0-9]{9}$/',\n\t\t\t\t'address'=> 'required'\n\t\t\t\t]\n\t\t);\n\t\t\n\t\tif($validatorUserDetail->fails()){\n\t\t\treturn Redirect::route('user.create')->withErrors($validatorUserDetail)->withInput();\n\t\t}\n\t\t\n\t\t$newUser = User::create($dataUser);\n\t\tif($newUser){\n\t\t\t//$userId=array('user_id' => $newUser->id);\n\t\t\t$userDetails = UsersDetails::create($dataUserDetails);\n\t\t\t//var_dump(User::find($newUser->id));\n\t\t\tif($userDetails){\t\t\t\t\n\t\t\t\t\n\t\t\t\t$userDetails->user()->associate(User::find($newUser->id));\n\t\t\t\t$userDetails->save();\n\t\t\t\t\n\t\t\t\tAuth::login($newUser);\n\t\t\t\treturn Redirect::route('profile');\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn Redirect::route('user.create')->withInput();\n\t}", "public function save($user) {\n\n\t\t$stmt = $this->db->prepare(\"INSERT INTO users values (?,?,?)\");\n\t\t$stmt->execute(array($user->getEmail(), $user->getCompleteName(), $user->getPasswd()));\n\t}", "public function save() {\n\t\t$data = array(\n\t\t\t\t\"user\" => array(\n\t\t\t\t\t\t\"email\" => $this->_data[\"email\"],\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t// kontrola zmeny hesla\n\t\tif (in_array(\"password\", $this->_changed)) $data[\"user\"][\"password\"] = $this->_data[\"password\"];\n\t\t\n\t\t// odeslani dat\n\t\t$response = $this->_connection->sendRequest(self::OBJECT, \"put\", $this->_data[$this->_identifier], $data, \"post\");\n\t}", "public function store()\n\t{\n\t\t$request = Request::input();\t\n\t\t$user = new User;\n\t\t$user->username = $request['username'];\n\t\t$user->password = Hash::make($request['password']);\n\t\t$user->email = $request['email'];\n\n\t\t$user->save();\n\n\t\treturn Redirect::to('/user');\n\n\t}", "public function store()\n\t {\n $newUserInfo = Input::all();\n\n $newUserInfo['username'] = $newUserInfo['name'];\n $newUserInfo['email'] = $newUserInfo['email'];\n $newUserInfo['password'] = Hash::make(\"password\");\n\n $user = User::create($newUserInfo);\n\n return Response::json(array(\n \"id\" => $user->id\n ));\n }", "public function store()\n\t{\n\n\t\t$input = Input::all();\n\t\t\n\t\tif ( ! $this->user->fill($input)->isValid())\n\t\t{\n\n\t\t\treturn Redirect::back()->withInput()->withErrors($this->user->errors);\n\n\t\t}\n\n\t\t$this->user->save();\n\n\t\treturn Redirect::route('users.index');\n\t}", "public function store()\n {\n $validator = Validator::make(Input::all(), User::rules(), [], User::attributes());\n\n if ($validator->fails()) {\n return Redirect::action('Admin\\UserController@create')->withErrors($validator)->withInput();\n }\n\n $model = new User;\n $model->title = Input::get('title');\n $model->content = Input::get('content');\n $model->audit = Input::get('audit');\n if($model->save()){\n Request::session()->flash('info', '系统用户创建成功!');\n }\n return Redirect::action('Admin\\UserController@index');\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), User::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\t$role = array_pull($data, 'role');\n\t\t$contact = array_pull($data, 'contactInfo');\n\t\t$numbers = array_pull($contact, 'number');\n\t\t$numberTypes = array_pull($contact, 'number_type');\n\n\t\t$data['password'] = Hash::make($data['password']);\n\n\t\t$user = User::create($data);\n\n\t\tforeach ($numbers as $index => $number) {\n\t\t\t$contactNumbers[] = new ContactNumber([\n\t\t\t\t'number' => $number,\n\t\t\t\t'type' => $numberTypes[$index]\n\t\t\t]);\n\t\t}\n\n\t\t$contactInfo = ContactInfo::create($contact);\n\t\t$contactInfo->contactNumbers()->saveMany($contactNumbers);\n\n\t\t// Attach Address\n\t\t$user->contactInfo()->save($contactInfo);\n\n\t\t// Attach role\n\t\t$user->roles()->sync([$role]);\n\n\t\treturn Redirect::route('users.index')\n\t\t\t\t\t\t\t->with('message', 'Successfully added user')\n\t\t\t\t\t\t\t->with('alert-class', 'success');\n\t}", "public function store()\n {\n $user_identifier = $this->session->userdata('identifier');\n $data = [\n 'email' => $this->input->post('inputEmail'),\n 'name' => $this->input->post('inputName'),\n 'address' => $this->input->post('inputAddress'),\n 'phone' => $this->input->post('inputPhone')\n ];\n\n if ($this->user_m->updateDetails($user_identifier, $data)) {\n $this->flash_message('Profil Akun Berhasil di Update');\n } else {\n $this->flash_message('Profil Akun Gagal di Update');\n }\n redirect($this->data['user'].'/show');\n }", "public function store()\n\t{\n\t\tif (Auth::user()->role == 'Admin') {\n\t\t\t$input = Input::all();\n\t\t\t$validation = Validator::make($input, User::$rules);\n\n\t\t\tif ($validation->passes()){\n\t\t\t\t$user = new User();\n\t\t\t\t$user->username = Input::get('username');\n\t\t\t\t$user->email = Input::get('email');\n\t\t\t\t$user->password = Hash::make(Input::get('password'));\n\t\t\t\t$user->role = Input::get('role');\n\t\t\t\t$user->save();\n\t\t\t\t\n\t\t\t\tFlash::success('User Created');\n\t\t\t\treturn Redirect::route('users.index');\n\t\t\t}\n\t\t\t\t\n\t\t\treturn Redirect::route('users.create')\n\t\t\t\t->withInput()\n\t\t\t\t->withErrors($validation);\n\t\t}\n\t\tFlash::error('Your account is not authorized to view this page');\n\t\treturn Redirect::to('home');\t\n\t}", "public function saveUser() {\n\n try {\n\n $this->save();\n\n }catch (Exception $e) {\n\n throw new Exception($e->getMessage());\n\n }\n }", "public function store()\n {\n $user = request()->validate(User::$validationRules);\n\n request()->merge(array_map(\"trim\", array_map(\"strip_tags\", $user)));\n\n User::forceCreate($user);\n \n return redirect()->route('users.index')->with('form_success', 'You have successfully created new user entry.');\n }", "function save() {\n\n $record = new stdClass;\n $record->username = $this->username;\n $record->firstname = addslashes($this->firstname);\n $record->lastname = addslashes($this->lastname);\n $record->idnumber = $this->idnumber;\n $record->update_flag = $this->update_flag;\n $record->reg_status = $this->reg_status;\n $record->college = $this->college;\n $record->year = $this->year;\n $record->classification = $this->classification;\n $record->keypadid = $this->keypadid;\n $record->ferpa= $this->ferpa;\n $record->anonymous = $this->anonymous;\n $record->degree_candidacy = $this->degree_candidacy;\n\n if ($this->hidden != null) {\n $record->hidden = $this->hidden;\n }\n if ($this->numsections != null) {\n $record->numsections = $this->numsections;\n }\n if ($this->format != null) {\n $record->format= $this->format;\n }\n if ($this->cr_delete != null) {\n $record->cr_delete = $this->cr_delete;\n }\n if ($this->moodleid != null) {\n $record->moodleid = $this->moodleid;\n }\n\n if (!$this->id) {\n\n $this->id = insert_record('block_courseprefs_users', $record, true);\n\n if (!$this->id) {\n throw new Exception('Unable to create new courseprefs user within database');\n }\n\n } else {\n\n $record->id = $this->id;\n\n if (!update_record('block_courseprefs_users', $record)) {\n throw new Exception('Unable to update existing courseprefs user within database');\n }\n }\n }", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'username' => 'required|between:3,20',\n\t\t\t'email' => 'required|email|confirmed|unique:users,email',\n\t\t\t'password' => 'required|min:6|alpha_num|confirmed'\n\t\t);\n\n\t\t$validation = Validator::make(Input::all(), $rules);\n\n\t\tif($validation->fails()) {\n\t\t\treturn Redirect::back()->withErrors($validation);\n\t\t}\n\n\t\t$user = new User;\n\t\t$user->username = Input::get('username');\n\t\t$user->email = Input::get('email');\n\t\t$user->password = Hash::make(Input::get('password'));\n\n\t\tif($user->save()){\n\t\t\tAuth::login($user);\n\t\t\tif(Auth::check()) {\n\t\t\t\treturn Redirect::to('user/'.$user->id);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn Redirect::back()->with('flash_error', \"Impossible de connecter l'utilisateur\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn Redirect::back()->with('flash_error', \"Impossible d'enregistrer l'utilisateur\");\n\t\t}\n\t}", "public function store()\n {\n //MEMBUAT VALIDASI\n $this->validate([\n 'name' => 'required|string',\n 'username' => 'required|string',\n 'email' => 'required|string'\n ]);\n $pass = $this->password;\n //QUERY UNTUK MENYIMPAN / MEMPERBAHARUI DATA MENGGUNAKAN UPDATEORCREATE\n //DIMANA ID MENJADI UNIQUE ID, JIKA IDNYA TERSEDIA, MAKA UPDATE DATANYA\n //JIKA TIDAK, MAKA TAMBAHKAN DATA BARU\n User::updateOrCreate(['id' => $this->idz], [\n 'name' => $this->name,\n 'username' => $this->username,\n 'email' => $this->email,\n 'password' => $pass,\n ]);\n\n //BUAT FLASH SESSION UNTUK MENAMPILKAN ALERT NOTIFIKASI\n session()->flash('message', $this->id ? $this->name . ' Diperbaharui': $this->name . ' Ditambahkan');\n $this->closeUser(); //TUTUP User\n $this->resetFields(); //DAN BERSIHKAN FIELD\n }", "public function store(User $user)\n {\n\n\n $user->user_id = request('id');\n $user->fname = request('fname');\n $user->lndame = request('lname');\n $user->user_cin = request('cin');\n $user->user_role = 'etudiant';\n $user->email = request('email');\n $user->password = request('password');\n $user->dob = request('dob');\n\n\n $user->save();\n return redirect('admin/std');\n }", "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 save(){\n\t\t\tif($this->uid){\n\t\t\t\t$query = sprintf('UPDATE %sUSER SET USERNAME = \"%s\",PASSWORD =\"%s\", EMAIL_ADDR =\"%s\", IS_ACTIVE = %d WHERE USER_ID = %d',DB_TBL_PREFIX,\n\t\t\t\t\t\tmysql_real_escape_string($this->username, $GLOBALS['DB']),\n\t\t\t\t\t\tmysql_real_escape_string($this->password, $GLOBALS['DB']),\n\t\t\t\t\t\tmysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n\t\t\t\t\t\t$this->isActive, $this->userId);\n\t\t\t\t\t return mysql_query($query, $GLOBALS['DB']);\n\t\t\t}else{\n\t\t\t\t// if the user has not registered yet\n\t\t\t\t$query = sprintf('INSERT INTO %USER (USERNAME, PASSWORD, EMAIL_ADDR, IS_ACTIVE) VALUES ( \"%s\",\"%s\", \"%s\", %d)',DB_TBL_PREFIX,\n\t\t\t\t\t\tmysql_real_escape_string($this->username, $GLOBALS['DB']),\n\t\t\t\t\t\tmysql_real_escape_string($this->password, $GLOBALS['DB']),\n\t\t\t\t\t\tmysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n\t\t\t\t\t\t$this->isActive);\n\t\t\t\t\t\tif(mysql_query($query, $GLOBALS['DB'])){\n\t\t\t\t\t\t\t$this->uid = mysql_insert_id($GLOBALS['DB']);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t }", "public function store()\n\t{\n\t\tif (!$this->userService->create(Input::all()))\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tAlert::success('User successfully created!')->flash();\n\n\t\treturn Redirect::route('dashboard.users.index');\n\t}", "public function store()\n\t{\n\t\tInput::merge(array_map('trim', Input::all()));\n\t\t\n\t\t$entryValidator = Validator::make(Input::all(), Users::$store_rules);\n\n\t\tif ($entryValidator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->with('error_message', Lang::get('core.msg_error_validating_entry'))->withErrors($entryValidator)->withInput();\n\t\t}\n\n\t\t$store = $this->repo->store( \n\t\t\tInput::get('first_name'),\n\t\t\tInput::get('last_name'),\n\t\t\tInput::get('username'),\n\t\t\tInput::get('region'),\n\t\t\tInput::get('city'),\n\t\t\tInput::get('date_of_birth'),\n\t\t\tInput::get('email'),\n\t\t\tInput::get('password'),\n\t\t\tInput::get('contact1'),\n\t\t\tInput::get('contact2'),\n\t\t\tInput::get('additional_notes'),\n\t\t\tInput::get('user_info'),\n\t\t\tInput::get('published'),\n\t\t\tInput::file('image')\n\t\t);\n\n\t\tif ($store['status'] == 0)\n\t\t{\n\t\t\treturn Redirect::back()->with('error_message', Lang::get('core.msg_error_adding_user'))->withErrors($entryValidator)->withInput();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Redirect::route('UsersIndex')->with('success_message', Lang::get('core.msg_success_user_added', array('name' => Input::get('name'))));\n\t\t}\n\t}", "public function save($user){\n $this->validate();\n if(sizeof($this->errors)==0){\n\n $password_hash=password_hash($user->getPassword(),PASSWORD_DEFAULT);\n $sql=\"INSERT INTO user(name,email,password) VALUES(?,?,?)\";\n $stmt=static::getDB()->prepare($sql);\n $stmt->execute(array($user->getUsername(),$user->getEmail(),$password_hash));\n \n }else{\n print_r($this->errors) ;\n }\n\n // return false;\n }", "public function store()\n\t{\n\t\t$userdata = Input::all();\n\n $rules = array(\n 'first_name' => 'required|alpha',\n 'last_name' => 'required|alpha',\n 'email' => 'required|email|unique:users',\n 'password' => 'confirmed',\n 'password_confirmation' => ''\n );\n\n $validator = Validator::make($userdata, $rules);\n\n if ($validator->fails())\n {\n $response = array(\n\t\t\t\t'message' \t\t=> 'The user could not need added',\n\t\t\t\t'data'\t\t\t=> $validator->messages()->toArray(),\n\t\t\t\t'status' \t \t=> 400 \n\t\t\t);\n\t\t\treturn Response::make($response, 400);\n\t\t}\n\n $user = new User();\n $user->fill(Input::except('_token', 'password_confirmation'));\n $userdata['password'] = (isset($userdata['password']))?$userdata['password']:\"password\";\n $user->password = Hash::make($userdata['password']);\n $user->save();\n\n /* Audit Log */ \n Log::info('New user: ' . $userdata['email']);\n \n $response = array(\n\t\t\t'message' \t\t=> 'The user has successfully been added..',\n\t\t\t'data'\t\t\t=> $user->toArray(),\n\t\t\t'status' \t \t=> 200 \n\t\t);\n\t\treturn Response::make($response, 200);\n \t\n\t}", "public function store()\n\t{\n\t\t$member = member::create([\n\t\t\t'pid' => Request::input('pid'),\n\t\t\t'username' => Request::input('username'),\n\t\t\t'password' => md5(Request::input('password')),\n\t\t\t'status' => Request::input('status'),\n\t\t\t]);\n\n\t\tmember_profiles::create([\n\t\t\t'uid' => $member->id,\n\t\t\t'nickname' => Request::input('nickname'),\n\t\t\t]);\n\t\tmember_credits::create([\n\t\t\t'uid' => $member->id,\n\t\t\t'credit' => Request::input('credit'),\n\t\t\t]);\n\t\tmember_percents::create([\n\t\t\t'uid' => $member->id,\n\t\t\t]);\n\t}", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'name'\t\t\t\t=>\t'required|min:3|regex:/^[a-zA-Z][a-zA-Z ]*$/',\n\t\t\t'username'\t\t\t=>\t'required|min:3|unique:users|regex:/^[A-Za-z0-9_]{1,15}$/',\n\t\t\t'password'\t\t\t=>\t'required|min:6',\n\t\t\t'retype-password'\t=> \t'required|min:6|same:password',\n\t\t\t'email'\t\t\t\t=>\t'required|email|unique:users'\n\t\t);\n\n\t\t$validator = Validator::make(Request::all(), $rules);\n\n\t\tif ($validator->fails()) {\n\t\t\treturn Redirect::back()\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput(Request::except('password'));\n\t\t} else {\n\n\t\t\t$user = new User;\n\n\t\t\t$user->name = Request::get('name');\n\t\t\t$user->username = Request::get('username');\n\t\t\t$user->password = Hash::make(Request::get('password'));\n\t\t\t$user->email = Request::get('email');\n\n\t\t\t$user->save();\n\n\t\t\t// Redirect\n\t\t\tSession::flash('message', 'Account created!');\n\t\t\treturn Redirect::to('auth/login');\n\t\t}\n\t}", "public function store($user_data)\n\t{\n\t\t$new_user = new User;\n\t\t$new_user->role_id \t\t\t= $user_data['role_id'];\n\t\t$new_user->first_name \t\t= (isset($user_data['first_name']) && !empty($user_data['first_name'])) \t\t? $user_data['first_name'] \t: null;\n\t\t$new_user->last_name \t\t= (isset($user_data['last_name']) && !empty($user_data['last_name'])) \t\t\t? $user_data['last_name'] \t: null;\n\t\t$new_user->username \t\t= $user_data['username'];\n\t\t$new_user->password \t\t= (Hash::needsRehash($user_data['password'])) ? Hash::make($user_data['password']) : $user_data['password'];\n\t\t$new_user->email \t\t\t= $user_data['email'];\n\t\t$new_user->birthdate \t\t= (isset($user_data['birthdate']) && !empty($user_data['birthdate'])) \t\t\t? $user_data['birthdate'] \t\t: null;\n\t\t$new_user->phone \t\t\t= (isset($user_data['phone']) && !empty($user_data['phone'])) \t\t\t\t\t? $user_data['phone'] \t\t\t: null;\n\t\t$new_user->facebook \t\t= (isset($user_data['facebook']) && !empty($user_data['facebook']))\t\t\t\t? $user_data['facebook'] \t\t: null;\n\t\t$new_user->twitter \t\t\t= (isset($user_data['twitter']) && !empty($user_data['twitter'])) \t\t\t\t? $user_data['twitter'] \t\t: null;\n\t\t$new_user->profile_image \t= (isset($user_data['profile_image']) && !empty($user_data['profile_image'])) \t? $user_data['profile_image'] \t: null;\n\t\t$new_user->cover_image \t\t= (isset($user_data['cover_image']) && !empty($user_data['cover_image'])) \t\t? $user_data['cover_image'] \t: null;\n\t\t$new_user->cover_text \t\t= (isset($user_data['cover_text']) && !empty($user_data['cover_text']))\t\t\t? $user_data['cover_text'] \t\t: null;\n\t\tif($new_user->save())\n\t\t\treturn $new_user;\n\t\telse\n\t\t\treturn false;\n\t}", "public function store()\r\n\t{\r\n\t\t$jsonData = $this->getAll();\r\n\r\n\t $data = array(\r\n\t\t\t'username'=> $this->user->username,\r\n\t\t\t'post'=> $this->post,\r\n\t\t\t'date'=> $this->date,\r\n\t );\r\n\r\n\t\tarray_unshift($jsonData, $data);\r\n\r\n\t\t$this->save($jsonData);\r\n\t}", "public function save ( $isNewUser = false ) {\n $db = new DB();\n \n // If the user is already registered, just update their info\n if ( !$isNewUser ) {\n $data = array (\n 'password' => \"'$this->hashedPassword'\",\n 'email' => \"'$this->email'\"\n );\n $db->update($_SESSION[userTable], $data, \"id = '\".$this->id.\"'\");\n }\n // else register the user\n else {\n $data = array (\n 'username' => \"'$this->username'\",\n 'password' => \"'$this->hashedPassword'\",\n 'email' => \"'$this->email'\",\n 'joindate' => \"'\".date(\"Y-m-d H:i:s\").\"'\"\n );\n $this->id = $db->insert($_SESSION['userTable'], $data);\n $this->joindate = time();\n }\n }", "public function store(Request $request, User $user)\n\t{\t\n\t\t$user->create($request->all());\n\t\t$user->save();\n\t\t$user->attachRole($request->input('role'));\n\t}", "public function store(CreateUserRequest $request)\n {\n DB::beginTransaction();\n try{\n $user = new User($request->only('full_name','dni','phone','user','bank_account_number','role','group_id','sponsor_id'));\n $user->password= bcrypt($request->password);\n\n if(env('APP_DEBUG')){\n $user->created_at = session('day');\n }\n if(Auth::user()->role == 'admin'){\n $user->admin_id = Auth::user()->id;\n }\n if(Auth::user()->role == 'sponsored'){\n $user->admin_id = Auth::user()->admin_id;\n }\n $user->save();\n DB::commit();\n return response(['message' => 'Se ha creado el usuario corrrectamente','redirect'=>route('user.index')]);\n }catch(QueryException $e){\n DB::rollBack();\n return response(['message'=> 'QueryException :'.$e->getMessage(),'type' => 'error']);\n }catch(Exception $e){\n DB::rollBack();\n return response(['message'=> 'Exception :'.$e->getMessage(),'type' => 'error']);\n }\n }", "public function store(UserRequest $request)\n {\n $this->authorize('create', User::class);\n\n $input = $request->all();\n\n $person = Person::create($input);\n $input['person_id'] = $person->id;\n\n $user = User::create($input);\n\n if ($request->has('center')) {\n $center = Center::abbreviation($request->get('center'))->first();\n if ($center) {\n $user->setCenter($center);\n }\n }\n if ($request->has('role')) {\n $role = Role::find($request->get('role'));\n if ($role) {\n $user->roleId = $role->id;\n }\n }\n if ($request->has('active')) {\n $user->active = $request->get('active') == true;\n }\n if ($request->has('require_password_reset')) {\n $user->requirePasswordReset = $request->get('require_password_reset') == true;\n }\n $user->save();\n\n return redirect('admin/users');\n }", "public function store() {\n\t\tApp::get( 'database' )->insert( 'users', [\n\t\t\t'name' => $_POST['name']\n\n\t\t] );\n\t\t//And then redirect back to all users\n\t\treturn redirect( 'users' );\n\t}", "public function store()\n {\n $objUser = new User;\n \n $objUser->doSave($_POST);\n \n return Redirect::to('/admin/manage_user');\n }", "public function store(\n\t\tUserCreateRequest $request\n\t\t)\n\t{\n//dd($request);\n\t\t$this->user->store($request->all());\n\t\tFlash::success( trans('kotoba::account.success.create') );\n\t\treturn redirect('admin/users');\n\t}", "private function saveUser(){\n\n if( ! $this->checkEmail() ){\n $password = password_hash($this->_userPassword, PASSWORD_DEFAULT);\n $request = $this->_connexion->prepare(\"INSERT INTO Users (user_name, user_email, user_password) VALUES (?, ?, ?)\");\n $request->execute(array($this->_userName, $this->_userEmail, $password));\n\n return $response = json_encode([\n 'status' => 'ok',\n 'message' => 'successfuly add'\n ]);\n }\n else{\n return $response = json_encode([\n 'status' => 'failed',\n 'message' => 'this email allready exist'\n ]);\n }\n\n }", "public function m_insert_supervisor_user(){\n $this->FirstName = $_POST['FirstName'];\n $this->LastName = $_POST['LastName'];\n $this->EmailPN = $_POST['EmailPN'];\n $this->Password = password_hash($_POST['Password'], PASSWORD_DEFAULT);\n //insert value to users table\n $this->db->insert('users', $this);\n }", "public function save()\n {\n $user_id = Yii::$app->session->getFlash('validatedUserId');\n if ($this->validate() && ( $user = User::findOne($user_id)) !== null ) {\n // Hashing user password before saving it to the DB\n // http://www.yiiframework.com/doc-2.0/guide-security-passwords.html\n $user->password = Yii::$app->getSecurity()->generatePasswordHash($this->password);\n $user->active = '1';\n // Generates a new auth key to avoid the previous one from being used\n $user->auth_key = Yii::$app->security->generateRandomString();\n // Save DB record\n return $user->save();\n }\n return false;\n }", "public static function saveUser ($data) {\n\t\t// DB::insert(\"INSERT INTO users (email, password, username) VALUES(?, ?, ?)\", [$data['email'], \\Hash::make($data['pass']), $data['username']]);\n\t\t\n\t\t$user = new User;\n\t\t$user->email = $data['email'];\n\t\t$user->username = $data['username'];\n\t\t$user->password = $data['pass'];\n\t\t$user->save();\n\t}", "public function store()\n\t{\n\t\tif( Input::get('password') !== Input::get('password2') )\n\t\t\t$message = Functions::GetMessage ('ACCOUNT_PASS_MISMATCH');\n\t\telse if( strlen(Input::get('password')) < 6 || strlen(Input::get('password')) > 32 )\n\t\t\t$message = Functions::GetMessage('ACCOUNT_PASS_CHAR_LIMIT', array(6, 32));\n\t\telse\n\t\t{\n\t\t\t$user = Member::create(Input::all());\n\t\t\tif( empty($user) )\n\t\t\t{\n\t\t\t\treturn Redirect::back()\n\t\t\t\t\t\t->withErrors('message', $message)\n\t\t\t\t\t\t->withInput();\n\t\t\t}\t\n\t\t\t\n\t\t\t$user->username = $user->fullname;\n\t\t\t$user->role = 2;\n\t\t\t$user->password = Hash::make(Input::get('password'));\n\t\t\t$user->save();\t\t\t\n\t\t\t\n\t\t\t$message = 'SUCCESS';\n\t\t}\t\t\t\n\t\t\n\t\t$user = new Member();\n\t\t\n\t\t$user->fullname = Input::get('fullname');\n\t\t$user->email = Input::get('email');\n\t\t$user->contact = Input::get('contact');\n\n\t\treturn Redirect::back()\n\t\t\t\t\t\t->withErrors([$message])\n\t\t\t\t\t\t->withInput();\n\t}", "public function saveUser($user) {\n if(empty($user->user_id)){\n $this->dao->insertUser($user);\n } else {\n $this->dao->updateUser($user, $user->user_id); \n }\n }", "public function store()\n {\n $data = request()->validate([\n 'name' => ['bail', 'required', 'between:2,100'],\n 'surname' => ['bail', 'required', 'between:2,100'],\n 'id_card' => ['bail', 'required', 'numeric', 'integer', 'digits_between:1,8', Rule::unique('users')],\n 'email' => ['bail', 'required', 'email', Rule::unique('users')],\n 'password' => ['bail', 'required', 'alpha_dash', 'between:6,16'],\n 'phone_number' => ['bail', 'required', 'numeric', 'digits:11'],\n 'address' => ['bail', 'required', 'between:5,200'],\n 'toAdmin' => '',\n ]);\n\n $user = User::create([\n 'name' => $data['name'],\n 'surname' => $data['surname'],\n 'id_card' => $data['id_card'],\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n 'phone_number' => $data['phone_number'],\n 'address' => $data['address'],\n ]);\n if (isset($data['toAdmin']) && $data['toAdmin']) {\n $user->is_admin = 1;\n $user->update();\n }\n return redirect(route('admin.users'));\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$validation = Validator::make($input, User::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$this->user->create($input);\n\n\t\t\treturn Redirect::route('users.index');\n\t\t}\n\n\t\treturn Redirect::route('users.create')\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'There were validation errors.');\n\t}", "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}", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'username'=> 'required|alpha_dash|min:3|unique:users,username',\n\t\t\t'display_name'=> 'required',\n\t\t\t'email'=>'email',\n\t\t\t'password'=> 'required',\n\t\t\t'repeat_password'=> 'required|same:password'\n\t\t);\t\n\n\t\t$validation= Validator::make(Input::all(), $rules);\n\n\t\tif ($validation ->fails()) {\n\t\t\treturn Redirect::to('register')\n\t\t\t\t->withErrors($validation)\n\t\t\t\t->withInput(Input::all());\n\t\t}\n\n\t\t$user = new User;\n\t\t$user->username = Input::get('username');\n\t\t$user->password = Hash::make(Input::get('password'));\n\t\t$user->display_name = Input::get('display_name');\n\t\t$user->email = Input::get('email');\n\t\t$user->role = 'user';\n\t\t$user->token = sha1(uniqid());\n\t\t$user->status = 'pending';\n\t\t$user->save();\n\n\t\treturn Redirect::to('/')\n\t\t\t->with('message','User Created, Waiting for Approval');\n\t}", "public function set_user_info($data){\n\t\t\treturn $result=$this->save($data);\n\t\t}", "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 store()\n\t{\n\t\t$rules = array(\n\t\t\t'name' => 'required|max:255|min:4',\n\t\t\t'surname' => 'required|max:255|min:4',\n\t\t\t'email' => 'required|email|max:255|unique:users',\n\t\t\t'location' => 'required|max:255|min:4',\n\t\t\t'password' => 'required|confirmed|min:6',\n\t\t);\n\t\t$validator = Validator::make(Input::all(), $rules);\n\t\tif ($validator->fails()) {\n\t\t\treturn redirect('admin/create')\n\t\t\t\t\t->withErrors($validator);\n\t\t\t\t\t//->withInput(Input::except('password'));\n\t\t} \n\t\telse \n\t\t{\n\t\t\t// store\n\t\t\t$user = new User;\n\t\t\t$user->name = Request::Input('name');\n\t\t\t$user->surname = Request::Input('surname');\n\t\t\t$user->email \t = Request::Input('email');\n\t\t\t$user->location = Request::Input('location');\n\t\t\t$user->password = bcrypt(Request::Input('password'));\n\t\t\t$user->save();\n\n\t\t\t// redirect\n\t\t\treturn redirect('admin/users');\n\t\t}\n\t}", "public function store()\n\t{\n\t\t$user = new User;\n\n\t\t$user->name = Request::input('user.name');\n\t\t\n\t\t$user->email = Request::input('user.email');\n\n\t\t$user->password = bcrypt(Request::input('user.password'));\n\n\t\t$user->save();\n\n\t\treturn ['user'=>$user];\n\t}", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$input['password']=Hash::make($input['password']);\n\n\t\t$validation = Validator::make($input, User::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$user = new User();\t\t\t\n\t\t\t$user->username = Input::get('username');\n\t\t\t$user->desusuario = Input::get('desusuario');\t\t\n\t\t\t$user->rolusuario = Input::get('rolusuario');\t\t\n\t\t\t$user->estado = 'ACT';\t\t\n\t\t\t$user->password = Hash::make(Input::get('password'));\t\t\n\t\t\t//$user->usuario_id = Input::get('usuario_id');\n\t\t\t$user->usuario_id = 1;\n\t\t\t$user->save();\n\n\t\t\t//$this->user->create($input); obviar el modo automatico\n\n\t\t\treturn Redirect::route('users.index');\n\t\t}\n\n\t\treturn Redirect::route('users.create')\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'There were validation errors.');\n\t}", "public function store()\n\t{\n\t\t//create rules \n\t\t$rules = array(\n\t\t\t'user_email' => 'required|email|unique:user',\n\t\t\t'user_password' => 'required|confirmed',\n\t\t\t'user_first' \t=> 'required',\n\t\t\t'user_last' \t=> 'required',\n\t\t\t'user_access' \t=> 'required'\n\t\t);\n\n\t\t//validate posted data\n\t\t$validator = Validator::make(Input::all(), $rules);\n\t\t\n\t\t//check if data is ok\n\t\tif($validator->fails()) {\n\t\t\treturn Redirect::to('user/create')\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput(Input::except('password'));\n\t\t} else {\n\n\t\t\t$userTypeId = Input::get('user_access');\n\t\t\t$existsUserType = UserType::where('id', '=', $userTypeId)->first();\n\t\t\tif(!$existsUserType) {\n\t\t\t\treturn Redirect::to('user/create')\n\t\t\t\t->with('error', 'User Type doesnt exists')\n\t\t\t\t->withInput(Input::except('password'));\n\t\t\t}\n\n\t\t\t$user = new User;\n\t\t\t$user->user_email = Input::get('user_email');\n\t\t\t$user->user_password = Hash::make(Input::get('user_password'));\n\t\t\t$user->user_first \t = Input::get('user_first');\n\t\t\t$user->user_last \t = Input::get('user_last');\n\t\t\t$user->user_middle\t = Input::get('user_middle');\n\t\t\t$user->user_access\t = Input::get('user_access');\n\t\t\t$user->active\t \t = true;\n\t\t\t$user->save();\n\n\t\t\tSession::flash('message', 'User successfully added');\n\t\t\tif(Input::get('save')) {\n\t\t\t\treturn Redirect::to('user/' . $user->id . '/edit');\n\t\t\t}\n\n\t\t\tif(Input::get('save_and_close')) {\n\t\t\t\treturn Redirect::to('user');\n\t\t\t}\n\n\t\t\tif(Input::get('save_and_new')) {\n\t\t\t\treturn Redirect::to('user/create');\n\t\t\t}\n\t\t}\n\t}", "public function addUserToDatabase($user) {\n $name = $user->getName();\n $password = $user->getHashedPassword();\n $sql = \"INSERT INTO users (name, password) VALUES (:name, :password)\";\n $insertToDb = $this->connection->prepare($sql);\n $insertToDb->bindParam(':name', $name);\n $insertToDb->bindParam(':password', $password);\n $insertToDb->execute();\n $this->registerStatus = true;\n }", "public function store()\n {\n// $data = Input::all();\n\n $user = $this->execute(CreateUserCommand::class);\n\n\n /*\n * Here we check if user porovided correct\n * inputs. If not we redirect her back.\n * we also provide some messages so, according view would\n * show appropriate messages to user\n */\n //TODO: find a way to show the user appropiate messages\n //catch exception is located in global.php\n //Now in case of validation exception we redirect user to home page\n //without any messages\n /* $this->registrationForm->validate($data);\n\n $user = $this->userRepo->add($data);\n\n \\Event::fire('user.creating',[$data]);*/\n\n Auth::login($user);\n return Redirect::route('home');\n }", "function saveUser(UserEntity $user, string $hashedPwd);", "private function __saveBasicInfo() {\n\t\t$postData = $this->request->data['User'];\n\n\t\t$fields = array('username', 'first_name', 'last_name', 'email', 'gender', 'timezone');\n\t\t$data = array();\n\t\tforeach ($fields as $field) {\n\t\t\t$data[$field] = $postData[$field];\n\t\t}\n\n\t\t// convert dob\n\t\t$dob = $postData['date_of_birth'];\n\t\tlist($dobMonth, $dobDay, $dobYear) = explode('-', $dob);\n\t\t$formattedDob = sprintf('%s-%s-%s', $dobYear, $dobMonth, $dobDay);\n\t\t$data['date_of_birth'] = $formattedDob;\n\n\t\t$data['id'] = $userId = $this->Auth->user('id');\n\t\tif ($this->User->save($data)) {\n\t\t\t// save user photo\n\t\t\t$this->__saveUserPhoto($userId, $this->request->data['cropfileName']);\n\n\t\t\t// send email change notification if email is changed\n\t\t\t$sendEmailChangeNotification = ($postData['email'] !== $postData['old_email']) ? true : false;\n\t\t\tif ($sendEmailChangeNotification === true) {\n\t\t\t\t$this->__sendEmailChangeNotification($postData);\n\t\t\t}\n\n\t\t\t// set new data on session\n\t\t\t$this->Session->write('Auth', $this->User->read(null, $userId));\n\n\t\t\t// redirect with success message\n\t\t\t$this->Session->setFlash(__('Successfully updated the details.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t// redirect with error message\n\t\t\t$this->Session->setFlash(__('Failed to update the details.'), 'error');\n\t\t}\n\t}", "public function store(UserRequest $request)\n {\n $user = new User();\n $user->first_name = trim($request->input('first_name'));\n $user->last_name = trim($request->input('last_name'));\n $user->username = trim($request->input('username'));\n $user->active = ($request->input('active') == \"on\") ? 1 : 0;\n $user->password = bcrypt(trim($request->input('password')));\n $user->email = trim($request->input('email'));\n $user->mobile = trim($request->input('mobile'));\n if ($user->save()) {\n createSessionFlash('User Create', 'SUCCESS', 'User create successfully');\n } else {\n createSessionFlash('User Create', 'FAIL', 'Error in User create');\n }\n return redirect('admin/users');\n }", "function saveuser(){\n \t\t\tif (isset($_POST['UserID'])){\n \t\t\t\t$UserID = base64_decode($_POST['UserID']);\n \t\t\t\t$this->Users->UpdateUser($UserID);\n \t\t\t}else{\n \t\t\t\t$UserID = $this->Users->AddNewUser();\n \t\t\t\t$this->Users->AddUserToCompany($UserID);\n \t\t\t}\n \t\t\t$this->Flash->error(__('UserSaved', true));\n \t\t\t$this->Redirect('/users/edituser/'.base64_encode($UserID));\n \t\t}", "function save_user_info ()\n{\n if (check_user_info()){\n $feedback = array ();\n // Retrieve datas from form\n $user_name = filter_var($_POST['user_name'],\n FILTER_SANITIZE_STRING);\n //$user_password = $_POST['user_password'];\n $user_email = filter_var($_POST['user_email'], \n FILTER_SANITIZE_EMAIL);\n $user_birthday = filter_var($_POST['user_birthday'], \n FILTER_SANITIZE_STRING);\n $user_nationality = utf8_encode(filter_var($_POST['user_nationality'], \n FILTER_SANITIZE_STRING));\n $user_lastname = utf8_encode(filter_var($_POST['user_lastname'], \n FILTER_SANITIZE_STRING));\n $user_firstname = utf8_encode(filter_var($_POST['user_firstname'], \n FILTER_SANITIZE_STRING));\n $user_gender = utf8_encode(filter_var($_POST['user_gender'], \n FILTER_SANITIZE_STRING));\n $user_password_hash = \n $_SESSION['user']->get_string_attribute('user_password_hash');\n \n /*if (isset($_POST['user_password_new'])) {\n $user_password_hash = password_hash($_POST['user_password_new'],\n PASSWORD_DEFAULT);\n }else {\n $user_password_hash = \n $_SESSION['user']->get_string_attribute('user_password_hash');\n }*/\n \t\n //Create an user object with it\n $parameters = array ('user_id' =>\n $_SESSION['user']->get_string_attribute('user_id'),\n\t\t\t'user_name' => $user_name,\n\t\t\t'user_email' => $user_email,\n\t\t\t'user_birthday' => $user_birthday,\n\t\t\t'user_nationality' => $user_nationality,\n\t\t\t'user_lastname' => $user_lastname,\n\t\t\t'user_firstname' => $user_firstname,\n 'user_password_hash' => $user_password_hash,\n \t'user_gender' => $user_gender);\n $user = new User ($parameters);\n \t\n // save new datas in database;\n if ($user->update_user_data()) {\n // Save them in the user session\n $_SESSION['user'] = $user;\n $feedback ['status'] = true;\n $_SESSION['feedback'] = $feedback;\n return true;\n } else {\n $feedback ['msg'] = 'The update of your profile information has failed';\n $feedback ['status'] = false;\n $_SESSION['feedback'] = $feedback;\n return false;\n }\n }else {\n return false;\n }\n}", "public function persist() {\n $bd = BD::getConexion();\n $sql = \"insert into usuarios (nombre, clave) values (:nombre, :clave)\";\n $sthSql = $bd->prepare($sqlInsertUsuario);\n $result = $sthSql->execute([\":nombre\" => $this->nombre, \":clave\" => $this->clave]);\n $this->id = (int) $bd->lastInsertId();\n }", "public function store(Request $request)\n {\n $user = new User;\n $user->first_name = $request->first_name;\n $user->last_name = $request->last_name;\n $user->age = $request->age;\n $user->city = $request->city;\n $user->state = $request->state;\n $user->country = $request->country;\n $user->about = $request->about;\n\n $user->save();\n //\n }", "public function store()\n {\n\n try {\n\n $encodedPin = $this->_data->secure;\n\n $pin = new Pin();\n $user = $pin->setPin($encodedPin)->getUserByPin();\n\n if (is_null($user)) {\n die(json_encode(['status' => 'error', 'msg' => 'No user found.']));\n }\n // have the employee\n $employee = $this->_getEmployeeByUserId($user['id']);\n\n if (is_null($employee)) {\n die(json_encode(['status' => 'error', 'msg' => 'Employee not found.']));\n }\n // get allowed actions\n $lastAction = $this->_getEmployeeTimesheetState($employee['id']);\n echo json_encode(array_merge(['status' => 'success'], $employee, $lastAction));\n } catch (\\Exception $e) {\n die($e->getMessage());\n }\n // * route: /template [POST]\n\n // echo __FUNCTION__;\n // print_r($data);\n\n // $this->render('user.index');\n }", "public function store(Request $request) {\n\n // Validate the data.\n $this->validate($request, array(\n 'name' => 'required',\n 'email' => 'required',\n ));\n\n // Store in the database\n $user = new User;\n $user->name = $request->name;\n $user->email = $request->email;\n $user->facebook = $request->facebook->null;\n $user->twitter = $request->twitter->null;\n $user->instagram = $request->instagram->null;\n $user->address = $request->address->null;\n $user->birthday = $request->birthday->null;\n $user->save();\n\n // Success message just for one request.\n Session::flash('success', 'The user was successfully saved!');\n\n // Redirect to the page of the last created user.\n return view('profile.my_profile')->withUser($user);\n }", "public function save()\n {\n $this->validate();\n if(empty($this->errors)) {\n $qb = new QB;\n $qb->conn = static::getDB();\n $columns = ['name', 'email', 'password_hash'];\n $password_hash = password_hash($this->password, PASSWORD_BCRYPT);\n $values = [\n $this->name,\n $this->email,\n $password_hash\n ];\n $qb->insert('users', $columns, $values);\n return true;\n }else{\n return false;\n }\n }", "public function store(Request $request)\n{\n\t\n\t// echo \"new user\";\n\t// die();\n\t$this->validate($request,[\n\t\t'name' => 'required|max:255',\n\t\t\t\t// 'address' => 'required',\n\t\t'email' => 'required|unique:users|max:255',\n\t\t// 'ph1' => 'required',\n\t\t'password' => 'required',\n\t\t]);\n\t\n\t$user = new User();\n\t\n\n\t\n\t$user->name = $request->input(\"name\");\n\t\t// $user->mname = $request->input(\"mname\");\n\t\n\t// $user->address = $request->input(\"address\");\n\t$user->ph1 = $request->input(\"ph1\");\n\t\t// $user->ph2 = $request->input(\"ph2\");\n\t$user->email = $request->input(\"email\");\n\t$user->password = Hash::make($request->input(\"password\"));\n\t\t// $user->photourl = $photourl;\n\t$user->save();\n\n\t\n\t$credentials = array(\n\t\t'email' => $request->input(\"email\"),\n\t\t'password' => $request->input(\"password\")\n\t\t);\n\n\tif (Auth::attempt($credentials)) {\n\t\treturn redirect()->action('HomeController@index');\n\t}\n\t\n\n\t\n\n}", "public function SaveToDb() {\n\t\tif ($this->parameter_check) {\n\t\t\t$db=$GLOBALS['db'];\n\t\t\t$sql=\"INSERT INTO \".$GLOBALS['database_ref'].\"user_master\n\t\t\t\t\t\t(full_name,username,password,identity_number,tel_cellular,tel_home,address,email_address,role_id,date_created)\n\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t'\".$this->full_name.\"',\n\t\t\t\t\t\t'\".$this->username.\"',\n\t\t\t\t\t\t'\".MD5($this->password).\"',\n\t\t\t\t\t\t'\".$this->identity_number.\"',\n\t\t\t\t\t\t'\".@$this->tel_cellular.\"',\n\t\t\t\t\t\t'\".@$this->tel_home.\"',\n\t\t\t\t\t\t'\".@$this->address.\"',\n\t\t\t\t\t\t'\".$this->email_address.\"',\n\t\t\t\t\t\t'\".$this->DefaultRole().\"',\n\t\t\t\t\t\tsysdate()\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\";\n\t\t\t//echo $sql;\n\t\t\t$result=$db->Query($sql);\n\t\t\tif ($db->AffectedRows($result) > 0) {\n\t\t\t\treturn True;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn False;\n\t\t\t}\n\t\t}\n\t}", "public function store(Request $request, StoreUserPost $user) {\n $this->model->addUser($request->all());\n Controller::FlashMessages('The user has been added', 'success');\n return redirect('/users');\n }", "public function setUser()\n\t{\n\t\t$user = User::getInstance();\n\t\t\n\t\tif ( $this->session->get( 'user_id' ) ) {\n\t\t\t$user->set( 'id', $this->session->get( 'user_id' ) );\n\t\t\t$user->read();\n\t\t}\n\t}", "public function store(UserRequest $request)\n {\n try {\n\n DB::beginTransaction();\n //upload profile pic\n $path = \"profiles/default.png\";\n $data = [\n 'name' => $request->name,\n 'email' => $request->email,\n 'role' => 'user',\n 'password' => !empty($request->password) ? bcrypt($request->password) : \"\",\n 'org_password' => !empty($request->password) ? $request->password : \"\",\n 'profile_photo_path' => empty($path) ? 'defaul.png' : $path,\n 'phone' => !empty($request->phone) ? $request->phone : \"\",\n 'address' => !empty($request->address) ? $request->address : \"\",\n 'gender' => !empty($request->gendr) ? $request->gendr : \"\",\n ];\n User::Create($data);\n DB::commit();\n return redirect(route('users.index'))->with('success', 'Record has been updated.');\n } catch ( \\Exception $e) {\n DB::rollBack();\n return Redirect::back()->withErrors(['error', 'Sorry Record not inserted.']);\n }\n }", "public function save(User $user) {\n $userData = array(\n 'user_email' => $user->getEmail(),\n 'user_salt' => $user->getSalt(),\n 'user_password' => $user->getPassword(),\n 'user_role' => $user->getRole(),\n 'user_lastname' => $user->getLastname(),\n 'user_firstname' => $user->getFirstname(),\n 'user_address' => $user->getAddress(),\n 'user_town' => $user->getTown(),\n 'user_zipcode' => $user->getZipcode()\n );\n\n if ($user->getId()) {\n $this->getDb()->update('user', $userData, array('user_id' => $user->getId()));\n } else {\n // The user has never been saved : insert it\n $this->getDb()->insert('user', $userData);\n // Get the id of the newly created user and set it on the entity.\n // $id = $this->getDb()->lastInsertId();\n $user->setEmail($user->getEmail());\n }\n }", "public function save() {\n\n if( isset( $_POST ) ) {\n // Set user id for add\n $id = null;\n // Set null if empty value\n $_POST['email'] = replace_empty_with_null( $_POST['email'] );\n // Update mode\n if( $_POST['userId'] != '' ) {\n // Set user id for update\n $id = $_POST['userId'];\n // Check if update password form is trigger\n if( isset( $_POST['password'] ) ) {\n $_POST['password'] = $this->user_model->hash( $_POST['password'] ); \n unset( $_POST['confirm_password'] ); \n } else {\n $_POST['firstName'] = ucfirst( $_POST['firstName'] );\n $_POST['surname'] = ucfirst( $_POST['surname'] );\n $_POST['initials'] = ucfirst( $_POST['initials'] );\n }\n } else {\n\n $_POST['password'] = $this->user_model->hash( $_POST['password'] );\n $_POST['firstName'] = ucfirst( $_POST['firstName'] );\n $_POST['surname'] = ucfirst( $_POST['surname'] );\n $_POST['initials'] = ucfirst( $_POST['initials'] );\n\n }\n \n $this->user_model->save( $_POST, $id );\n echo \"true\";\n } else {\n echo \"error\";\n }\n\n }", "public function store()\n\t{\n\n\t\t// get current user\n\t\t$user = Auth::user();\n\n\t\t// get data\n\t\t$input = Input::get();\n\n\t\t// create record\n\t\t$profile = new Profile;\n\t\t$profile->business = $input['business'];\n\t\t$profile->name = $input['name'];\n\t\t$profile->last = $input['last'];\n\t\t$profile->contact = $input['contact'];\n\t\t$profile->address = $input['address'];\n\t\t$profile->address2 = $input['address2'];\n\t\t$profile->city = $input['city'];\n\t\t$profile->state = $input['state'];\n\t\t$profile->zip = $input['zip'];\n\t\t$profile->country = $input['country'];\n\t\t$profile->save();\n\n\t\t// Link it to user\n\t\t$user->profiles()->attach($profile->id);\n\n\t\treturn Redirect::back();\n\t\t\n\t}" ]
[ "0.8169066", "0.78635836", "0.75964403", "0.75511473", "0.7436346", "0.72348166", "0.70863855", "0.7070493", "0.705984", "0.70529515", "0.6999247", "0.69601464", "0.69207853", "0.68873847", "0.68788934", "0.68714774", "0.6853348", "0.6822383", "0.68148804", "0.6784842", "0.67844456", "0.677272", "0.67684954", "0.6699595", "0.6694541", "0.66729397", "0.66691494", "0.6657342", "0.6656573", "0.6653264", "0.6645619", "0.6645448", "0.6637166", "0.6617817", "0.6613417", "0.66103023", "0.6606007", "0.65945387", "0.65614986", "0.6560831", "0.65508026", "0.65475285", "0.6534798", "0.65306765", "0.6515895", "0.6503902", "0.650089", "0.648773", "0.64832914", "0.64782226", "0.64759725", "0.64569455", "0.6445127", "0.6435665", "0.6430901", "0.642996", "0.64295304", "0.6419748", "0.6409688", "0.6408106", "0.64025605", "0.64006174", "0.6398822", "0.6389697", "0.6384476", "0.6384113", "0.63831854", "0.6382457", "0.63797385", "0.6379478", "0.63718957", "0.63599974", "0.6357486", "0.6355388", "0.63552314", "0.63537616", "0.63492644", "0.63474023", "0.63374615", "0.6327889", "0.63245964", "0.6318651", "0.6313314", "0.63132864", "0.6309527", "0.6294969", "0.6293048", "0.62892646", "0.6286777", "0.62805617", "0.62788534", "0.6270159", "0.62608635", "0.62593096", "0.6256888", "0.6250835", "0.6250771", "0.6247343", "0.6240365", "0.623898", "0.62379766" ]
0.0
-1
Updates the permission of the user from AJAX Request.
public function updatePermission($id) { if (!in_array($id, $this->organizationManager->getOrganizationUsers(session('org_id')))) { return false; } $permission = Input::get('permission'); $availablePermissions = Role::lists('id')->toArray(); if (in_array($permission, $availablePermissions)) { $this->userService->updatePermission($id, $permission); return 'success'; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ajax_updateperm() {\n\t\t\t\n\t\t\tif( !isset($_GET['usergroup']) || !isset($_GET['key']) || !isset($_GET['value']) )\n\t\t\t\tdie( \"error\" );\n\t\t\t\t\n\t\t\t$Usergroup = $this->usergroup_model->GetByID( intval( $this->input->get('usergroup') ) );\n\t\t\tif( $Usergroup == false ) die( \"error\" );\n\t\t\t\n\t\t\tif( $_GET[ \"key\" ] == \"name\" ) {\n\t\t\t\t$NewName = $this->db->escape( $_GET[ \"value\" ] );\n\t\t\t\tget_instance()->db->query( \"UPDATE `usergroups` SET `Name` = {$NewName} WHERE `ID` = {$Usergroup->ID};\" );\n\t\t\t\tdie( \"success\" );\n\t\t\t}\n\t\t\t\n\t\t\tif( $_GET[ \"value\" ] == \"enable_cat\" || $_GET[ \"value\" ] == \"disable_cat\" ) {\n\t\t\t\t$CatID = intval( $_GET['key'] );\n\t\t\t\t\n\t\t\t\tif( $_GET[ \"value\" ] == \"enable_cat\" ) {\n\t\t\t\t\t$Usergroup->AddTicketCat( $CatID );\n\t\t\t\t}else{\n\t\t\t\t\t$Usergroup->RemoveTicketCat( $CatID );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdie( \"success\" );\n\t\t\t}\n\t\t\t\n\t\t\t$Permission = Permissions::GetByKey( $this->input->get('key') );\n\t\t\tif( $Permission == false ) die( \"error\" );\n\t\t\t\n\t\t\tif( intval( $_GET['value'] ) == 1 ) {\n\t\t\t\t$Usergroup->GivePermission( $Permission->ID );\n\t\t\t}else{\n\t\t\t\t$Usergroup->RemovePermission( $Permission->ID );\n\t\t\t}\n\t\t\t\n\t\t\tdie( \"success\" );\n\t\t}", "public function actionUpdate()\n {\n\t\t/**\n\t\t * @author \t: ptrnov <[email protected]>\n\t\t * @since \t\t: 1.2\n\t\t * Subject\t\t: PERMISSION PER MODUL.\n\t\t * Metode\t\t: PUT (Update)\n\t\t * URL\t\t\t: http://production.kontrolgampang.com/login/user-permissions\n\t\t * Body Param\t: ACCESS_ID (key),MODUL_ID (key), BTN_VIEW/BTN_CREATE/BTN_UPDATE/BTN_DELETE/STATUS.\n\t\t * Alert\t\t: {\"result\": \"ACCESS_ID-Empty\"}=> Field ACCESS_ID Param tidak ada.\n\t\t *\t\t\t\t {\"result\": \"User-Not-Exist\"}=> user tidak di temukan.\n\t\t */\n\t\t$paramsBody \t\t= Yii::$app->request->bodyParams;\n\t\t$accessId\t\t\t= isset($paramsBody['ACCESS_ID'])!=''?$paramsBody['ACCESS_ID']:'';\n\t\t$modulId\t\t\t= isset($paramsBody['MODUL_ID'])!=''?$paramsBody['MODUL_ID']:'';\n\t\t$btnView\t\t\t= isset($paramsBody['BTN_VIEW'])!=''?$paramsBody['BTN_VIEW']:'';\n\t\t$btnCreate\t\t\t= isset($paramsBody['BTN_CREATE'])!=''?$paramsBody['BTN_CREATE']:'';\n\t\t$btnUpdate\t\t\t= isset($paramsBody['BTN_UPDATE'])!=''?$paramsBody['BTN_UPDATE']:'';\n\t\t$btnDelete\t\t\t= isset($paramsBody['BTN_DELETE'])!=''?$paramsBody['BTN_DELETE']:'';\n\t\t$status\t\t\t\t= isset($paramsBody['STATUS'])!=''?$paramsBody['STATUS']:'';\n\t\t\n\t\tif($accessId){\n\t\t\t$cntUser= User::find()->where(['ACCESS_ID'=>$accessId])->count();\n\t\t\tif($cntUser){\n\t\t\t\t$modalPermission = AppModulPermission::find()->where(['ACCESS_ID'=>$accessId,'MODUL_ID'=>$modulId])->one();\n\t\t\t\tif ($btnView!=''){$modalPermission->BTN_VIEW=$btnView;};\n\t\t\t\tif ($btnCreate!=''){$modalPermission->BTN_CREATE=$btnCreate;};\n\t\t\t\tif ($btnUpdate!=''){$modalPermission->BTN_UPDATE=$btnUpdate;};\n\t\t\t\tif ($btnDelete!=''){$modalPermission->BTN_DELETE=$btnDelete;};\n\t\t\t\tif ($status!=''){$modalPermission->STATUS=$status;};\n\t\t\t\tif($modalPermission->save()){\n\t\t\t\t\t$modalView = AppModulPermission::find()->where(['ACCESS_ID'=>$accessId,'MODUL_ID'=>$modulId])->one();\n\t\t\t\t\treturn array('USER_PERMISSIONS'=>$modalView);\t\n\t\t\t\t}else{\n\t\t\t\t\treturn array('result'=>'permission-Not-Exist');\n\t\t\t\t}\t\t\t\t\n\t\t\t}else{\n\t\t\t\treturn array('result'=>'User-Not-Exist');\n\t\t\t}\n\t\t}else{\n\t\t\treturn array('result'=>'ACCESS_ID-Empty');\n\t\t}\n\t}", "public function UpdatePermission() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n\n if (isset($_REQUEST['data'])) {\n\n foreach ($_REQUEST['data'] as $data) {\n if (isset($data['idUser'])) {\n $idUser = $data['idUser'];\n }\n if (isset($data['client'])) {\n $client = (int) ($data['client'] === 'true');\n }\n if (isset($data['fournisseur'])) {\n $fournisseur = (int) ($data['fournisseur'] === 'true');\n }\n if (isset($data['article'])) {\n $article = (int) ($data['article'] === 'true');\n }\n if (isset($data['stock'])) {\n $stock = (int) ($data['stock'] === 'true');\n }\n if (isset($data['factureAchat'])) {\n $factureAchat = (int) ($data['factureAchat'] === 'true');\n }\n if (isset($data['factureVente'])) {\n $factureVente = (int) ($data['factureVente'] === 'true');\n }\n if (isset($data['commandeAchat'])) {\n $commandeAchat = (int) ($data['commandeAchat'] === 'true');\n }\n if (isset($data['commandeVente'])) {\n $commandeVente = (int) ($data['commandeVente'] === 'true');\n }\n if (isset($data['bonLivraisonAchat'])) {\n $bonLivraisonAchat = (int) ($data['bonLivraisonAchat'] === 'true');\n }\n if (isset($data['bonLivraisonVente'])) {\n $bonLivraisonVente = (int) ($data['bonLivraisonVente'] === 'true');\n }\n if (isset($data['paiement'])) {\n $paiement = (int) ($data['paiement'] === 'true');\n }\n }\n\n if (!empty($idUser)) {\n try {\n $sql = $this->db->prepare(\"UPDATE permission SET client = :client, fournisseur = :fournisseur, article = :article, stock = :stock, factureAchat = :factureAchat,\" .\n \"factureVente = :factureVente, commandeAchat = :commandeAchat, commandeVente = :commandeVente, bonLivraisonAchat = :bonLivraisonAchat,\" .\n \"bonLivraisonVente = :bonLivraisonVente, paiement = :paiement WHERE idUser= :idUser\");\n\n $sql->bindParam('client', $client, PDO::PARAM_INT);\n $sql->bindParam('fournisseur', $fournisseur, PDO::PARAM_INT);\n $sql->bindParam('article', $article, PDO::PARAM_INT);\n $sql->bindParam('stock', $stock, PDO::PARAM_INT);\n $sql->bindParam('factureAchat', $factureAchat, PDO::PARAM_INT);\n $sql->bindParam('factureVente', $factureVente, PDO::PARAM_INT);\n $sql->bindParam('commandeAchat', $commandeAchat, PDO::PARAM_INT);\n $sql->bindParam('commandeVente', $commandeVente, PDO::PARAM_INT);\n $sql->bindParam('bonLivraisonAchat', $bonLivraisonAchat, PDO::PARAM_INT);\n $sql->bindParam('bonLivraisonVente', $bonLivraisonVente, PDO::PARAM_INT);\n $sql->bindParam('paiement', $paiement, PDO::PARAM_INT);\n $sql->bindParam('idUser', $idUser, PDO::PARAM_INT);\n\n $sql->execute();\n\n if ($sql) {\n $success = array('status' => \"Success\", \"msg\" => \"Successfully updated\");\n $this->response($this->json($success), 200);\n }\n // If invalid inputs \"Bad Request\" status message and reason\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid params \");\n $this->response($this->json($error), 400);\n } catch (Exception $ex) {\n $this->response('', $ex->getMessage()); // If no records \"No Content\" status\n }\n }\n }\n\n // If invalid inputs \"Bad Request\" status message and reason\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid param\");\n $this->response($this->json($error), 400);\n }", "public function permissionChange()\n {\n $data = $this->request->all();\n unset($data['_token']);\n $arr = explode('_', $data['id']);\n $permissions = Permission::all()->sortBy('name')->pluck('name', 'id');\n $roles = Role::all()->sortBy('name')->pluck('name');//return json_encode($roles);\n $data['permission'] = $permissions[$arr[1]];\n $data['role'] = $roles[$arr[2]];\n $role = Role::findByName($data['role']);\n\n //first check if there are admin changes, only super admins have access to this\n if (strstr($data['permission'], 'admin')) {\n if (!Auth::user()->hasRole('super admin')) {\n $data['error'] = 'Only super administrators can edit this permission';\n } else {\n if ($data['val'] === '1') {\n $role->revokePermissionTo($data['permission']);\n $data['val'] = '0';\n } else {\n $role->givePermissionTo($data['permission']);\n $data['val'] = '1';\n }\n }\n } //check all other requests\n else if ($data['val'] === '1') {\n $role->revokePermissionTo($data['permission']);\n $data['val'] = '0';\n } else {\n $role->givePermissionTo($data['permission']);\n $data['val'] = '1';\n }\n\n return json_encode($data);\n }", "function ajax()\n\t{\n\t\t$method = $this->input->post('method');\t\t\n\t\t\n\t\tswitch( $method )\n\t\t{\n\t\t\tcase \"modify\" :\n\t\t\t\t$user_map_id = $this->input->post('user_map_id'); \n\t\t\t\t$modified = false;\n\t\t\t\t$deniedpermissions = $this->getDeniedPermissionByUserMapId($this->input->post(), true);\t\t\n\t\t\t\t$permission_ids = $this->input->post('permission_id');\t\t\t\t\n\t\t\t\tif($deniedpermissions)\t\n\t\t\t\t{\n\t\t\t\t\tif( ! $permission_ids )\n\t\t\t\t\t\t$modified = $this->pmdf->dbUpdate('delete', $user_map_id) ? true : false;\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\t$should_update = array_values( array_intersect( $deniedpermissions, $permission_ids ) );\n\t\t\t\t\t\tif($should_update)\t\t\n\t\t\t\t\t\t\t$modified = $this->pmdf->dbUpdate('mixupdate', $user_map_id, $should_update) ? true : false;\t\t\t\t\t\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$modified = $this->pmdf->dbUpdate('delete', $user_map_id) ? true : false;\t\n\t\t\t\t\t\t$should_insert = array_values( array_diff( $permission_ids, $deniedpermissions ) );\n\t\t\t\t\t\tif($should_insert)\n\t\t\t\t\t\t\t$modified = $this->pmdf->insertInto(array('user_map_id' => $user_map_id, 'permission_id' => $should_insert)) ? true : ( $modified ? true : false );\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\tif( ! $permission_ids )\n\t\t\t\t\t{\n\t\t\t\t\t\techo json_encode( array(\"event\" => \"error\", \"msg\" => 'Please choose permission to deny' ) );\n\t\t\t\t\t\texit;\n\t\t\t\t\t}\n\t\t\t\t\t$should_insert = $permission_ids;\n\t\t\t\t\t$modified = $this->pmdf->insertInto(array('user_map_id' => $user_map_id, 'permission_id' => $should_insert)) ? true : false;\n\t\t\t\t}\n\t\t\t\tif( $modified )\n\t\t\t\t\techo json_encode( array(\"event\" => \"success\", \"msg\" => _e('permission modified')) );\n\t\t\t\telse\n\t\t\t\t\techo json_encode( array(\"event\" => \"error\", \"msg\" => _e('permission unchanged')) );\t\n\t\t\t\tbreak;\t\t\t\t\n\t\t}\n\t}", "public function ajax_user_can()\n {\n }", "public function ajax_user_can()\n {\n }", "function updatePermissionsForUser($request, $user)\n{\n $userPermissionModel = new UserPermission;\n $userpermissions =\n $userPermissionModel->where([\n 'user_id' => $user->id\n ])->get();\n\n // store the permission IDs for the user in an array\n $permissionids = [];\n foreach ($userpermissions as $userpermission) {\n $permissionids[] = $userpermission->permission_id;\n }\n\n // check if the permissions $_POST array is empty and if it is make it an empty array\n if (!empty($request['permissions'])) {\n $permissions = $request['permissions'];\n } else {\n $permissions = [];\n }\n\n // delete permissions which were in tcp_user_permissions but have not been selected\n foreach ($permissionids as $userpermissionId) {\n if (!in_array($userpermissionId, $permissions)) {\n $userPermissionModel->where([\n 'permission_id' => $userpermissionId,\n 'user_id' => $user->id\n ])->delete();\n }\n }\n\n // add permissions which were not in tcp_user_permissions but have been selected\n foreach ($permissions as $permission) {\n if (!in_array($permission, $permissionids)) {\n $userPermissionModel->create([\n 'permission_id' => $permission,\n 'user_id' => $user->id\n ]);\n }\n }\n}", "public function update(Request $request, Permission $permission)\n {\n //\n }", "public function update(UpdateUserPermissionRequest $request, UserPermission $userPermission) {\n\t\tif($request->has(\"entity\")) {\n\t\t\t$userPermission->entity = $request->input(\"entity\");\n\t\t}\n\n\t\tif($request->has(\"label\")) {\n\t\t\t$userPermission->label = $request->input(\"label\");\n\t\t}\n\n\t\tif($request->has(\"user_type_id\")) {\n\t\t\t$userPermission->user_type_id = $request->input(\"user_type_id\");\n\t\t}\n\n\t\tif($request->has(\"user_type_id\")) {\n\t\t\t$userPermission->user_type_id = $request->input(\"user_type_id\");\n\t\t}\n\n $userPermission->save();\n\n\n return $this->item($userPermission, $this->transformer);\n }", "public function update(Request $request, $id){\n try{\n\n //Find the user using the id\n $user = User::find($id);\n\n if (!$user) { //If the user not found\n return $this->userNotFoundResponse();\n }\n \n //Delete all old permissions\n $user->permissions()->detach();\n \n //Add new permissions\n foreach($request->all() as $row){\n $result = $user->permissions()->attach(Permission::where('name', $row)->first());\n }\n\n //Get all permissions of the user\n $permissions = $user->permissions()->get();\n //Get all System Modules with thier permissions\n $sysModules = SystemModule::with('permissions')->get();\n\n\n //build the response\n $code = 200;\n $status = 'success';\n $message = 'The permissions have been updated successfully';\n $dataContent = [\n 'user_permissions' => $permissions->toArray(),\n 'sysModulesPermissions'=> $sysModules->toArray()\n ];\n\n \n\n }catch (Exception $e) {\n\n //build the response\n $code = 401;\n $status = 'Exception';\n $message = \"Something went wrong\";\n $dataContent = $e;\n }\n\n return $this->returnApiResult($code, $status, $message, $dataContent);\n \n }", "function updateRole()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $roleId = $this->input->post('id');\n $permission = $this->input->post('permission');\n\n $result = $this->user_model->getRoleById($roleId);\n $roleInfo=$result;\n $roleInfo->permission = $permission;\n $result = $this->user_model->updateRole($roleInfo, $roleId);\n\n if ($result == true) {\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 //redirect('roleListing');\n\n }\n }", "public function update(Request $request)\n {\n try{\n $per = Permission::findOrFail($request->input('id'));\n }\n\n catch(ModelNotFoundException $e){\n return $this -> returnOnError(\"Permission Not exist\" , false);\n }\n\n $requestInfo = $request->input('updatePermission');\n $updated = $per->update($requestInfo);\n if(!$updated){\n\n return $this -> returnOnError(\"Failed to updated Permission\" , false);\n }\n return $this -> returnOnSuccess(\"Permission Updated Successfully\" , true);\n }", "public function updatePermission() {\n try {\n if (!($this->permission instanceof Base_Model_ObtorLib_App_Core_Doc_Entity_Permission)) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception(\" Permission Entity not intialized\");\n } else {\n $objPermission = new Base_Model_ObtorLib_App_Core_Doc_Dao_Permission();\n $objPermission->permission = $this->permission;\n return $objPermission->updatePermission();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception($ex);\n }\n }", "public function updatePermissions(Request $request, User $user)\n {\n // dd($request);\n // dd($user->id);\n\n //\n // Updates the Detail Table (Synchronizing)\n //\n $profileInfo = $user->profile;\n // dd($profileInfo);\n // dd($request->input('permissionsAssigned')); // list of the permissions to be assigned\n\n // $profileInfo->roles()->sync($request->input('rolesAssigned'));\n $this->syncPermissions($profileInfo, $request->input('permissionsAssigned'));\n\n // @todo: Update log updated_by / updated timestamp\n\n return back()->with('success', __('Permissions Updated') );\n }", "public function update(PermissionUpdateRequest $request, $id)\n {\n /* Update Permission name */\n if (Auth::user()->hasRole('superadmin')) {\n \n $permission = Permission::findOrFail($id);\n $resultPermission = $permission->update([\n 'name' => $request->permission\n ]);\n\n /* check Permission and toast message */\n if($resultPermission){\n Toastr::success('Permission Successfully Updated', 'Success');\n return redirect()->route('super-admin.permission.index');\n }\n abort(404);\n }\n abort(403);\n \n }", "public function update(Request $request, Permission $permission)\n {\n $data = $request->all();\n $validator = $this->validator($data);\n //if($validator->fails()) return redirect()->back()->withErrors($validator)->withInput();\n if($validator->fails()) return response()->json($validator->messages(),422);\n $permission->update($data);\n return response()->json(['permissions' => $permission,'msg' => 'Zaktualizowano uprawnienie'],201);\n return redirect()->route('permission.index')->withSuccess('Uprawnienie zaktualizowano');\n }", "public function update(Request $request, $pid)\n {\n $permissions= UserPermissions::find($pid);\n $permissions->role=$request->get('role');\n $permissions->permissions=json_encode($request->get('permissions'));\n $permissions->save();\n\n return redirect('layouts.dashboard.admin.crud.permissions.edit')->with('successful', 'Permission(s) has been added');\n }", "public function update(User $actor, Permission $permission)\n {\n return $actor->can('set permissions');\n }", "public function modifyAdminSetting(Request $request) {\n try {\n\n if (RequestFacade::ajax()) {\n return UserServiceProvider::modifyAdminSetting($request->all());\n }\n abort(404);\n } catch (Exception $e) {\n Log::error(__CLASS__ . \"::\" . __METHOD__ . ' ' . $e->getFile() . $e->getLine() . $e->getMessage());\n abort(404);\n }\n }", "function update_role_permision() {\n\t\t$user_role = $this->get_role_permission($_POST['role_id']);\n\t\tforeach ($user_role->result() as $role) {\n\t\t\t\n\t\t\t$this->db->where('entry_id', $role->entry_id);\n\t\t\t$list = $_POST['role_permission'];\n\t\t\t$allow = isset($list[$role->entry_id]) ? 1 : 0;\n\t\t\t$this->db->update('system_security.security_role_permission', array('allow_deny' => $allow));\n\t\t}\n\t}", "public function update(Request $request, Permission $permission)\n {\n $permission = $permission->update($request->all());\n }", "function updateUser()\r\n {\r\n return $this->UD->user_update($_GET['uid']);\r\n }", "private function updateUser(){\n\t\t$data['datosUsuario'] = $this->users->get($_REQUEST[\"idusuario\"]);\n\t\t$data['tipoUsuario'] = Seguridad::getTipo(); \n\t\tView::show(\"user/updateForm\", $data);\n\t}", "public function update(Request $request, Role $role)\n {\n\n $id =$role->id;\n $validated = $request->validate([\n 'name' => \"required|unique:roles,name,$id\",\n ]);\n\n $role->update($request->except('permissions'));\n $permissions = $request->input('permissions') ? $request->input('permissions') : [];\n\n if($request->ajax()){\n $permissions = explode(',', $permissions);\n $role->givePermissionTo($permissions);\n // If request from AJAX\n return [\n 'success' => true,\n 'redirect' => route('roles.index'),\n ];\n } else {\n $role->givePermissionTo($permissions);\n return redirect()->route('roles.index');\n }\n }", "public function update(){\n\t\tparent::update(\"UPDATE Users set privacy_setting = \" . $this->privacy_setting . \" where id = \" . $this->id);\n\t}", "public function update(Request $request, $id) {\n\n //Check Edit Access Permission\n $this->EditAccess = Permit::AccessPermission('permissions-edit');\n if (!$this->EditAccess)\n return redirect('errors/401');\n\n //Ajax request\n if (request()->ajax()) {\n $Permission = Permission::findOrFail($id);\n $Permission->update(['status' => $request->status]);\n return response()->json(['response' => config('global.statusUpdated')]);\n }\n $Permission = Permission::findOrFail($id);\n\n\n // validate\n $validator = Validator::make($request->all(), [\n 'groupname' => 'required'\n ]);\n\n // validation failed\n if ($validator->fails()) {\n\n return redirect('admin/permissions/' . $id . '/edit')\n ->withErrors($validator)->withInput();\n } else {\n\n $input = $request->only(['groupname', 'status']);\n $collection = collect($request->permissions);\n $input['permissions'] = $collection->toJson();\n $Permission->fill($input)->save();\n\n //logActivity\n LogActivity::addToLog('Permission - ' . $request->groupname, 'updated');\n\n Session::flash('message', config('global.updatedRecords'));\n\n return redirect('admin/permissions');\n }\n }", "public function update(Request $request, $id)\n {\n $user = User::find($id);\n\n if (!$user) {\n abort(404);\n }\n\n if (Auth::user()->hasPrivilege('Users')) {\n $this->saveUserPermissions(\n $user,\n collect($request->input('permissions')),\n );\n }\n\n return redirect()\n ->back()\n ->with('success', 'Edited User');\n }", "function ajax_user_can() {\n\t}", "public function update($id, UserRequest $request)\n\t{\n $request['modified_by'] = Auth::id();\n $request['password'] = bcrypt($request->input('password'));\n $permissions = $request->get('permission_ids');\n Permission_User::where('user_id', $id)->delete();\n if ($permissions != null) {\n foreach ($permissions as $permission) {\n Permission_User::create([\n 'user_id' => $id,\n 'permission_id' =>\n $permission,\n ]);}\n }\n $user = User::findOrFail($id);\n $user->update($request->all());\n \\Session::flash('flash_message', 'User Modified');\n\n return redirect('users');\n\t}", "public function update(Request $request, $id)\n {\n $reqExecTimeId = 50;\n\n if ($this->privileges[\"role\"] != 3 && $this->privileges[\"role\"] != 2) {\n return response()->json([\n 'message' => 'Forbidden'\n ], 403);\n }\n $new_data = json_decode($request->getContent(), true);\n if ($new_data == null) {\n $new_data = $request->all();\n }\n\n try {\n $Permission = Permission::findOrFail($id);\n\n $Permission->setSelf($new_data);\n // if ($Permission->isValide()) {\n $Permission->save();\n // }\n $res = new PermissionTemplate($Permission);\n } catch (ModelNotFoundException $e) {\n $res = response()->json([\n 'error' => \"Invalid_or_missing_fields\"\n ], 500);\n }\n\n $this->workEnd($reqExecTimeId);\n return $res;\n }", "function thietlap($UserID){\n if($this->session->userdata('permission')!=1){\n redirect(base_url());\n exit();\n }\n $data=$this->default_model->getInfoID($this->_table,array(\"userid\" => $UserID));\n $data['permission']=$data['permission'];\n $data['template']='admin/form_thietlap'; \n $per=$this->input->post(\"permission\");\n //Neu dang nhap loi\n if($per==\"\")\n {\n }\n else\n {\n $cdata=array(\"permission\" => $per);\n $this->default_model->updateDuLieu($this->_table,$cdata,array(\"userid\" => $UserID));\n redirect(base_url().\"thanhvien/quanlythanhvien/1/g/\");\n exit(); \n }\n $this->load->view('admin/admin',$data); \n }", "public function profileUpdate(UpdateUserRequest $request,$user_id)\n {\n\t\t$data=array();\n\t\t $result =array();\n\t\t $requestData = User::where('id',$user_id);\n\t\t $stored_data = User::where('id',$user_id)->first()->toArray();\n\t\t \n\t\tif($request->ajax()){\n\t\t\t$data =array();\n\t\t\t$data['first_name']= $request->first_name;\n\t\t\t$data['last_name']= $request->last_name;\n\t\t\n\t\t\t$requestData->update($data);\n\t\t\t\n\t\t\t//UPDATE PROFILE EVENT LOG END \n\t\t\t$result['success'] = true;\n\t\t\t$result['message'] = 'Your details has been successfully changed.';\n\t\t \n\t\t return Response::json($result, 200);\n\t\t}\n\t\t\n }", "public function update(PermissionRequest $request, $id)\n {\n // Authorization is declared in the PermissionRequest\n\n // Retrieve the validated input data....\n $validatedData = $request->validated();\n $permission = Permission::findOrFail($id);\n $permission->update($validatedData);\n return response()->json([\n 'status' => true, \n 'message' => \"Permission \\\"{$permission->name}\\\" updated successfully.\",\n 'data' => Permission::find($permission->id)\n ], 200);\n }", "public function update(Request $request, RolePermission $rolePermission)\n {\n //\n }", "public function updated(Permission $permission)\n {\n //\n }", "public function updateAjax(Request $request, User $user) \n {\n $request->validate([\n 'name' => 'required|string|max:255'\n ]);\n $userUpdated = ['name' => $request->name];\n\n $user->fill($userUpdated)->save();\n\n return response()->json([\n 'updated' => true,\n 'id' => $user->id,\n ]);\n }", "public function update(Request $request, $id)\n {\n $status = Permission::where('name',$request->permission_name)->first();\n\n if($status !== null){\n return redirect()->back()->with('warning',\"Already updated permission exist ! !\");\n }else{\n $res = Permission::find($id)->update([ 'name' => $request->permission_name ]);\n if($res)\n return redirect()->back()->with('success',\"Permission updated\");\n else\n return redirect()->back()->with('warning',\"Unable to update role !\");\n\n }\n }", "public function update(User $user, $id)\n {\n if ($user->id == $id || $user->hasPermission('update_' . $this->name)) {\n return true;\n }\n\n return abort(403, __('messages.access-denied'));\n }", "public function update(Request $request, Role $role, Permission $permission)\n {\n //\n }", "public function actionChangemoderator() {\n $json = array();\n if (isset(\\Yii::$app->request->post()['id']) && isset(\\Yii::$app->request->post()['moderator'])) {\n $model = BbiiMember::find(\\Yii::$app->request->post()['id']);\n if ($model !== null) {\n $model->moderator = Html::encode(\\Yii::$app->request->post()['moderator']);\n $model->save();\n $json['success'] = true;\n }\n }\n echo json_encode($json);\n \\Yii::$app->end();\n }", "public function adminUser(Request $request)\n {\n if (Auth::user()->role_id == 1) {\n $user = Users::findOrFail($request->input('user_id'));\n //нельзя снять права админа с самого себя и юзера с id = 1\n if (!((Auth::user()->id == $user->id) || ($user->id == 1))) {\n $user->role_id = $request->input('action');\n $user->save();\n $data = array( 'text' => 'success' );\n } else {\n $data = array( 'text' => 'fail' . $request->input('action') );\n }\n } else {\n $data = array( 'text' => 'fail' . $request->input('action') );\n }\n return Response::json($data);\n }", "public function updateUser(Request $request)\n { \n\n if($request->ajax()){\n\n $repositories = new UsersRepositories;\n $user = $repositories->getUser( $request->id );\n $auth = $repositories->getUser( Hashids::encode ( Auth::user()->id ) );\n $ranks = $repositories->AgentRanks();\n $agents = $repositories->Recruiters();\n $recruiter = null;\n\n if( !empty( $user->recruiter) ) { \n $recruiter = $repositories->getRecruiter( $user->recruiter );\n }\n\n $view = view('dashboard.users.forms.update')->with(compact('user','auth', 'ranks', 'agents', 'recruiter'))->render();\n\n return response()->json(['content'=> $view ]);\n\n }\n\n }", "public function ajaxResponse(Request $request, $id = 0) {\n if ($request->isMethod('post')) {\n $data = $request->all();\n unset($data['_token']);\n User::where('id', $_POST['id'])->update($data);\n }\n }", "public function update_profile(Request $request) {\n //type can be: mobile/phone/email\n $type = $request->type;\n //this new value is already validated in javascript\n $new_value = $request->new_value;\n $user = User::find($request->user_id);\n //dd($user);\n switch ($type) {\n case 'mobile':\n $user->gsm = $new_value;\n break;\n case 'phone':\n $user->tel = $new_value;\n break;\n case 'email':\n $user->email = $new_value;\n break;\n }\n\n $user->save();\n return 'success';\n }", "public function update(Request $request)\n {\n $data = $request->all();\n\n return Permission::whereId($request->get('id'))->update($data);\n }", "public function update(PermissionsRequest $request)\n {\n $permission = Permission::where('id',$request['permissionId'])->first();\n $permission->name = $request['name'];\n $permission->updated_by = \\Auth::user()->id;\n $permission->save();\n \\Session::flash('success', 'well done! permission '.$request['name'].' has been successfully updated!');\n return redirect()->back();\n }", "public function promptUserForPermissions() {\r\n\t\t$url = 'http://www.facebook.com/dialog/oauth?' . http_build_query($this->getParamsForLogin());\r\n\t\tHelper_Request::respond($url, Helper_Request::RESPONSE_REDIR_JS);\r\n\t}", "public function update_account()\n\t{\n\t\t$data = $this->input->post();\n\t\t\n\t\t$success = $this->user_model->safe_update($this->user->id, $data);\n\t\t\n\t\tif ( $success )\n\t\t{\n\t\t\t$this->json['message'] = 'Your account details have been successfully updated.';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->json['status'] = 'error';\n\t\t\t$this->json['message'] = 'There were errors when attempting update your account.';\n\t\t}\n\t\t\n\t\t$this->json['content'] = $this->update_account_content();\n\t\t\n\t\treturn $this->ajax_response();\n\t}", "public function update(Request $request)\n {\n // Si no tiene permisos para modificar o visualizar lo echamos\n if (!auth()->user()->can('admin-roles-update')) {\n app()->abort(403);\n }\n\n $idpermissions = explode(\",\", $request->input('results'));\n $idrole = $request->input(\"id\");\n\n // Compruebo que el rol al que se quieren asignar datos existe\n $role = Role::find($idrole);\n\n if (is_null($role)) {\n app()->abort(500);\n }\n\n try {\n DB::beginTransaction();\n\n // Asigno el array de permisos al rol\n $role->syncPermissions($idpermissions);\n\n DB::commit();\n\n // Y Devolvemos una redirección a la acción show para mostrar el usuario\n return redirect()->route('roles.edit', array($idrole, '2'))\n ->with('success', trans('roles/lang.okUpdate_permission'))\n ->with('tab', \"tab_2\");\n } catch (\\PDOException $e) {\n DB::rollBack();\n return redirect()->route('roles.edit', array($idrole, '2'))\n ->with('error', trans('roles/lang.errorediciion'))\n ->with('tab', \"tab_2\");\n }\n }", "public function testUpdatePermissionSet()\n {\n }", "public function updateUser($request)\n {\n $this->name = $request[\"name\"];\n $this->email = trim($request[\"email\"]);\n $this->enabled = $request[\"enabled\"];\n\n if (array_key_exists(\"password\", $request)) {\n $this->password = $this->passwordHash($request[\"password\"]);\n }\n\n if ($request[\"reset-password\"]) {\n $this->password = $this->passwordHash($this->generatePassword(12));\n }\n\n if (Auth::user()->isAdministrator()) {\n $this->access_level = $request[\"access_level\"];\n $this->group_id = $request[\"group_id\"];\n }\n $this->update();\n }", "public function update(User $user)\n {\n if ($user->can('update_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function actionChangeUserStatus()\n {\n if (Yii::$app->request->isAjax) {\n $data = Yii::$app->request->post();\n $login = $data['login'];\n $model = UserLikeStatus::find()->where(['login' => $login])->one();\n if ($model) {\n $model->status = $model->status ? 0 : 1;\n } else {\n $model = new UserLikeStatus();\n $model->login = $login;\n $model->status = true;\n }\n\n $model->save();\n\n $text = $model->status ? 'Unlike' : 'Like';\n $response = Yii::$app->response;\n $response->format = \\yii\\web\\Response::FORMAT_JSON;\n $response->data = ['label' => $text];\n $response->statusCode = 200;\n\n return $response;\n } else throw new \\yii\\web\\BadRequestHttpException;\n }", "public function update(Request $request, User $member)\n {\n $params = $request->validate([\n 'role' => 'required',\n ]);\n\n $member->toggleRole($params['role']);\n\n return json_encode([\n 'changed' => $member->hasRole($params['role']),\n ]);\n }", "public function submitaccesspermissionAction()\r\n\t{\r\n\t\t$this->view->ses_user=$ses_user=$_SESSION['bsc_session']['user_id'];\r\n\t\t$this->view->ses_role=$ses_role=$_SESSION['bsc_session']['account_id'];\r\n\t\t$user_id = trim($this->_request->getParam('user_id',\"\"));\r\n\t\t$key= trim($this->_request->getParam('keyy',''));\r\n\t\t$menu_id = ($this->_request->getParam('menu_id',\"\"));\r\n\t\t$ob_Permission\t= new Permission();\r\n $ob_Permission->delete_user_permission($user_id);\r\n\t\t$ob_Permission->set_user_permission($menu_id,$user_id);\r\n\t\t$this->sessionAuth->msg_centre('Access permission updated successfully');\r\n\t\t$this->_redirect('/Accounts/accesspermission/user_key/'.$key);\r\n\t\texit;\r\n\t}", "public function act_edit_user()\n {\n $id = strip_tags($this->input->post('id'));\n $email = strip_tags($this->input->post('email'));\n $pass = strip_tags(hash('sha256',$this->input->post('password')));\n\n\n if (validation_edit_admin()) {\n $update_user = $this->dashboard->update('m_admin', array('id' => $id), array('email' => $email, 'password' => $pass));\n if ($update_user) {\n $response = array('error'=>false,'title'=>'Update Berhasil','pesan'=>'');\n echo json_encode($response);\n }\n\n }else{\n $response = array('error'=>true,'title'=>'Update Gagal!','pesan'=>strip_tags(validation_errors()));\n echo json_encode($response);\n }\n }", "public function update(Request $request, User $user)\n {\n //\n //только изменение информации, кроме head и blocked\n }", "public function voxy_update_user_info()\n {\n $data = $this->input->post();\n\n if(!(isset($data['external_user_id']) && $data['external_user_id'])){\n $this->ajax_data_return['msg'] = 'ID người dùng không hợp lệ !';\n return $this->ajax_response();\n }\n if(isset($data['expiration_date']) && $data['expiration_date'] != ''){\n $data['expiration_date'] = strtotime($data['expiration_date']);\n }\n if(isset($data['date_of_next_vpa']) && $data['date_of_next_vpa'] != ''){\n $data['date_of_next_vpa'] = strtotime($data['date_of_next_vpa']);\n }\n if(isset($data['can_reserve_group_sessions']) && $data['can_reserve_group_sessions'] != ''){\n $data['can_reserve_group_sessions'] = strtolower($data['can_reserve_group_sessions']);\n }\n\n if(isset($data['feature_group']) && $data['feature_group'] != ''){\n $api_data = $this->m_voxy_connect->add_user_to_feature_group($data['external_user_id'], $data['feature_group']);\n if($api_data && isset($api_data['error_message'])) {\n $this->ajax_data_return['msg'] = $api_data['error_message'];\n return $this->ajax_response();\n }\n }\n\n $api_data = $this->m_voxy_connect->update_profile_of_one_user($data['external_user_id'], $data);\n if($api_data && isset($api_data['error_message'])) {\n $this->ajax_data_return['msg'] = $api_data['error_message'];\n } else {\n $this->ajax_data_return['status'] = TRUE;\n $this->ajax_data_return['msg'] = 'Cập nhật thông tin người dùng thành công !';\n $this->ajax_data_return['data'] = $api_data;\n }\n\n return $this->ajax_response();\n }", "public function update(StorePermissionRequest $request, $id)\n {\n if (Auth::user()->ability('superadministrator', 'update-permissions')){\n //update the permission\n $permission=Permission::findOrFail($id);\n $permission->display_name=$request->input('display_name');\n $permission->description=$request->input('description');\n $bool=$permission->save();\n //redirection after update\n if ($bool){\n return redirect()->route('permissions.index')->with('success','well done!');\n }else{\n return redirect()->back()->with('error','Something wrong!!!');\n }\n }\n return abort(403,config('yyxt.permission_deny'));\n }", "public function changeStatus(Request $request)\n {\n $user = User::find($request->id);\n $user->is_admin = $request->is_admin;\n $user->save();\n\n return response()->json(['success'=>'Status change successfully.']);\n }", "public function update($id, Request $request) {\n\n // find role by id\n $role = Sentinel::findRoleById($id);\n // inputs\n $data = $request->get('data');\n $value = $request->get('value');\n $type = $request->get('type');\n \n //minor improvement to prevent inserting unwated values\n if(!(string)$value)\n return \"failed\";\n \n switch ($type) {\n case 'single':\n if (isset($role->permissions[$value])) {\n $role->updatePermission($value, ($data == 'true') ? true : false);\n $role->save();\n return \"update\";\n } else {\n $role->addPermission($value, ($data == 'true') ? true : false);\n $role->save();\n return \"add\";\n }\n case 'menu':\n $menu = ModuleMenu::find($value);\n if ($menu) {\n foreach ($menu->permissions as $permission) {\n $permission_name = $permission->permission;\n if (isset($role->permissions[$permission_name])) {\n $role->updatePermission($permission_name, ($data == 'true') ? true : false);\n } else {\n $role->addPermission($permission_name, ($data == 'true') ? true : false);\n }\n }\n $role->save();\n return \"success\";\n }\n return \"failed\";\n }\n }", "public function update(Request $request)\n {\n\n $this->validate($request, [\n 'name' => 'required',\n 'jsy_number' => 'required'\n ]);\n $user = Player::find($request->id);\n $user->first_name = $request->name;\n $user->country = $request->country;\n $user->run = $request->run;\n $user->save();\n\n if ($request->ajax()) {\n return response()->json(['response' => 'User Updated']);\n }\n\n return back();\n }", "public function user_update($data = array())\n\t{\n\t\tunset($data['user']['u_password']);\n\t\t\n\t\t$this->CI->logger->add('users/user_update', $data);\n\t\t\n\t\t// Update the permission cache table\n\t\t$this->CI->load->model('permissions_model');\n\t\t$this->CI->permissions_model->set_cache($data['u_id']);\n\t}", "public function update(Request $request, Server_User $server_User)\n {\n //\n }", "public function updatePermission(Request $request, $id) {\n \t$user_auth = Auth::user();\n if (!$user_auth) \n {\n return response()->json(['error'=>'Unauthorised'], 401);\n } \n\t\tif (tbl_permission::where('id', $id)->exists())\n\t\t {\n $validator = Validator::make($request->all(), [ \n\t\t 'menu_id' => 'required', \n\t\t 'profile_id' => 'required', \n\t\t 'user_id' => 'required', \n\t\t 'view_flag' => 'required', \n\t\t 'add_flag' => 'required', \n\t\t 'edit_flag' => 'required', \n\t\t 'delete_flag' => 'required', \n\t\t \n\t\t ]);\n\n\t\t if ($validator->fails()) { \n\t\t return response()->json(['error'=>$validator->errors()], 401); \n\t\t }\n\n\t\t if (!tbl_menu::where('id', $request->menu_id)->exists()) \n\t\t {\n\t\t return response()->json(['error'=>'menu_id is not found.Enter Valid menu_id'], 404); \n\t\t }\n\t\t if (!tbl_profile::where('id', $request->profile_id)->exists()) \n\t\t {\n\t\t return response()->json(['error'=>'profile_id is not found.Enter Valid profile_id'], 404); \n\t\t }\n\t\t if (!User::where('id', $request->user_id)->exists()) \n\t\t {\n\t\t return response()->json(['error'=>'user_id is not found.Enter Valid user_id'], 404); \n\t\t }\n\n\t\t $tbl_permission = tbl_permission::find($id);\n\t\t $tbl_permission->menu_id = $request->menu_id;\n\t\t\t $tbl_permission->profile_id = $request->profile_id;\n\t\t\t $tbl_permission->user_id = $request->user_id;\n\t\t\t $tbl_permission->view_flag = $request->view_flag;\n\t\t\t $tbl_permission->add_flag = $request->add_flag;\n\t\t\t $tbl_permission->edit_flag = $request->edit_flag;\n\t\t\t $tbl_permission->delete_flag = $request->delete_flag;\n\t\t\t\n\t\t $tbl_permission->save();\n\n\t\t return response()->json([\"message\" => \"records updated successfully\"], 200);\n\t\t }\n\t\t else \n\t\t {\n\t\t return response()->json([\"message\" => \"permission not found\"], 404);\n\t\t \n\t\t }\n }", "public function modifierProfil(){\n $login = $this->input->post('login');\n $password1 = ($this->input->post('password1'));\n $password2 = ($this->input->post('password2'));\n $this->admin_model->updateUserProfil($login, $password1, $password2);\n }", "public function aksi_ubah_member($id_pengguna){ \n if($this->session->userdata('id_level') =='1'){\n \n if($this->input->is_ajax_request()==true){\n\n $nama=$this->input->post('nama', true);\n $no_hp=$this->input->post('no_hp', true);\n $alamat=$this->input->post('alamat', true);\n \n \n\n $this->m_admin->update_member($id_pengguna,$nama, $no_hp, $alamat);\n\n $msg = [\n 'sukses' => 'Data member telah diubah'\n ];\n echo json_encode($msg);\n } else {\n echo \"tidak ada request\";\n }\n\t\n } else{\n echo \"Anda tidak berhak mengakses halaman ini\";\n }\n }", "public function permission_assignment(Request $request, User $user)\n {\n $this->authorize('assign_permission', $user);\n $user->permissions()->sync($request->permissions);\n alert('Exito', 'Permisos asignados', 'success');\n return redirect()->route('backoffice.user.show', $user);\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required|max:255',\n 'guard_name' => 'required|max:255'\n ]);\n echo $request->name;\n\n $input = $request->all();\n $user = UserPermission::find($id);\n $user->update($input);\n // DB::table('model_has_roles')->where('model_id',$id)->delete();\n return redirect()->route('user_permission.index')\n ->with('success','Permission updated successfully')\n ->with(['menu'=>'user_permission']);\n }", "public function update(Request $request)\n {\n $role = Role::findOrFail($request->id);\n $role->name = $request->name;\n $role->syncPermissions($request->permissions);\n\n $save = $role->save();\n\n if($save) {\n Alert::toast('Sukses mengubah data', 'success');\n } else {\n Alert::toast('Terjadi kesalahan!', 'error');\n }\n return redirect()->route('admin.user.index');\n }", "public function updateUser($data) {\n\t\t\n\t}", "public function update(Request $request, $id) {\n try {\n if ($request->ajax()) {\n\n\n if (isset($request['rol'])) {\n $rol = '1';\n } else {\n $rol = '2';\n }\n\n $password = $request['password'];\n\n $branch = 0;\n $lender = 0;\n if ($request['branch'] != \"\") {\n $branch = $request['branch'];\n }\n if ($request['lender'] != \"\") {\n $lender = $request['lender'];\n }\n\n $user = UsersApp::find($id);\n $user->fill([\n 'us_nom' => $request['name'],\n 'us_mail' => $request['email'],\n 'us_contra' => md5($password),\n 'us_recon' => $password,\n 'suc_id' => $branch,\n 'pres_id' => $lender,\n 'emp_id' => $request['em_id'],\n 'rol' => $rol,\n ]);\n $user->save();\n $this->audit('Actualización de administrador ID #' . $id);\n return response()->json([\"msg\" => \"updated\"]);\n }\n } catch (Exception $ex) {\n return false;\n }\n return false;\n }", "public function update(Request $request, Permission $selected_permission)\n {\n $this->validator($request->all())->validate();\n\n\n $updatedPermission = [\n 'name' => $request->name,\n 'guard_name' => $request->guard_name,\n 'description' => $request->description\n ];\n\n $selected_permission->update($updatedPermission);\n\n return redirect(route('UserCenter.Permissions.Index'));\n }", "public function update(UpdatePermissionsRequest $request, Permission $permission)\n {\n if (! Gate::allows('users_manage')) {\n return abort(401);\n }\n\n $permission->update($request->all());\n\n return redirect()->route('admin.permissions.index');\n }", "public function update(PermissionRequest $request, $id)\n {\n try {\n $model = $this->model->find($id);\n // $this->authorize('update', $model);\n\n $model->fill($request->all())->save();\n\n flash('更新操作成功', 'success');\n return redirect()->back();\n } catch (ValidationException $e) {\n return $this->toException($e);\n }\n }", "public function update(User $user)\n {\n if ($this->role($user)){\n return $user->hasDirectPermission($this->permission_list['update']);\n }\n }", "public function update(Request $request, Permission $privilegio)\n {\n $privilegio->update($request->all());\n return redirect()->route('privilegios.edit' , $privilegio->id)\n ->with('info', 'Permission Actualizado con Exito');\n }", "public function updraftplus_user_notice_ajax() {\n\n\t\tif (is_user_logged_in() && current_user_can('manage_options')) {\n\t\t\t$this->process_user_notice_ajax();\n\t\t}\n\t}", "public function update($id, PermissionRequest $request) {\n\t\tif(!(Entrust::hasRole(['support', 'admin']) || Entrust::can('permission.edit'))) return redirect()->route('home');\n Log::info('update: '.$id,$request->all());\n\n\t\t/*\n\t\t * Here we can apply any business logic required,\n\t\t * then change $request->all() to results.\n\t\t */\n\t\t$input = $request->all();\n\n\t\t$this->permissionRepository->update($id, $input);\n\n\t\treturn redirect()->route('permission.index');\n\t}", "public function update(Request $request, $id)\n {\n //Approve user\n $user = Pending::find($id);\n\n if($user->user_role == 102) {\n $user->user_role = 2;\n } \n if($user->user_role == 103) {\n $user->user_role = 3;\n } \n \n $user->save();\n\n return redirect('/pending')->with('success', 'User Approved');\n }", "function grantPermissions($userid, $pageid) {\n\t//serving change permission requests\n\tif(isset($_GET['doaction']) && $_GET['doaction'] == \"changePerm\") {\n\t\t$permtype = escape($_GET['permtype']);\n\t\t$pageid = escape($_GET['pageid']);\n\t\t$usergroupid = escape($_GET['usergroupid']);\n\t\t$permid = escape($_GET['permid']);\n\t\t$perm = escape($_GET['perm']);\n\t\t$flag = true;\n\t\tif($perm == 'Y' || $perm == 'N') {\n\t\t\tif($permission = mysql_fetch_array(mysql_query(\"SELECT `perm_permission` FROM `\" . MYSQL_DATABASE_PREFIX . \"userpageperm` WHERE `perm_type` = '{$permtype}' AND `page_id` = '{$pageid}' AND `usergroup_id` = '{$usergroupid}' AND `perm_id` = '{$permid}'\"))) {\n\t\t\t\tif($permission['perm_permission'] != $perm) {\n\t\t\t\t\tmysql_query(\"UPDATE `\" . MYSQL_DATABASE_PREFIX . \"userpageperm` SET `perm_permission` = '{$perm}' WHERE `perm_type` = '{$permtype}' AND `page_id` = '{$pageid}' AND `usergroup_id` = '{$usergroupid}' AND `perm_id` = '{$permid}'\");\n\t\t\t\t\tif(mysql_affected_rows() == 0)\n\t\t\t\t\t\t$flag = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmysql_query(\"INSERT `\" . MYSQL_DATABASE_PREFIX . \"userpageperm`(`perm_type`, `page_id`, `usergroup_id`, `perm_id`, `perm_permission`) VALUES('$permtype','$pageid','$usergroupid','$permid','$perm')\");\n\t\t\t\tif(mysql_affected_rows() == 0)\n\t\t\t\t\t$flag = false;\n\t\t\t}\n\t\t} else {\n\t\t\tif($permission = mysql_fetch_array(mysql_query(\"SELECT `perm_permission` FROM `\" . MYSQL_DATABASE_PREFIX . \"userpageperm` WHERE `perm_type` = '{$permtype}' AND `page_id` = '{$pageid}' AND `usergroup_id` = '{$usergroupid}' AND `perm_id` = '{$permid}'\"))) {\n\t\t\t\tmysql_query(\"DELETE FROM `\" . MYSQL_DATABASE_PREFIX . \"userpageperm` WHERE `perm_type` = '{$permtype}' AND `page_id` = '{$pageid}' AND `usergroup_id` = '{$usergroupid}' AND `perm_id` = '{$permid}'\");\n\t\t\t\tif(mysql_affected_rows() == 0)\n\t\t\t\t\t$flag = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($flag)\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\tdisconnect();\n\t\texit();\n\t}\n\t//serving refresh permissions request\n\tif(isset($_GET['doaction']) && $_GET['doaction'] == 'getpermvars' && isset($_GET['pageid'])) {\n\t\tglobal $cmsFolder,$urlRequestRoot, $templateFolder;\n\t\t$pageid = escape($_GET['pageid']);\n\t\tif(mysql_fetch_array(mysql_query(\"SELECT `page_name` FROM `\" . MYSQL_DATABASE_PREFIX . \"pages` WHERE `page_id` = '{$pageid}'\"))) {\n\t\t$pagepath = array();\n\t\tparseUrlDereferenced($pageid, $pagepath);\n\t\t$pageid = $pagepath[count($pagepath) - 1];\n\n\t\t$groups = array_reverse(getGroupIds($userid));\n\t\t$virtue = '';\n\t\t$maxPriorityGroup = getMaxPriorityGroup($pagepath, $userid, $groups, $virtue);\n\t\tif($maxPriorityGroup == -1) {\n\t\t\treturn 'You do not have the required permissions to view this page.';\n\t\t}\n\n\t\tif($virtue == 'user') {\n\t\t\t$grantableActions = getGroupPermissions($groups, $pagepath, $userid);\n\t\t}\n\t\telse {\n\t\t\t$grantableActions = getGroupPermissions($groups, $pagepath);\n\t\t}\n\n\t\t$actionCount = count($_POST['permission']);\n\t\t$checkedActions = array();\n\t\tfor($i = 0; $i < $actionCount; $i++) {\n\t\t\tlist($modTemp, $actTemp) = explode('_', escape($_POST['permission'][$i]), 2);\n\n\t\t\tif(isset($_POST[$modTemp.$actTemp])) {\n\t\t\t\tif(isset($grantableActions[$modTemp])) {\n\t\t\t\t\tfor($j = 0; $j < count($grantableActions[$modTemp]); $j++) {\n\t\t\t\t\t\tif($grantableActions[$modTemp][$j][1] == $actTemp) {\n\t\t\t\t\t\t\t$checkedActions[$modTemp][] = $grantableActions[$modTemp][$j];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(count($checkedActions) > 0) {\n\t\t\t$grantableActions = $checkedActions;\n\t\t}\n\n\t\t$modifiableGroups = getModifiableGroups($userid, $maxPriorityGroup);\n\t\t$modifiableGroupIds = array(0, 1);\n\t\tfor($i = 0; $i < count($modifiableGroups); $i++) {\n\t\t\t$modifiableGroupIds[] = $modifiableGroups[$i]['group_id'];\n\t\t}\n\t\t$permissions = formattedPermissions($pagepath, $modifiableGroupIds, $grantableActions);\n\t\t\t$ret =<<<RET\npageid = {$pageid};\n{$permissions}\nRET;\n\t\t\techo $ret;\n\t\t} else {\n\t\t\techo \"Error: Invalid Pageid passed\";\n\t\t}\n\t\tdisconnect();\n\t\texit();\n\t}\n\t\n\tglobal $cmsFolder,$urlRequestRoot;\n\t$pagepath = array();\n\tparseUrlDereferenced($pageid, $pagepath);\n\t$pageid = $pagepath[count($pagepath) - 1];\n\n\t$groups = array_reverse(getGroupIds($userid));\n\t$virtue = '';\n\t$maxPriorityGroup = getMaxPriorityGroup($pagepath, $userid, $groups, $virtue);\n\tif($maxPriorityGroup == -1) {\n\t\treturn 'You do not have the required permissions to view this page.';\n\t}\n\n\tif($virtue == 'user') {\n\t\t$grantableActions = getGroupPermissions($groups, $pagepath, $userid);\n\t}\n\telse {\n\t\t$grantableActions = getGroupPermissions($groups, $pagepath);\n\t}\n\tif(isset($_POST['permission']))\n\t$actionCount = count($_POST['permission']);\n\telse $actionCount=\"\";\n\t$checkedActions = array();\n\tfor($i = 0; $i < $actionCount; $i++) {\n\t\tlist($modTemp, $actTemp) = explode('_', escape($_POST['permission'][$i]), 2);\n\n\t\tif(isset($_POST[$modTemp.$actTemp])) {\n\t\t\tif(isset($grantableActions[$modTemp])) {\n\t\t\t\tfor($j = 0; $j < count($grantableActions[$modTemp]); $j++) {\n\t\t\t\t\tif($grantableActions[$modTemp][$j][1] == $actTemp) {\n\t\t\t\t\t\t$checkedActions[$modTemp][] = $grantableActions[$modTemp][$j];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif(count($checkedActions) > 0) {\n\t\t$grantableActions = $checkedActions;\n\t}\n\n\t$modifiableGroups = getModifiableGroups($userid, $maxPriorityGroup);\n\t$modifiableGroupIds = array(0, 1);\n\tfor($i = 0; $i < count($modifiableGroups); $i++) {\n\t\t$modifiableGroupIds[] = $modifiableGroups[$i]['group_id'];\n\t}\n\t$perms = json_encode(formatPermissions($grantableActions));\n\t$permissions = formattedPermissions($pagepath, $modifiableGroupIds, $grantableActions);\n\t$groups = customGetGroups($maxPriorityGroup);\n\t$users = customGetAllUsers();\n\tglobal $templateFolder;\n\t$smarttableconfig = array (\n\t\t\t'permtable' => array(\n\t\t\t\t'sPaginationType' => 'two_button',\n\t\t\t\t'bAutoWidth' => 'false',\n\t\t\t\t'aoColumns' => '{ \"sWidth\": \"100px\" }'\n\t\t\t),\n\t\t\t'permtable2' => array(\n\t\t\t\t'sPaginationType' => 'two_button',\n\t\t\t\t'bAutoWidth' => 'false',\n\t\t\t\t'aoColumns' => '{ \"sWidth\": \"100px\" }'\n\t\t\t)\n\t);\n\t$ret = smarttable::render(array('permtable','permtable2'),$smarttableconfig);\n\t$globals = getGlobalSettings();\n\t$baseURL = \"./+grant&doaction=changePerm\";\n\tif($globals['url_rewrite']=='false')\n\t\t$baseURL = prettyurl($baseURL);\n\t$selected = \"var selected = {'permissions' : [], 'users' : [], 'groups' : []};\";\n\tif(isset($_GET['doaction']) && $_GET['doaction'] == 'getUserPerm') {\n\t\t$get_selectedPerms = array();\n\t\t$get_selectedGroups = array();\n\t\t$get_selectedUsers = array();\n\t\tforeach($_POST as $key => $var)\n\t\t\tif(substr($key,0,12)==\"permissions_\")\n\t\t\t\t$get_selectedPerms[] = (int)substr($key,12);\n\t\tlist($get_sortedGroupPerms,$get_sortedUserPerms) = getAllPermissionsOnPage($pagepath, $modifiableGroupIds, $grantableActions);\n\t\t$save = 0;\n\t\tforeach($get_sortedGroupPerms['Y'] as $get_groupId => $get_data) {\n\t\t\t$found = false;\n\t\t\tforeach($get_sortedGroupPerms['Y'][$get_groupId] as $get_permId) {\n\t\t\t\tforeach($get_selectedPerms as $selected_perm)\n\t\t\t\t\tif($selected_perm == $get_permId) {\n\t\t\t\t\t\t$get_selectedGroups[] = (int)$get_groupId;\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t}\n\t\t\t\tif($found)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif($get_groupId==0&&$found)\n\t\t\t\t$save += 1;\n\t\t\tif($get_groupId==1&&$found)\n\t\t\t\t$save += 2;\n\t\t}\n\t\tforeach($get_sortedUserPerms['Y'] as $get_userId => $get_data) {\n\t\t\t$found = false;\n\t\t\tforeach($get_sortedUserPerms['Y'][$get_userId] as $get_permId) {\n\t\t\t\tforeach($get_selectedPerms as $selected_perm)\n\t\t\t\t\tif($selected_perm == $get_permId) {\n\t\t\t\t\t\t$get_selectedUsers[] = (int)$get_userId;\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t}\n\t\t\t\tif($found)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$get_selectedGroups = filterByPriority($maxPriorityGroup,$get_selectedGroups);\n\t\tif($save%2==1)\n\t\t\t$get_selectedGroups[] = 0;\n\t\tif($save/2==1)\n\t\t\t$get_selectedGroups[] = 1;\n\t\t$selected = \"var selected = {'permissions' : \" . json_encode($get_selectedPerms) . \", 'users' : \" . json_encode($get_selectedUsers) . \", 'groups' : \" . json_encode($get_selectedGroups) . \"};\";\n\t}\n\tif(isset($_GET['doaction']) && $_GET['doaction'] == 'getPermUser') {\n\t\t\n\t\t$get_selectedPerms = array();\n\t\t$get_selectedGroups = array();\n\t\t$get_selectedUsers = array();\n\t\tforeach($_POST as $key => $var)\n\t\t\tif(substr($key,0,6)==\"users_\")\n\t\t\t\t$get_selectedUsers[] = (int)substr($key,6);\n\t\t\telse if(substr($key,0,7)==\"groups_\")\n\t\t\t\t$get_selectedGroups[] = (int)substr($key,7);\n\t\tlist($get_sortedGroupPerms,$get_sortedUserPerms) = getAllPermissionsOnPage($pagepath, $modifiableGroupIds, $grantableActions);\n\t\t$save = 0;\n\t\tforeach($get_sortedGroupPerms['Y'] as $get_groupId => $get_data) {\n\t\t\tif(isPresent($get_groupId,$get_selectedGroups)) {\n\t\t\t\tforeach($get_sortedGroupPerms['Y'][$get_groupId] as $get_permId) {\n\t\t\t\t\tif(!isPresent($get_permId,$get_selectedPerms))\n\t\t\t\t\t\t$get_selectedPerms[] = $get_permId;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach($get_sortedUserPerms['Y'] as $get_userId => $get_data) {\n\t\t\tif(isPresent($get_userId,$get_selectedUsers)) {\n\t\t\t\tforeach($get_sortedUserPerms['Y'][$get_userId] as $get_permId) {\n\t\t\t\t\tif(!isPresent($get_permId,$get_selectedPerms))\n\t\t\t\t\t\t$get_selectedPerms[] = $get_permId;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$selected = \"var selected = {'permissions' : \" . json_encode($get_selectedPerms) . \", 'users' : \" . json_encode($get_selectedUsers) . \", 'groups' : \" . json_encode($get_selectedGroups) . \"};\";\n\t}\n\t$ret .= <<<RET\n<style type=\"text/css\" title=\"currentStyle\">\n\tdiv#permtable_filter input { width: 90px; }\n\tdiv#permtable2_filter input { width: 90px; }\n</style>\n<script type=\"text/javascript\" language=\"javascript\" src=\"$urlRequestRoot/$cmsFolder/$templateFolder/common/scripts/permissionsTable.js\"></script>\n<script type=\"text/javascript\">\nvar baseURL = \"$baseURL\";\nvar pageid = {$pageid};\nvar permissions = {$perms};\nvar permGroups;\nvar permUsers;\nvar groups = {{$groups}};\nvar users = {{$users}};\n{$permissions}\n{$selected}\n</script>\n<div id='info'></div>\n<INPUT type=checkbox id='skipAlerts'> Skip Alerts <br>\n<div id='permTable'>\n\n</div>\n<table width=100%>\n<tr>\n<td width=50%>\n<a href='javascript:selectAll1()'>Select All</a> <a href='javascript:clearAll1()'>Clear All</a> <a href='javascript:toggle1()'>Toggle</a> <a href='javascript:getuserperm()'>Check Users having selected Permission</a><br>\n<form action='./+grant&doaction=getUserPerm' method=\"POST\" id='getuserperm'>\n<table class=\"userlisttable display\" id='permtable' name='permtable'><thead><tr><th>Permissions</th></thead><tbody id='actionsList'>\n\n</tbody></table>\n</form>\n</td>\n<td width=50%>\n<a href='javascript:selectAll2()'>Select All</a> <a href='javascript:clearAll2()'>Clear All</a> <a href='javascript:toggle2()'>Toggle</a> <a href='javascript:getpermuser()'>Check Permissions selected User is having</a><br>\n<form action='./+grant&doaction=getPermUser' method=\"POST\" id='getpermuser'>\n<table class=\"userlisttable display\" id='permtable2' name='permtable2'><thead><tr><th>Users</th></thead><tbody id='usersList'>\n\n</tbody></table>\n</form>\n</td>\n</tr>\n</table>\n\n<a href='javascript:populateList()'>Click here if the lists are empty</a>\nRET;\n\tglobal $STARTSCRIPTS;\n\t$STARTSCRIPTS .= \" populateList();\";\n\treturn $ret;\n}", "public function updateUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$data = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\t\t\t$userModel->fill($data);\n\t\t\t$userModel->save();\n\t\t\treturn $this->sendResponse('Your details have been successfully updated');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to update this account');\n }", "public function update(Request $request, $id)\n {\n // dd($request->all());\n RoleHasPermission::where(\"role_id\", $id)->delete();\n foreach ($request->permission_id as $key => $value) {\n $data[] = [\n \"permission_id\" => $request->permission_id[$key],\n \"role_id\" => $id,\n ];\n }\n RoleHasPermission::insert($data);\n// $user=User::find(Auth::user()->id);\n// $permission_name=Role::find($id);\n// $user->syncRoles([$permission_name->name]);\n return back();\n }", "public function update(Request $request, $id)\n {\n $user = User::findOrFail( $id );\n\n if ( !Auth::user()->hasRole( 'super-admin' ) && !Auth::user()->is( $user ) ) {\n \n return redirect()->back()->with('warning', 'Permission required'); \n }\n\n $request->edit_account = $request->edit_account === 'true' ? true : false;\n\n\n\n if ( $request->pass_email ){\n\n $validatedData = $request->validate([\n 'email' => 'required|string|email|max:255|unique:users,email,'.$user->id,\n 'password' => 'nullable|string|min:6|confirmed'\n ]);\n\n $user->email = strtolower($request->email);\n $user->password = Hash::make($request->password);\n\n $user->save();\n\n return redirect()->back()->with('passemail_status', 'Updated');\n\n }\n\n $validatedData = $request->validate([\n 'firstname' => 'nullable|string|max:39',\n 'lastname' => 'nullable|string|max:39',\n 'country' => 'nullable|string|max:90',\n ]);\n\n $user->firstname = strtolower($request->firstname);\n $user->lastname = strtolower($request->lastname);\n $user->country = $request->country;\n\n $user->save();\n\n\n if ( !$request->edit_account ) {\n\n if ( $request->role == 'super-admin' )\n\n {\n\n $user->assignRole( 'super-admin' );\n \n } elseif ( is_array($request->permissions) && $request->role == 'assign-permission' ) {\n\n if ( $user->hasRole( 'super-admin' ) ){\n\n $user->removeRole( 'super-admin' );\n \n }\n\n $user->syncPermissions( array_keys( $request->permissions ) );\n\n }\n\n else {\n\n return redirect()->back()->with('warning', 'You must assign at least one permission/role');\n }\n\n }\n\n\n\n return redirect()->back()->with('status', 'Updated');\n\n }", "function updateUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"PUT\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t\texit;\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['user_name']) && isset($_POST['password']) && isset($_POST['_id'])){\n\t\t\t\t\t$user_id = $_POST['_id'];\n\t\t\t\t\t$array['user_name'] = $_POST['user_name'];\n\t\t\t\t\t$array['password'] = $_POST['password'];\n\t\t\t\t\t$result = $this->model->setUser($array, \"_id='\".$user_id.\"'\");\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record updated.';\n\t\t\t\t\t\t$update = $this->model->getUser('*',\"_id = \".\"'\".$user_id.\"'\");\n\t\t\t\t\t\t$response_array['data']=$update;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='no record updated';\n\t\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t\t$this->rest->response($response_array, 304);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\t\n\t\t\t}\n\t\t\t\n\n\t\t}", "public function ajaxRequest(Request $request)\n {\n $user = User::find($request->user_id);\n $response = auth()->user()->toggleFollow($user);\n\n return response()->json([\"success\" => $response]);\n }", "function assignpermission()\r\r\r\n\t\t{\r\r\r\n\t\t\t\r\r\r\n\t\t\t\r\r\r\n\t\t\t$is_logged_in = $this->session->userdata('logged_in');\r\r\r\n\t\t\t//echo getCurUserID();\r\r\r\n\t\t\t$permission='';\r\r\r\n\t\t\t//pr($_POST);\r\r\r\n\t\t\t\r\r\r\n\t\t\tforeach($_POST as $module=>$controller)\r\r\r\n\t\t\t{\r\r\r\n\t\t\t\tif(is_array($controller))\r\r\r\n\t\t\t\t{\r\r\r\n\t\t\t\t\t$i=1;\r\r\r\n\t\t\t\t\tforeach($controller as $key=>$controllers)\r\r\r\n\t\t\t\t\t{\r\r\r\n\t\t\t\t\t\r\r\r\n\t\t\t\t\t\t$permission .= strtolower($controllers).',';\r\r\r\n\t\t\t\t\t\r\r\r\n\t\t\t\t\t}\r\r\r\n\t\t\t\t\t\r\r\r\n\t\t\t\t}\r\r\r\n\t\t\t}\r\r\r\n\t\t\r\r\r\n\t\t\r\r\r\n\t\t\r\r\r\n\t\t\t$permission=(!empty($permission))?substr($permission,0,-1):'';\r\r\r\n\t\t\t\t\r\r\r\n\t\t\t\t\t\t\r\r\r\n\t\t\t$data = array('permission' => $permission,\r\r\r\n\t\t\t\t\t);\r\r\r\n\t\r\r\r\n\t\r\r\r\n\t\t$msg = 0;\r\r\r\n\t\t$this->db->where('role_id',$this->input->post('user_role') );\r\r\r\n\t $this->db->update('tbl_role', $data); \r\r\r\n\t\r\r\r\n\t\t//$this->db->update('tbl_role', $this->input->post('user_role')); \r\r\r\n\t\t//echo $this->db->last_query();die;\r\r\r\n\t\t$msg = ($this->db->affected_rows() > 0) ? 2 : 3;//for update : for nothing happened\r\r\r\n\t\t\r\r\r\n\t\treturn $msg;\r\r\r\n\t\t\r\r\r\n\t\t}", "protected function editLockPermissions() {}", "public function update(Request $request, Permission $permission)\n {\n $request->validate([\n 'name' => 'required|unique:permissions,name'.$request->id\n ]);\n $permission->update($request->all());\n return redirect()->route('permissions.index')->with('success','Permiso actualizado correctamente');\n }", "public function update(Request $request)\n {\n $modules = Module::get();\n $role_id = $request->route('groupuser');\n $roles = new Role();\n $role = $roles->find($role_id);\n $permission = $role->permissions()->get();\n $array_permission = array();\n foreach ($permission as $key => $value) {\n $array_permission[] = $value->permission_slug;\n }\n\n return view('admin.user.updategroup', compact('modules', 'role', 'array_permission'));\n }", "public function ajax_update_keluarga()\n {\n $data['user_id'] = $this->user['id'];\n $update = $this->home->update_keluarga($data);\n\n if($update){\n echo json_encode(array(\"response\" => 'SUKSES', 'act' => \"upd\"));\n }else{\n echo json_encode(array(\"response\" => 'GAGAL', 'act' => \"upd\"));\n }\n }", "public function givePermission($user, $permission) {\n global $MYSQL, $TANGO;\n $user = $TANGO->user($user);\n if( !empty($user) ) {\n $perm = $TANGO->perm->perm($permission);\n if( $user['additional_permissions'] == \"0\" ) {\n $update = array(\n 'additional_permissions' => $perm['permission_name']\n );\n } else {\n $ap_array = array();\n foreach( $user['additional_permissions'] as $ap ) {\n $MYSQL->where('permission_name', $ap);\n $ap_query = $MYSQL->get('{prefix}permissions');\n if( $ap_query ) {\n $ap_array[] = $ap_query['0']['id'];\n }\n }\n $additional_permissions = implode(',', $ap_array);\n $update = array(\n 'additional_permissions' => $additional_permissions . ',' . $perm['permission_name']\n );\n }\n $MYSQL->where('id', $user['id']);\n if( $MYSQL->update('{prefix}users', $update) ) {\n return true;\n } else {\n return false;\n }\n } else { \n return false;\n }\n }", "public function update(User $user)\n {\n $user_role = \\App\\Role::find($user->role_id);\n $role_permissions = $user_role->permissions;\n foreach ($role_permissions as $permission) {\n if ($permission->id ==2) {\n return true;\n }\n\n }\n return false;\n }", "public function modify_user($user);", "public function GetPermission() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n\n if (isset($_REQUEST['data'])) {\n $idUser = $_REQUEST['data'][\"idUser\"];\n // Input validations\n if (!empty($idUser)) {\n try {\n $sql = $this->db->prepare(\"SELECT * FROM permission WHERE idUser = :idUser LIMIT 1\");\n $sql->bindParam('idUser', $idUser, PDO::PARAM_INT);\n $sql->execute();\n\n if ($sql->rowCount() > 0) {\n $result = $sql->fetch();\n\n // If success everythig is good send header as \"OK\" and user details\n $this->response($this->json($result), 200);\n }\n $this->response('', 204); // If no records \"No Content\" status\n } catch (Exception $ex) {\n $this->response('', $ex->getMessage());\n }\n }\n }\n\n // If invalid inputs \"Bad Request\" status message and reason\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid param\");\n $this->response($this->json($error), 400);\n }", "public function update(Request $request, Permission $permission)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|min:2|max:255|unique:permissions,title,' . $permission->id,\n 'label' => 'required|min:2|max:255|unique:permissions,label,' . $permission->id,\n ]);\n if ($validator->fails()) {\n $this->errorMessage($validator);\n return redirect()->back()->withInput();\n }\n $permission->update([\n \"title\" => $request->input('title'),\n \"label\" => $request->input('label'),\n ]);\n// -----------------------------\n $this->successMessage(['عملیات موفیت آمیز بود']);\n return redirect()->to($request->input('redirects_to'));\n }", "public function updatePrivilegios(Request $request){\n if(!$request->ajax() || Auth::user()->rol_id == 11)return redirect('/');\n $user = User::findOrFail($request->id);\n $user->administracion = $request->administracion;\n $user->desarrollo = $request->desarrollo;\n $user->precios = $request->precios;\n $user->obra = $request->obra;\n $user->ventas = $request->ventas;\n $user->acceso = $request->acceso;\n $user->reportes = $request->reportes;\n $user->saldo = $request->saldo;\n $user->gestoria = $request->gestoria;\n $user->postventa = $request->postventa;\n $user->comisiones = $request->comisiones;\n $user->calendario = $request->calendario;\n $user->notifications = $request->notifications;\n //Administracion\n $user->departamentos = $request->departamentos;\n $user->personas = $request->personas;\n $user->empresas = $request->empresas;\n $user->medios_public = $request->medios_public;\n $user->lugares_contacto = $request->lugares_contacto;\n $user->servicios = $request->servicios;\n $user->inst_financiamiento = $request->inst_financiamiento;\n $user->tipos_credito = $request->tipos_credito;\n $user->asig_servicios = $request->asig_servicios;\n $user->mis_asesores = $request->mis_asesores;\n $user->cuenta = $request->cuenta;\n $user->proveedores = $request->proveedores;\n $user->digital_campain = $request->digital_campain;\n $user->notaria =$request->notaria;\n //Desarrollo\n $user->fraccionamiento = $request->fraccionamiento;\n $user->etapas = $request->etapas;\n $user->modelos = $request->modelos;\n $user->lotes = $request->lotes;\n $user->asign_modelos = $request->asign_modelos;\n $user->licencias = $request->licencias;\n $user->acta_terminacion = $request->acta_terminacion;\n $user->p_etapa = $request->p_etapa;\n $user->descarga_actas = $request->descarga_actas;\n $user->ruv = $request->ruv;\n $user->seg_ruv = $request->seg_ruv;\n\n //Pago interno\n $user->seg_pago = $request->seg_pago;\n\n //Precios\n $user->agregar_sobreprecios=$request->agregar_sobreprecios;\n $user->precios_etapas = $request->precios_etapas;\n $user->precios_viviendas = $request->precios_viviendas;\n $user->sobreprecios = $request->sobreprecios;\n $user->paquetes = $request->paquetes;\n $user->promociones = $request->promociones;\n //Obra\n $user->contratistas = $request->contratistas;\n $user->ini_obra = $request->ini_obra;\n $user->aviso_obra = $request->aviso_obra;\n $user->partidas = $request->partidas;\n $user->avance = $request->avance;\n $user->estimaciones = $request->estimaciones;\n //Calculadora de lotes\n $user->calc_lotes = $request->calc_lotes;\n $user->edit_cotizacion = $request->edit_cotizacion;\n $user->opc_cotizador = $request->opc_cotizador;\n //Creditos Puente\n $user->bases = $request->bases;\n $user->solic_credito_puente = $request->solic_credito_puente;\n $user->seg_cp = $request->seg_cp;\n $user->edo_cta_bancrea = $request->edo_cta_bancrea;\n //Ventas\n $user->lotes_disp = $request->lotes_disp;\n $user->mis_prospectos = $request->mis_prospectos;\n $user->simulacion_credito = $request->simulacion_credito;\n $user->hist_simulaciones = $request->hist_simulaciones;\n $user->hist_creditos = $request->hist_creditos;\n $user->contratos = $request->contratos;\n $user->docs = $request->docs;\n $user->equipamientos = $request->equipamientos;\n $user->digital_lead = $request->digital_lead;\n $user->reubicaciones = $request->reubicaciones;\n //Rentas\n $user->admin_rentas = $request->admin_rentas;\n $user->pagos_rentas = $request->pagos_rentas;\n //Saldos\n $user->edo_cuenta = $request->edo_cuenta;\n $user->depositos = $request->depositos;\n $user->gastos_admn = $request->gastos_admn;\n $user->cobro_credito = $request->cobro_credito;\n $user->dev_exc = $request->dev_exc;\n $user->dev_cancel = $request->dev_cancel;\n $user->facturas = $request->facturas;\n $user->ingresos_concretania = $request->ingresos_concretania;\n $user->dev_virtual = $request->dev_virtual;\n //Gestoria\n $user->expediente = $request->expediente;\n $user->asig_gestor = $request->asig_gestor;\n $user->seg_tramite = $request->seg_tramite;\n $user->avaluos = $request->avaluos;\n $user->bonos_rec = $request->bonos_rec;\n $user->int_cobros = $request->int_cobros;\n //Postventa\n $user->entregas = $request->entregas;\n $user->solic_detalles = $request->solic_detalles;\n //RH\n $user->vehiculos = $request->vehiculos;\n $user->mant_vehiculos = $request->mant_vehiculos;\n $user->admin_mant_vehiculos = $request->admin_mant_vehiculos;\n $user->prestamos_personales = $request->prestamos_personales;\n $user->fondo_ahorro = $request->fondo_ahorro;\n $user->fondo_pension = $request->fondo_pension;\n //Oficina\n $user->inventarios = $request->inventarios;\n $user->prov_inventarios = $request->prov_inventarios;\n\n //Comisiones\n $user->exp_comision = $request->exp_comision;\n $user->gen_comision = $request->gen_comision;\n $user->bono_com = $request->bono_com;\n //Acceso\n $user->usuarios = $request->usuarios;\n $user->roles = $request->roles;\n //Reportes\n $user->mejora = $request->mejora;\n $user->rep_publi = $request->rep_publi;\n $user->rep_proy = $request->rep_proy;\n $user->inventario = $request->inventario;\n $user->rep_venta_canc = $request->rep_venta_canc;\n $user->rep_asesores = $request->rep_asesores;\n $user->rep_ini_term_ventas = $request->rep_ini_term_ventas;\n $user->rep_recursos_propios = $request->rep_recursos_propios;\n $user->rep_vent_modelos = $request->rep_vent_modelos;\n $user->rep_detalles_post = $request->rep_detalles_post;\n $user->rep_acumulado = $request->rep_acumulado;\n $user->rep_ingresos = $request->rep_ingresos;\n $user->rep_escrituras = $request->rep_escrituras;\n $user->rep_leads = $request->rep_leads;\n $user->rep_entregas = $request->rep_entregas;\n $user->rep_empresas = $request->rep_empresas;\n $user->save();\n\n }", "public function update_user(Request $request){\n Session::put('menu_item_parent', 'users');\n Session::put('menu_item_child', '');\n Session::put('menu_item_child_child', '');\n $user = User::where('userIdx', $request->userIdx)->get()->first();\n\n if($user){\n $data = array();\n $data['firstname'] = $request->firstname;\n $data['lastname'] = $request->lastname;\n $data['email'] = $request->email;\n $data['jobTitle'] = $request->jobTitle;\n if($request->businessName2 == \"Other industry\") {\n $data['businessName'] = $request->businessName;\n } else {\n $data['businessName'] = $request->businessName2;\n }\n if($request->role2 == \"Other\") {\n $data['role'] = $request->role;\n } else {\n $data['role'] = $request->role2;\n }\n User::where('userIdx', $request->userIdx)->update($data);\n\n $logDetail = 'Updated: UserID- '.$request->userIdx.', Email- '.$data['email'].', Firstname- '.$data['firstname'].', Lastname- '.$data['lastname'];\n SiteHelper::logActivity('USER', $logDetail, 'admin');\n\n Session::flash('flash_success', 'User detail has been updated successfully');\n echo \"success\";\n }else \n echo \"fail\";\n }", "public function update(PermissionUpdate $request, Permission $permission)\n {\n $permission->update($request->only('label'));\n\n return back()->withNotify('İzin Güncellendi!');\n }" ]
[ "0.73524326", "0.6735795", "0.66886437", "0.66673875", "0.63214403", "0.6241689", "0.62406814", "0.61843824", "0.6181951", "0.6155277", "0.61227286", "0.61054236", "0.6022508", "0.60091054", "0.60034186", "0.59918463", "0.5982391", "0.5923434", "0.59201336", "0.59157526", "0.59040815", "0.58826834", "0.58624476", "0.58455646", "0.58359104", "0.58224523", "0.58038825", "0.5771157", "0.5763377", "0.57454985", "0.57393104", "0.5732659", "0.5715523", "0.57122386", "0.571177", "0.5707499", "0.57071924", "0.5704261", "0.5698871", "0.56973094", "0.56933594", "0.56870717", "0.56720763", "0.56719726", "0.56656915", "0.56595004", "0.5658849", "0.5655377", "0.56543493", "0.5642099", "0.5639145", "0.5637636", "0.56368566", "0.56299984", "0.56242347", "0.5616434", "0.5608206", "0.5592995", "0.5588714", "0.55798316", "0.5568568", "0.55663073", "0.5561864", "0.5560418", "0.55596036", "0.55551755", "0.5553179", "0.5547447", "0.55363923", "0.5526479", "0.5523182", "0.55113685", "0.55014414", "0.5499216", "0.5499022", "0.54951173", "0.549122", "0.54778075", "0.547526", "0.5474142", "0.5473666", "0.5468238", "0.54641247", "0.54594153", "0.5457775", "0.54528624", "0.5452755", "0.54527515", "0.5449376", "0.5449258", "0.5444576", "0.5438443", "0.5434199", "0.5431062", "0.5429999", "0.5428615", "0.54276717", "0.5424559", "0.541892", "0.5411119" ]
0.5722423
32
Sent email to the users of the organisation when user identifier is changed.
public function notifyUsernameChanged() { $this->userService->notifyUsernameChanged(session('org_id')); $response = ['type' => 'success', 'code' => ['sent', ['name' => 'Emails']]]; return redirect()->route('lite.settings.edit')->withResponse($response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sendUserUpdateNotification(): void\n {\n $this->notify(new VerifyAccountNotification());\n }", "public function changeEmail()\n {\n $breadCrumb = $this->userEngine\n ->breadcrumbGenerate('change-email');\n\n $recentEmail = $this->userEngine\n ->getChangeRequestedEmail();\n \n JavaScript::put(['newEmail' => __ifIsset($recentEmail['data'], $recentEmail['data']['new_email'], false)]);\n\n return $this->loadPublicView('user.change-email', $breadCrumb['data']);\n }", "private function _sendNewStatusUpdateEmailToUser()\n {\n // Get a reference to the Joomla! mailer object\n $mailer = \\JFactory::getMailer();\n\t\t\t\n\t\t\t$config = \\JFactory::getConfig();\n\t\t\t$sender = array( \n\t\t\t $config->get( 'mailfrom' ),\n\t\t\t $config->get( 'fromname' ) \n\t\t\t);\n \n\t\t\t$mailer->setSender($sender);\n\n\t\t\t$user = \\JFactory::getUser();\n\t\t\t$mailer->addRecipient($user->email);\n \n // Set the subject\n $subject = \\JFactory::getConfig()->get('sitename') . \": New Status Update...\";\n\t\t\t$mailer->setSubject($subject);\n\t\t\t$projectId = $this->recordData['hshrndreview_fk_project_id'];\n\t\t\t\n\t\t\t$db = \\JFactory::getDbo();\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select($db->quoteName(array('name', 'owner')));\n\t\t\t$query->from($db->quoteName('#__hshrndreview_projects'));\n\t\t\t$query->where($db->quoteName('hshrndreview_project_id').\" = \". $projectId);\n\t\t\t$db->setQuery($query);\n\t\t\t$project = $db->loadRow();\n\t\t\t\n\t\t\t$body = \"Thank you for submitting a new status update for project named: \\\"\" . $project['0'] . \"\\\". It has been added to the HSH project database!\\n\\n Have a nice day - your friendly HSH RnD Review automailer...\";\n\t\t\t$mailer->setBody($body);\n // Send the email\n\t\t\t$send = $mailer->Send();\n\t\t\tif ( $send !== true ) {\n\t\t\t echo 'Error sending email: ' . $send->__toString();\n\t\t\t} else {\n\t\t\t echo 'Mail sent';\n\t\t\t}\n }", "private function onboardUsers()\n {\n foreach ($this->users as $user) {\n $token = $user->generateMagicToken();\n $user->sendNotification(new OnboardEmail($user, $token));\n }\n }", "function Users_user_changeemail()\n{\n if (!pnUserLoggedIn()) {\n return LogUtil::registerPermissionError();\n }\n\n $changepassword = pnModGetVar('Users', 'changeemail', 1);\n if ($changepassword <> 1) {\n return pnRedirect('Users', 'user', 'main');\n }\n\n // Create output object\n $pnRender = & pnRender::getInstance('Users', false, null, true);\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('users_user_changeemail.htm');\n}", "private function changeEmail()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['new_email']) || $request['new_email']==\"\")\n throw_error_msg(\"provide new_email\");\n\n if(!isset($request['cnew_email']) || $request['cnew_email']==\"\")\n throw_error_msg(\"provide cnew_email\");\n\n if($request['new_email']!=$request['cnew_email'])\n throw_error_msg(\"new email and confirm email do not match\");\n\n $request['userid'] = userid();\n $userquery->change_email($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"email has been changed successfully\");\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "private function _sendNewStatusUpdateEmailToAdministrators()\n {\n // Get a reference to the Joomla! mailer object\n $mailer = \\JFactory::getMailer();\n\t\t\t\n\t\t\t$config = \\JFactory::getConfig();\n\t\t\t$sender = array( \n\t\t\t $config->get( 'mailfrom' ),\n\t\t\t $config->get( 'fromname' ) \n\t\t\t);\n \n\t\t\t$mailer->setSender($sender);\n\n // Load the category and set the recipient to this category's email address\n\t\t\t// $category = $this->category;\n\t\t\t// $emails = explode(',', $category->email);\n\t\t\t$user = \\JFactory::getUser('admin');\n\t\t\t$mailer->addRecipient($user->email);\n \n // Set the subject\n $subject = \\JFactory::getConfig()->get('sitename') . \": New Status Update ...\";\n\t\t\t$mailer->setSubject($subject);\n\t\t\t$projectId = $this->recordData['hshrndreview_fk_project_id'];\n\t\t\t\n\t\t\t$db = \\JFactory::getDbo();\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select($db->quoteName(array('name', 'owner')));\n\t\t\t$query->from($db->quoteName('#__hshrndreview_projects'));\n\t\t\t$query->where($db->quoteName('hshrndreview_project_id').\" = \". $projectId);\n\t\t\t$db->setQuery($query);\n\t\t\t$project = $db->loadRow();\n\t\t\t\n\t\t\t$owner = $project['1'];\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query2 = $db->getQuery(true);\n\t\t\t$query2->select('title');\n\t\t\t$query2->from($db->quoteName('#__usergroups'));\n\t\t\t$query2->where($db->quoteName('id').\" = \". $owner);\n\t\t\t$db->setQuery($query2)->loadObject();\n\t\t\t$ownerName = $db->loadResult();\n\t\t\t$ownerName = ltrim($ownerName, \"hsgrp_\");\t\t\n\t\t\t\n\t\t\t$submitter = \\JFactory::getUser();\n\t\t\t$submitterName = $submitter->name;\n\t\t\t\n\t\t\t//$ownerName = ltrim($ownerName, \"hsgrp_\");\n\t\t\t\n\t\t\t$body = \"A new status update for project named: \\\"\" . $project['0'] . \"\\\" has been submitted by \" . $submitterName . \"@\" . $ownerName . \" to the HSH project database!\\n\\n Have a nice day - your friendly HSH RnD Review automailer...\";\n\t\t\t$mailer->setBody($body);\n // Send the email\n\t\t\t$send = $mailer->Send();\n\t\t\tif ( $send !== true ) {\n\t\t\t echo 'Error sending email: ' . $send->__toString();\n\t\t\t} else {\n\t\t\t echo 'Mail sent';\n\t\t\t}\n }", "public static function remindAssignedUser() {\n $unrespondedToTickets = Self::getUnrespondedToTickets(15);\n\n if($unrespondedToTickets->count() > 0) {\n foreach($unrespondedToTickets as $ticket) {\n $vendor = $ticket->assignedTo;\n\n $message = \"<p>Hello {$vendor->name}.<br/> You are yet to respond to the ticket ID <a href='{{ route('tickets.vendor.show', ['ticket_id'=> $ticket->ticket_id]) }}''>#{{$ticket->ticket_id}}</p>. <p>If further delayed, your unit head would be notified of your delayed response to this ticket. <br/><br/>Thank you</p>\";\n $title = \"Ticket #{$ticket->ticket_id} is yet to receive a response\";\n send_email($vendor->name, $vendor->email, $message, route('tickets.vendor.show', ['ticket_id'=> $ticket->ticket_id]), $title);\n\n }\n }\n }", "public function notifyOwner()\n {\n global $config, $reefless, $account_info;\n\n $reefless->loadClass('Mail');\n\n $mail_tpl = $GLOBALS['rlMail']->getEmailTemplate(\n $config['listing_auto_approval']\n ? 'free_active_listing_created'\n : 'free_approval_listing_created'\n );\n\n if ($config['listing_auto_approval']) {\n $link = $reefless->getListingUrl(intval($this->listingID));\n } else {\n $myPageKey = $config['one_my_listings_page'] ? 'my_all_ads' : 'my_' . $this->listingType['Key'];\n $link = $reefless->getPageUrl($myPageKey);\n }\n\n $mail_tpl['body'] = str_replace(\n array('{username}', '{link}'),\n array(\n $account_info['Username'],\n '<a href=\"' . $link . '\">' . $link . '</a>',\n ),\n $mail_tpl['body']\n );\n $GLOBALS['rlMail']->send($mail_tpl, $account_info['Mail']);\n }", "function Users_user_updateemail()\n{\n if (!pnUserLoggedIn()) {\n return LogUtil::registerPermissionError();\n }\n\n if (!SecurityUtil::confirmAuthKey('Users')) {\n return LogUtil::registerAuthidError(pnModUrl('Users', 'user', 'changeemail'));\n }\n\n $uservars = pnModGetVar('Users');\n if ($uservars['changeemail'] <> 1) {\n return pnRedirect('Users', 'user', 'main');\n }\n\n $newemail = FormUtil::getPassedValue('newemail', '', 'POST');\n\n $checkuser = pnModAPIFunc('Users', 'user', 'checkuser',\n array('uname' => pnUserGetVar('uname'),\n 'email' => $newemail,\n 'agreetoterms' => true));\n\n // check email related errors only\n if (in_array($checkuser, array(-1, 2, 9, 11, 12))) {\n switch($checkuser)\n {\n case -1:\n $message = __('Sorry! You have not been granted access to this module.');\n break;\n case 2:\n $message = __('Sorry! The e-mail address you entered was incorrectly formatted or is unacceptable for other reasons. Please correct your entry and try again.');\n break;\n case 9:\n $message = __('Sorry! This e-mail address has already been registered, and it cannot be used again for creating another account.');\n break;\n case 11:\n $message = __('Sorry! Your user agent is not accepted for registering an account on this site.');\n break;\n case 12:\n $message = __('Sorry! E-mail addresses from the domain you entered are not accepted for registering an account on this site.');\n break;\n default:\n $message = __('Sorry! You have not been granted access to this module.');\n } // switch\n return LogUtil::registerError($message, null, pnModURL('Users', 'user', 'changeemail'));\n }\n\n // set the new email\n pnUserSetVar('email', $newemail);\n\n LogUtil::registerStatus(__('Done! Saved your e-mail address.'));\n return pnRedirect(pnModURL('Users', 'user', 'main'));\n}", "public static function updateEmails()\n {\n // When inconsistency occurs, choose FB's data.\n $users = User::all();\n foreach($users as $user)\n {\n // If token doesn't exist locally, continue\n if(Token::where('user_id', $user->id)->count() == 0)\n continue;\n\n $token = Token::getLatestToken($user->id);\n\n if(Token::checkIfTokenExpired($token))\n continue;\n\n $FB_email = Helpers::getFacebookResources($token)->getEmail();\n\n $Local_email = $user->email;\n if(($FB_email !== $Local_email) && ($FB_email !== null))\n {\n $user->update(['email' => $FB_email]);\n }\n }\n }", "public function sendEmail()\r\n {\r\n\t\t$mail = new UserMails;\r\n\t\t$mail->sendAdminEmail('admin-user', $this->_user);\r\n }", "protected function notifyByEmail() {\n\t\t$userlist = array();\n\n\t\t// find all the users with this server listed\n\t\t$users = $this->db->select(\n\t\t\tSM_DB_PREFIX . 'users',\n\t\t\t'FIND_IN_SET(\\''.$this->server['server_id'].'\\', `server_id`) AND `email` != \\'\\'',\n\t\t\tarray('user_id', 'name', 'email')\n\t\t);\n\n\t\tif (empty($users)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// build mail object with some default values\n\t\t$mail = new phpmailer();\n\n\t\t$mail->From\t\t= sm_get_conf('email_from_email');\n\t\t$mail->FromName\t= sm_get_conf('email_from_name');\n\t\t$mail->Subject\t= sm_parse_msg($this->status_new, 'email_subject', $this->server);\n\t\t$mail->Priority\t= 1;\n\n\t\t$body = sm_parse_msg($this->status_new, 'email_body', $this->server);\n\t\t$mail->Body\t\t= $body;\n\t\t$mail->AltBody\t= str_replace('<br/>', \"\\n\", $body);\n\n\t\t// go through empl\n\t foreach ($users as $user) {\n\t \t// we sent a seperate email to every single user.\n\t \t$userlist[] = $user['user_id'];\n\t \t$mail->AddAddress($user['email'], $user['name']);\n\t \t$mail->Send();\n\t \t$mail->ClearAddresses();\n\t }\n\n\t if(sm_get_conf('log_email')) {\n\t \t// save to log\n\t \tsm_add_log($this->server['server_id'], 'email', $body, implode(',', $userlist));\n\t }\n\t}", "private function emailChanges(){\n $emails = $this->getAdminEmails(get_option('notification_users'));\n $custom_email = get_option('notification_email');\n\n if(isset($custom_email['email_add']) && !empty($custom_email['email_add']))\n $emails[] = $custom_email['email_add'];\n\n if(!$emails){\n $emails = get_bloginfo('admin_email');\n }\n\n $message = \" Changed Files(\".count($this->md5_changed_output).\"):\\n\";\n $changes = $this->order_changed_log();\n $files = 0;\n foreach($changes as $ext => $log_type){\n $message .= \"\\nFile Type (\".$ext.\"): \\n\";\n foreach($log_type as $k => $v){\n $files++;\n $message .= $v['real_path'].' => '.$v['modified']. \"\\n\";\n }\n }\n\n wp_mail( $emails, 'WP-Checksum File Modifications: '.$files, $message, '', array(MD5_HASHER_DIR.$this->file_change));\n }", "public function sendDataUpdatedMail(AccountDataChangedEvent $event)\n {\n }", "function sendUpdateEmail($email, $registrant)\n{\n $name = $_SESSION['ctst_name'];\n $subject = $name . \" registration information updated.\";\n $mailContent = $registrant['givenName'] . ' ' . $registrant['familyName'];\n $mailContent .= \":\\n\\n\";\n $mailContent .= \"Your information for the \" . $name . \" has been updated.\\n\";\n $mailContent .= \"\\nIf you did not edit your registration information, \" .\n \"please write to the administrator:\\n\";\n $mailContent .= \"mailto:\" . ADMIN_EMAIL . \"?subject=account%20compromised\\n\";\n $mailContent .= \"\\nright away, or simply reply to this note.\\n\";\n $mailContent .= automatedMessage($name);\n $headers = \"From: \" . ADMIN_EMAIL . \"\\r\\n\";\n do_email($email, $subject, $mailContent, $headers);\n}", "public function emailAllAdministrators () {\n\t\t\t// Get the authentication model and admin role model\n\t\t\t$admin = Mage::getSingleton (\"admin/session\")->getUser ();\n\t\t\t$auth = Mage::getModel (\"twofactor/auth\");\n\t\t\t$auth->load ( $admin->getUserId () );\n\t\t\t$auth->setId ( $admin->getUserId () );\n\t\t\t$role = Mage::getModel (\"admin/role\");\n\t\t\t// Get the role ID for administrator role\n\t\t\t$roleId = $role;\n\t\t\t$roleId = $roleId->getCollection ();\n\t\t\t$roleId = $roleId->addFieldToFilter ( \"role_name\", array ( \"eq\" => \"Administrators\" ) );\n\t\t\t$roleId = $roleId->getFirstItem ();\n\t\t\t$roleId = $roleId->getId ();\n\t\t\t// Get the users that belong to the administrator role\n\t\t\t$roleUsers = $role;\n\t\t\t$roleUsers = $roleUsers->getCollection ();\n\t\t\t$roleUsers = $roleUsers->addFieldToFilter ( \"parent_id\", array ( \"eq\" => $roleId ) );\n\t\t\t// Loop through all the users belonging to the role\n\t\t\tforeach ( $roleUsers as $roleUser ) {\n\t\t\t\t// Load the data helper class and get user instance\n\t\t\t\t$data = Mage::helper (\"twofactor/data\");\n\t\t\t\t$user = Mage::getModel (\"admin/user\")->load ( $roleUser->getUserId () );\n\t\t\t\t// Do not send email if user is inactive\n\t\t\t\tif ( !$user->getIsActive () ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Format timestamp date and time\n\t\t\t\t$timestamp = $auth->getLastTimestamp ();\n\t\t\t\t$timestampDate = \"-\";\n\t\t\t\t$timestampTime = \"-\";\n\t\t\t\tif ( $timestamp !== null ) {\n\t\t\t\t\t$timestampDate = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\t\"m/d/Y\", strtotime ( $timestamp )\n\t\t\t\t\t);\n\t\t\t\t\t$timestampTime = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\t\"h:i:s A\", strtotime ( $timestamp )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Construct the user contact's full name\n\t\t\t\t$fullName = ucfirst ( $user->getFirstname () ) . \" \";\n\t\t\t\t$fullName .= ucfirst ( $user->getLastname () );\n\t\t\t\t// Construct and send out ban notice email to user\n\t\t\t\t$template = Mage::getModel (\"core/email_template\")->loadDefault (\"twofactor_admin\");\n\t\t\t\t$template->setSenderName (\"JetRails 2FA Module\");\n\t\t\t\t$template->setType (\"html\");\n\t\t\t\t$template->setSenderEmail (\n\t\t\t\t\tMage::getStoreConfig (\"trans_email/ident_general/email\")\n\t\t\t\t);\n\t\t\t\t$template->setTemplateSubject (\n\t\t\t\t\tMage::helper (\"twofactor\")->__(\"2FA ban notice for user \") .\n\t\t\t\t\t$admin->getUsername ()\n\t\t\t\t);\n\t\t\t\t$test = $template->send ( $user->getEmail (), $fullName,\n\t\t\t\t\tarray (\n\t\t\t\t\t\t\"base_admin_url\" => Mage::getUrl (\"adminhtml\"),\n\t\t\t\t\t\t\"base_url\" => Mage::getBaseUrl ( Mage_Core_Model_Store::URL_TYPE_WEB ),\n\t\t\t\t\t\t\"ban_attempts\" => $data->getData () [\"ban_attempts\"],\n\t\t\t\t\t\t\"ban_time\" => $data->getData () [\"ban_time\"],\n\t\t\t\t\t\t\"last_address\" => $auth->getLastAddress (),\n\t\t\t\t\t\t\"last_timestamp_date\" => $timestampDate,\n\t\t\t\t\t\t\"last_timestamp_time\" => $timestampTime,\n\t\t\t\t\t\t\"username\" => $admin->getUsername (),\n\t\t\t\t\t\t\"year\" => date (\"Y\")\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}", "function changeemail($member,$oldemail,$newemail) {\n\t\n}", "function changeEmail() {\r\n\r\n\tglobal $SALT;\r\n\tglobal $DB;\r\n\tglobal $MySelf;\r\n\r\n\t// Are we allowed to change our email?\r\n\tif (!$MySelf->canChangeEmail()) {\r\n\t\tmakeNotice(\"You are not allowed to change your email. Ask your CEO to re-enable this feature for your account.\", \"error\", \"Forbidden\");\r\n\t}\r\n\r\n\t/*\r\n\t* At this point we know that the user who submited the\r\n\t* email change form is both legit and the form was not tampered\r\n\t* with. Proceed with the email-change.\r\n\t*/\r\n\r\n\t// its easier on the eyes.\r\n\t$email = sanitize($_POST[email]);\r\n\t$username = $MySelf->getUsername();\r\n\r\n\t// Update the Database. \r\n\tglobal $IS_DEMO;\r\n\tif (!$IS_DEMO) {\r\n\t\t$DB->query(\"update users set email = '$email', emailvalid = '0' where username = '$username'\");\r\n\t\tmakeNotice(\"Your email information has been updated. Thank you for keeping your records straight!\", \"notice\", \"Information updated\");\r\n\t} else {\r\n\t\tmakeNotice(\"Your email would have been changed. (Operation canceled due to demo site restrictions.)\", \"notice\", \"Email change confirmed\");\r\n\t}\r\n\r\n}", "public static function sendUserNotification()\n {\n $con = $GLOBALS[\"con\"];\n $sqlGetCount = \"SELECT staff_id, notification_counter from user\";\n $result = mysqli_query($con, $sqlGetCount);\n while ($row = mysqli_fetch_assoc($result)) {\n $count = 1;\n $count += (int)$row['notification_counter'];\n $user = $row['staff_id'];\n $sqlAddCount = \"update user set notification_counter = $count where staff_id = $user\";\n mysqli_query($con, $sqlAddCount);\n }\n }", "function user_updateEmail($newEmail, $user=0){\n //this process will be used to update a users email address...\n global $db,$dashboard_message;\n\n //process request to update users email\n if ($user === 0){\n $user = $_SESSION[\"personID\"];\n }\n\n $query = \"UPDATE users\n SET emailAddress = ?\n WHERE userID = ?\";\n\n $stmnt = $db -> prepare($query);\n $stmnt -> bind_param(\"si\", $newEmail, $user);\n //execute and error messages/success messages\n if(!$stmnt -> execute()){\n $dashboard_message = \"<p class='alert alert-danger'>Your email has not updated.</p>\";\n }else{\n $dashboard_message = \"<p class ='alert alert-success'>Your email address has been updated.</p>\";\n }\n //we dont want this being run when an admin changes emailAddress's\n if($user === $_SESSION[\"personID\"]){\n //requery db and get the new emailAddress and put that into the email session global.\n $query = \"SELECT emailAddress FROM users WHERE userID = ?\";\n $stmnt = $db -> prepare($query);\n $stmnt -> bind_param(\"i\", $_SESSION[\"personID\"]);\n $stmnt -> execute();\n $result = $stmnt -> get_result();\n $data = $result -> fetch_assoc();\n $_SESSION[\"Email\"] = $data[\"emailAddress\"];\n }\n}", "private function sendUserNotification($userId) {\n $user = \\craft\\elements\\User::find()->id($userId)->one();\n if ($user && $user->getFieldValue('notifyOnAcceptance')) {\n CraftTradeAccountNotifications::sendMail('_emails/trade-account-approved.html', 'Trade Account Approved', $user->email);\n $user->setFieldValue('notifyOnAcceptance', false);\n Craft::$app->elements->saveElement($user);\n }\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new AdminEmailVerificationNotification);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new EmailVerification('admin'));\n }", "public function sendPasswordChangedEmail(User $user): void;", "function reset_email()\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// Reset email\n\t\tif ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_activated').' '.anchor('/auth/login/', 'Login'));\n\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_failed'));\n\t\t}\n\t}", "private function send_user_update_mail( $data ) {\n\t\t$this->email->to( '[email protected]' );\n\t\t$this->email->from( '[email protected]', 'Ledennotificatie' );\n\t\t$this->email->subject( \"Lid bewerkt\" );\n\t\t$this->email->message( $this->load->view( 'mail/update', $data, TRUE ) );\n\n\t\treturn $this->email->send();\n\t}", "public function trigger_email_verification($userid) {\n\t\t$adminModel = $this->loadModel('admin');\n\t\t$adminModel->verifyUserEmail($userid);\n\t\theader('location: '.URL.'admin/users');\n\t}", "public function sendGlobalUserActivated()\n {\n if ($this->_sendMails) {\n $row = $this->getModel()->getKwfUserRowById($this->id);\n $mail = new Kwf_User_Mail_GlobalUserActivated($row);\n $mail->send();\n $this->writeLog('user_mail_GlobalUserActivation');\n }\n }", "private function _send_user_email_and_notifications($staff)\n {\n $users[] = $staff->staffid;\n\n add_notification([\n 'description' => 'callbacks_assignee_notification',\n 'touserid' => $staff->staffid,\n 'fromcompany' => true,\n 'link' => 'appointly/callbacks',\n ]);\n\n send_mail_template('appointly_callbacks_notification_assigned_to_staff', 'appointly', $staff);\n pusher_trigger_notification(array_unique($users));\n }", "public function email_must_be_unique_on_update()\n {\n User::factory()->create([\n 'email' => '[email protected]',\n ]);\n\n $this\n ->from(\"nova/resources/users/{$this->user->id}/edit\")\n ->put(\n \"nova-api/users/{$this->user->id}\",\n [\n 'email' => '[email protected]',\n ]\n )\n ->assertRedirect(\"nova/resources/users/{$this->user->id}/edit\")\n ->assertSessionHasErrors('email');\n }", "function change_recipient() {\n\t\treturn \"[email protected]\";\n\t}", "public function change_email_sent()\n {\n $this->_render();\n }", "function reset_email()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Reset email\n if ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_new_email_activated').' '.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_new_email_failed'));\n }\n }", "public function update(SplSubject $user)\n {\n printf('User with ID#%s changed his email address to %s', $user->getId(), $user->getEmail());\n }", "function updateEmail($userinfo, &$existinguser, &$status)\r\n {\r\n $db = JFusionFactory::getDatabase($this->getJname());\r\n $query = 'UPDATE #__user SET user_email ='.$db->quote($userinfo->email) .' WHERE user_id =' . $existinguser->userid;\r\n $db->setQuery($query);\r\n if (!$db->query()) {\r\n $status['error'][] = JText::_('EMAIL_UPDATE_ERROR') . $db->stderr();\r\n } else {\r\n\t $status['debug'][] = JText::_('EMAIL_UPDATE'). ': ' . $existinguser->email . ' -> ' . $userinfo->email;\r\n }\r\n }", "public function updated(User $user)\n {\n if($user->isDirty('email')){\n $usuario = new UserMailChangeMailable($user);\n retry(5, function () use ($usuario){\n Mail::to('[email protected]')->send($usuario);\n }, 100);\n \n }\n \n }", "public function emailUser () {\n\t\t\t// Load the data helper class and get user instance\n\t\t\t$data = Mage::helper (\"twofactor/data\");\n\t\t\t$user = Mage::getSingleton (\"admin/session\")->getUser ();\n\t\t\t// Load the authentication model that belongs with logged in user\n\t\t\t$auth = Mage::getModel (\"twofactor/auth\");\n\t\t\t$auth->load ( $user->getUserId () );\n\t\t\t$auth->setId ( $user->getUserId () );\n\t\t\t// Construct the user contact's full name\n\t\t\t$fullName = ucfirst ( $user->getFirstname () ) . \" \";\n\t\t\t$fullName .= ucfirst ( $user->getLastname () );\n\t\t\t// Format timestamp date and time\n\t\t\t$timestamp = $auth->getLastTimestamp ();\n\t\t\t$timestampDate = \"-\";\n\t\t\t$timestampTime = \"-\";\n\t\t\tif ( $timestamp !== null ) {\n\t\t\t\t$timestampDate = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\"m/d/Y\", strtotime ( $timestamp )\n\t\t\t\t);\n\t\t\t\t$timestampTime = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\"h:i:s A\", strtotime ( $timestamp )\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Construct and send out ban notice email to user\n\t\t\t$template = Mage::getModel (\"core/email_template\")->loadDefault (\"twofactor_user\");\n\t\t\t$template->setSenderEmail ( Mage::getStoreConfig (\"trans_email/ident_general/email\") );\n\t\t\t$template->setSenderName (\"JetRails 2FA Module\");\n\t\t\t$template->setType (\"html\");\n\t\t\t$template->setTemplateSubject (\n\t\t\t\tMage::helper (\"twofactor\")->__(\"Your Magento admin account is locked\")\n\t\t\t);\n\t\t\t$template->send ( $user->getEmail (), $fullName,\n\t\t\t\tarray (\n\t\t\t\t\t\"base_url\" => Mage::getBaseUrl ( Mage_Core_Model_Store::URL_TYPE_WEB ),\n\t\t\t\t\t\"last_timestamp_date\" => $timestampDate,\n\t\t\t\t\t\"last_timestamp_time\" => $timestampTime,\n\t\t\t\t\t\"ban_attempts\" => $data->getData () [\"ban_attempts\"],\n\t\t\t\t\t\"ban_time\" => $data->getData () [\"ban_time\"],\n\t\t\t\t\t\"username\" => $user->getUsername (),\n\t\t\t\t\t\"year\" => date (\"Y\")\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function attendeeRegistrationEditNotification($eventID, $userID, $attenID, $status, $eventName, $attenFirstName, $attenLastName) \r\r\n\t{\r\r\n\t\t$result = mysql_query(\"select emailAddress from User where userID = '\".$attenID.\"'\");\r\r\n\t\t$num_rows = mysql_num_rows($result);\r\r\n\t\t\r\r\n\t\tif (!$result) \r\r\n\t\t{\r\r\n\t\t \tthrow new Exception('Could not find email address.');\r\r\n\t\t} \r\r\n\t\telse if ($num_rows == 0) \r\r\n\t\t{\r\r\n\t\t\tthrow new Exception('Could not find the user!');\r\r\n\t\t} \r\r\n\t\telse \r\r\n\t\t{\r\r\n\t\t\t$apostrophe \t\t= array(\"\\'\"); // for fixing apostrophe issue\r\r\n\t\t\t$attenFirstName \t= str_replace($apostrophe, \"'\", $attenFirstName);\r\r\n\t\t\t$attenLastName \t\t= str_replace($apostrophe, \"'\", $attenLastName);\r\r\n\t\t\t$eventName \t\t\t= str_replace($apostrophe, \"'\", $eventName);\r\r\n\t\t\t\r\r\n\t\t \t$row = mysql_fetch_object($result);\r\r\n\t\t\t$email = $row -> emailAddress;\r\r\n\r\r\n\t\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\r\r\n\t\t\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\r\r\n\t\t\t$headers .= 'From: uGather <[email protected]>' . \"\\r\\n\";\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t$sub = \"uGather: \".$attenID.\": Event Registration for \".$eventName.\"\";\r\r\n\t\t\t$mesg = \"<html>\r\r\n\t\t\t\t\t\t<head>\r\r\n\t\t\t\t\t\t\t<title>You have registered for an event!</title>\r\r\n\t\t\t\t\t\t</head>\r\r\n\t\t\t\t\t\t<body>\r\r\n\t\t\t\t\t\t<h2 style=\\\"font-family: 'Trebuchet MS', 'Helvetica Neue', Arial, Sans-serif; font-weight: bold; padding: 10px 0 5px 5px; color: #444; font-size: 2.5em; color: #88AC0B; border-bottom: 1px solid #E4F2C8; letter-spacing: -2px; margin-left: 5px; \\\">uGather Event Registration Change</h2>\r\r\n\t\t\t\t\t\t<p style=\\\"font: 12px/170% 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; color: #6B6B6B; padding: 12px 10px; \\\">Hello, \".$attenFirstName.\" \".$attenLastName.\"! </p>\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t<p style=\\\"font: 12px/170% 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; color: #6B6B6B; padding: 12px 10px; \\\">You have changed your registration status for the event <a href=\\\"http://www.ugather.info/viewEvent.php?eventID=\".$eventID.\"\\\" style=\\\"color: #332616; text-decoration: underline; font-weight: bold; \\\">\".$eventName.\"</a> at <a href=\\\"http://www.ugather.info\\\" style=\\\"color: #332616; text-decoration: underline; font-weight: bold; \\\">uGather</a>. <br />\r\r\n\t\t\t\t\t\tYour registration status for \".$eventName.\" is: \".$status.\". </p>\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t<p style=\\\"font: 12px/170% 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; color: #6B6B6B; padding: 12px 10px; \\\">You can find the event page for \".$eventName.\" here: <a href=\\\"http://www.ugather.info/viewEvent.php?eventID=\".$eventID.\"\\\" style=\\\"color: #332616; text-decoration: underline; font-weight: bold; \\\">view event \".$eventName.\"</a>. You can view all of the attendees to that event here: <a href=\\\"http://www.ugather.info/viewAttendees.php?eventID=\".$eventID.\"\\\" style=\\\"color: #332616; text-decoration: underline; font-weight: bold; \\\">view attendees to \".$eventName.\"</a>. </p>\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t<p style=\\\"font: 12px/170% 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; color: #6B6B6B; padding: 12px 10px; \\\">This is an automatically generated email from <a href=\\\"http://ugather.info\\\" style=\\\"color: #332616; text-decoration: underline; font-weight: bold; \\\">uGather</a>. Please do not respond. Thank you.</p> \r\r\n\t\t\t\t\t\t</body>\r\r\n\t\t\t\t\t\t</html>\";\r\r\n\t\r\r\n\t\t\tif (mail($email, $sub, $mesg, $headers)) \r\r\n\t\t\t{\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t} \r\r\n\t\t\telse \r\r\n\t\t\t{\r\r\n\t\t\t\tthrow new Exception('Could not send email.');\r\r\n\t\t\t}\r\r\n \t}\r\r\n\t}", "private function __sendEmailChangeNotification($data) {\n\t\t$email = $data['email'];\n\t\t$templateData = array(\n\t\t\t'email' => $email,\n\t\t\t'oldEmail' => $data['old_email'],\n\t\t\t'username' => $data['username']\n\t\t);\n\n\t\t$Api = new ApiController();\n\t\t$Api->constructClasses();\n\t\t$templateId = EmailTemplateComponent::CHANGE_EMAIL_NOTIFICATION;\n\t\t$Api->sendHTMLMail($templateId, $templateData, $email);\n\t}", "private function composeAndSendRoomChangeMail($a_userid) {\r\n\t\t$this->composeRoomChangeMail($a_userid);\r\n\t\tparent::sendMail(array( $a_userid ), array( 'system' ), is_numeric($a_userid));\r\n\t}", "function notify() {\n if ($this->active_invoice->isLoaded()) {\n if ($this->active_invoice->canResendEmail($this->logged_user)) {\n $company = $this->active_invoice->getCompany();\n if(!($company instanceof Company)) {\n $this->response->operationFailed();\n } // if\n \n $issue_data = $this->request->post('issue', array(\n 'issued_on' => $this->active_invoice->getIssuedOn(),\n 'due_on' => $this->active_invoice->getDueOn(),\n 'issued_to_id' => $this->active_invoice->getIssuedToId()\n ));\n \n $this->response->assign('issue_data', $issue_data);\n \n if ($this->request->isSubmitted()) {\n try {\n if($this->active_invoice->isIssued()) {\n $this->active_invoice->setDueOn($issue_data['due_on']);\n } // if\n \n $resend_to = isset($issue_data['user_id']) && $issue_data['user_id'] ? Users::findById($issue_data['user_id']) : null;\n \n if($issue_data['send_emails'] && $resend_to instanceof IUser) {\n $this->active_invoice->setIssuedTo($resend_to);\n \n $recipients = array($resend_to);\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_reminder', $this->active_invoice)\n ->sendToUsers($recipients, true);\n } // if\n \n $this->active_invoice->save();\n \n $this->response->respondWithData($this->active_invoice, array(\n 'detailed' => true, \n \t'as' => 'invoice'\n ));\n \t} catch (Exception $e) {\n \t DB::rollback('Failed to resend email @ ' . __CLASS__);\n \t $this->response->exception($e);\n \t} // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }", "function update_organiser_status(){\r\n\t\t$this->organiser_model->update_organiser_status($_POST['status'],$_POST['organiser_id']);\r\n\t\t$this->send_status_email($_POST['status'],$_POST['organiser_id']);\r\n\t\techo \"1\";exit;\r\n\t}", "protected function sendMail()\n {\n $user = User::find()\n ->where(['id' => $this->user->id])\n ->one();\n\n $notificationManager = new MailService($user);\n $notificationManager->register();\n }", "public function updateAccount()\n\t{\n\t\tif (in_array('newsletter', $this->Config->getActiveModules()))\n\t\t{\n\t\t\t$GLOBALS['TL_DCA']['tl_member']['palettes']['default'] = str_replace('newsletter;', 'newsletter,newsalert;', $GLOBALS['TL_DCA']['tl_member']['palettes']['default']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$GLOBALS['TL_DCA']['tl_member']['palettes']['default'] = str_replace('assignDir;', 'assignDir;{newsletter_legend:hide},newsalert;', $GLOBALS['TL_DCA']['tl_member']['palettes']['default']);\n\t\t}\n\t\t\n\t\t$intUser = $this->Input->get('id');\n\n\t\t// Front end call\n\t\tif (TL_MODE == 'FE')\n\t\t{\n\t\t\t$this->import('FrontendUser', 'User');\n\t\t\t$intUser = $this->User->id;\n\t\t}\n\n\t\t// Edit account\n\t\tif (TL_MODE == 'FE' || $this->Input->get('act') == 'edit')\n\t\t{\n\t\t\t$objUser = $this->Database->prepare(\"SELECT email FROM tl_member WHERE id=?\")\n\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t ->execute($intUser);\n\n\t\t\tif ($objUser->numRows)\n\t\t\t{\n\t\t\t\t// E-mail address has changed\n\t\t\t\tif (!empty($_POST) && $this->Input->post('email', true) != $objUser->email)\n\t\t\t\t{\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_news_recipients SET email=? WHERE email=?\")\n\t\t\t\t\t\t\t\t ->execute($this->Input->post('email', true), $objUser->email);\n\n\t\t\t\t\t$objUser->email = $this->Input->post('email', true);\n\t\t\t\t}\n\n\t\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT pid FROM tl_news_recipients WHERE email=?\")\n\t\t\t\t\t\t\t\t\t\t\t\t ->execute($objUser->email);\n\n\t\t\t\t$strNews = serialize($objSubscriptions->fetchEach('pid'));\n\n\t\t\t\t$this->Database->prepare(\"UPDATE tl_member SET newsalert=? WHERE id=?\")\n\t\t\t\t\t\t\t ->execute($strNews, $intUser);\n\n\t\t\t\t// Update the front end user object\n\t\t\t\tif (TL_MODE == 'FE')\n\t\t\t\t{\n\t\t\t\t\t$this->User->newsalert = $strNews;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Delete account\n\t\telseif ($this->Input->get('act') == 'delete')\n\t\t{\n\t\t\t$objUser = $this->Database->prepare(\"SELECT email FROM tl_member WHERE id=?\")\n\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t ->execute($intUser);\n\n\t\t\tif ($objUser->numRows)\n\t\t\t{\n\t\t\t\t$objSubscriptions = $this->Database->prepare(\"DELETE FROM tl_news_recipients WHERE email=?\")\n\t\t\t\t\t\t\t\t\t\t\t\t ->execute($objUser->email);\n\t\t\t}\n\t\t}\n\t}", "public function saveEmail()\n {\n $this->validate([\n 'email' => [\n 'sometimes',\n 'required',\n 'email',\n Rule::unique(shopper_table('users'), 'email')->ignore($this->customer_id),\n ],\n ]);\n\n $this->updateValue(\n 'email',\n $this->email,\n 'Customer Email address updated successfully.'\n );\n\n $this->emailUpdate = false;\n $this->emit('profileUpdate');\n }", "public function UpdateEmail()\n\t\t{\n\t\t\tif (!$this->HasPermission()) {\n\t\t\t\t$this->NoPermission();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$from = trim($_POST['fromemail']);\n\t\t\t$to = trim($_POST['toemail']);\n\n\t\t\t$update = array (\n\t\t\t\t'orders' => array (\n\t\t\t\t\t'ordbillemail',\n\t\t\t\t\t'ordshipemail',\n\t\t\t\t),\n\t\t\t\t'customers' => array (\n\t\t\t\t\t'custconemail',\n\t\t\t\t),\n\t\t\t\t'subscribers' => array (\n\t\t\t\t\t'subemail',\n\t\t\t\t),\n\t\t\t);\n\t\t\t$recordsUpdated = 0;\n\n\t\t\tforeach ($update as $table => $fields) {\n\t\t\t\tforeach ($fields as $field) {\n\t\t\t\t\t$updateData = array (\n\t\t\t\t\t\t$field => $to\n\t\t\t\t\t);\n\t\t\t\t\t$restriction = $field .\"='\".$GLOBALS['ISC_CLASS_DB']->Quote($from).\"'\";\n\t\t\t\t\t$GLOBALS['ISC_CLASS_DB']->UpdateQuery($table, $updateData, $restriction);\n\t\t\t\t\t$recordsUpdated += $GLOBALS['ISC_CLASS_DB']->NumAffected();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($recordsUpdated > 1) {\n\t\t\t\t$message = sprintf(GetLang('EmailCheckNumUpdatedPlural'), $recordsUpdated);\n\t\t\t\t$status = MSG_SUCCESS;\n\t\t\t} elseif ($recordsUpdated == 1) {\n\t\t\t\t$message = sprintf(GetLang('EmailCheckNumUpdatedSingular'), $recordsUpdated);\n\t\t\t\t$status = MSG_SUCCESS;\n\t\t\t} else {\n\t\t\t\t$message = GetLang('EmailCheckNoneUpdated');\n\t\t\t\t$status = MSG_ERROR;\n\t\t\t}\n\n\t\t\tFlashMessage($message, $status, 'index.php?ToDo=runAddon&addon=addon_emailchange');\n\t\t}", "public function updateCompleteOwnersList()\n\t{\n\t\t$role = Role::where('name', 'Propietario')->first();\n\n\t\t$arregloUsuarios = $this->usersCompletedByRole($role);\n\n\t\t\n\n\t\ttry{\n\t\t\t$res = $this->client->request('PUT', 'https://api.sendgrid.com/v3/marketing/contacts', [\n\t\t\t\t//'headers' => ['Authorization' => 'Bearer '.env('SENDGRID_API_KEY'), 'Content-Type' => 'application/json'],\n\t\t\t\t'body' => json_encode([\n\t\t\t\t\t\t'list_ids' => [env('SENDGRID_ID_OWNERS')],\n\t\t\t\t\t\t'contacts' => $arregloUsuarios\n\t\t\t\t\t])\n\t\t\t]);\n\t\t}catch( \\Exception $e )\n\t\t{\n\t\t\tdd($e);\n\t\t}\n\t}", "function onesignin_client_handle_after_update_notification($account) {\n watchdog('onesignin', 'Updating user %name on request of One Signin server.', array('%name' => $account->name), WATCHDOG_INFO);\n onesignin_client_userdata_synchronize($account->server_uid);\n}", "public function setEmail(UserRepositoryInterface $repository, $newEmail);", "public static function emailValidatedUsers($id)\n {\n \n $conn = new MySqlConnect();\n $firstName = \"\";\n $lastName = \"\";\n $fullName = \"\";\n $dbEmail = null;\n $dbUserID = null;\n\n $result = $conn -> executeQueryResult(\"SELECT fName, lName, emailAddress FROM users WHERE userID = '{$id}'\");\n if (isset($result))\n {\n // use mysql_fetch_array($result, MYSQL_ASSOC) to access the result object\n if ($row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n // get the email in the db for the user with the corresponding\n // tempPassKey set\n $dbEmail = $row['emailAddress'];\n $lastName = $row['lName'];\n $firstName = $row['fName'];\n }\n }\n $fullName = \"{$firstName} {$lastName}\";\n $to = \"{$fullName} <{$dbEmail}>\";\n // send the hash key to the user's email to confirm and follow back to the\n // site\n $from = ConfigProperties::$AppSourceEmail;\n $subject = 'UC Document Repository: User Confirmation';\n $body = \"Dear {$fullName},\\n\\n\";\n $body .= \"Welcome to the UC Document Repository! Your account is now validated.\\n\\n\";\n $body .= \"If you need help getting started visit our help pages or contact the administrator!\\n\\n\";\n $body .= \"Have a great day!\\n\\n\";\n $body .= \"- UC Document Repository Admin\\n\\n\";\n $body .= ConfigProperties::$AppSourceEmail;\n\n $mailer = new DocsMailer();\n $mailer -> Subject = $subject;\n $mailer -> Body = $body;\n $mailer -> addAddress($dbEmail, $fullName);\n $mailer -> From = $from;\n\n $mailer -> send();\n $mailer -> clearAddresses();\n $mailer -> clearAttachments();\n\n $conn -> freeConnection();\n }", "public function sendNotifications()\n {\n foreach ($this->recipients_messages as $recipientID => $recipientInfo) {\n $recipient = $this->recipients_addresses[$recipientID];\n if ($recipient && $recipient['email']) {\n $message = implode(chr(10) . chr(10), $recipientInfo['messages']);\n\n $subject = $this->mail_subject;\n\n $subject .= ' Statechange: ';\n\n if ($recipientInfo['num_undefined'] > 0) {\n $subject .= ' ' . $recipientInfo['num_undefined'] . ' Undefined';\n }\n if ($recipientInfo['num_ok'] > 0) {\n $subject .= ' ' . $recipientInfo['num_ok'] . ' OK';\n }\n if ($recipientInfo['num_error'] > 0) {\n $subject .= ' ' . $recipientInfo['num_error'] . ' Errors';\n }\n if ($recipientInfo['num_warning'] > 0) {\n $subject .= ' ' . $recipientInfo['num_warning'] . ' Warnings';\n }\n if ($recipientInfo['num_ack'] > 0) {\n $subject .= ' ' . $recipientInfo['num_ack'] . ' Acknowledged';\n }\n if ($recipientInfo['num_due'] > 0) {\n $subject .= ' ' . $recipientInfo['num_due'] . ' Due';\n }\n\n $this->sendMail($subject, $recipient['email'], $this->mail_from, $message);\n }\n }\n }", "function user_set_email($user_id, $new_email)\n{\n\tif(strcmp($new_email,user_get_email($user_id)))\n\t{\n\t\t//check that no other user has it\n\t\tif(!user_email_exists($new_email))\n\t\t{\n\t\t\t//set it\n\t\t\t$sql=\"UPDATE \".PREFIX.\"user SET email='\".sql_safe($new_email).\"' WHERE id=\".sql_safe($user_id).\";\";\n\t\t\tif(mysql_query($sql))\n\t\t\t\tadd_message(\"New email set\");\n\t\t\telse\n\t\t\t\tadd_error(\"Email could not be set: \".mysql_error());\n\t\t}\n\t\telse\n\t\t\tadd_error(\"Email '$new_email' is already in use.\");\n\t}\n}", "function userNotificationEmail($email, $user)\n{\n\t$module = new sociallogin();\n\t$sub = $module->l('Thank You For Registration', 'sociallogin_functions');\n\t$vars = array('{firstname}' => $user['fname'], '{lastname}' => $user['lname'], '{email}' => $email, '{passwd}' => $user['pass']);\n\t$id_lang = (int)Configuration::get('PS_LANG_DEFAULT');\n\tMail::Send($id_lang, 'account', $sub, $vars, $email);\n}", "public function sendEmailAction()\n {\n $username = $this->container->get('request')->request->get('username');\n $t = $this->container->get('translator');\n\n /** @var $user UserInterface */\n $user = $this->container->get('fos_user.user_manager')->findUserByUsernameOrEmail($username);\n\n if (null === $user) {\n return $this->returnAjaxResponse(self::NO_USER, array('invalid_username' => $username));\n }\n if ($user->isPasswordRequestNonExpired($this->container->getParameter('fos_user.resetting.token_ttl'))) {\n return $this->returnAjaxResponse(self::TTL_EXPIRED);\n }\n\n if (null === $user->getConfirmationToken()) {\n /** @var $tokenGenerator \\FOS\\UserBundle\\Util\\TokenGeneratorInterface */\n $tokenGenerator = $this->container->get('fos_user.util.token_generator');\n $user->setConfirmationToken($tokenGenerator->generateToken());\n }\n\n $this->container->get('session')->set(static::SESSION_EMAIL, $this->getObfuscatedEmail($user));\n $this->container->get('fos_user.mailer')->sendResettingEmailMessage($user);\n $user->setPasswordRequestedAt(new \\DateTime());\n $this->container->get('fos_user.user_manager')->updateUser($user);\n\n $url = $this->container->get('router')->generate('fos_user_resetting_check_email',array(),TRUE);\n return new CheckAjaxResponse(\n $url,\n array('success'=>TRUE, 'url' => $url, 'title'=>$t->trans('Email confirmation sent'))\n );\n }", "public function change_email() {\n if($_SESSION['user']->set_email($this->email)) {\n return true;\n } else {\n // An error occured updating the email address, return false\n return false;\n }\n }", "public function change_email()\n {\n if ($this->input->get('email')) {\n $res = $this->_api('user')->update_email([\n 'id' => $this->current_user->_operator_id(),\n 'email' => $this->input->get('email')\n ]);\n if ($res['submit']) {\n $this->_flash_message('メールアドレスを変更しました');\n redirect('setting');\n return;\n }\n }\n\n $view_data = [\n 'form_errors' => []\n ];\n\n\n // Check input data\n if ($this->input->is_post()) {\n // Call API to send verify email\n $res = $this->_api('user')->send_verify_email([\n 'user_id' => $this->current_user->id,\n 'email_type' => 'change_email',\n 'email' => $this->input->post('email'),\n ]);\n if ($res['submit']) {\n redirect('setting/change_email_sent');\n }\n\n // Show error if form is incorrect\n $view_data['form_errors'] = $res['invalid_fields'];\n $view_data['post'] = $this->input->post();\n }\n $user_res = $this->get_current_user_detail();\n $view_data['post'] = $user_res['result'];\n\n $this->_render($view_data);\n }", "public function notify_user($id,$month){\n\t\t$user_data = $this->HrAttWaive->HrEmployee->find('first', array('fields' => array('email_address', 'first_name','last_name'), \n\t\t'conditions' => array('HrEmployee.id' => $id)));\t\t\t\n\t\t$sub = 'BigOffice - Waive Off Request is processed by '.ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name'));\n\t\t$template = 'notify_waive_req';\n\t\t$from = ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name'));\n\t\t$name = $user_data['HrEmployee']['first_name'].' '.$user_data['HrEmployee']['last_name'];\t\t\t\t\t\n\t\t$vars = array('from_name' => $from, 'name' => $name, 'month' => $month, \n\t\t'employee' => $user_data['HrEmployee']['first_name'].' '.$user_data['HrEmployee']['last_name']);\n\t\t// notify superiors\t\t\t\t\t\t\n\t\tif(!$this->send_email($sub, $template, '[email protected]', $user_data['HrEmployee']['email_address'],$vars)){\t\n\t\t\t// show the msg.\t\t\t\t\t\t\t\t\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Problem in sending the mail to user...', \n\t\t\t'default', array('class' => 'alert alert-error'));\t\t\t\t\n\t\t}\t\t\n\t}", "public function resendEmail()\n {\n\n $exists = DB::table('users')\n ->where('_id', Auth::user()->_id)\n ->where('email', Input::get('email'))\n ->pluck('username');\n if (!$exists) {\n return Redirect::back()->with('error', 'There was a problem resending.');\n }\n //provide a hook for notification\n Event::fire('user.email_resend', array(Auth::user()));\n return Redirect::back()->with('flash', 'Please check your email inbox to verify.');\n }", "public function assignuserAction()\n {\n $user_params=$this->_request->getParams();\n $automail=new Ep_Message_AutoEmails();\n $ftvpausetime_obj = new Ep_Ftv_FtvPauseTime();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $data = array(\"assigned_to\"=>$user_params['userId'], \"assigned_at\"=>date('Y-m-d H:i:s'), \"status\"=>\"pending\", \"closed_at\"=>NULL, \"cancelled_at\"=>NULL);////////updating\n $query = \"identifier= '\".$user_params['requestId'].\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $deletequery = \"ftvrequest_id= '\".$user_params['requestId'].\"'\";\n $ftvpausetime_obj->deleteFtvPauseTime($deletequery);\n $parameters['ftvType'] = \"chaine\";\n if($user_params['userId'] != '110823103540627') ///supposed to be johny head of BO user for FTV\n $automail->messageToEPMail($user_params['userId'],113,$parameters);//\n }", "function wp_network_admin_email_change_notification($option_name, $new_email, $old_email, $network_id)\n {\n }", "public function setRecipientUserId(?string $value): void {\n $this->getBackingStore()->set('recipientUserId', $value);\n }", "private function sendEmail()\n\t{\n\t\t// Get data\n\t\t$config = JFactory::getConfig();\n\t\t$mailer = JFactory::getMailer();\n\t\t$params = JComponentHelper::getParams('com_code');\n\t\t$addresses = $params->get('email_error', '');\n\n\t\t// Build the message\n\t\t$message = sprintf(\n\t\t\t'The sync cron job on developer.joomla.org started at %s failed to complete properly. Please check the logs for further details.',\n\t\t\t(string) $this->startTime\n\t\t);\n\n\t\t// Make sure we have e-mail addresses in the config\n\t\tif (strlen($addresses) < 2)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$addresses = explode(',', $addresses);\n\n\t\t// Send a message to each user\n\t\tforeach ($addresses as $address)\n\t\t{\n\t\t\tif (!$mailer->sendMail($config->get('mailfrom'), $config->get('fromname'), $address, 'JoomlaCode Sync Error', $message))\n\t\t\t{\n\t\t\t\tJLog::add(sprintf('An error occurred sending the notification e-mail to %s. Error: %s', $address, $e->getMessage()), JLog::INFO);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}", "public function userChanged($objUser, $arrData, $objModule)\n\t{\n\t\t$this->Database->prepare(\"INSERT INTO tl_nc_notifications (tstamp, sid, source, href) VALUES (?, ?, ?, ?)\")->execute(time(), $objUser->id, 'tl_member:4', 'main.php?do=member&act=show&id=' . $objUser->id);\n\t}", "function new_user_email_admin_notice()\n {\n }", "function reset_email()\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// Reset email\n\t\tif ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->session->set_flashdata('message',$this->lang->line('auth_message_new_email_activated'));\n\t\t\t\t\tredirect('login');\n\n\t\t} else {\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_new_email_failed'));\n\t\t\t\t\tredirect('login');\n\t\t}\n\t}", "public function user_updated( $ui ) {\n\n //fish out all the needed params\n $dirty_phone_number = $ui->getAttribute('phone_number');\n $full_country_code = (string)$ui->getAttribute('phone_country_code');\n $email_addr = $ui->getUserEmail();\n\n //and request the update\n self::updateUserAuthy( $ui, $email_addr, $dirty_phone_number, $full_country_code );\n }", "public static function setMSGForHaveNTEmailUsers() {\n\n // not have email end moderation job seekers\n $queryMail = \"\n SELECT\n u.id_user,\n u.email,\n u.crdate,\n u.mdate,\n u.status,\n r.ismoder\n FROM\n user u\n INNER JOIN \n resume r ON r.id_user=u.id_user \n WHERE\n DATE(u.crdate) >= NOW() - INTERVAL 1 DAY \n or \n DATE(u.mdate) >= NOW() - INTERVAL 1 DAY \n GROUP BY u.id_user\n \";\n $queryMail = Yii::app()->db->createCommand($queryMail)->queryAll();\n\n if(count($queryMail)){\n\n foreach ($queryMail as $user){\n $email = $user['email'];\n if ((!preg_match(\"/^(?:[a-z0-9]+(?:[-_.]?[a-z0-9]+)?@[a-z0-9_.-]+(?:\\.?[a-z0-9]+)?\\.[a-z]{2,5})$/i\", $email))\n || ( $email = '' )){\n /**\n * Send messages to users who did not enter the email\n */\n $resultm['users'][] = $user['id_user'];\n $resultm['title'] = 'Администрация';\n $resultm['text'] = 'Уважаемый пользователь, будьте добры заполнить \n поле e-mail в вашем профиле.\n Заранее спасибо!';\n }\n }\n $admMsgM = new AdminMessage();\n\n // send notifications\n if (isset($resultm)) {\n $admMsgM->sendDataByCron($resultm);\n }\n\n foreach ($queryMail as $user){\n $status = $user['status'];\n $ismoder = $user['ismoder'];\n if ( ($status == 2) && ($ismoder != 1)){\n /**\n * Send messages to users who did not enter moderation information\n */\n $resultjs['users'][] = $user['id_user'];\n $resultjs['title'] = 'Администрация';\n $resultjs['text'] = 'Уважаемый пользователь, заполните '.\n 'поля, необходимые для модерации:'.\n '<ul style=\"text-align:left\">'.\n '<li>имя и фамилия</li>'.\n '<li>год рождения</li>'.\n '<li>Фото(допускается и без него, на фото не природа, '.\n 'не больше одной личности, не анимация и т.д)</li>'.\n '<li>номер телефона и эмейл</li>'.\n '<li>целевая вакансия</li>'.\n '<li>раздел \"О себе\"</li>'.\n '<ul>';\n }\n }\n $admMsgJS = new AdminMessage();\n if (isset($resultjs)) {\n $admMsgJS->sendDataByCron($resultjs);\n }\n\n }\n\n $queryEmpl = \"\n SELECT\n u.id_user,\n u.email,\n u.crdate,\n u.mdate,\n u.status,\n e.ismoder\n FROM\n user u\n INNER JOIN \n employer e ON e.id_user=u.id_user \n WHERE\n (\n DATE(u.crdate) >= NOW() - INTERVAL 1 DAY \n or \n DATE(u.mdate) >= NOW() - INTERVAL 1 DAY\n ) and u.status = 3 \n \n GROUP BY u.id_user\n \";\n $queryEmpl = Yii::app()->db->createCommand($queryEmpl)->queryAll();\n\n if(count($queryEmpl)) {\n\n foreach ($queryEmpl as $user){\n $ismoder = $user['ismoder'];\n if ( $ismoder != 1 ){\n /**\n * Send messages to employer who did not enter moderation information\n */\n $resulte['users'][] = $user['id_user'];\n $resulte['title'] = 'Администрация';\n $resulte['text'] = 'Уважаемый пользователь, заполните '.\n 'поля в вашем профиле, необходимые для модерации:'.\n '<ul style=\"text-align:left\">'.\n '<li>название компании</li>'.\n '<li>логотип - желаельно</li>'.\n '<li>номер телефона и эмейл</li>'.\n '<li>имя контактного лица</li>'.\n '<li>контактный номер телефона</li>'.\n '<ul>';\n }\n }\n $admMsgE = new AdminMessage();\n if (isset($resulte)) {\n $admMsgE->sendDataByCron($resulte);\n }\n }\n\n }", "function daily_update_property_email(){\n\t\t$meta_post = $this->InteractModal->get_update_post_meta();\n\t\tif(!empty($meta_post)){\n\t\t\t$data = array();\n\t\t\tforeach($meta_post as $meta_details){\n\t\t\t\t$user_id = $this->InteractModal->get_post_meta($meta_details['post_id'],'initiator_id');\n\t\t\t\t$data[$user_id][]= $meta_details['meta_key'];\n\t\t\t}\n\t\t}\t\t\n\t\t$get_data=$this->InteractModal->get_today_data();\n\t\t$id=2;\n\t\tif(!empty($get_data)){\n\t\t\t$result = array();\n\t\t\tforeach ($get_data as $element) {\n\t\t\t\t$result[$element['user_id']][]= $element['task_type'];\n\t\t\t}\n\t\t\tif(!empty($data) && (!empty($result))){\n\t\t\t\t$results = array_merge($data,$result);\n\t\t\t}\n\t\t\t$user_id= '';\n\t\t\tif(!empty($results)){\n\t\t\t\tforeach($result as $user_id=>$value):\n\t\t\t\t\t$update_details='';\n\t\t\t\t\t$value = array_unique($value);\n\t\t\t\t\tforeach($value as $values):\t\t\t\t\t\t\n\t\t\t\t\t\t$update_details=$update_details.'Today '.ucwords($values).' Successfully.<br>';\n\t\t\t\t\tendforeach;\n\t\t\t\t\tif(!empty($user_id)){\n\t\t\t\t\t\t$where = array( 'id' =>$user_id);\n\t\t\t\t\t\t$user_data=$this->InteractModal->single_field_value('users',$where);\n\t\t\t\t\t\techo $email= $user_data[0]['user_email'];\n\t\t\t\t\t\techo \"<br>\";\n\t\t\t\t\t\t$company_id = $this->InteractModal->get_user_meta( $user_id, 'company_id');\n\t\t\t\t\t\t///get auto email content data \n\t\t\t\t\t\t$status_template = $this->InteractModal->get_user_meta( $company_id, 'status_template_id_'.$id );\n\t\t\t\t\t\tif(($status_template ==1)){\n\t\t\t\t\t\t\t$subject = $this->InteractModal->get_user_meta( $company_id, 'subject_template_id_'.$id );\n\t\t\t\t\t\t\t$content = $this->InteractModal->get_user_meta( $company_id, 'content_template_id_'.$id );\n\t\t\t\t\t\t\t$user_name = $this->InteractModal->get_user_meta( $user_id, 'concerned_person');\n\t\t\t\t\t\t\t$phone_number = $this->InteractModal->get_user_meta( $user_id, 'phone_number');\n\t\t\t\t\t\t\t$logo_content = '<img src=\"'.base_url().'/assets/img/profiles/logo_(2).png\" height=\"auto\" width=\"100\" alt=\"Logo\">'; \t\t\t\t\t\t\n\t\t\t\t\t\t\t$content=nl2br($content);\n\t\t\t\t\t\t\t$content = str_replace(\"_NAME_\",$user_name,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_PHONE_\",$phone_number,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_EMAIL_\",$email,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_LOGO_\",$logo_content,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_DATE_\",date('d-F-Y'),$content);\n\t\t\t\t\t\t\t$content = $content.'<br>'.$update_details;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$template_list = $this->InteractModal->get_email_template($id);\n\t\t\t\t\t\t\tforeach( $template_list as $template_lists ):\n\t\t\t\t\t\t\t\t$subject = $template_lists['subject']; \n\t\t\t\t\t\t\t\t$content = $update_details; \n\t\t\t\t\t\t\tendforeach;\t\t\t\t\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t///get auto email content data \t\t\t\t\n\t\t\t\t\t\t$email_data = array('email' => $email,\n\t\t\t\t\t\t\t'content' => $content,\n\t\t\t\t\t\t\t'subject' => $subject\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->send_email($email_data);\n\t\t\t\t\t} \n\t\t\t\tendforeach;\n\t\t\t}\n\t\t}\n\t}", "function emailRegistrationAdmin() {\n require_once ('com/tcshl/mail/Mail.php');\n $ManageRegLink = DOMAIN_NAME . '/manageregistrations.php';\n $emailBody = $this->get_fName() . ' ' . $this->get_lName() . ' has just registered for TCSHL league membership. Click on the following link to approve registration: ';\n $emailBody.= $ManageRegLink;\n //$sender,$recipients,$subject,$body\n $Mail = new Mail(REG_EMAIL, REG_EMAIL, REG_EMAIL_SUBJECT, $emailBody);\n $Mail->sendMail();\n }", "public function new_coin_announcement(){\n \n \n// $user = User::find( 19 );\n $users = User::all();\n \n \n// echo $user->full_name;\n// echo \"<br>\";\n// echo \"<pre>\";\n// // print_r( $user);\n// exit;\n\n\n foreach( $users as $user ){\n $email_data = array(\n 'userfullname' => isset($user->full_name) ? $user->full_name : ''\n );\n\n $data = array( 'data' => $email_data );\n Mail::send( 'email_templates.newCoinAnnouncement', $data, function($message) use ( $user ) {\n $message->to( $user->email, $user->full_name )->subject\n ( 'New coins added to WooCommerce Altcoin Payment Gateway' );\n $message->from( '[email protected]', 'CodeSolz Team' );\n });\n }\n \n echo 'Email sent!';\n \n }", "public function changeEmail($newValue){\n\n $this->email = $newValue;\n $this ->save();\n\n }", "public function emailApprovalByUser($user) {\n\t\t$user->getPrimaryElectronicAddress()->setApproved(TRUE);\n\t\t$this->personRepository->update($user);\n\t\t$this->persistenceManager->persistAll();\n\t}", "public function updateEmailAction(Request $request)\r\n {\r\n $email = $request->get('email', null);\r\n\r\n $entityManager = $this->getDoctrine()->getManager();\r\n\r\n $authenticatedUser = $this->getAuthenticatedUser();\r\n\r\n $entityManager->beginTransaction();\r\n\r\n try{\r\n\r\n if($authenticatedUser->getEmail() == $email){\r\n throw new YilinkerException(\"New email should not be the same with your present email.\", 1);\r\n }\r\n\r\n $accountManager = $this->get(\"yilinker_front_end.service.user.account_manager\");\r\n\r\n $response = $accountManager->updateUserEmail($authenticatedUser, $email, false);\r\n\r\n if(!$response[\"isSuccessful\"]){\r\n return new JsonResponse($response, 400);\r\n }\r\n\r\n $jwtService = $this->get(\"yilinker_core.service.jwt_manager\");\r\n $request = $jwtService->setKey(\"ylo_secret_key\")->encodeUser($authenticatedUser)->encodeToken(null);\r\n\r\n $ylaService = $this->get(\"yilinker_core.service.yla_service\");\r\n $ylaService->setEndpoint(false);\r\n\r\n $response = $ylaService->sendRequest(\"user_update\", \"post\", array(\"request\" => $request));\r\n\r\n $accountManager->updateUserEmail($authenticatedUser, $email, true);\r\n\r\n $entityManager->flush();\r\n $entityManager->commit();\r\n\r\n return new JsonResponse(array(\r\n \"isSuccessful\" => true,\r\n \"message\" => \"Email has been changed.\",\r\n \"data\" => array()\r\n ), 200);\r\n }\r\n catch(YilinkerException $e){\r\n $entityManager->rollback();\r\n\r\n return new JsonResponse(array(\r\n \"isSuccessful\" => false,\r\n \"message\" => $e->getMessage(),\r\n \"data\" => array()\r\n ), 400);\r\n }\r\n\r\n return new JsonResponse(array(\r\n \"isSuccessful\" => false,\r\n \"message\" => \"Email change failed.\",\r\n \"data\" => array()\r\n ), 400);\r\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new AffiliateVerifyEmail);\n }", "private function notifyAdmin(): void\n {\n if (!$this->cfg->getAdminEmails())\n return;\n\n $ex = new \\Exception;\n $trace = $ex->getTraceAsString();\n\n // format msg\n $msg = \"Trying to send email with subject: \\\"$this->Subject\\\" \"\n . \"triggered a failover.\\r\\n\\r\\n\"\n . \"Server(s) that failed:\\r\\n\";\n foreach ($this->failedServers as $k => $v)\n $msg .= \"- Server $k $v \\r\\n\";\n $msg .= \"\\r\\nTrace:\\r\\n$trace\\r\\n\\r\\n\"\n . \"Successful failover server:\\r\\n$this->Host\\r\\n\\r\\n\"\n . \"--\\r\\n\"\n . 'Sent from ' . __FILE__ . ' using ' . $this->Host;\n\n $this->FromName = $this->cfg->getNotificationFromEmail();\n $this->From = $this->cfg->getNotificationFromEmail();\n $this->clearAllRecipients();\n\n $adminEmails = $this->cfg->getAdminEmails();\n foreach ($adminEmails as $adminEmail)\n $this->addAddress($adminEmail);\n $this->Subject = $this->cfg->getAppName() . ': SMTP server(s) failed';\n\n $this->Body = $msg;\n\n // send using the last set SMTP server\n $this->send();\n }", "public function resendConfirmationMailAction()\n {\n // @todo find a better way to fetch the data\n $result = GeneralUtility::_GP('tx_femanager_pi1');\n if (is_array($result)) {\n if (GeneralUtility::validEmail($result['user']['email'])) {\n $user = $this->userRepository->findFirstByEmail($result['user']['email']);\n if (is_a($user, User::class)) {\n $this->sendCreateUserConfirmationMail($user);\n $this->addFlashMessage(\n LocalizationUtility::translate('resendConfirmationMailSend'),\n '',\n AbstractMessage::INFO\n );\n $this->redirect('resendConfirmationDialogue');\n }\n }\n }\n $this->addFlashMessage(\n LocalizationUtility::translate('resendConfirmationMailFail'),\n LocalizationUtility::translate('validationError'),\n AbstractMessage::ERROR\n );\n $this->redirect('resendConfirmationDialogue');\n }", "function request_admin_password_change() {\n\t\tif (isset($this->data['User']['forgot_password_email'])) {\n\t\t\t$forgot_password_email = $this->data['User']['forgot_password_email'];\n\t\t\t\n\t\t\t\n\t\t\t// check to make sure the email is a valid email for a user\n\t\t\t$change_password_user = $this->User->find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'User.email_address' => $forgot_password_email,\n\t\t\t\t\t'User.admin' => true,\n\t\t\t\t),\n\t\t\t\t'contain' => false,\n\t\t\t));\n\t\t\t\n\t\t\tif (empty($change_password_user)) {\n\t\t\t\t$this->Session->setFlash(__('Email does not belong to a valid user', true), 'admin/flashMessage/warning', array(), 'auth');\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Check your email to change your password', true), 'admin/flashMessage/success', array(), 'auth');\n\t\t\t\t$this->FotomatterEmail->send_forgot_password_email($this, $change_password_user);\n\t\t\t}\n\t\t}\n\t\t$this->redirect('/admin');\n\t}", "public function notifyPasswordUpdate($data){\r\n\t$this->sendTemplateEmail($data['email'], $this->app_config['password_reset_notification_subject'], $this->app_config['password_reset_notification_body'], $data);\r\n}", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail); // my notification\n }", "function email_change($msg = \"\")\r\n\t{\r\n\t\tglobal $ibforums, $std;\r\n\r\n\t\t$txt = $ibforums->lang['ce_current'] . $this->member['email'];\r\n\r\n\t\tif ($ibforums->vars['reg_auth_type'])\r\n\t\t{\r\n\t\t\t$txt .= $ibforums->lang['ce_auth'];\r\n\t\t}\r\n\r\n\t\tif ($ibforums->vars['bot_antispam'])\r\n\t\t{\r\n\t\t\t//-----------------------------------------------\r\n\t\t\t// Set up security code\r\n\t\t\t//-----------------------------------------------\r\n\r\n\t\t\t// Get a time roughly 6 hours ago...\r\n\r\n\t\t\t$r_date = time() - (60 * 60 * 6);\r\n\r\n\t\t\t// Remove old reg requests from the DB\r\n\r\n\t\t\t$ibforums->db->exec(\r\n\t\t\t \"DELETE FROM ibf_reg_antispam\r\n\t\t\t WHERE ctime < '$r_date'\"\r\n );\r\n\r\n\t\t\t// Set a new ID for this reg request...\r\n\r\n\t\t\t$regid = md5(uniqid(microtime()));\r\n\r\n\t\t\t// Set a new 6 character numerical string\r\n\r\n\t\t\tmt_srand((double)microtime() * 1000000);\r\n\r\n\t\t\t$reg_code = mt_rand(100000, 999999);\r\n\r\n\t\t\t// Insert into the DB\r\n\r\n\t\t\t$data = [\r\n\t\t\t\t'regid' => $regid,\r\n\t\t\t\t'regcode' => $reg_code,\r\n\t\t\t\t'ip_address' => $ibforums->input['IP_ADDRESS'],\r\n\t\t\t\t'ctime' => time(),\r\n\t\t\t];\r\n\r\n\t\t\t$ibforums->db->insertRow(\"ibf_reg_antispam\", $data);\r\n\t\t}\r\n\r\n\t\t$this->output .= View::make(\"ucp.email_change\", ['txt' => $txt, 'msg' => $ibforums->lang[$msg]]);\r\n\r\n\t\tif ($ibforums->vars['bot_antispam'])\r\n\t\t{\r\n\r\n\t\t\tif ($ibforums->vars['bot_antispam'] == 'gd')\r\n\t\t\t{\r\n\t\t\t\t$this->output = str_replace(\"<!--ANTIBOT-->\",\r\n\t\t\t\t\tView::make(\"ucp.email_change_gd\", ['regid' => $regid]), $this->output);\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\t$this->output = str_replace(\"<!--ANTIBOT-->\",\r\n\t\t\t\t\tView::make(\"ucp.email_change_img\", ['regid' => $regid]), $this->output);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t$this->page_title = $ibforums->lang['t_welcome'];\r\n\t\t$this->nav = array(\"<a href='\" . $this->base_url . \"act=UserCP&amp;CODE=00'>\" . $ibforums->lang['t_title'] . \"</a>\");\r\n\r\n\t}", "public function sendRoomChangeMail($a_roomid) {\r\n\t\t$user_ids = array();\r\n\t\t$this->bookings = $this->ilRoomSharingDatabase->getBookingsForRoomThatAreValid($a_roomid);\r\n\t\tforeach ($this->bookings as $booking) {\r\n\t\t\t$user_ids[] = $booking['user_id'];\r\n\t\t}\r\n\t\tforeach (array_unique($user_ids) as $userid) {\r\n\t\t\t$this->composeAndSendRoomChangeMail($userid);\r\n\t\t}\r\n\t}", "private function sendConfirmationEmail(\\User $user, $confirmationCode, $newDn){\n $portal_url = \\Factory::getConfigService()->GetPortalURL();\n //echo $portal_url;\n //die();\n\n $link = $portal_url.\"/index.php?Page_Type=User_Validate_DN_Change&c=\".$confirmationCode;\n $subject = \"Validation of changes on your GOCDB account\";\n $body = \"Dear GOCDB User,\\n\\n\"\n .\"A request to retrieve and associate your GOCDB account and privileges with a \"\n . \"new account ID has just been made on GOCDB (e.g. you have a new certificate with a different DN).\"\n .\"\\n\\nThe new account ID is: $newDn\"\n .\"\\n\\nIf you wish to associate your GOCDB account with this account ID, please validate your request by clicking on the link below:\\n\"\n .\"$link\".\n \"\\n\\nIf you did not create this request in GOCDB, please immediately contact [email protected]\" ;\n ;\n //If \"sendmail_from\" is set in php.ini, use second line ($headers = '';):\n //$headers = \"From: [email protected]\";\n $headers = \"From: [email protected]\";\n //$headers = \"\";\n\n //mail command returns boolean. False if message not accepted for delivery.\n if (!mail($user->getEmail(), $subject, $body, $headers)){\n throw new \\Exception(\"Unable to send email message\");\n }\n\n //echo $body;\n }", "public function deletedusers($userid=0){\n if(!$this->phpsession->get('ciAdmId')){ redirect($this->config->item('base_url').'r/k/admin'); }\n\n if($userid > 0){\n //resend verification mail to user\n $___user = $this->U_Model->getUserById($userid);\n\n $activationcode = $___user->activationcode;\n $verification_code=$userid * 32765;\n // Create link for verification\n $link = \"<a href='\".$this->config->item('base_url').\"register/registerverify/\".$activationcode.\"'>\".$this->config->item('base_url').\"register/registerverify/\".$activationcode.\"</a>\";\n\n $this->load->model('SystemEmail_Model','SE_Model');\n\n $admin_email= $this->SE_Model->getAdminEmails();\n $mail_content= $this->SE_Model->getEmailById(1);\n \n //Email Sending Code\n $this->load->library('email');\n $this->email->from($admin_email->value,'fashionesia');\n $this->email->to($___user->email); // \n $this->email->subject($mail_content->subject);\n\n $message = str_replace(\"[link]\", $link, $mail_content->message);\n $message = str_replace(\"[[username]]\", $___user->first_name, $message);\n $message = str_replace(\"[[email]]\", $___user->email, $message);\n \n $content_message = str_replace(\"[sitename]\", $this->config->item('base_site_name'), $message);\n\n $emailPath = $this->config->item('base_abs_path').\"templates/\".$this->config->item('base_template_dir');\n $email_template = file_get_contents($emailPath.'/email/email.html');\n \n\n $email_template = str_replace(\"[[EMAIL_HEADING]]\", $mail_content->subject, $email_template);\n $email_template = str_replace(\"[[EMAIL_CONTENT]]\", nl2br(utf8_encode($content_message)), $email_template);\n $email_template = str_replace(\"[[SITEROOT]]\", $this->config->item('base_url'), $email_template);\n $email_template = str_replace(\"[[LOGO]]\",$this->config->item('base_url').\"templates/\".$this->config->item('base_template_dir'), $email_template);\n\n $this->email->message(html_entity_decode(($email_template)));\n\n //echo html_entity_decode(($email_template));\n\n $this->email->send();\n\n $this->phpsession->save('success_msg',\"Verification email successfully send to '\".$___user->first_name.\" \".$___user->last_name.\"'.\");\n\n redirect($this->config->item('base_url').\"admin/users/\");\n \n }\n\n $data = array('users' => '', 'PAGING' => '', 'search' => '-','delete'=>'-','fn'=>'-','status'=>'-');\n $this->load->helper(array('pagination'));\n $array = $this->uri->uri_to_assoc(3);\n\n $pages = (@$array['pages']?$array['pages']:1);\n $page = (@$array['page']?$array['page']:1);\n\n $orderb = (@$array['orderby']?@$array['orderby']:\"asc\"); $data['orderby'] = $orderb;\n $fn = (@$array['fn']?@$array['fn']:\"first_name\"); $data['fn'] = $fn;\n $status = (@$array['status']?@$array['status']:\"-\"); $data['status'] = $status; \n $orderby = $fn.\" \".$orderb;\n\n $data['search'] = (@$array['search']?$array['search']:'-');\n $data['delete'] = (@$array['delete']?$array['delete']:'-');\n\n \n if(strlen(trim($this->input->post('submit'))) > 0){\n $user_ids = implode(\",\",$this->input->post('checbox_ids'));\n $action = $this->input->post('action');\n if($action=='delete'){$action = 'permanentdelete';}\n $message = $this->U_Model->users_operations(array('user_ids' => $user_ids),$action);\n //$this->phpsession->save('success_msg',$message);\n $this->message->setMessage($message,\"SUCCESS\");\n }\n\n $PAGE = $page;\n $PAGE_LIMIT = $this->U_Model->countDeletedUsersBySearch($data['search'],$data['delete'],$status); //20;\n $DISPLAY_PAGES = 25;\n $PAGE_LIMIT_VALUE = ($PAGE - 1) * $PAGE_LIMIT;\n\n if($this->input->post('delete')!='')\n {\n// $delete = explode(\"-\",$this->input->post('datepicker'));\n// $delete_date = $delete[2].\"-\".$delete[0].\"-\".$delete[1];\n $data['delete'] =$this->input->post('delete');\n }\n // Get posted search value in variables\n $data['search'] = ($this->input->post('search')?trim($this->input->post('search')):$data['search']);\n $data['delete'] = ($this->input->post('delete')?trim($this->input->post('delete')):$data['delete']);\n \n // Count total users\n $total = $this->U_Model->countDeletedUsersBySearch($data['search'],$data['delete'],$status);\n \n $PAGE_TOTAL_ROWS = $total;\n $PAGE_URL = $this->config->item('base_url').'admin/adminusers/fn/'.$fn.'/orderby/'.$orderb.'/search/'.$data['search'].'/delete/'.$data['delete'].'/status/'.$status;\n $data['PAGING'] = pagination_assoc($PAGE_TOTAL_ROWS,$PAGE_LIMIT,$DISPLAY_PAGES,$PAGE_URL,$page,$pages);\n // Pagination end \n // Get all users\n $data['users'] = $this->U_Model->deletedusers($PAGE_LIMIT_VALUE,$PAGE_LIMIT,$data['search'],$orderby,$data['delete'],$status); \n // set variable to show active menu \n $data['menutab'] = 'network';\n $data['menuitem'] = 'deletedusers'; \n $this->load->view($this->config->item('base_template_dir').'/admin/users_del', $data);\n \n }", "public function sendEmailVerificationNotification(){\n $this->notify(new VerifyEmail);\n }", "function _notify_users($channel_id, $entry_id, $entry_title)\n\t{\n\t\t// If we have a member group set for this channel\n\t\tif(isset($this->settings['channels']['id_'.$channel_id]['notification_group']))\n\t\t{\n\t\t\t$notification_group = $this->settings['channels']['id_'.$channel_id]['notification_group'];\n\t\t\t\n\t\t\t// Get all members from this group\n\t\t\t$this->EE->load->model('ep_members');\n\t\t\t$notifications = $this->EE->ep_members->get_all_members_from_group($notification_group);\n\t\t\t\n\t\t\t// If we didn't get any members\n\t\t\tif($notifications == FALSE) return;\n\t\t\t\n\t\t\t// Load the email library and text helper\n\t\t\t$this->EE->load->library('email');\n\t\t\t$this->EE->load->helper('text'); \n\n\t\t\t$this->EE->email->wordwrap = true;\n\t\t\t$this->EE->email->mailtype = 'text';\n\t\t\t\n\t\t\t// Email settings\n\t\t\t$review_url = $this->EE->functions->remove_double_slashes($this->EE->config->item('site_url').\"/\".SYSDIR.\"/\".BASE.AMP.\"C=content_publish\".AMP.\"M=entry_form\".AMP.\"channel_id={$channel_id}\".AMP.\"entry_id={$entry_id}\");\n\t\t\t\n\t\t\t$the_message = \"\";\n\t\t\t$the_message .= \"The entry '{$entry_title}' has been submitted for approval.\\n\\nTo review it please log into your control panel\\n\\n\";\n\t\t\t$the_message .= $review_url.\"\\n\";\n\n\t\t\t$the_subject = $this->EE->config->item('site_name').': An entry has been submitted for approval';\n\t\t\t\n\t\t\t$the_from = $this->EE->config->item('webmaster_email');\n\t\t\t\n\t\t\tforeach ($notifications->result_array() as $row)\n\t\t\t{\n\t\t\t\t$this->EE->email->initialize();\n\t\t\t\t$this->EE->email->from($the_from);\n\t\t\t\t$this->EE->email->to($row['email']); \n\t\t\t\t$this->EE->email->subject($the_subject);\n\t\t\t\t$this->EE->email->message(entities_to_ascii($the_message));\n\t\t\t\t$this->EE->email->Send();\n\t\t\t\t\n\t\t\t\t// Logging\n\t\t\t\t$this->action_logger->add_to_log(\"ep_status_transition, METHOD: _notify_users(): Notification email sent to : \".$row['email']);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Logging\n\t\t\t$this->action_logger->add_to_log(\"ep_status_transition, METHOD: _notify_users(): No member group found for channel: \".$channel_id);\n\t\t}\n\t}", "public function sendEmailVerificationNotification()\n { \n \n $this->notify(new ConfirmEmail); \n \n }", "function wp_site_admin_email_change_notification($old_email, $new_email, $option_name)\n {\n }", "private function composeRoomChangeMail($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_room_changed_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_room_changed_message') . \"\\n\");\r\n\t\tforeach ($this->bookings as $booking) {\r\n\t\t\tif ($booking['user_id'] != $a_user_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else {\r\n\t\t\t\t$roomname = $this->ilRoomSharingDatabase->getRoomName($booking['room_id']);\r\n\t\t\t\t$datestart = new ilDateTime($booking['date_from'], IL_CAL_DATETIME);\r\n\t\t\t\t$dateend = new ilDateTime($booking['date_to'], IL_CAL_DATETIME);\r\n\r\n\t\t\t\t$this->appendBody($lng->txt('rep_robj_xrs_room') . \" \");\r\n\t\t\t\t$this->appendBody($roomname . \" \");\r\n\t\t\t\t$this->appendBody($lng->txt('rep_robj_xrs_from') . \" \");\r\n\t\t\t\t$this->appendBody($datestart->get(IL_CAL_FKT_DATE, 'd.m.Y H:s') . \" \");\r\n\t\t\t\t$this->appendBody($lng->txt('rep_robj_xrs_to') . \" \");\r\n\t\t\t\t$this->appendBody($dateend->get(IL_CAL_FKT_DATE, 'd.m.Y H:s') . \"\\n\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function updateUsers(){\n\t\t$text='';\n//TODO: clean this up\n\t\tforeach ($this->users as $name => $schedule) {\n\t\t\t$text = $text.\"\\n\".$name.'^';\n\t\t\tforeach ($schedule as $cell) {\n\t\t\t\t$text = $text.$cell.'|';\n\t\t\t}\n\t\t}\n\n\t\t$returnCode = $this->fileHandler->writeToFile('users.txt',$text);\n\t\tif($returnCode == NO_LOCK) $this->logMsg(WARNING,'User file is locked, try again later');\n\t\telse $this->logMsg(SUCCESS, 'schedule updated, and uploaded');\n\n\t}", "function jmw_buddypress_profile_update( $user_id, $posted_field_ids, $errors, $old_values, $new_values ) {\n\t\n\tif( current_user_can( 'manage_options' ) ) {\n\t\t// If administrator is making the changes don't email\n\t\treturn;\n\t}\n\n $message_subject = sprintf( '%s: Profile moderation required for %s',\n \tesc_html( get_bloginfo( 'name' ) ),\n \tesc_html( bp_core_get_user_displayname( $user_id ) )\n );\n\n $message = sprintf( 'Member %s has updated their profile. See %s',\n \tesc_html( bp_core_get_user_displayname( $user_id ) ),\n \tesc_url( bp_loggedin_user_domain() )\n );\n\n wp_mail( get_bloginfo( 'admin_email' ), $message_subject, $message );\n }", "public function updateUser(GenericEvent $event): void\n {\n /** @var User $user */\n $user = $event->getSubject();\n // ...\n }", "public function update()\n {\n echo uniqid('km-');\n // $data = $this->Users_model->get_all();\n // foreach ($data as $datas) {\n // $d['users_id'] = uniqid('km-');\n // $this->Users_model->update_users($datas->users_email, $d);\n // }\n }", "protected function sendOrderChangeNotification()\n {\n if ($this->getSendNotificationFlag()) {\n \\XLite\\Core\\Mailer::getInstance()->sendOrderAdvancedChangedCustomer($this->getOrder());\n }\n }", "public function updateEmail()\n {\n $this->schol->updateEmail( $this->input->post('emp'), $this->input->post('email'));\n return redirect('/affirs/Scholarship/show/'. $this->input->post('schol'));\n\n }", "function active_mail($id){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"UPDATE `utilisateur` SET `status_mail` = '1' WHERE id_utilisateur = :id\");\n\t\t$req->execute(array('id'=>$id));\n\t\t$req->closeCursor();\n\t}", "function edituseremail()\n {\n // Auth::handleLogin() makes sure that only logged in users can use this action/method and see that page\n Auth::handleLogin();\n $this->view->render('login/edituseremail');\n }", "public function sendVerificationEmail()\n {\n $user = Auth::user();\n\n event(new UserResendVerification($user));\n\n return redirect('/');\n }", "function notifyReg($uName,$eMail) { //notify a new user registration\r\n\tglobal $ax, $set, $today;\r\n\t\t\r\n\t//compose email message\r\n\t$subject = \"{$ax['log_new_reg']}: {$uName}\";\r\n\t$msgBody = \"\r\n<p>{$ax['log_new_reg']}:</p><br>\r\n<table>\r\n\t<tr><td>{$ax['log_un']}:</td><td>{$uName}</td></tr>\r\n\t<tr><td>{$ax['log_em']}:</td><td>{$eMail}</td></tr>\r\n\t<tr><td>{$ax['log_date_time']}:</td><td>\".IDtoDD($today).\" {$ax['at_time']} \".ITtoDT(date(\"H:i\")).\"</td></tr>\r\n</table>\r\n\";\r\n\t//send email\r\n\t$result = sendEml($subject,$msgBody,$set['calendarEmail'],1,0,0);\r\n\treturn $result;\r\n}", "protected function lstUsersAsAssessmentManager_Update() {\n\t\t\tif ($this->lstUsersAsAssessmentManager) {\n\t\t\t\t$this->objGroupAssessmentList->UnassociateAllUsersAsAssessmentManager();\n\t\t\t\t$objSelectedListItems = $this->lstUsersAsAssessmentManager->SelectedItems;\n\t\t\t\tif ($objSelectedListItems) foreach ($objSelectedListItems as $objListItem) {\n\t\t\t\t\t$this->objGroupAssessmentList->AssociateUserAsAssessmentManager(User::Load($objListItem->Value));\n\t\t\t\t}\n\t\t\t}\n\t\t}" ]
[ "0.67037", "0.6367923", "0.63246864", "0.63131154", "0.6273172", "0.6230952", "0.6222536", "0.62079465", "0.6203002", "0.6125814", "0.61069214", "0.6101656", "0.60840803", "0.6013226", "0.59596163", "0.5957093", "0.5940295", "0.58981705", "0.5894618", "0.58887446", "0.58833313", "0.588104", "0.58691573", "0.5863947", "0.58153695", "0.58141893", "0.5811297", "0.57908386", "0.57836944", "0.5773896", "0.5772698", "0.5770677", "0.57611674", "0.5751537", "0.5749441", "0.57203335", "0.5719919", "0.5710351", "0.5697243", "0.5693804", "0.56853044", "0.5681745", "0.5674022", "0.56732523", "0.56688446", "0.5666121", "0.56605804", "0.56588686", "0.56577164", "0.56565005", "0.5647699", "0.5647246", "0.5643258", "0.56283784", "0.5623821", "0.56203365", "0.5618894", "0.55900824", "0.55871844", "0.55779094", "0.5572644", "0.5565874", "0.5560369", "0.5557049", "0.5549424", "0.5547602", "0.55458665", "0.55454636", "0.5543497", "0.5539497", "0.5536892", "0.5528906", "0.5520848", "0.5503207", "0.5499081", "0.5492836", "0.54851204", "0.5483381", "0.5480313", "0.5478371", "0.5472891", "0.54711527", "0.546783", "0.54648626", "0.5461042", "0.5459897", "0.5458872", "0.5456515", "0.5442604", "0.5440165", "0.54260254", "0.54209423", "0.5420902", "0.54188067", "0.5418482", "0.540363", "0.5403565", "0.53982055", "0.53949755", "0.5386913" ]
0.68712634
0
Returns a Crawler instance for the given html
public function getCrawler($html) { return new Crawler($html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newCrawler()\n {\n return new Crawler;\n }", "public static function create(): CrawlerInterface;", "public function parse() : self\n {\n $this->parsed = new Crawler($this->html);\n\n return $this;\n }", "protected function getCrawler(string $body) : Crawler\n {\n return new Crawler($body);\n }", "public function getCrawler()\r\n {\r\n if ($this->crawler == null) {\r\n $url = $this->request->getUrl();\r\n $html = file_get_contents($url);\r\n\r\n $domDocument = new DOMDocument();\r\n\r\n libxml_use_internal_errors(true);\r\n $domDocument->loadHTML($html);\r\n\r\n $this->crawler = new DOMXPath($domDocument);\r\n }\r\n\r\n return $this->crawler;\r\n }", "public function getCrawler() {\n\t\t$crawler = new Crawler(NULL, $this->lastRequest->getBaseUri());\n\t\t$crawler->addContent($this->lastResponse->getContent(), $this->lastResponse->getHeader('Content-Type'));\n\n\t\treturn $crawler;\n\t}", "public function getCrawler()\n {\n if (!$this->crawler instanceof Crawler) {\n $this->crawler = new Crawler('', $this->getUri()->toString());\n $this->crawler->addContent(\n $this->getResponse()->getBody(true),\n $this->getResponse()->getHeader('Content-Type', true)\n );\n }\n return $this->crawler;\n }", "static function fromHTML($html, $url=NULL) {\n $index_time = microtime(true);\n $doc = new self($html, false);\n if($url) {\n $doc->location($url);\n }\n $doc->index();\n $index_time = microtime(true) - $index_time;\n $doc->index_time = $index_time * 1000;\n return $doc;\n }", "public function fromHtml($html, $selector = null)\n {\n $cr = $htmlStr = null;\n if ($html instanceof Response) {\n if (!$html->isSuccessful()) {\n $msg = 'Request for 1st argument of '.__METHOD__.' must be successful, check isSuccessful() first.';\n throw new \\LogicException($msg);\n }\n $html = $html->getContent();\n }\n if (is_string($html)) {\n if (null === $selector) {\n $htmlStr = $html;\n } else {\n $cr = new Crawler();\n $cr->addHtmlContent($html);\n }\n } elseif ($html instanceof \\DOMNode) {\n $node = $html;\n if (null !== $selector) {\n $cr = new Crawler();\n $cr->addNode($node);\n } else {\n $htmlStr = $node->ownerDocument->saveHTML($node);\n }\n } elseif ($html instanceof Crawler) {\n $cr = $html;\n } else {\n $type = is_object($html) ? get_class($html) : gettype($html);\n $msg = '1st argument must by string, Crawler, DOMNode or Response, but is '.$type;\n throw new \\InvalidArgumentException($msg);\n }\n\n if (null === $htmlStr) {\n if (null !== $selector) {\n $cr = $cr->filter($selector)->first();\n }\n $node = $cr->getNode(0); // $cr->html() only returns html of children\n if (!$node->ownerDocument) {\n throw new \\OutOfBoundsException('node has no ownerDocument, selector probaly returned nothing');\n }\n $htmlStr = $node->ownerDocument->saveHTML($node);\n }\n\n if (false === strpos($htmlStr, '<body>')) {\n $htmlStr = \"<html>\\n<head>\\n<meta charset=\\\"UTF-8\\\">\\n</head>\\n<body>\\n\".$htmlStr.\"</body>\\n</html>\\n\";\n }\n\n $tmpFile = $this->getTempHtmlFile($htmlStr); // as temporary file because it must have a filename\n\n return IOFactory::load($tmpFile['path']);\n // tmpfile is deleted automatically\n }", "public function getCrawler()\r\n {\r\n if ($this->crawler == null) {\r\n $url = $this->request->getUrl();\r\n $this->crawler = $this->getClient()->request('GET', $url);\r\n }\r\n\r\n return $this->crawler;\r\n }", "public static function fromHtml(string $html) : self\n {\n return (new static())->setHtml($html);\n }", "public function __construct($url) {\r\n $options = array(\r\n 'http'=>array('method'=>\"GET\", 'header'=>\"User-Agent: crawlBot/0.1\\n\")\r\n );\r\n $context = stream_context_create($options);\r\n \r\n $this->doc = new DomDocument();\r\n @$this->doc->loadHTML(file_get_contents($url, false, $context));\r\n }", "public static function fromHtml(string $html): Renderer;", "public function parseFromHtml($url, $html) {\n $this->url = $url;\n $crawler = new Crawler(null, $this->url);\n $crawler->addContent($html);\n $this->parseFromCrawler($crawler);\n }", "private function initCrawler($url, $siteUrl) {\n $response = $this->client->request('GET', trim($url), ['http_errors' => false]);\n if ($response->getStatusCode() != 200) {\n $this->errors[$id][] = \"Status \" . $response->getStatusCode(). \" returned for \" . $url;\n return FALSE;\n }\n else {\n $body = $response->getBody();\n $html = $body->getContents();\n return new HtmlPageCrawler($html, $siteUrl);\n }\n }", "public function startCrawling(UriInterface $baseUrl): CrawlerInterface;", "public function visit(string $url) : self\n {\n $this->html = $this->client->get($url);\n\n return $this;\n }", "public function __construct($html, $num_results, $url){\n # Clean HTML.\n $purifier = new HTMLPurifier();\n $clean_html = $purifier->purify($html);\n\n # Build a HTML parser to search for items.\n $this->dom = new Dom;\n $this->dom->load($clean_html);\n\n $this->num_results = $num_results;\n $this->url = $url;\n $this->detailed = false;\n }", "protected function getParser($url, $html)\n {\n $html_encoding = XmlParser::getEncodingFromMetaTag($html);\n $html = Encoding::convert($html, $html_encoding ?: 'utf-8');\n $html = Filter::stripHeadTags($html);\n $ruleLoader = new RuleLoader($this->config);\n $rules = $ruleLoader->getRules($url);\n if (!empty($rules['grabber'])) {\n foreach ($rules['grabber'] as $pattern => $rule) {\n $url = new Url($url);\n $sub_url = $url->getFullPath();\n if (preg_match($pattern, $sub_url)) {\n return new RuleParser($html, $rule);\n }\n }\n }\n return new CandidateParser($html);\n }", "public function crawl() {\n $client = Naloader::getHttpClient($this->url);\n $crawler = $client->request('GET', $this->url);\n $this->parseFromCrawler($crawler);\n }", "public function fromHtml(string $html): Generator\n {\n $this->fromHtml = $html;\n\n return $this;\n }", "public function getScraper(string $url) : PageScraper\n {\n // We offer single-domain metrics, so we want a shared scraper for that domain.\n if (!isset($this->scraper)) {\n $this->scraper = $this->makeScraper($url);\n }\n return $this->scraper;\n }", "protected function parse($html) {\n $this->crawler->addHtmlContent($html, 'UTF-8');\n return $this->crawler->filterXPath(\"//div[contains(@class,'sr_item')]\")\n ->each(function(Crawler $node, $i){\n return [\n 'hotelid' => $node->attr('data-hotelid'),\n 'score' => $node->attr('data-score'),\n 'name' => $node->filterXPath(\"//span[contains(@class,'sr-hotel__name')]\")->text(),\n 'location' => $node->filterXPath(\"//div[contains(@class,'address')]/a[contains(@class,'district_link')]\")->text(),\n // 'price' => $node->filterXPath(\"//table/tr/td[contains(@class,'roomPrice')]/div[contains(@class,'smart_price_style')]\")->text(),\n ];\n });\n }", "public function process($html);", "public function parse($html);", "public function parse($html);", "public function __construct($url){\n\n $options = array(\n 'http'=> array(\n 'method' => 'GET',\n 'header' => 'User-Agent: GooggleBot/1.0\\n'\n )\n );\n\n $context = stream_context_create($options);\n\n // chargement du document html\n\n $this->_doc = new DomDocument();\n\n @$this->_doc ->loadHTML(file_get_contents($url,false,$context));\n }", "static function make($type)\n {\n $scraper = null;\n\n switch ($type) {\n case 'ElAderezo':\n $scraper = new ScraperElAderezo;\n break; \n case 'GastronomiaYCia':\n $scraper = new ScraperGastronomiaYCia;\n break;\n case 'UtensiliosDeCocina':\n $scraper = new ScraperUtensiliosDeCocina;\n break;\n } \n return $scraper;\n }", "protected function buildCrawler($document, $charset = null)\n {\n if (is_null($charset)) {\n $charset = $this->charset;\n }\n\n $crawler = $this->newCrawler();\n\n // We explicitly specify the character set to avoid issues\n // with documents using old charsets such as ISO-8859-1.\n $crawler->addHtmlContent($document, $charset);\n\n return $crawler;\n }", "public abstract function get_html();", "public function load($url, $html) {\n $page = new PGPage($url, \"HTTP/1.1 200 OK\\n\\n\" . $this->clean($html), $this);\n $this->lastUrl = $url;\n return $page;\n }", "public function testConstructInvalidHTML(string $html)\n {\n (new Dom($html));\n }", "public function getCrawler($document = null, $charset = null)\n {\n if (is_null($document)) {\n $document = $this->getDocument();\n }\n\n return $this->buildCrawler($document, $charset);\n }", "public function load($html);", "public function getScrapClient()\n {\n if ($this->scrapClient === null) {\n if ($this->headlessBrowserEnabled === true) {\n $scrapClient = CrawlingFactory::create(CrawlingFactory::TYPE_HEADLESS_BROWSER, $this->config);\n } else {\n $scrapClient = CrawlingFactory::create(CrawlingFactory::TYPE_HTTP_CLIENT, $this->config);\n }\n $this->setScrapClient($scrapClient);\n }\n return $this->scrapClient;\n }", "abstract function get_html();", "private function makeScraper(string $url) : PageScraper\n {\n $topHost = parse_url($url, PHP_URL_HOST); // handles most formats\n $topDomain = implode('.', array_slice(explode('.', $topHost), -2)); // A.B.C.HOST.TLD -> HOST.TLD\n\n return new DomainPageScraper($topDomain);\n }", "function __construct($html = \"\") {\n\t\t// getting html\n\t\t$this->html = $html;\n\t\t// calling method to create tokens from html\n\t\t$this->createTokens();\n\t}", "private function deepCrawling(InputInterface $input, OutputInterface $output)\n {\n $crawler = new Crawler();\n $crawler->setVerbosity($output->isVerbose()); // Set the verbosity mode\n $crawler->setURL($input->getArgument('url')); // Setup the target url\n //$crawler->addContentTypeReceiveRule('#text/html#'); // Find in html documents\n $crawler->addContentTypeReceiveRule('#text/xml'); // Find in php files\n //$crawler->addContentTypeReceiveRule('#text/php'); // Find in php files\n $crawler->addURLFilterRule('#\\.(jpg|jpeg|gif|png|ico|js|js?.*|'.\n 'css|css?.*]?|eot|svg|woff|ttf)$# i'); // Filtering this\n $crawler->enableCookieHandling(true); // Enable cookie handling\n $crawler->enableAggressiveLinkSearch(true);\n $crawler->setFollowMode(2); // Cralwer stays in host\n $crawler->setTrafficLimit(0); // Unlimit trafic limit\n $crawler->setUserAgentString('Mozilla/5.0 (Linux; Android 7.0; '.\n 'SM-G930VC Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) '.\n 'Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36');\n //$crawler->addURLFollowRule('#(html|htm|php|php3|php4|php5|xml)$# i'); // Follow only with this endings\n $crawler->setFinder([\n 'PHPCrawlerEmailFinder',\n 'PHPCrawlerPhoneNumberFinder',\n 'PHPCrawlerExternalLinkFinder',\n 'PHPCrawlerSitemapFinder',\n ]);\n $crawler->setTrafficLimit(0); // Switch off trafic limit\n $crawler->go(); // Start crawling\n\n // Print report:\n if (isset($crawler->crawlerStatus)) {\n Memory::printData($crawler->getProcessReport(), $crawler->getUserAgentString());\n }\n }", "public function testComDayCqRewriterProcessorImplHtmlParserFactory()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.rewriter.processor.impl.HtmlParserFactory';\n\n $crawler = $client->request('POST', $path);\n }", "protected function grab($url, $html)\n {\n $html = $this->getParser($url, $html)->execute();\n $filter = Filter::html($html, $url);\n $filter->setConfig($this->config);\n\n return $filter->execute();\n }", "public function includeCrawlerClass() {}", "public function getCrawlerFrom($source, $charset = null)\n {\n $document = $this->documentProvider->getFrom($source);\n\n return $this->buildCrawler($document, $charset);\n }", "public function crawlerSpider() \r\n {\r\n try {\r\n //initialize \r\n $runStartTime = new \\DateTime('now');\r\n $inputArray = array(\r\n 'lang' => contrexx_raw2db($this->langId),\r\n 'startTime' => $runStartTime,\r\n 'endTime' => $runStartTime,\r\n 'totalLinks' => 0,\r\n 'totalBrokenLinks' => 0,\r\n 'runStatus' => contrexx_raw2db(self::RUN_STATUS_RUNNING)\r\n );\r\n $lastInsertedRunId = $this->modifyCrawler($inputArray);\r\n\r\n $request = new \\HTTP_Request2();\r\n $sitemapPath = ASCMS_DOCUMENT_ROOT.'/sitemap_'.$this->langName.'.xml';\r\n if (file_exists($sitemapPath)) {\r\n $sitemapXml = simplexml_load_file($sitemapPath);\r\n foreach($sitemapXml->children() as $child) {\r\n foreach($child as $value) {\r\n if ($value->getName() == 'loc') {\r\n $page = $this->isModulePage((string) $value);\r\n if ($page && $page->getType() == self::TYPE_CONTENT) {\r\n $this->initializeScript((string) $value, $request, $page->getId());\r\n $this->checkMemoryLimit($lastInsertedRunId);\r\n //$this->checkTimeoutLimit($lastInsertedRunId);\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n $this->updateCrawlerStatus($lastInsertedRunId, self::RUN_STATUS_INCOMPLETE);\r\n \\DBG::log('No sitemap found for language '.$this->langName.'. Please save a page so the sitemap can be build.');\r\n return;\r\n }\r\n\r\n //move the uncalled links from link table to history table\r\n $this->updateHistory($this->langId, $lastInsertedRunId);\r\n //get the total links and total broken links \r\n $totalLinks = $this->linkRepo->getLinksCountByLang($runStartTime->format(ASCMS_DATE_FORMAT_INTERNATIONAL_DATETIME), $this->langId);\r\n $totalBrokenLinks = $this->linkRepo->brokenLinkCountByLang($this->langId);\r\n \r\n //save the run details\r\n $crawlerRuns = $this->crawlerRepo->findOneBy(array('id' => $lastInsertedRunId));\r\n if ($crawlerRuns) {\r\n $inputArray = array(\r\n 'lang' => contrexx_raw2db($this->langId),\r\n 'startTime' => $runStartTime,\r\n 'totalLinks' => contrexx_raw2db($totalLinks),\r\n 'totalBrokenLinks' => contrexx_raw2db($totalBrokenLinks),\r\n 'runStatus' => contrexx_raw2db(self::RUN_STATUS_COMPLETED)\r\n );\r\n $crawlerRuns->updateEndTime();\r\n $this->modifyCrawler($inputArray, $crawlerRuns);\r\n }\r\n \r\n } catch (\\Exception $error) {\r\n $this->updateCrawlerStatus('', self::RUN_STATUS_INCOMPLETE);\r\n die('Error occurred'. $error);\r\n }\r\n \r\n }", "public static function inst() {\n\t\tif (class_exists('HTMLPurifier')) return new PurifierHTMLCleaner();\n\t\telseif (class_exists('tidy')) return new TidyHTMLCleaner();\n\t}", "public static function extract(string $html)\n {\n static::$classes = new Arr();\n static::load();\n static::$config = cache('monsoon') ?? Config::get();\n\n $classes = new Arr();\n $mediaqueries = new Arr();\n $screens = new Arr(static::$config['screens']);\n $pseudos = new Arr(static::$pseudos);\n $str = new Builder();\n\n foreach(explode('<', $html) as $tag)\n {\n if(!Str::startWith($tag, ['!', '/']) && $tag !== '' && Str::has($tag, 'class=\"'))\n {\n $break = Str::break($tag, 'class=\"');\n $split = explode(' ', Str::break($break[1], '\"')[0]);\n $css = new Arr();\n\n foreach($split as $util)\n {\n $negative = Str::startWith($util, '-');\n $util = Str::moveFromStart(Str::moveFromEnd($util, '!'), '-');\n $pseudo = Str::break($util, ':')[0];\n $mediaquery = false;\n\n if(Str::has($util, ':'))\n {\n $util = Str::break($util, ':')[1];\n\n if($pseudos->has($pseudo) || $screens->hasKey($pseudo))\n {\n if($screens->hasKey($pseudo))\n {\n $mediaquery = true;\n }\n }\n else\n {\n $pseudo = null;\n }\n }\n else\n {\n $pseudo = null;\n }\n\n if(static::$classes->hasKey($util))\n {\n if($mediaquery)\n {\n $key = $pseudo . '-' . $util;\n $css->push($key);\n\n if($mediaqueries->hasKey($pseudo))\n {\n $data = new Arr($mediaqueries->get($pseudo));\n $data->push(static::generate($key, $util, null, $negative));\n $mediaqueries->set($pseudo, $data->unique()->get());\n }\n else\n {\n $mediaqueries->set($pseudo, [static::generate($key, $util, null, $negative)]);\n }\n }\n else\n {\n $key = $util;\n\n if(!is_null($pseudo))\n {\n $key = $pseudo . '-' . $util;\n }\n\n $css->push($key);\n $cache = cache('util_' . $key);\n\n if(is_null($cache))\n {\n $cache = cache('util_' . $key, static::generate($key, $util, $pseudo, $negative));\n }\n\n $classes->set($key, $cache);\n }\n }\n else\n {\n $array = new Arr(explode('-', $util));\n $value = $array->last();\n $class = $array->pop()->implode('-');\n\n if(static::$classes->hasKey($class))\n {\n if($mediaquery)\n {\n $key = $pseudo . '-' . $util;\n $css->push($key);\n\n if($mediaqueries->hasKey($pseudo))\n {\n $data = new Arr($mediaqueries->get($pseudo));\n $data->push(static::generate($key, $class, null, $negative, $value));\n $mediaqueries->set($pseudo, $data->unique()->get());\n }\n else\n {\n $mediaqueries->set($pseudo, [static::generate($key, $class, null, $negative, $value)]);\n }\n }\n else\n {\n $key = $util;\n\n if(!is_null($pseudo))\n {\n $key = $pseudo . '-' . $util;\n }\n\n $css->push($key);\n $cache = cache('util_' . $key);\n \n if(is_null($cache))\n {\n $cache = cache('util_' . $key, static::generate($key, $class, $pseudo, $negative, $value));\n }\n\n $classes->set($util, $cache);\n }\n }\n else\n {\n $css->push($util);\n }\n }\n }\n\n $str->append('<' . $break[0]);\n $str->append('class=\"' . Str::moveFromBothEnds($css->implode(' '), ' ') . '\"');\n $str->append(Str::break($break[1], '\"')[1]);\n }\n else\n {\n $str->append('<' . $tag);\n }\n }\n\n foreach($mediaqueries->get() as $key => $item)\n {\n $media = new Builder('@media only screen and (max-width:' . $screens->get($key) . 'px){');\n\n foreach($item as $css)\n {\n $media->append($css);\n }\n\n $media->append('}');\n\n TemplateEngine::addStylesheet($key . '-utilities', $media->get());\n }\n\n if(!$classes->empty())\n {\n TemplateEngine::addStylesheet('monsoon-utilities', $classes->implode(PHP_EOL));\n }\n\n if($str->startWith('<<'))\n {\n $str->move(1);\n }\n \n return $str->get();\n }", "private function crawl(){\n\t\t// check if path is allowed by robots.txt\n\t\tif(!$this->robot || $this->robot->crawlAllowed($this->pages[0])){\n\t\t\t// set the file path, extract directory structure, open file\n\t\t\t$path = 'http://'.$this->url.$this->pages[0];\n\t\t\t$this->setCurrentPath();\n\t\t\t$this->doc->loadHTMLFile($path);\n\t\t\t\n\t\t\t// find all <a> tags in the page\n\t\t\t$a_tags = $this->doc->getElementsByTagName('a');\n\t\t\t$link_tags = $this->doc->getElementsByTagName('link');\n\t\t\t$script_tags = $this->doc->getElementsByTagName('script');\n\t\t\t$img_tags = $this->doc->getElementsByTagName('img');\n\t\t\t$form_tags = $this->doc->getElementsByTagName('form');\n\t\t\t// if <a> tags were found, loop through all of them\n\t\t\tif(isset($a_tags) && !is_null($a_tags)){\n\t\t\t\tforeach ($a_tags as $link) {\n\t\t\t\t\t// find the href attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'href'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if <link> tags were found, loop through all of them\n\t\t\tif(isset($link_tags) && !is_null($link_tags)){\n\t\t\t\tforeach ($link_tags as $link) {\n\t\t\t\t\t// find the href attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'href'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if <script> tags were found, loop through all of them\n\t\t\tif(isset($script_tags) && !is_null($script_tags)){\n\t\t\t\tforeach ($script_tags as $link) {\n\t\t\t\t\t// find the src attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'src'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if <img> tags were found, loop through all of them\n\t\t\tif(isset($img_tags) && !is_null($img_tags)){\n\t\t\t\tforeach ($img_tags as $link) {\n\t\t\t\t\t// find the src attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'src'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if <form> tags were found, loop through all of them\n\t\t\tif(isset($forms_tags) && !is_null($form_tags)){\n\t\t\t\tforeach ($form_tags as $link) {\n\t\t\t\t\t// find the src attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'action'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// merge and sort all arrays\n\t\t$this->arrayShuffle();\n\t}", "public function parseLink($url)\n {\n $dom = HtmlDomParser::file_get_html($url);\n $this->dom = $dom;\n $this->parsePageNews();\n\n return $this;\n }", "public function getCrawler($id, &$crawler) {\n $osda = $this->_interface->OsdAssociator();\n\n $cs = $osda->GetCrawlerType($id);\n if (!$cs->success_) {\n return $cs->error_;\n }\n\n $crawler = self::toArray($cs->result_);\n return null;\n }", "private function grabCategoryContent($url, $html = null)\n {\n if ($html == null) {\n $html = new simple_html_dom();\n @$html->load_file($url);\n $url = explode('?', $url)[0];\n }\n\n $links = $html->find('div[id=text] div[class=desc] h2 a');\n $eshops = $html->find('div[id=text] div[class=desc] p a');\n foreach ($links as $index => $link) {\n #echo \"PARSING SHOP: $link->href \".$eshops[$index]->plaintext.\" (\";\n echo \"PARSING SHOP: \".$eshops[$index]->plaintext.\" (\";\n echo $this->getShopListcount();\n echo \")\\n\";\n $this->addShopToList($link->href, $url, $eshops[$index]->plaintext);\n }\n\n $link = $html->find('a[class=next]', 0);\n if (!empty($link)) {\n $this->grabCategoryContent($url . substr($link->href, 2), null);\n }\n }", "protected function getPageCurl()\n\t{\n\t\t// initiate curl with our url\n\t\t$this->curl = curl_init($this->url);\n\n\t\t// set curl options\n\t\tcurl_setopt($this->curl, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent);\n\t\tcurl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, false);\n\n\t\t// execute the call to google+\n\t\t$this->html = curl_exec($this->curl);\n\n\t\tcurl_close($this->curl);\n\t}", "public static function html() {\n\n\t\treturn new BF_HTML_Generator;\n\t}", "public function crawl(){\n\t\t\t$this->collectUrls();\n\t\t}", "abstract public function scrape();", "public function parsePage($html){\n\t\t\tforeach($html->find(Configuration::getParameter(\"TAG_CLASS\")) as $become) {\n\t\t\t\tif($become->getAttribute(\"scope\") == \"\"){\n\t\t\t\t\tif($become->getAttribute(\"method\") != \"\"){\n\t\t\t\t\t\t$template = $become->innertext;\n\t\t\t\t\t\tif($template != \"\")\n\t\t\t\t\t\t\t@ $become->outertext = call_user_func(Array($this, $become->getAttribute(\"method\")), $template);\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\t@ $become->outertext = call_user_func(Array($this, $become->getAttribute(\"method\")));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$template = $become->innertext;\n\t\t\t\t\tif($template != \"\")\n\t\t\t\t\t\t@ $become->outertext = call_user_func(Array($become->getAttribute(\"scope\"), $become->getAttribute(\"method\")), $template);\n\t\t\t\t\telse \n\t\t\t\t\t\t@ $become->outertext = call_user_func(Array($become->getAttribute(\"scope\"), $become->getAttribute(\"method\")));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $html;\n\t\t}", "static public function getFromUrl(){\n $args = func_get_args();\n\n $cacheIsExpired = true; // By default we assume no cache then never expire (then cache always expire !)\n\n $cache = static::getCache();\n if( !is_null($cache) && isset($args[0]) && is_string($args[0]) ){ // Cache defined ?\n $cacheIsExpired = $cache->setRequest($args[0])->isExpired();\n }\n\n set_error_handler(array('\\Draeli\\RssBridge\\Utils', 'set_error_handler'));\n\n $argsLng = count($args);\n\n if( $cacheIsExpired ){\n if( !isset($args[1]) ){\n $args[1] = false;\n }\n\n if( !isset($args[2]) ){\n $randVersion = rand(23, 30) . '.' . rand(0, 9);\n\n // http://www.php.net/manual/fr/context.http.php\n // http://en.wikipedia.org/wiki/List_of_HTTP_header_fields\n $context = stream_context_create(array(\n 'http' => array(\n 'header' =>\n 'Accept-Charset: utf-8' . \"\\r\\n\" . \n 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:' . $randVersion . ') Gecko/' . date('Ymd') . ' Firefox/' . $randVersion . \"\\r\\n\", // À la bourrin ! :)\n )\n ));\n $args[2] = $context;\n }\n\n $argsFileGetContens = $argsLng > 5 ? array_slice($args, 0, 5) : $args;\n /*\n Note : il est possible d'utilisater les options de context, cf. http://www.php.net/manual/fr/context.http.php + http://fr2.php.net/manual/en/function.file-get-contents.php\n */\n $sourceHtml = call_user_func_array('\\file_get_contents', $argsFileGetContens );\n }\n else{ // Cache not expired, we reload stuff\n $sourceHtml = $cache->loadData();\n }\n\n if( $sourceHtml === false ){\n throw new \\Exception('No data to load from this URL');\n }\n\n $argsStrGetContens = $argsLng > 5 ? array_slice($args, 5) : array();\n array_unshift($argsStrGetContens, $sourceHtml);\n\n $result = call_user_func_array( array('\\Sunra\\PhpSimple\\HtmlDomParser', 'str_get_html'), $argsStrGetContens);\n // $result = call_user_func_array( array('\\Sunra\\PhpSimple\\HtmlDomParser', 'file_get_html'), $args );\n restore_error_handler ();\n\n if( !is_null($cache) ){ // Cache expired or not exist, we refresh cache\n $cache->saveData($sourceHtml);\n }\n\n return $result;\n }", "public function crawl()\n\t{\n \t// truncate any non-existant pages\n\t\t$this->resetIndex();\n\n\t\t// create a temporary table for incrementing counts\n\t\t$this->createTempTable();\n\n\t\t// add initial URL to crawl list\n\t\t$this->addRequest($this->startUrl);\n\n\t\t// begin crawling the url\n\t\t$this->crawlUrls();\n\n\t\t// update url counts and remove the temp table\n\t\t$this->finalizeUrlCounts();\n\t}", "protected function __construct( $config, $html ) {\r\n self::configure( $config );\r\n\r\n $this->_original_html = $html;\r\n $this->_converted_html = $html;\r\n $this->_browser_info = self::_get_browser();\r\n $this->_doc = new DOMDocument();\r\n @$this->_doc->loadHTML($this->_converted_html);\r\n\r\n if( $this->_config['debug'] ) {\r\n error_log(\"Init with $html\");\r\n }\r\n }", "protected function tryGetFirst($other): Crawler\n {\n $dom = new Crawler();\n $dom->addHtmlContent((string) $other);\n $maybeFirst = $dom->filter($this->selector)->first();\n return $maybeFirst;\n }", "abstract public function scrape(): Result;", "public function crawl($url) {\n\t\t$this->url = $this->format_url($url);\n\t\t$this->hostname = $this->extract_host($this->url);\n\n\t\t// Get page\n\t\t$page = file_get_contents($this->url, false);\n\n\t\t// Get favicon path\n\t\t$path = $this->extract_favicon_link($page);\n\n\t\tif ($path) {\n\t\t\t$this->download($path);\n\t\t}\n\t\telse {\n\t\t\techo \"Could not find favicon\\n\";\n\t\t}\n\t}", "protected function getParserByUrl($url) {\n $idParser = $this->getParserId($url);\n $parser = $this->getParserById($idParser);\n $parser->setUrl($url);\n return $parser;\n }", "function getPage($url){\n //use curl since we need to set a cookie\n $c = curl_init($url);\n curl_setopt($c, CURLOPT_VERBOSE, 1);\n curl_setopt($c, CURLOPT_COOKIE, $this->cookie);\n curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n $page = curl_exec($c);\n curl_close($c);\n $c = null;\n $html = str_get_html($page); //simplehtmldom method\n return $html;\n }", "static public function getFromString(){\n set_error_handler(array('\\Draeli\\RssBridge\\Utils', 'set_error_handler'));\n $result = call_user_func_array( array('\\Sunra\\PhpSimple\\HtmlDomParser', 'str_get_html'), func_get_args() );\n restore_error_handler ();\n\n return $result;\n }", "public function enqueueHTMLContent($html) {\r\n $this->HTMLContent[] = $html;\r\n return $this;\r\n }", "public function __construct()\n {\n $this->html = file_get_contents('html/list.html');\n \n }", "public function find(UriInterface $url): ?WebPage;", "function getHTML($url,$timeout)\n{\n $ch = curl_init($url); // initialize curl with given url\n curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER[\"HTTP_USER_AGENT\"]); // set useragent\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // write the response to a variable\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // follow redirects if any\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // max. seconds to execute\n curl_setopt($ch, CURLOPT_FAILONERROR, 1); // stop when it encounters an error\n return @curl_exec($ch);\n}", "public function initialize()\n {\n curl_setopt($this->ch, CURLOPT_AUTOREFERER, TRUE);\n curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($this->ch, CURLOPT_MAXREDIRS, 5);\n curl_setopt($this->ch, CURLOPT_USERAGENT, self::$USER_AGENT); \n // curl_setopt($this->ch, CURLOPT_COOKIEFILE, '/tmp/curl_client');\n // curl_setopt($this->ch, CURLOPT_COOKIEJAR, '/tmp/curl_client');\n // curl_setopt($this->ch, CURLOPT_HEADER, TRUE);\n return $this;\n }", "public static function createDomFromHtml(Trace $trace, $html) {\n Preconditions::checkIsString($html);\n $dom = new DOMDocument();\n $trace->tlog(\"Loading html to DOM\");\n $loaded = @$dom->loadHTML($html);\n if (!$loaded) {\n throw new ParseException(\"Problem parsing html to DOM.\");\n }\n $trace->tlog('Fixing id attributes in the DOM'); \n ParserUtils::fixIdAttributes($trace, $dom);\n return $dom;\n }", "public function withSource($html): self\n {\n $this->dom->loadXML(mb_convert_encoding(\n $html,\n self::MBSTRING_ENCODING_HTML,\n self::MBSTRING_ENCODING_UTF8\n ));\n\n // automatically set `id` attribute for use on client-side\n $id = $this->dom->createAttribute('id');\n $id->appendChild($this->dom->createTextNode(sprintf('template-%s', $this->name)));\n $this->dom->firstChild->appendChild($id);\n\n return $this;\n }", "function _parseHtml($html)\n\t\t{\n\t\t\t$html=preg_replace(\"/<!DOCTYPE((.|\\n)*?)>/ims\",\"\",$html);\n\t\t\t$html=preg_replace(\"/<script((.|\\n)*?)>((.|\\n)*?)<\\/script>/ims\",\"\",$html);\n\t\t\tpreg_match(\"/<head>((.|\\n)*?)<\\/head>/ims\",$html,$matches);\n\t\t\t$head=$matches[1];\n\t\t\tpreg_match(\"/<title>((.|\\n)*?)<\\/title>/ims\",$head,$matches);\n\t\t\t$this->title = $matches[1];\n\t\t\t$html=preg_replace(\"/<head>((.|\\n)*?)<\\/head>/ims\",\"\",$html);\n\t\t\t$head=preg_replace(\"/<title>((.|\\n)*?)<\\/title>/ims\",\"\",$head);\n\t\t\t$head=preg_replace(\"/<\\/?head>/ims\",\"\",$head);\n\t\t\t$html=preg_replace(\"/<\\/?body((.|\\n)*?)>/ims\",\"\",$html);\n\t\t\t$this->htmlHead=$head;\n\t\t\t$this->htmlBody=$html;\n\t\t\treturn;\n\t\t}", "public function __construct()\n {\n \n $this->html = file_get_contents('html/item.html');\n \n }", "public function checkNode($html, $url)\n {\n try {\n $crawler = new Crawler($html);\n //data crawling from style\n $data = [\n 'title' => $crawler->filter($this->style['title'])->text(),\n 'brand' => $crawler->filter($this->style['brand'])->text(),\n 'sku' => $crawler->filter($this->style['sku'])->attr('value'),\n 'price' => $crawler->filter($this->style['price'])->count()?\n preg_replace('/\\D/', \"\", $crawler->filter($this->style['price'])->text()) : '',\n 'price_discount' => $crawler->filter($this->style['priceDiscount'])->count()?\n preg_replace('/\\D/', \"\", $crawler->filter($this->style['priceDiscount'])->text()) :\n preg_replace('/\\D/', \"\", $crawler->filter($this->style['price'])->text()),\n 'image_link' => $crawler->filter($this->style['image'])->attr('src'),\n 'category' => $crawler->filter($this->style['category'])->count()?\n $crawler->filter($this->style['category'])->text() :\n $crawler->filter($this->style['category-lastChild'])->text(),\n 'url' => $url\n ];\n $data['discount'] = $data['price_discount']?\n round(($data['price'] - $data['price_discount']) / $data['price'] * 100) : 0;\n\n return $data;\n } catch (Exception $e) {\n //show error message from line on code\n session()->put('errorNode', 'The current node list is empty. File '.\n $e->getTrace()[0]['file'].' line '.$e->getTrace()[0]['line']);\n return 0;\n }\n }", "function get_soup($url) {\n echo '[get_soup] url: ', $url, \"\\n\";\n\n // for test - to see what you get from server\n // $html = file_get_contents($url);\n // echo $html\n // $doc = new DOMDocument();\n // $doc->loadHTML($html, LIBXML_NOERROR);\n \n // read HTML directly from server and convert to DOMDocument\n $doc = new DOMDocument();\n $doc->loadHTMLFile($url, LIBXML_NOERROR);\n\n // search in HTML using XPath\n $xpath = new DOMXPath($doc);\n \n return $xpath;\n}", "public function html($html) {\n $this->html = $html;\n\n return $this;\n }", "public static function instance() {\n return new \\phpbrowscap\\Browscap(APPPATH . static::$cache_file);\n }", "protected function _document( $html ) {\n\t\t$reporting = error_reporting( 0 );\n\t\t$Document = DomDocument::loadHTML( $html );\n\t\terror_reporting( $reporting );\n\n\t\tif ( $Document === false ) {\n\t\t\tthrow new Exception( 'Unable to load HTML document.' );\n\t\t}\n\n\t\treturn $Document;\n\t}", "public function getParser($url)\n {\n try {\n $client = new Client();\n $response = $client->request('GET', $url, ['verify' => false]);\n $html = $response->getBody();\n\n $dom = new Dom();\n return $dom->load($html);\n } catch (CurlException $ex) {\n // TODO - decide what to do on HTTP error conditions, ignoring seems useless\n } catch (ClientException $clientEx) {\n \n } catch (ConnectException $connectEx) {\n \n } catch (ServerException $serverEx) {\n \n }\n \n return false;\n }", "function getURLContents($this_url)\n\t{\n\t\t$timeout = 8;\n\t\t$retry = 3;\n\t\t$website_page_contents = false;\n\t\t$success_crawl = false;\n\t\t\n\t\twhile (!$success_crawl) {\n\t\t\t// initialize cURL\n\t\t\t$ch = curl_init();\n\n\t\t\tif (strlen($this_url) > 8) {\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $this_url);\n\t\t\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, $timeout);\n\t\t\t\tcurl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Chrome/22.0.1216.0 Safari/537.2\");\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t\tcurl_setopt($ch, CURLOPT_REFERER, \"http://www.facebook.com\");\n\t\t\t\tcurl_setopt($ch, CURLOPT_HEADER, true);\n\t\t\t\tcurl_setopt($ch,CURLOPT_HTTPHEADER,array('HeaderName: HeaderValue'));\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\t\t@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\t\t\t@curl_setopt($ch, CURLOPT_MAXREDIRS, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_ENCODING, 'gzip');\n\t\t\t\tcurl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n\t\t\t\t//curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/c00kie.txt');\n\t\t\t\t// get contents\n\t\t\t\t$website_page_contents = curl_exec($ch);\n\n\t\t\t\t// check if there's some error's\n\t\t\t\tif(curl_error($ch))\n\t\t\t\t{\n\t\t\t\t\techo 'Curl error: ' . curl_error($ch) . \".\\n\";\n\t\t\t\t\t$retry--;\n\t\t\t\t\tif($retry < 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$success_crawl = true; // just to stop crawling\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$success_crawl = false;\n\t\t\t\t\t\techo 'Retrying in a second. ' . $retry . ' retries left.' . \"\\n\";\n\t\t\t\t\t\tsleep(1);\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$success_crawl = true;\n\t\t\t\t\t//echo 'curl success!'.\"\\n\";\n\t\t\t\t\t// close cURL\n\t\t\t\t\tcurl_close($ch);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 'Invalid URL: ' . $this_url . \"\\n\";\n\t\t\t\t$website_page_contents = '';\n\t\t\t\t$retry = 0;\n\t\t\t}\n\t\t}\n\t\t// return the contents\n\t\treturn $website_page_contents;\n\t}", "protected function parse($html)\n {\n $doc = new \\DOMDocument();\n $doc->loadHTML('<?xml encoding=\"UTF-8\">' . $html);\n\n $xpath = new \\DOMXPath($doc);\n\n $title = $xpath->query(\"//div[@id='title']/div[@class='left']/h1\");\n $developer = $xpath->query(\"//div[@id='title']/div[@class='left']/h2\");\n $description = $xpath->query(\"//div[@class='product-review']/p\");\n\n if (empty($title) || empty($developer) || empty($description)) {\n throw new InvalidPageException('Invalid page format');\n }\n\n $this->title = $title->item(0)->textContent;\n $this->developer = ltrim($developer->item(0)->textContent, 'By ');\n $this->description = $description->item(0)->textContent;\n $this->source = 'apple';\n }", "public static function loadHTML($data, $storeContent = false)\r\n {\r\n return new Zend_Search_Lucene_Document_Html($data, false, $storeContent);\r\n }", "public function crawl()\n {\n foreach ($this->urlQueue as $k => $url) {\n echo \"\\n[\" . $k . \"] \" . $url;\n ob_flush();\n flush();\n \n $parser = $this->getParser($url);\n if ($parser !== false) {\n $links = $this->getLinksOnPage($url, $parser);\n $this->urlQueue->addFromArray($links);\n }\n }\n \n echo print_r($this->urlQueue, true);\n }", "function fetch($url){\n curl_setopt($this-> ch,CURLOPT_URL, $url);\n curl_setopt($this-> ch,CURLOPT_COOKIE, \"./cookie.txt\"); \n curl_setopt($this-> ch,CURLOPT_FOLLOWLOCATION, true);\n return $this-> html = curl_exec($this-> ch);\n }", "abstract public function getHtml();", "public function getLinks(){\n\t\t\n\t\t// Get the global config\n\t\tglobal $CrawlerConfig;\n\t\t\n\t\t// Create DOM object and load HTML\n\t\t@$dom = new DOMDocument();\n\t\t@$dom->loadHTML($this->html);\n\t\t$dom->preserveWhiteSpace = false;\n\t\t\n\t\t// Return array\n\t\t$ret = array();\n\t\t\n\t\t// Get links\n\t\t$links = $dom->getElementsByTagName('a');\n\t\t\n\t\t// Extract links data\n\t\tforeach ($links as $tag){\n\t\t\t\n\t\t\t// Get the hyperlink reference\n\t\t\t$url = trim($tag->getAttribute('href'));\n\t\t\t\n\t\t\t// Make sure it's a complete URL\n\t\t\t$url = self::filterUrl($url);\n\t\t\tif($url === false) continue;\n\t\t\t\n\t\t\t// Skip URL's that start with #\n\t\t\tif(substr($url, \"0\", 1) == \"#\") continue;\n\t\t\t\n\t\t\t// Skip mailto links\n\t\t\tif(strpos($url, \"mailto:\") !== false) continue;\n\t\t\t\n\t\t\t// Skip links that don't match the 'FOLLOW_LINKS_LIKE' config param\n\t\t\tif(\n\t\t\t\t!empty($CrawlerConfig['FOLLOW_LINKS_LIKE']) &&\n\t\t\t\tstrpos($url, $CrawlerConfig['FOLLOW_LINKS_LIKE']) === false\n\t\t\t) continue;\n\t\t\t\n\t\t\t// Skip links that DO match the \"IGNORE_LINKS_LIKE\" config param\n\t\t\tif(!empty($CrawlerConfig['IGNORE_LINKS_LIKE'])){\n\t\t\t\tforeach($CrawlerConfig['IGNORE_LINKS_LIKE'] as $l){\n\t\t\t\t\tif(strpos($url, $l) !== false) continue 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Dump it to the array\n\t\t\tarray_push($ret, array(\n\t\t\t\t\"url\" => $url,\n\t\t\t\t\"title\" => $tag->textContent ///$tag->childNodes->item(0)->nodeValue\n\t\t\t));\t\t\t\n }\n\t\t\n\t\t$ret = self::doopScooper($ret, array(\"url\"));\n\t\t\t\t\n\t\treturn $ret;\n\t}", "protected function get_html_from_url($url){\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $url); \r\n\t\t// curl_setopt($ch, CURLOPT_HEADER, false); \r\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\r\n \t\t'Content-Type: text/html; charset=UTF-8',\r\n \t\t'Accept-Language: en-US,en;q=0.5'\r\n \t));\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //echo if 0 \r\n\t\t$html = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\t\treturn $html;\r\n\t\r\n\t}", "private function fastCrawling(InputInterface $input, OutputInterface $output)\n {\n $userAgent = 'Mozilla/5.0 (Linux; Android 7.0; '.\n 'SM-G930VC Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) '.\n 'Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36';\n $baseUrl = $input->getArgument('url');\n\n $data = [];\n\n // Initialize Sitemap Finder\n PHPCrawlerSitemapFinder::setBaseUrl($baseUrl);\n PHPCrawlerSitemapFinder::setUserAgent($userAgent);\n $links = PHPCrawlerSitemapFinder::find();\n\n // Load finders:\n $finders = [\n 'PHPCrawlerEmailFinder',\n 'PHPCrawlerPhoneNumberFinder',\n 'PHPCrawlerExternalLinkFinder',\n ];\n\n if (!empty($links)) {\n // Crawling the links\n foreach ($links as $link) {\n echo \"Link: $link \\n\";\n if ($html = PHPCrawlerSitemapFinder::getUrl($link)) {\n echo 'Content: '.$html.$link;\n // Run all finders:\n foreach ($finders as $finder) {\n $finder = '\\\\Crawler\\\\Finders\\\\'.$finder;\n\n if (class_exists($finder)) {\n $finder::setBaseUrl($baseUrl); // Set up base url for the finders\n $finder::setUserAgent($userAgent); // Set User Agent\n\n $data[$finder::getFinderName()] = $finder::find($html);\n }\n }\n // Print verbose:\n if ($output->isVerbose()) {\n $output->writeln('Page requested: <fg=white>'.$link.'</>');\n\n foreach ($data as $key => $value) {\n $output->writeln($key.':'.Memory::formatOutput($key, 28, ' ').'<fg=green>'.count($value).'</> pc(s)');\n }\n\n $output->writeln('');\n }\n }\n }\n\n return true;\n }\n\n $output->writeln('<fg=red>Page can not be open</>');\n\n return true;\n }", "public function __construct() {\n $referer = $_SERVER['HTTP_REFERER'];\n \n // array with common analyticbots\n $urlsArray = array( \"buttons-for-website.com\",\n \"buttons-for-your-website.com\",\n \"videos-for-your-business.com\",\n \"success-seo.com\",\n \"semaltmedia.com\",\n \"dailyrank.net\",\n \"sitevaluation.org\",\n \"100dollars-seo.com\",\n \"forum69.info\",\n \"best-seo-solution.com\",\n \"best-seo-offer.com\",\n \"semalt.semalt.com\",\n \"semalt.com\",\n \"7makemoneyonline.com\",\n \"anticrawler.org\",\n \"baixar-musicas-gratis.com\",\n \"descargar-musica-gratis.net\" );\n \n foreach($urlsArray as $url) {\n if(strpos($referer, $url) !== false) { // is a bot\n // return \"404 - not found\"\n http_response_code(404);\n // stop the whole page\n exit();\n return true;\n } else { // is not a bot\n return false;\n }\n }\n }", "function curlToDOM($url) {\n $ci = curl_init($url);\n curl_setopt($ci, CURLOPT_HEADER, 0);\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ci, CURLOPT_AUTOREFERER, 1);\n curl_setopt($ci, CURLOPT_FOLLOWLOCATION, 1);\n $dom = new simple_html_dom();\n $siteData = $dom->load(curl_exec($ci));\n curl_close($ci);\n return $siteData;\n }", "public static function getInstance() {\n if (!isset(self::$instance)) {\n self::$instance = new SelectorUtils();\n }\n return self::$instance;\n }", "public static function loadHTMLFile($file, $storeContent = false)\r\n {\r\n return new Zend_Search_Lucene_Document_Html($file, true, $storeContent);\r\n }", "public function withMaxNumberOfPages(int $number): Crawler;", "public function cacheMarkup($html)\n {\n return $this->cache->remember(\"cdn.{$html}\", $this->cacheExpiry, function () use ($html) {\n return $this->rewriteMarkup($html);\n });\n }", "public function __construct()\n\t{\n\t\t$this->html = new HtmlBuilder;\n\t}", "public function initSpider(){\n echo \"<p>Searching: <b>\".$this->keyword.\"</b> and Looking for: <b>\".$this->website.\"</b></p>\";\n echo str_repeat(\" \", 256);\n $contador=0;\n $encontre=false;\n $_GET['weboriginal']=\"\";\n $_GET['webcontador']=\"\";\n $i=10;\n $c=1;\n while($c<=10) { \n echo \"<ul><li><b>Searching in Page: $c</b></li>\"; \n flush();ob_flush();\n $records= $this->getRecordsAsArray($this->url); \n $count=count($records);\n echo \"<ul>\";\n for($k=0;$k<$count;$k++){\n $j=$k+1;\n $link=$records[$k][2];\n $linkOriginal = $link;\n $link=strip_tags($link);\n $link=str_replace(\"http://www.\",\"\",$link);\n $link=str_replace(\"http://\",\"\",$link);\n $link=str_replace(\"www.\",\"\",$link);\n $pos=strpos($link, \"/\");\n $link=trim(substr($link,0,$pos));\n $contador++;\n if($this->website==$link){\n $domain=$this->website;\n $_GET['weboriginal']=$linkOriginal;\n $_GET['webcontador']=$contador;\n echo \"<li><h1>Result was found in Page: $c and Record: $j</h1></li>\";\n echo \"Web original \".$linkOriginal;\n echo \"<div>Congrats, We searched google's top 10 pages for <b>\\\"\".$this->keyword.\"</b>\\\", we found your domain <b>\\\"$domain\\\"</b> listed on page: $c at $j place </div>\";echo \"</ul></ul>\";\n $encontre=true;\n break;\n }\n else{\n echo \"<li>Result not found on Page: $c and Record: $j</li>\";\n } \n }\n if($encontre==true){\n break;\n }\n echo \"</ul></ul>\";\n $c++;\n $this->url = $this->updateUrl($this->keyword, $i,$this->motor);\n }\n echo \"Crawled through all 10 pages.\"; \n \n if($this->page==false){\n $domain=$this->website;\n $keyword=$this->keyword;\n echo \"<div>Sorry, We searched google's top 10 pages for <b>\\\"$keyword\\\"</b>, but was unable to find your domain <b>\\\"$domain\\\"</b> listed anywhere. </div>\";\n }\n else {\n $page=$this->page;\n $records=$this->records;\n $domain=$this->website;\n $keyword=$this->keyword;\n echo \"<div>Congrats, We searched google's top 10 pages for <b>\\\"$keyword\\\"</b>, we found your domain <b>\\\"$domain\\\"</b> listed on page: $page at $record place </div>\";\n }\n }", "public function run() {\n\t\t$result = array();\n\t\t\n\t\t// This could take a while to run, so set no time limit\n\t\tset_time_limit(0);\n\t\t\n\t\t// This is used for ob_flush to work\n\t\tif(ob_get_length() === false && $this->showMessages) ob_start();\n\t\t\n\t\t$html = $this->fetchHTML($this->url);\n\n\t\tif(!$html) {\n\t\t\tif($this->showMessages) echo \"$this->url doesn't appear to exist.\\r\\n\";\n\t\t}\n\n\t\t$links = $this->extractLinks($html, $this->url);\n\t\t\n\t\t// HTML stored in memory is no longer required, discard it\n\t\tunset($html);\n\t\n\t\tif($this->showMessages) echo \"Getting HTML from {$this->url}\\r\\n\";\n\n\t\tif(empty($links)) {\n\t\t\tif($this->showMessages) {\n\t\t\t\techo \"$this->url doesn't appear to have any links.\\r\\n\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t// We only need unique links, so take any duplicates and discard them\n\t\t$links = array_values(array_unique($links));\n\t\t$linkCount = count($links);\n\t\t\n\t\tif($this->showMessages) echo \"Found {$linkCount} links on {$this->url}\\r\\n\";\n\n\t\tif($this->showMessages) {\n\t\t\tflush();\n\t\t\tob_flush();\n\t\t}\n\n\t\t// Each unique link needs to be checked to see what status code is returned\n\t\tfor($i = 0; isset($links[$i]) && !connection_aborted(); ++$i) {\n\t\t\t\t\n\t\t\t// First, we need to check the URL exists, before we can get the status\n\t\t\tif($this->urlExists(html_entity_decode($links[$i]))) {\n\t\t\t\t// Get the headers for the link\n\t\t\t\t$headers = $this->fetchHeaders(html_entity_decode($links[$i]));\n\t\n\t\t\t\t// Get the status code from the headers\n\t\t\t\t$status = $this->extractStatusCode($headers);\n\t\t\t\t\n\t\t\t\t// Build the results (link, code, status)\n\t\t\t\t$result[$i]['Link'] = $links[$i];\n\t\t\t\t$result[$i]['Code'] = $status[0];\n\t\t\t\t$result[$i]['Status'] = $status[1];\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// URL doesn't exist, result is a 404.\n\t\t\t\t$result[$i]['Link'] = $links[$i];\n\t\t\t\t$result[$i]['Code'] = '404';\n\t\t\t\t$result[$i]['Status'] = 'Page not found';\n\t\t\t}\n\n\t\t\tif($this->showMessages) {\n\t\t\t\tflush();\n\t\t\t\tob_flush();\n\t\t\t}\n\t\t}\n\n\t\tif($this->showMessages) {\n\t\t\tob_end_flush();\n\t\t}\n\n\t\treturn $result;\n\t}", "public function handle()\n {\n $html = file_get_contents('https://ringside24.com/ru/mma/');\n $crawler = new Crawler(null, $html);\n $crawler->addHtmlContent($html, 'UTF-8');\n $arr = [];\n $articles = $crawler->filter('body > div.site-wrap.site-body > div.container-fluid > div > section > div.post-list-wr > div.post-list')->each(function (Crawler $node)\n {\n return $node;\n });\n\n foreach ($articles as $key => $news)\n {\n $img = 'https://ringside24.com' . $news->filter('div.post-list__left > a > img')->attr('src');\n $title = $news->filter('div.post-list__right > div.h3 > a')->text();\n $text = $news->filter('div.post-list__right > p')->text();\n $info = 'https://ringside24.com' . $news->filter('div.post-list__right > div.post-list__more > a')->attr('href');\n $arr[$key]['img'] = $img;\n $arr[$key]['title'] = $title;\n $arr[$key]['news'] = $text;\n $arr[$key]['info'] = $info;\n }\n\n $site = file_get_contents('https://www.sports.ru/football/');\n $crawler = new Crawler(null , $site);\n $crawler->addHtmlContent($site, 'UTF-8');\n $football = [];\n $allNews = $crawler->filter('body > #branding-layout > div.page-layout > div.content-wrapper > div > div > div > main > article')->each(function (Crawler $node)\n {\n return $node;\n });\n foreach ($allNews as $key => $news)\n {\n\n $img = $news->filter('article > a > img')->attr('data-lazy-normal');\n $title = $news->filter('h2 > a')->text();\n $text = $news->filter('p')->text();\n $info = 'https://sport.ua' . $news->filter('h2 > a')->attr('href');\n $football[$key]['img'] = $img;\n $football[$key]['title'] = $title;\n $football[$key]['news'] = $text;\n $football[$key]['info'] = $info;\n }\n logger($arr);\n ParseProcess::withChain([\n new ParseFootball($football)\n ])->dispatch($arr);\n\n//// ParseProcess::dispatch($arr);\n// ParseFootball::dispatch($football);\n\n }", "public function test(){\n \t// it could be a huge performance concern if crawl it.\n \t// so I just choose the \"I\" category of all programs insteaded.\n\n \t// $url_main = \"http://www.humber.ca/program\"; \n \tset_time_limit(1000);\n \t// $url_main = \"http://www.humber.ca/program/listings/b?school=All&credential=All&campus=All&field_program_name_value_1=\";\n\n \t$html_main = file_get_contents($url_main);\n\n\t\t$crawler = new Crawler($html_main);\n\n\t\t$links = array();\n\n\t\t// Simple XPath for this element, so I did not use CssSelector.\n\t\t$crawler->filterXPath('//tbody/tr/td/a')->each(function ($node, $i) use( &$links) {\n\t\t\t\n\t\t\t// the links in website are relative path, so I need to add a prefix to make it absolute.\n\t\t\t$prefix = \"http://humber.ca\";\n\n\t\t\t$existed_programs = Program::all();\n\t\t\t$existed_program_names = array();\n\t\t\tforeach ($existed_programs as $key => $value) {\n\t\t\t\t$existed_program_names[] = $value['program_name'];\n\t\t\t}\n\n\t\t\t// get rid of the duplicated links, no idea why Humber make the program list a mess\n\t\t\tif (strpos($node->text(),',') === false) {\n\t\t\t\t\n\t\t\t\t// get the full link\n\t\t\t\t$link = $prefix . $node->attr('href');\n\t\t\t $link = trim($link);\n\t\t\t // get the text which is the program name\n\t\t\t $text = trim($node->text());\t\t\n\t\t \t\n\t\t \t// put associate name & link to key/value pair array\n\t\t\t if(!in_array($text, $existed_program_names)){\n\t\t\t \t$links[\"$text\"] = $link;\n\t\t\t }\n\t\t \t\t\t\t\n\t\t\t}\n\t\t});\n\n\t\t// an array to store all programs\n\t\t$programs = array();\n\n\t\t// use a loop to crawl individual program webpage by accessing its link in $links array\n\t\tforeach ($links as $key => $value) {\n\n\t\t\t$program_url = $value;\n\n\t\t\t// use curl to get the webpage content\n\t\t\t// it seems file_get_contents() has some issues for these webpage\n\t\t\t// or it's just I made some mistakes\n\t\t\t$curl_handle=curl_init();\n\t\t\tcurl_setopt($curl_handle, CURLOPT_URL,$program_url);\n\t\t\tcurl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);\n\t\t\tcurl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($curl_handle, CURLOPT_USERAGENT, 'Humber College');\n\n\t\t\t\n\n\t\t\t$program_html = curl_exec($curl_handle);\n\t\t\tcurl_close($curl_handle);\n\n\t\t\tif($program_html){\n\t\t\t\t$program_crawler = new Crawler($program_html);\n\t\t\t}\n\n\t\t\t// $program is an array to store the program's information with key/value pair\n\t\t\t$program = array();\n\n\t\t\t// here I used CssSelector to help me translate the XPath.\n\t\t\t// It made me address it without headache.\n\t\t\t$program['program_name'] = trim($key);\n\n\t\t\t$Code = $program_crawler->filterXPath(CssSelector::toXPath('div.container.clearfix>section>div.field-items>div.field-item.even'))->text();\n\t\t\t$program['program_code'] = trim($Code);\n\n\t\t\t$Credential = $program_crawler->filterXPath(CssSelector::toXPath('section.field-name-field-credential>div.field-item>a'))->text();\n\t\t\t$program['program_credential'] = trim($Credential);\n\n\t\t\t$School = $program_crawler->filterXPath(CssSelector::toXPath('section.field-name-field-school>div.field-item>a'))->text();\n\t\t\t$program['program_school'] = trim($School);\n\n\t\t\t// get all the schools from database\n\t\t\t$schools = School::all();\n\n\t\t\t// Because I used School table's id as the foreign key in Program table.\n\t\t\tforeach ($schools as $key1 => $value1) {\n\t \t\tif($program['program_school'] == $value1['school_name']){\n\t \t\t\t$program['program_school_id'] = $value1['id'];\n\t \t\t}\n\t \t}\t\n\n\t \t// getting each courses' name/code\n\t\t\t$courses = array();\n\t\t\t$courses = $program_crawler->filterXPath(CssSelector::toXPath('div.course'))->each(function ($node, $i) {\n\t\t\t\t$course = array();\n\t\t\t\t$course_code = $node->children()->first()->text();\n\t\t\t\t$course_name = $node->children()->last()->text();\n\t\t\t\t$course['course_code'] = $course_code;\n\t\t\t\t$course['course_name'] = $course_name;\n\t\t\t\treturn $course;\n\n\t\t\t});\n\n\t\t\t\n\t\t\t$program['program_courses'] = $courses;\n\t\t\t$programs[] = $program;\n\t\t}\n\n\t\t// store the information from array to database through loops\n\t\t// just in case of accidents, I commented the inserting database code below.\n\t\tforeach ($programs as $key => $value) {\n\t\t\t$one_program = new Program;\n\t\t\t$one_program->program_name = $value['program_name'];\n\t\t\t$one_program->program_code = $value['program_code'];\n\t\t\t$one_program->school_id = $value['program_school_id'];\n\t\t\t$one_program->credential = $value['program_credential'];\n\t\t\t$one_program->save();\n\t\t\techo \"a program is saved to db\" . \"<br>\";\n\t\t\tforeach ($value['program_courses'] as $key2 => $value2) {\n\n\t\t\t\t// Same reason as above, I used Program table's id as foreign key in Course table\n\t\t\t\t$stored_programs = Program::all();\n\t\t\t\t// $stored_programs = $programs;\n\t\t\t\t$course_belongs_id = 0;\n\t\t\t\tforeach ($stored_programs as $key3 => $value3) {\n\t\t \t\tif($value['program_name'] == $value3['program_name']){\n\t\t \t\t\t$course_belongs_id = $value3['id'];\n\t\t \t\t}\n\t\t \t}\n\n\t\t \t$existed_courses = Course::where('program_name', '=', $value['program_name']);\n\t\t\t\t$existed_course_name = array();\n\t\t\t\tforeach ($existed_courses as $key => $value) {\n\t\t\t\t\t$existed_course_name[] = $value['course_name'];\n\t\t\t\t}\t\n\t\t\t\tif(!in_array($value2['course_name'], $existed_course_name)){\n\t\t\t\t\t$one_course = new Course;\n\t\t\t\t\t$one_course->course_name = $value2['course_name'];\n\t\t\t\t\t$one_course->course_code = $value2['course_code'];\n\t\t\t\t\t$one_course->program_id = $course_belongs_id;\n\t\t\t\t\t$one_course->save();\n\t\t\t\t\techo \"a course is saved to db ---- \" . $one_course->program_id . \"<br>\";\n\t\t\t\t}\n\t\t \t\n\n\t\t\t}\n\t\t\techo \"<br>======<br>\";\n\t\t}\n\n\t}", "function __construct($parserType = null){\n $this->ch = curl_init();\n curl_setopt($this->ch, CURLOPT_USERAGENT, \"PGBrowser/0.0.1 (http://github.com/monkeysuffrage/pgbrowser/)\");\n curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($this->ch, CURLOPT_AUTOREFERER, true);\n curl_setopt($this->ch, CURLOPT_MAXREDIRS, 10);\n curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($this->ch, CURLOPT_ENCODING, 'gzip,deflate,identity');\n curl_setopt($this->ch, CURLOPT_HTTPHEADER, array(\n \"Accept-Charset:\tISO-8859-1,utf-8;q=0.7,*;q=0.7\",\n \"Accept-Language:\ten-us,en;q=0.5\",\n \"Connection: keep-alive\",\n \"Keep-Alive: 300\",\n \"Expect:\"\n ));\n curl_setopt($this->ch, CURLOPT_COOKIEJAR, '');\n curl_setopt($this->ch, CURLOPT_HEADER, true);\n $this->parserType = $parserType;\n if(function_exists('gc_enable')) gc_enable();\n }" ]
[ "0.73360854", "0.7096998", "0.70868254", "0.70169264", "0.6963565", "0.68020976", "0.673131", "0.66502386", "0.6409645", "0.6311036", "0.6147224", "0.6035871", "0.6006924", "0.5957782", "0.5822971", "0.57692397", "0.57500994", "0.5697311", "0.5643459", "0.5616252", "0.56113464", "0.55850035", "0.555462", "0.5542558", "0.54548365", "0.54548365", "0.5424367", "0.5384641", "0.53772974", "0.5361771", "0.53208107", "0.53000915", "0.52931076", "0.52801186", "0.527362", "0.524825", "0.52349526", "0.52302617", "0.5171685", "0.5140441", "0.5138168", "0.5135424", "0.5129272", "0.51266825", "0.5116478", "0.5116154", "0.51039356", "0.50885737", "0.5077049", "0.50626355", "0.5061024", "0.5053429", "0.5050478", "0.5009859", "0.49959874", "0.4994194", "0.4984331", "0.4943973", "0.49325788", "0.49047315", "0.48929718", "0.48733145", "0.4861544", "0.48584688", "0.48501885", "0.48269635", "0.48179287", "0.47996813", "0.4798605", "0.4789118", "0.47880957", "0.47796416", "0.47643173", "0.47572783", "0.4756644", "0.47527954", "0.47509623", "0.47502524", "0.47402287", "0.473816", "0.47373185", "0.4734903", "0.4729774", "0.47269312", "0.47240838", "0.4717861", "0.4715165", "0.46913904", "0.46912873", "0.4680632", "0.46516314", "0.46270686", "0.46218035", "0.46194887", "0.4612774", "0.459774", "0.458891", "0.45878458", "0.45823345", "0.45800632" ]
0.8848025
0
Filters html using a css selector. Runs the callback over each returned element of the css selector and the method returns an array of all the callback responses
public function filter($html, $selector, callable $closure) { return $this->getCrawler($html)->filter($selector)->each($closure); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findElements($selector = 'all') {\r\n\t\t$attrs = $this->parseSelector($selector);\r\n\t\t$result = array();\r\n\t\tforeach($this->children as $child) {\r\n\t\t\tif ($child->matchSelector($attrs)) {\r\n\t\t\t\t$result[] = $child;\r\n\t\t\t}\r\n\t\t\t$childElements = $child->findElements($selector);\r\n\t\t\tforeach($childElements as $elem) {\r\n\t\t\t\t$result[] = $elem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "function _filter_block_content_callback($matches)\n {\n }", "public function getHtmlElements();", "public function filter()\n {\n $domDoc = new DOMDocument();\n @$domDoc->loadHTML($this->_input);\n $editableElements = $this->findEditableElements($domDoc);\n \n foreach ($editableElements as $value) {\n $element = $value['element'];\n $data = $value['data'];\n\n // filter boolean for mysql\n $data['isGlobal'] = ($data['isGlobal']) ? 1 : 0;\n\n // query database for content\n $contentTable = new Hobo_Db_Table_Content();\n $data['routeName'] = Zend_Controller_Front::getInstance()->getRouter()->getCurrentRouteName();\n $row = $contentTable->selectLatest($data);\n \n if (! empty($row->content)) {\n // remove any children\n while ($element->hasChildNodes()){\n $element->removeChild($element->childNodes->item(0));\n } \n // inject content\n $fragment = $domDoc->createDocumentFragment(); // create fragment\n $fragment->appendXML($row->content);\n $element->appendChild($fragment); \n }\n }\n\n return $domDoc->saveHTML();\n }", "protected function getContents()\n {\n $contents = $this->crawler->filter('.page.group');\n if (!$contents->count()) {\n return;\n }\n\n $contents = $contents->html();\n\n // I'll have my own syntax highlighting, WITH BLACKJACK AND HOOKERS\n $this->crawler->filter('pre')->each(function ($code) use (&$contents) {\n $unformatted = htmlentities($code->text());\n $unformatted = '<pre><code class=\"php\">'.$unformatted.'</code></pre>';\n $contents = str_replace('<pre class=\"code php\">'.$code->html().'</pre>', $unformatted, $contents);\n });\n\n return $contents;\n }", "protected function parse($html) {\n $this->crawler->addHtmlContent($html, 'UTF-8');\n return $this->crawler->filterXPath(\"//div[contains(@class,'sr_item')]\")\n ->each(function(Crawler $node, $i){\n return [\n 'hotelid' => $node->attr('data-hotelid'),\n 'score' => $node->attr('data-score'),\n 'name' => $node->filterXPath(\"//span[contains(@class,'sr-hotel__name')]\")->text(),\n 'location' => $node->filterXPath(\"//div[contains(@class,'address')]/a[contains(@class,'district_link')]\")->text(),\n // 'price' => $node->filterXPath(\"//table/tr/td[contains(@class,'roomPrice')]/div[contains(@class,'smart_price_style')]\")->text(),\n ];\n });\n }", "protected function fetchElementNodes()\n {\n $elements = [];\n\n foreach ($this->map as $query) {\n $list = $this->document->xpath($query);\n\n if (0 == count($list)) {\n continue;\n }\n\n foreach ($list as $node) {\n $elements[] = new HtmlNode($node, $this->document->getDocument());\n }\n }\n\n return $elements;\n }", "public function selectAnyElements ( ) {\n\n return $this->getStream()->selectAnyElements();\n }", "public function selectAll();", "public function find($selector);", "public function filter(callable ...$callbacks): self;", "public function getElements() {}", "function allLatestEpisodesCrawler($latestEpisodesVar,$latestFilterVar)\n{\n\t$html = file_get_contents(\"http://www.animerush.tv/\");\n\t//Create DOM-Obect\n\t$dom = new DOMDocument();\n\t@$dom->loadHTML($html);\n\t//Create DOM XPath\n\t$xpath = new DOMXPath($dom);\n\t//Get div-classes with specific ID through DOM XQuery\n\t$xpath_resultset = $xpath->query(\"//div[@class='$latestFilterVar']\");\n\t\t//Loop through all the result from previous XPath Query\n\t\tfor ($i = 0; $i < $xpath_resultset->length; $i++)\n\t\t{\n\t\t\t//Save object into string with HTML-format\n\t\t\t$htmlString = $dom->saveHTML($xpath_resultset->item($i));\n\t\t\t//Print out episode/object in result\n\t\t\techo '<div class=\"latestEpisodes\">';\n\t\t\techo $htmlString;\n\t\t\techo '</div>';\n\t\t\t//When loop has gone through more than specified value of how many results to show, stop loop, also linebreak\n\t\t\tif ($i >= $latestEpisodesVar-1)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n}", "public function process($html);", "public function getListUnParseHtml()\n\t{\n\t\treturn $this->listUnFilterHtmlFunction;\n\t}", "function getAllLinks($html){\n $tmp_str=\"\";\n $tmp_links=array();\n if (count($html->find('span[class=pl]'))>0)\n foreach ($html->find('span[class=pl] a') as $ahref)\n {\n $tmp_str=$tmp_str.'<a href=\"http://losangeles.craigslist.org'.$ahref->href.'\">'.$ahref->innertext.'</a><br/>';\n $tmp_links[]='<a href=\"http://losangeles.craigslist.org'.$ahref->href.'\">'.$ahref->innertext.'</a>';\n\n }\n return $tmp_links;\n}", "function episodeCrawler($urlVar,$resultsVar,$filterVar)\n{\n$html = file_get_contents($urlVar);\n//Create DOM-Obect\n$dom = new DOMDocument();\n@$dom->loadHTML($html);\n//Create DOM XPath\n$xpath = new DOMXPath($dom);\n//Get div-classes with specific ID through DOM XQuery\n$xpath_resultset = $xpath->query(\"//div[@class='$filterVar']\");\n\t//Loop through all the result from previous XPath Query\n\tfor ($i = 0; $i < $xpath_resultset->length; $i++)\n\t{\n\t//Save object into string with HTML-format\n\t$htmlString = $dom->saveHTML($xpath_resultset->item($i));\n\t\t\t//When loop has gone through more than specified value of how many results to show, stop loop\n\t if ($i >= $resultsVar)\n {\n break;\n }\n //If object in result has matching string \"Coming Soon\", do dateCountdownCrawler\n elseif (strpos($htmlString, '- Coming soon') !== false)\n {\n\t\t\t\t//Print out episode/object in result\n $comingSoonEpisode = $htmlString;\n\t\t\t\t//Call dateCountdownCrawler\n\t\t\t\tdateCountdownCrawler($dom,$xpath,$filterVar,$i,$comingSoonEpisode);\n }\n\t\telse\n\t\t{\n\t\t//print results\n\t\techo '<div class=\"customEpisodes\">';\n\t\techo $htmlString;\n\t\techo '</div>';\n\t\t}\n\t}\n}", "protected function _getElements() {\n // Get avatar\n $avatar = null;\n $this->_getAvatar($this->id)->then(function($url) use(&$avatar) {\n $avatar = $url;\n })->wait();\n // Get data\n return $this->_paginate('/search', [\n 'maxResults' => $this->per_page,\n 'channelId' => $this->id,\n 'part' => 'snippet',\n 'type' => 'video',\n 'order' => 'date',\n 'safeSearch' => $this->config['nsfw'] ? 'none' : 'strict'\n ], $avatar);\n }", "#[@generic(params= 'T[]', return= 'T[]')]\n public function filter($elements) {\n $filtered= array();\n foreach ($elements as $element) {\n if ($this->accept($element)) $filtered[]= $element;\n }\n return $filtered;\n }", "function getTitles($selector = '.search-result')\n\t{\n\t\t$titles = array();\n\t\tif(is_object($this->dom))\n\t\t{\n\t\t\t$containers = $this->dom->find($selector);\n\t\t\tforeach ($containers as $container)\n\t\t\t{\n\t\t\t\t$titles[] = $this->getTitle($container, true);\n\t\t\t}\n\t\t}\n\n\t\treturn $titles;\n\t}", "public function ajax()\n {\n if ($_POST['url'] != '' && $_POST['css'] != '') {\n $url = $_POST['url'];\n $css = $_POST['css'];\n\n $html = file_get_html($url);\n\n // If we get the empty array as a result, we can assume\n // that user inputed css selector does not exist\n // on the page, so we need to bail out!\n if ($html->find($css) == []) {\n return '<script>alert(\"No search results found with param: ' . $css . '\");</script>';\n }\n\n $render = '<div class=\"row\" id=\"innerWrap\">';\n\n foreach ($html->find($css) as $element) {\n\n $render .= $element->innertext . '<hr>';\n }\n\n $render .= '</div>';\n\n return $render;\n }\n\n return null;\n }", "function scan_page($content)\n{\n $tidy = new Tidy();\n $content = $tidy->repairString($content);\n $doc = new DOMDocument();\n $doc->loadHtml($content);\n $doc->normalizeDocument();\n\n $divs = $doc->getElementsByTagName('div');\n $length = $divs->length;\n $listing = array();\n\n for ($pos=0; $pos<$length; $pos++)\n {\n $node = $divs->item($pos);\n\n $class = $node->getAttribute('class');\n if ($class == \"sqdetailsDep trow\")\n $listing[] = scan_entry($node);\n }\n return $listing;\n\n}", "public function getChildren($selector = 'all') {\r\n\t\tif ($selector == 'all') return $this->children;\r\n\t\t$rslt = array();\r\n\t\t$attrs = $this->parseSelector($selector);\r\n\t\tforeach($this->children as $child) {\r\n\t\t\tif ($child->matchAttrs($attrs)) {\r\n\t\t\t\t$rslt[] = $child;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $rslt;\r\n\t}", "public static function filter_via_tag( $tag ) {\r\n\r\n\t\t\t$css_class = self::css_class_list();\r\n\r\n\t\t\t$filtered = array();\r\n\r\n\t\t\tif ( isset( $css_class[ $tag ] ) ) {\r\n\t\t\t\t$filtered = $css_class[ $tag ];\r\n\t\t\t}\r\n\r\n\t\t\treturn $filtered;\r\n\r\n\t\t}", "public function find($selector)\n\t{\n\t\t$expr = (new CssSelectorConverter())->toXPath($selector);\n\t\t\n\t\treturn $this->xpath($expr);\n\t}", "protected abstract function filter();", "protected function parse()\n {\n\n $crawler = new Crawler($this->originalHTML);\n\n $this->tableOfContents = $crawler->filter('body > nav')->html();\n $this->body = $crawler->filter('body > main')->html();\n\n $this->reformatTableOfContents();\n $this->reformatBody();\n }", "function filter($callback = null);", "public function getImages(){\n\t\t@$dom = new DOMDocument();\n\t\t@$dom->loadHTML($this->html);\n\t\t$dom->preserveWhiteSpace = false;\n\t\t\n\t\t// Create DOMXpath and get images\n\t\t$xpath = new DOMXpath($dom);\n\t\t$imgs = $xpath->query(\"//img\");\n\t\t\n\t\t// Return array\n\t\t$ret = array();\n\t\t\n\t\t// Loop results and return\n\t\tfor ($i = 0; $i < $imgs->length; $i++) {\n\t\t\t$img = $imgs->item($i);\n\t\t\t$src = $img->getAttribute(\"src\");\n\t\t\t\n\t\t\t// Make sure it's a complete URL\n\t\t\t$src = self::filterUrl($src);\n\t\t\tif($src === false) continue;\n\t\t\t\n\t\t\tarray_push($ret, $src);\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}", "protected function parseContent()\n {\n if (!empty($this->errors)) {\n return $this->getErrors();\n }\n\n try {\n $items = pq('tbody.itemWrapper');\n if ($items->html()) {\n return $this->parseV1Content();\n }\n return $this->parseV2Content();\n } catch (Exception $e) {\n $this->errors[] = $e;\n }\n }", "private function internalQuerySelectorAll($selector, $preferredLimit = null)\n {\n $walkChildren = function($element, $tagName, $callback) use (&$walkChildren) { // $walkChildren is a lot faster than $this->getElementsByTagName('*') for 300+ elements\n if ($tagName !== null) {\n $children = $element->getElementsByTagName($tagName);\n foreach ($children as $child) {\n if ($callback($child) === true) {\n return true;\n }\n }\n } else {\n foreach ($element->childNodes as $child) {\n if ($child instanceof \\DOMElement) {\n if ($callback($child) === true) {\n return true;\n }\n if ($walkChildren($child, $tagName, $callback) === true) {\n return true;\n }\n }\n }\n }\n };\n\n $getElementById = function($id, $tagName) use (&$walkChildren) {\n if ($this instanceof \\DOMDocument) {\n $element = $this->getElementById($id);\n if ($element && ($tagName === null || $element->tagName === $tagName)) {\n return $element;\n }\n } else {\n $foundElement = null;\n $walkChildren($this, $tagName, function($element) use ($id, &$foundElement) {\n if ($element->attributes->length > 0 && $element->getAttribute('id') === $id) {\n $foundElement = $element;\n return true;\n }\n });\n return $foundElement;\n }\n return null;\n };\n\n $matches = null;\n if ($selector === '*') { // all\n $result = [];\n $walkChildren($this, null, function($element) use (&$result, $preferredLimit) {\n $result[] = $element;\n if ($preferredLimit !== null && sizeof($result) >= $preferredLimit) {\n return true;\n }\n });\n return new \\IvoPetkov\\HTML5DOMNodeList($result);\n } elseif (preg_match('/^[a-z0-9\\-]+$/', $selector) === 1) { // tagname\n $result = [];\n $walkChildren($this, $selector, function($element) use (&$result, $preferredLimit) {\n $result[] = $element;\n if ($preferredLimit !== null && sizeof($result) >= $preferredLimit) {\n return true;\n }\n });\n return new \\IvoPetkov\\HTML5DOMNodeList($result);\n } elseif (preg_match('/^([a-z0-9\\-]*)(\\[.+\\])$/', $selector, $matches) === 1) { // tagname[target] or [target] // Available values for targets: attr, attr=\"value\", attr~=\"value\", attr|=\"value\", attr^=\"value\", attr$=\"value\", attr*=\"value\"\n $attributeSelectors = explode('][', substr($matches[2], 1, -1));\n foreach ($attributeSelectors as $i => $attributeSelector) {\n $attributeSelectorMatches = null;\n if (preg_match('/^(.+?)(=|~=|\\|=|\\^=|\\$=|\\*=)\\\"(.+)\\\"$/', $attributeSelector, $attributeSelectorMatches) === 1) {\n $attributeSelectors[$i] = [\n 'name' => $attributeSelectorMatches[1],\n 'value' => $attributeSelectorMatches[3],\n 'operator' => $attributeSelectorMatches[2]\n ];\n } else {\n $attributeSelectors[$i] = [\n 'name' => $attributeSelector\n ];\n }\n }\n $result = [];\n $tagName = strlen($matches[1]) > 0 ? $matches[1] : null;\n $walkChildren($this, $tagName, function($element) use (&$result, $preferredLimit, $attributeSelectors) {\n if ($element->attributes->length > 0) {\n foreach ($attributeSelectors as $attributeSelector) {\n $isMatch = false;\n $attributeValue = $element->getAttribute($attributeSelector['name']);\n if (isset($attributeSelector['value'])) {\n $valueToMatch = $attributeSelector['value'];\n switch ($attributeSelector['operator']) {\n case '=':\n if ($attributeValue === $valueToMatch) {\n $isMatch = true;\n }\n break;\n case '~=':\n $words = preg_split(\"/[\\s]+/\", $attributeValue);\n if (array_search($valueToMatch, $words) !== false) {\n $isMatch = true;\n }\n break;\n\n case '|=':\n if ($attributeValue === $valueToMatch || strpos($attributeValue, $valueToMatch . '-') === 0) {\n $isMatch = true;\n }\n break;\n\n case '^=':\n if (strpos($attributeValue, $valueToMatch) === 0) {\n $isMatch = true;\n }\n break;\n\n case '$=':\n if (substr($attributeValue, -strlen($valueToMatch)) === $valueToMatch) {\n $isMatch = true;\n }\n break;\n\n case '*=':\n if (strpos($attributeValue, $valueToMatch) !== false) {\n $isMatch = true;\n }\n break;\n }\n } else {\n if ($attributeValue !== '') {\n $isMatch = true;\n }\n }\n if (!$isMatch) {\n return;\n }\n }\n $result[] = $element;\n if ($preferredLimit !== null && sizeof($result) >= $preferredLimit) {\n return true;\n }\n }\n });\n return new \\IvoPetkov\\HTML5DOMNodeList($result);\n } elseif (preg_match('/^([a-z0-9\\-]*)#(.+)$/', $selector, $matches) === 1) { // tagname#id or #id\n $tagName = strlen($matches[1]) > 0 ? $matches[1] : null;\n $idSelector = $matches[2];\n $element = $getElementById($idSelector, $tagName);\n if ($element) {\n return new \\IvoPetkov\\HTML5DOMNodeList([$element]);\n }\n return new \\IvoPetkov\\HTML5DOMNodeList();\n } elseif (preg_match('/^([a-z0-9\\-]*)\\.(.+)$/', $selector, $matches) === 1) { // tagname.classname, .classname, tagname.classname.classname2, .classname.classname2\n $tagName = strlen($matches[1]) > 0 ? $matches[1] : null;\n $result = [];\n $classesSelector = explode('.', $matches[2]);\n if (!empty($classesSelector)) {\n $walkChildren($this, $tagName, function($element) use (&$result, $classesSelector, $preferredLimit) {\n if ($element->attributes->length > 0) {\n $classAttribute = $element->getAttribute('class');\n $allClassesFound = true;\n foreach ($classesSelector as $classSelector) {\n if (!($classAttribute === $classSelector || strpos($classAttribute, $classSelector . ' ') === 0 || substr($classAttribute, -(strlen($classSelector) + 1)) === ' ' . $classSelector || strpos($classAttribute, ' ' . $classSelector . ' ') !== false)) {\n $allClassesFound = false;\n break;\n }\n }\n if ($allClassesFound) {\n $result[] = $element;\n if ($preferredLimit !== null && sizeof($result) >= $preferredLimit) {\n return true;\n }\n }\n }\n });\n }\n return new \\IvoPetkov\\HTML5DOMNodeList($result);\n }\n throw new \\InvalidArgumentException('Unsupported selector (' . $selector . ')');\n }", "function tc_article_selectors() {\r\n \r\n //gets global vars\r\n global $post;\r\n global $wp_query;\r\n\r\n //declares selector var\r\n $selectors = '';\r\n\r\n // SINGLE POST\r\n $single_post_selector_bool = isset($post) && 'page' != $post -> post_type && 'attachment' != $post -> post_type && is_singular();\r\n $selectors = $single_post_selector_bool ? apply_filters( 'tc_single_post_selectors' ,'id=\"post-'.get_the_ID().'\" '.$this -> tc_get_post_class('row-fluid') ) : $selectors;\r\n\r\n // POST LIST\r\n $post_list_selector_bool = ( isset($post) && !is_singular() && !is_404() && !tc__f( '__is_home_empty') ) || ( is_search() && 0 != $wp_query -> post_count );\r\n $selectors = $post_list_selector_bool ? apply_filters( 'tc_post_list_selectors' , 'id=\"post-'.get_the_ID().'\" '.$this -> tc_get_post_class('row-fluid') ) : $selectors;\r\n\r\n // PAGE\r\n $page_selector_bool = isset($post) && 'page' == tc__f('__post_type') && is_singular() && !tc__f( '__is_home_empty');\r\n $selectors = $page_selector_bool ? apply_filters( 'tc_page_selectors' , 'id=\"page-'.get_the_ID().'\" '.$this -> tc_get_post_class('row-fluid') ) : $selectors;\r\n\r\n // ATTACHMENT\r\n //checks if attachement is image and add a selector\r\n $format_image = wp_attachment_is_image() ? 'format-image' : '';\r\n $selectors = ( isset($post) && 'attachment' == $post -> post_type && is_singular() ) ? apply_filters( 'tc_attachment_selectors' , 'id=\"post-'.get_the_ID().'\" '.$this -> tc_get_post_class(array('row-fluid', $format_image) ) ) : $selectors;\r\n\r\n // NO SEARCH RESULTS\r\n $selectors = ( is_search() && 0 == $wp_query -> post_count ) ? apply_filters( 'tc_no_results_selectors' , 'id=\"post-0\" class=\"post error404 no-results not-found row-fluid\"' ) : $selectors;\r\n\r\n // 404\r\n $selectors = is_404() ? apply_filters( 'tc_404_selectors' , 'id=\"post-0\" class=\"post error404 no-results not-found row-fluid\"' ) : $selectors;\r\n\r\n echo apply_filters( 'tc_article_selectors', $selectors );\r\n\r\n }", "function get_all_child_by_inner_html($inner_html,$exactly=false)\n\t{\t\t\n\t\t$params = array( \"inner_number\" => $this->inner_number , \"inner_html\" => $inner_html , \"exactly\" => $exactly );\n\t\t$child_inner_number=-1;\n\t\tif ($this->inner_number!=-1)\n\t\t\t$child_inner_number=$this->call_get(__FUNCTION__,$params);\n\t\treturn new XHEInterfaces($child_inner_number,$this->server,$this->password);\n\t}", "function tags_html($selector, $source = false)\r\n{\r\n\r\n //$r = get_noko($source)->get($selector)->toHtml();\r\n $r=array();\r\n $noko = get_noko($source);\r\n foreach ($noko->get($selector)->getNodes() as $tag) {\r\n $html = $tag->ownerDocument->saveXML($tag);\r\n $html = str_replace(array(\"\\n\", \"\\t\"), '', $html);\r\n if ($html=='<root/>') $html='';\r\n $html=close_tags($html);\r\n $r[] = $html;\r\n }\r\n if (DEV)\r\n xlogc('tags_html', $r, $selector, $source);\r\n\r\n return $r;\r\n}", "protected function get_links_from_filter($filter)\n {\n $results = [];\n foreach ($filter as $i => $content) {\n $content_crawler = new Crawler($content);\n $results[] = $content_crawler->filter('a')->attr('href');\n }\n return $results;\n }", "public static function get_more_results($html){\n # Clean HTML.\n $purifier = new HTMLPurifier();\n $clean_html = $purifier->purify($html);\n\n # Build a HTML parser to search for items.\n $dom = new Dom;\n $dom->load($clean_html);\n\n # Get result items from the HTML.\n $items = $dom->find(\".listing-item\");\n if(empty($items)){\n $results = [];\n }else{\n $results = static::parse_items($items);\n }\n $featured_items = $dom->find(\".featured-item\");\n if(!empty($featured_items)){\n $results = array_merge($results, static::parse_items($featured_items));\n }\n return $results;\n }", "public function testFindAllByClass(): void\n {\n $tree = new Soup('\n <a class=\"1\">Class 1.</a>\n <a class=\"2\">Class 2.</a>\n <b class=\"1\">Class 1.</b>\n <c class=\"3 4\">Class 3 and 4.</c>');\n\n $this->assertSelects(['Class 1.'], $tree->findAll('a', class: '1'));\n $this->assertSelects(['Class 3 and 4.'], $tree->findAll('c', class: '3'));\n $this->assertSelects(['Class 3 and 4.'], $tree->findAll('c', class: '4'));\n\n $this->assertSelects(['Class 1.'], $tree->findAll('a', '1'));\n $this->assertSelects(['Class 1.', 'Class 1.'], $tree->findAll(attrs: '1'));\n\n // TODO classなのでcontainsでマッチできるようにする必要がありそう。現状だと '3 4' じゃないとマッチングできない。\n // @*=\"xx\" or contains(@*, \"xx\") でよさげか\n // $this->assertSelects(['Class 3 and 4.'], $tree->findAll('c', '3'));\n // $this->assertSelects(['Class 3 and 4.'], $tree->findAll('c', '4'));\n }", "private function filterMarkdown($all) {\n foreach ($all as $value) {\n\n $value->comment = $this->textFilter->doFilter($value->comment, 'shortcode, markdown');\n }\n return $all;\n }", "public function getSelectorsBySpecificity($sSpecificitySearch = null) {\n\t\tif (is_numeric($sSpecificitySearch) || is_numeric($sSpecificitySearch[0])) {\n\t\t\t$sSpecificitySearch = \"== $sSpecificitySearch\";\n\t\t}\n\t\t$aResult = array();\n\t\t$this->allSelectors($aResult, $sSpecificitySearch);\n\t\treturn $aResult;\n\t}", "protected function parseHtml()\n\t{\n\t\t// parse the html to look for the h4 'have X in circles' element\n\t\tpreg_match('/<h4 class=\"nPQ0Mb pD8zNd\">(.*?)<\\/h4>/s', $this->html, $matches);\n\n\t\tif (isset($matches) && !empty($matches))\n\t\t{\n\t\t\t$count = $matches[1];\n\t\t\t$circles = preg_replace('/[^0-9_]/', '', $count);\n\t\t}\n\t\tif (empty($circles))\n\t\t{\n\t\t\t$circles = 0;\n\t\t}\n\n\t\t// parse the html for the user's name\n\t\tpreg_match('/<span class=\"fn\">(.*?)<\\/span>/s', $this->html, $matches);\n\t\t$name = $matches[1];\n\n\t\t// parse the html for the img div\n\t\tpreg_match('/<div class=\"k-Va-pc-N-A\">(.*?)<\\/div>/s', $this->html, $matches);\n\t\t$img_div = $matches[1];\n\t\t\n\t\t// parse the img div for the image src\n\t\tpreg_match('/< *img[^>]*src *= *[\"\\']?([^\"\\']*)/i', $img_div, $matches);\n\t\t$img = 'http:' . $matches[1];\n\n\t\t// put the data in an array\n\t\t$return = array('id' => $this->user_id, 'count' => $circles, 'name' => $name, 'img' => $img, 'url' => $this->url);\n\n\t\treturn $return;\n\t}", "private static function parseResponse($htmlBody)\n {\n\n $results = [];\n $raw_results = json_decode($htmlBody, true);\n \n foreach ($raw_results as $row) {\n if(is_array($row)){\n $result = new SearchResult();\n\n $result->setTorrentHash($row['torrent_hash']);\n $result->setName($row['title']);\n $result->setCategory($row['category']);\n $result->setLeechers($row['leechs']);\n $result->setSeeders($row['seeds']);\n $result->setSize($row['torrent_size']);\n\n $results[] = $result;\n }\n\n }\n\n return $results;\n }", "public function parse($html);", "public function parse($html);", "public function getElements();", "public abstract function get_html();", "function the_content_filter($content) {\n\t$block = join(\"|\",array(\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"columns\",\"columns_inside\",\"columns_inside2\",\"fullwidth\",\"header\",\"heading\",\"sec_color\",\"section\",\"emphasis\",\"info\",\"success\",\"error\",\"warning\",\"highlight\",\"quote\",\"one_half\",\"one_half_inside\",\"one_half_inside2\",\"one_third\",\"one_third_inside\",\"one_third_inside2\",\"one_fourth\",\"one_fourth_inside\",\"one_fourth_inside2\",\"two_third\",\"two_third_inside\",\"two_third_inside2\",\"three_fourth\",\"three_fourth_inside\",\"three_fourth_inside2\",\"services\",\"singleServices\",\"process\",\"staffs\",\"client\",\"clients\",\"carousel_slider\",\"contact\",\"progress\",\"content\",\"columns\",\"map\",\"icon50\",\"icon80\",\"icon190\",\"tab\",\"tab_content\",\"new_section\",\"intro_box\",\"tab_content\",\"tab\",\"accordions\",\"accordion\",\"toggle\",\"toggles\",\"icon\",\"pricing_tables\",\"pricing_column\",\"pricing_title\",\"pricing_price\",\"pricing_con\",\"pricing_row\",\"pricing_button\",\"googlemap_api\",\"google_map\",\"ul\",\"li\",\"chart\",\"animation\",\"icon_box\"));\n \n\t// opening tag\n\t$rep = preg_replace(\"/(<p>)?\\[($block)(\\s[^\\]]+)?\\](<\\/p>|<br \\/>)?/\",\"[$2$3]\",$content);\n\t// closing tag\n\t$rep = preg_replace(\"/(<p>)?\\[\\/($block)](<\\/p>|<br \\/>)?/\",\"[/$2]\",$rep);\n\treturn $rep;\n}", "function filterData(){\n $CI = & get_instance();\n $page = $CI->output->get_output();\n /* Creates a new DOMDocument and loads the HTML of the webpage. */\n $dom = new DOMDocument();\n $dom->loadHTML($page);\n /* Gets a list of all the <p> HTML elements and loops through them. */\n foreach($dom->getElementsByTagName('p') as $element)\n {\n /* If the class of the element is lead, it is modified. */\n if($element->getAttribute('class') == 'lead')\n {\n $temp = $element->textContent;\n $words = explode(' ', $temp);\n $inc = 0;\n foreach($words as $word){\n if(preg_match('/[.,!;?\"\\-_~]+/i', $word)){\n $punc = substr($word, 4, (strlen($word) - 4));\n if(!(preg_match('/^[a-z]/i', $punc))){\n if(!empty($punc)){\n $words[$inc] = \"****$punc\";\n }\n }\n }else if(preg_match('/^[a-z]{4}$/i', $word)){\n $words[$inc] = \"****\";\n }\n $inc++;\n }\n $fin = implode(\" \", $words);\n $element->textContent = $fin;\n }\n }\n echo $dom->saveHTML();\n die();\n }", "protected function findAll()\n {\n return ContainerPage::find()->contentContainer($this->contentContainer)->all();\n }", "function searchResults($results, $titlesOnly) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n{parse striping=\"searchStripe\" classes=\"row1,row2\"}\n<div id='search_results'>\n\t<ol>\n\t\t<if test=\"hasResults:|:is_array($results) && count($results)\">\n\t\t\t<foreach loop=\"results:$results as $result\">\n\t\t\t\t<if test=\"subResult:|:$result['sub']\">\n\t\t\t\t\t<li class='{parse striping=\"searchStripe\"} sub clearfix clear'>\n\t\t\t\t\t\t{$result['html']}\n\t\t\t\t\t</li>\n\t\t\t\t<else />\n\t\t\t\t\t<li class='{parse striping=\"searchStripe\"} clearfix clear'>\n\t\t\t\t\t\t{$result['html']}\n\t\t\t\t\t</li>\n\t\t\t\t</if>\n\t\t\t</foreach>\n\t\t</if>\n\t</ol>\n</div>\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}", "public function filter();", "public function selectorElements()\n {\n if ($this->isReference() && $this->getProject() !== null) {\n return $this->getRef($this->getProject())->selectorElements();\n }\n\n return $this->selectorsList;\n }", "private function getValidSelectors() {\n return [\n 'p' => '<p>',\n 'span' => '<span>',\n 'h1' => 'h1',\n 'h2' => 'h2',\n 'h3' => 'h3',\n 'h4' => 'h4',\n 'h5' => 'h5',\n 'h6' => 'h6',\n 'div' => '<div>',\n 'strong' => '<strong>',\n ];\n }", "function tags_text($selector, $source = false)\r\n{\r\n\r\n $r = array();\r\n foreach (nodes($selector, $source) as $node) {\r\n $text = trim(node_text($node));\r\n if (!$text) $text = $node->GetAttribute('content');\r\n if ($text) $r[] = $text;\r\n }\r\n\r\n if (DEV)\r\n xlogc('tags_text', $r, $selector, $source);\r\n\r\n return $r;\r\n}", "protected function elements()\n {\n $window = $this->getUrlWindow($this->onEachSide);\n\n return array_filter(array(\n $window['first'],\n is_array($window['slider']) ? '...' : null,\n $window['slider'],\n is_array($window['last']) ? '...' : null,\n $window['last'],\n ));\n }", "public function filtering();", "public function find()\n\t{\n\t\t$query = array_filter([\n\t\t\t'labelSelector' => $this->getLabelSelectorQuery(),\n\t\t\t'fieldSelector' => $this->getFieldSelectorQuery(),\n\t\t]);\n\n\t\tif ($this->beta) {\n\t\t\t$response = $this->client->sendBetaRequest('GET', '/' . $this->uri, $query, null, $this->namespace);\n\t\t} else {\n\t\t\t$response = $this->client->sendRequest('GET', '/' . $this->uri, $query, null, $this->namespace);\n\t\t}\n\n\t\t$this->resetParameters();\n\n\t\treturn $this->createCollection($response);\n\t}", "protected function _getFromCSS()\n {\n // styles to apply\n $styles = array();\n\n // list of the selectors to get in the CSS files\n $getit = array();\n\n // get the list of the selectors of each tags\n $lst = array();\n $lst[] = $this->value['id_lst'];\n for ($i=count($this->table)-1; $i>=0; $i--) {\n $lst[] = $this->table[$i]['id_lst'];\n }\n\n // foreach selectors in the CSS files, verify if it match with the list of selectors\n foreach ($this->cssKeys as $key => $num) {\n if ($this->_getReccursiveStyle($key, $lst)) {\n $getit[$key] = $num;\n }\n }\n\n // if we have selectors\n if (count($getit)) {\n // get them, but in the definition order, because of priority\n asort($getit);\n foreach ($getit as $key => $val) $styles = array_merge($styles, $this->css[$key]);\n }\n\n return $styles;\n }", "function findSkyscrapers($selector) {\n\n\t$validSorts = getValidSorts();\n\n\t// check if there is a valid 'sort' var in the GET variables\n\t$sort = sanitizer('name', input()->get('sort'));\n\n\t// if no valid sort, then use 'title' as a default\n\tif(!$sort || !isset($validSorts[$sort])) $sort = 'name';\n\n\t// whitelist the sort value so that it is retained in pagination\n\tif($sort != 'name') input()->whitelist('sort', $sort);\n\n\t// expand on the provided selector to limit it to 10 sorted skyscrapers\n\t$selector = \"template=skyscraper, limit=10, \" . trim($selector, \", \");\n\n\t// check if there are any keyword searches in the selector by looking for the presence of \n\t// ~= operator. if present, then omit the 'sort' param, since ProcessWire sorts by \n\t// relevance when no sort specified.\n\tif(strpos($selector, \"~=\") === false) $selector .= \", sort=$sort\";\n\n\t// now call upon ProcessWire to find the skyscrapers for us\n\t$skyscrapers = pages($selector);\n\n\t// save skyscrapers for possible display in a map\n\tmapSkyscrapers($skyscrapers);\n\n\treturn $skyscrapers;\n}", "public function getSelectors() {\n return $this->_selectors;\n }", "public function filter(callable $callback);", "public function select()\n {\n return curl_multi_select( $this->mh );\n }", "function callAll($arg) {\n\n $action = $this->action;\n\n $results = array();\n foreach ($this->filterPlugins($arg) as $plugin) {\n $results[] = $plugin->$action($arg);\n }\n\n return $results;\n\n }", "public function crawl()\n {\n if (!isset($this->date)) {\n return null;\n }\n\n $url = 'http://pt.euro-millions.com/resultados/'.date('d-m-Y', $this->date);\n $domDomcument = $this->getContentFrom($url, true);\n\n $numberWraperDomNode = $domDomcument->getElementById('jsBallOrderCell');\n $numbersDomNodes = $numberWraperDomNode->getElementsByTagName('li');\n\n $crawlResults = array(\n 'numbers' => array(),\n 'stars' => array(),\n );\n foreach ($numbersDomNodes as $key => $numberDomNode) {\n if ($key < 5) {\n $crawlResults['numbers'][] = $numberDomNode->nodeValue;\n } else {\n $crawlResults['stars'][] = $numberDomNode->nodeValue;\n }\n }\n\n $this->hasCrawled = true;\n\n return $crawlResults;\n }", "function mt_filter_the_content($content) {\n\t// $content = \"<div style='color: fuchsia;'>{$content}</div>\";\n\treturn $content;\n }", "function preview_theme_ob_filter_callback($matches)\n {\n }", "abstract public function scrape();", "public function extract($html): array\n {\n if (!$html instanceof Dom) {\n $this->dom->loadStr($html);\n }\n\n $fields_data = [];\n\n foreach ($this->config as $field_name => $field_config) {\n $fields_data[$field_name] = $this->extractSelector($field_config, $this->dom);\n }\n\n return $fields_data;\n }", "abstract function get_html();", "function html_element_as_array( $html ) {\n $dom = new \\DOMDocument( '1.0', 'UTF-8' );\n $dom->loadHTML( '<?xml encoding=\"utf-8\" ?>' . $html );\n return dom_node_to_array( $dom->getElementsByTagName('body')->item(0)->childNodes->item(0) );\n}", "public function ___find($selectors) {\n\t\treturn $this->getAll()->find($selectors); \n\t}", "function filterPlugins($arg) {\n\n $predicate = $this->filter;\n\n $results = array();\n foreach ($this->plugins as $plugin) {\n if ($plugin->$predicate($arg)) {\n $results[] = $plugin;\n }\n }\n\n return $results;\n\n }", "function elements()\n\t{\n\t\t$filenames = $this->getFilenames();\n\t\t\n\t\t$declaredClasses = array();\t\t\n\n\t\tforeach ($filenames as $filename)\n\t\t{\n\t\t\t$definedClasses = PHPUnitUtil::getDefinedClasses($filename, $this->classpath);\n\t\t\t\n\t\t\tforeach($definedClasses as $definedClass) {\n\t\t\t\t$this->project->log(\"(PHPUnit) Adding $definedClass (from $filename) to tests.\", Project::MSG_DEBUG);\n\t\t\t}\n\t\t\t\n\t\t\t$declaredClasses = array_merge($declaredClasses, $definedClasses);\n\t\t}\n\t\t\n\t\t$elements = array_filter($declaredClasses, array($this, \"filterTests\"));\n\n\t\treturn $elements;\n\t}", "public function elements()\n {\n return [\n '@element' => '#selector',\n ];\n }", "public function elements()\n {\n return [\n '@element' => '#selector',\n ];\n }", "public function elements()\n {\n return [\n '@element' => '#selector',\n ];\n }", "public function elements()\n {\n return [\n '@element' => '#selector',\n ];\n }", "public function select(One_Scheme $scheme, array $selectors = array())\n\t{\n\t\treturn array();\n\t}", "public function testElementMatchingWithMultipleClasses()\n {\n $mock = Mockery::mock('ZafBoxRequest');\n\n $test_result = new stdClass;\n $test_result->status_code = 200;\n $test_result->body = '<html><body><h1 class=\"active hover\">Some Text</h1></body></html>';\n $mock->shouldReceive('get')->andReturn($test_result);\n\n // set the requests object to be our stub\n IoC::instance('requests', $mock);\n\n $tester = IoC::resolve('tester');\n\n $result = $tester->test('element', 'http://dhwebco.com', array(\n 'tag' => 'h1',\n 'attributes' => array(\n 'class' => 'hover',\n ),\n ));\n\n $this->assertTrue($result);\n }", "function scrap_me($url, $xpath_query = '//div/table/tr/td')\n\t{\n\t\t$html = file_get_contents($url);\n\t\t$scrapme_doc = new DOMDocument();\n\t\t$result = [];\n\n\t\tlibxml_use_internal_errors(TRUE);\n\n\t\tif(!empty($html))\n\t\t{\n\t\t\t$scrapme_doc->loadHTML($html);\n\t\t\tlibxml_clear_errors();\n\n\t\t\t$scrapme_xpath = new DOMXPath($scrapme_doc);\n\t\t\t$scrapme_row = $scrapme_xpath->query($xpath_query);\n\n\t\t\tif($scrapme_row->length > 0)\n\t\t\t{\n\t\t\t\tforeach($scrapme_row as $row)\n\t\t\t\t\t$result[] = preg_replace('/\\s+/', ' ', utf8_decode($row->nodeValue));\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "private function _finish($html) {\n $contents = $this->_defaultContentArray;\n\n if (preg_match('@\\[cakepress_http_status code=\"(.+)\"\\]@msiU', $html, $matches))\n $contents['http_status_code'] = $matches[1];\n\n if ($this->cleanOutput) {\n $contents['body'] = $html;\n } else {\n // Load the DOM_Query class, first looking in the usual Composer locations (for either standard and Bedrock layouts). \n // Sadly the composer autoloader doesn't work here.\n $loader_path = dirname(__FILE__) . '/vendor/rkaiser0324/dom-query/vendor/Loader.php';\n if (!file_exists($loader_path))\n $loader_path = ABSPATH . '/../../vendor/rkaiser0324/dom-query/vendor/Loader.php';\n $loader_path = apply_filters('cakepress_dom_query_loader_path', $loader_path);\n if (!file_exists($loader_path))\n throw new exception(\"Cannot load rkaiser0324/dom-query/vendor/Loader.php. Ensure the cakepress_dom_query_loader_path filter is set properly.\");\n \n require $loader_path;\n \\Loader::init(array(dirname($loader_path)), false);\n\n $H = new \\PowerTools\\DOM_Query($html);\n\n // Get elements within head\n $contents['head'] = $this->_parseHead($H);\n\n // Get the body\n // This avoids mangling HTML by auto-closing <div>s - a big no-no \n $body = $H->select('body');\n $body_inner_html = preg_replace('@<body(.*)>(.+)</body>@msiU', '$2', $body->DOM->saveHTML($body->nodes[0]));\n $contents['body'] = $body_inner_html;\n if (WP_DEBUG)\n $contents['body'] = sprintf('<!-- CakePress start -->%s<!-- CakePress end -->', $contents['body']);\n }\n return $contents;\n }", "abstract public function filters();", "abstract public function filter(string $className): Closure;", "static public function SelectAll()\n {\n }", "public function read(): array\n {\n // TODO should use VOs instead of strings\n return array_map(fn (string $html): array => $this->parser->parse($html), $this->downloader->readHtml());\n }", "function getTables($selector = '.rptTable')\n\t{\n\t\t$tables = array();\n\t\tif(is_object($this->dom))\n\t\t{\n\t\t\t$contentTables = $this->dom->find($selector);\n\t\t\tforeach ($contentTables as $table)\n\t\t\t{\n\t\t\t\t$tables[] = $table->children();\n\t\t\t}\n\t\t}\n\n\t\treturn $tables ? $tables : array();\n\t}", "private function parsehtml()\n\t{\n\t\t$html = $this->getUrl($this->url);\n\t\t$dom = new \\DOMDocument();\n\t\t@$dom->loadHTML($html);\n\t\t// discard white space\n\t\t$dom->preserveWhiteSpace = false;\n\t\t\n\t\t// get the div with id=\"moviemeter\" which includes the movies\n\t\t$movies = $dom->getElementById(\"moviemeter\");\n\t\tif(!$movies)\n\t\t\treturn null;\n\t\t\n\t\t$charts = [];\n\t\tforeach ($movies->getElementsByTagName(\"div\") as $div) \n\t\t{\n\t\t\t$array = explode(\"#\", $div->nodeValue);\n\t\t\t\t\t\n\t\t\tif(is_array($array) && count($array) == 2)\n\t\t\t{\n\t\t\t\t// get rank\n\t\t\t\t$rank = trim(substr($array[1], 0, 3));\n\t\t\n\t\t\t\t//get was\n\t\t\t\tif( preg_match( '!\\(([^\\)]+)\\)!', $array[1], $match ) )\n\t \t\t\t$was = $match[1];\n\t \t\t\n\t\t\t\t$charts[$rank] = [\"title\"=>trim($array[0]), \"was\"=>$was, \"rank\"=>$rank];\n\t\t\t}\n\t\t}\n\t\tforeach ($charts as $key => $value) \n\t\t\t$temp[$key] = $value[\"rank\"];\n\t\t\n\t\t// sort by rank\n\t\tarray_multisort($temp, SORT_ASC, $charts);\n\n\t\t// return the top <limit>\n\t\treturn array_slice($charts, 0, $this->limit);\t\n\t}", "public function elements()\n {\n return [\n //'@element' => '#selector',\n ];\n }", "protected function createResults($data) {\n if (parent::createResults($data) === null) return null;\n\n // Providing any selector would do the job. We provide a selector, because we want the method to work properly\n // The method does not work if there is no selector. Hence, we just provide a selector. Although the selector\n // has no effect, providing \"html\" as selector is logical because we want the HTML to be output as result.\n return $this->createHtmlManipulationResults($this->url, $this->content, \"html\", $this->getMessageLastPart());\n }", "public function filter(callable $callback = null): Sequence;", "protected function parse_selectors($crawler, $selectors)\n {\n $result = [];\n foreach ($selectors as $name => $selector) {\n if (empty($selector))\n continue;\n\n list($bucket, $key) = explode('.', $name);\n if (!array_key_exists($bucket, $result))\n $result[$bucket] = [];\n\n $attr = false;\n $regex = false;\n if (is_array($selector) && count($selector) == 3) {\n list($selector, $attr, $regex) = $selector;\n } elseif (is_array($selector) && count($selector) == 2) {\n list($selector, $attr) = $selector;\n }\n\n $value = $this->get_selector_text($crawler, $selector, $regex, $attr);\n $result[$bucket][$key] = $value;\n }\n\n return $result;\n }", "public function getDoanhNghiep()\n {\n $number = 102;\n// $client = new \\Goutte\\Client();\n// $crawler = $client->request('GET', 'https://www.lazada.vn/dien-thoai-di-dong/?spm=a2o4n.home.cate_1.1.19056afeWLyiaY');\n// $crawler->filter('div.cpF1IH ul.ant-pagination li');\n// var_dump(($crawler->filter('div.cpF1IH ul.ant-pagination li')));\n// exit;\n \n// $crawler->filter('div.c3gNPq ul li')->each(\n// \n// function (Crawler $node) {\n// var_dump($node->filter('a')->text());\n// exit;\n// }\n// );\n $this->getDoanhNghiepByPage();\n for($i=2;$i<=$number;$i++){\n $this->getPhoneLazadaByPage($i);\n }\n \n }", "private function extractTitlesFromBlockbusterHTML($html){\n\t\t$matches = array();\n\t\tpreg_match_all('/<div[^>]+class\\s*=\\s*(\"|\\')title(\"|\\')[^>]*><a[^>]*>([^<]+)/m', $html, $matches);\n\t\t$titles = isset($matches[3]) ? $matches[3] : array();\n\t\t\n\t\t$titles = array_filter($titles, \n\t\t\tcreate_function('$var', \n\t\t\t\t'return !(strcmp($var, \"Title\") == 0 || strcmp($var, \"Movie Title\") == 0);')\n\t\t);\n\n\t\t$parsedTitles = array();\n\t\tforeach($titles as $title){\n\t\t\t$year = '';\n\t\t\t$parsedTitle = html_entity_decode(preg_replace('/\\[[^\\]]*]/', '', $title));\n\t\t\t\n\t\t\tif(preg_match('/(.*?)( \\(\\d{4}\\))/', $parsedTitle, $secondaryMatches)){\n\t\t\t\t$year = $secondaryMatches[2];\n\t\t\t\t$parsedTitle = $secondaryMatches[1];\n\t\t\t}\n\t\t\t\n\t\t\t$parsedTitles[] = array('title' => $parsedTitle, 'year' => $year);\n\t\t}\n\t\t\n//\t\t$this->log('Extracted titles: ' . print_r($parsedTitles, true), LOG_DEBUG);\n\t\treturn $parsedTitles;\n\t}", "public static function css2xpath($selector) {\r\n $selector_chunks = preg_split('/(?<!\\\\\\\\)\\s+/',$selector);\r\n $xpath_parts = array();\r\n foreach ($selector_chunks as $selector_chunk) {\r\n $selector_chunk = str_replace(',',' | //',$selector_chunk);\r\n # .class or #id (without tagname)\r\n $selector_chunk = preg_replace('/^([\\W])\\w/','*$0',$selector_chunk);\r\n # [name] or [name=value]\r\n $selector_chunk = preg_replace('/\\[(.+?(\\=.+?)?)\\]/','[@$1]',$selector_chunk);\r\n # .class\r\n $selector_chunk = preg_replace('/\\.([\\w-]+)/','[contains(concat(\" \",normalize-space(@class),\" \"),\" $1 \")]',$selector_chunk);\r\n # #id\r\n $selector_chunk = preg_replace('/^([\\w\\-]*)\\#([\\w\\-]+)/','$1[@id=\"$2\"]$3',$selector_chunk);\r\n # :eq(n)\r\n $selector_chunk = preg_replace_callback('/\\:eq\\((\\d+)\\)/',function($matches) { return \"[\".($matches[1]+1).\"]\"; },$selector_chunk);\r\n # :first\r\n $selector_chunk = preg_replace('/\\:first/','[1]',$selector_chunk);\r\n $selector_chunk = preg_replace('/\\:last/','[last()]',$selector_chunk);\r\n $selector_chunk = preg_replace_callback('/\\:gt\\((\\d+)\\)/',function($matches) { return \"[position()>\".($matches[1]+1).\"]\"; },$selector_chunk);\r\n $selector_chunk = preg_replace_callback('/\\:lt\\((\\d+)\\)/',function($matches) { return \"[position()<\".($matches[1]+1).\"]\"; },$selector_chunk);\r\n $selector_chunk = str_replace(\"\\\\ \",\" \",$selector_chunk);\r\n $selector_chunk = preg_replace('/\\:contains\\((.+)\\)/','[contains(.,$1)]',$selector_chunk);\r\n $xpath_parts[] = $selector_chunk;\r\n }\r\n\r\n $xpath = array(\"/\");\r\n foreach ($xpath_parts as $i=>$xpath_part) {\r\n if ($i>0) {\r\n if ($xpath_part==\">\") {\r\n continue;\r\n }\r\n if ($xpath_parts[$i-1]!=\">\") {\r\n $xpath_part = \"/$xpath_part\";\r\n }\r\n //echo $xpath_parts[$i-1].\" - \".$xpath_part.\"<br />\";\r\n }\r\n $xpath[] = $xpath_part;\r\n }\r\n $xpath = implode(\"/\",$xpath);\r\n //add_debug::var_dump($xpath);\r\n return $xpath;\r\n }", "public function filter($value) \n {\n return $this->cleanHtml($value);\n }", "public function filtrationElements(){\n foreach(self::getElements() as $key=>$items){\n if(\n NULL!==$items->getFilters() &&\n is_array($items->getFilters()) &&\n count($items->getFilters())\n ){\n self::filtrationElement($items);\n }\n \n }\n }", "public static function select($node, $query) {\n $nodes = array();\n $p = new CSSParser($node, $query);\n $nodes = $p->parse();\n return $nodes;\n }", "function getFeaturedArtists($dom) {\n $feat = $dom->find('div.featured_artists',0);\n $artists = array();\n if ($feat != NULL && sizeof($feat) > 0) {\n foreach($feat->find('a') as $artist) {\n $artists[] = $artist->plaintext;\n }\n }\n return $artists;\n}", "function getFeaturedArtists($dom) {\n $feat = $dom->find('div.featured_artists',0);\n $artists = array();\n if ($feat != NULL && sizeof($feat) > 0) {\n foreach($feat->find('a') as $artist) {\n $artists[] = $artist->plaintext;\n }\n }\n return $artists;\n}", "public function parsePage($html){\n\t\t\tforeach($html->find(Configuration::getParameter(\"TAG_CLASS\")) as $become) {\n\t\t\t\tif($become->getAttribute(\"scope\") == \"\"){\n\t\t\t\t\tif($become->getAttribute(\"method\") != \"\"){\n\t\t\t\t\t\t$template = $become->innertext;\n\t\t\t\t\t\tif($template != \"\")\n\t\t\t\t\t\t\t@ $become->outertext = call_user_func(Array($this, $become->getAttribute(\"method\")), $template);\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\t@ $become->outertext = call_user_func(Array($this, $become->getAttribute(\"method\")));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$template = $become->innertext;\n\t\t\t\t\tif($template != \"\")\n\t\t\t\t\t\t@ $become->outertext = call_user_func(Array($become->getAttribute(\"scope\"), $become->getAttribute(\"method\")), $template);\n\t\t\t\t\telse \n\t\t\t\t\t\t@ $become->outertext = call_user_func(Array($become->getAttribute(\"scope\"), $become->getAttribute(\"method\")));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $html;\n\t\t}", "public function scrape()\r\n {\r\n $data = array();\r\n $crawler = $this->getCrawler();\r\n foreach($this->keys as $name=>$path) {\r\n $result = $crawler->filterXPath($path);\r\n if ($result->count() > 0 ) {\r\n if ($result->attr('content') != null) {\r\n $data[$name] = $result->attr('content');\r\n } else {\r\n $data[$name] = $result->text();\r\n }\r\n }\r\n }\r\n\r\n $data['Model'] = $this->calculateModel($data);\r\n return $data;\r\n }" ]
[ "0.55005926", "0.5419678", "0.5393824", "0.52582014", "0.52054507", "0.516394", "0.50932014", "0.504576", "0.49866563", "0.49652475", "0.4918719", "0.49032167", "0.48923963", "0.48456004", "0.48378077", "0.48273998", "0.4817447", "0.48169622", "0.48013112", "0.47999", "0.47938672", "0.47736353", "0.47615564", "0.47435895", "0.4728467", "0.4694509", "0.46908036", "0.46890455", "0.46784422", "0.46741933", "0.4665218", "0.46603358", "0.46574795", "0.46485347", "0.46237624", "0.46203002", "0.46077597", "0.4605425", "0.45939857", "0.45703194", "0.45457464", "0.45429778", "0.45429778", "0.4538324", "0.45322907", "0.45280766", "0.4512986", "0.45112404", "0.4508346", "0.4502545", "0.44951597", "0.44926715", "0.4492534", "0.4480615", "0.44673035", "0.44665322", "0.4466354", "0.44577014", "0.4449278", "0.4448589", "0.44389325", "0.44379777", "0.44327086", "0.44318843", "0.44313303", "0.4428112", "0.44213906", "0.4407972", "0.4401581", "0.4397206", "0.4395144", "0.4394633", "0.43849382", "0.43849382", "0.43849382", "0.43849382", "0.43799222", "0.43776768", "0.4377477", "0.4373175", "0.43715754", "0.4361675", "0.4360896", "0.435829", "0.43471432", "0.4345067", "0.43433172", "0.43429226", "0.43384713", "0.4327723", "0.43257648", "0.43249267", "0.43192044", "0.43130636", "0.43091363", "0.4309085", "0.43005905", "0.43005905", "0.42941377", "0.4293991" ]
0.6283644
0
this function will check whether in this context, user can perform edit action
public function canEditContest($iContestId, $iUserId = 0) { if(!Phpfox::isUser()) { return false; } if(!$iUserId) { return false; } $aContest = Phpfox::getService('contest.contest')->getContestForCheckingPermission($iContestId); if(!$aContest) { return false; } // no way to edit a Contest in uneditable status if(in_array($aContest['contest_status'], Phpfox::getService('contest.constant')->getUneditableStatus())) { return false; } // if he is the owner and he has permission to edit his own Contest if(($iUserId == $aContest['user_id'] && Phpfox::getUserParam('contest.edit_own_contest')) || Phpfox::getUserParam('contest.edit_user_contest')) { return true; } return false; // // page owner is a big BOSS // if ($aContest['module_id'] == 'pages' && Phpfox::getService('pages')->isAdmin($aContest['item_id'])) // { // return true; // } // return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function canEdit() {}", "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 can_edit() {\n return true;\n }", "function canEdit() {\n\t\t\treturn true;\n\t\t}", "public function canEdit()\n {\n return true;\n }", "abstract function allowEditAction();", "public function getUserCanEditAttribute()\n {\n return AccessControl::check($this, 'edit_post', false);\n }", "function canEdit() {\r\n\t\tif($this->owner->ID == Member::currentUserID())\r\n\t\t\treturn true;\r\n\r\n\t\t$member = Member::currentUser();\r\n\t\tif($member)\r\n\t\t\treturn $member->isAdmin();\r\n\r\n\t\treturn false;\r\n\t}", "public function isEditAction() {}", "public function canEdit()\n {\n return $this->is_locked == 0;\n }", "public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }", "function canEdit() {\r\n\t\t$user\t=& JFactory::getUser();\r\n\r\n\t\tif (!JAccess::check($user->id, 'core.admin', 'root.1')) {\r\n\t\t\t\t$permission = FlexicontentHelperPerm::getPerm();\r\n\t\t\t\t$id = $this->getState($this->getName().'.id');\r\n\t\t\t\tif ($id) {\r\n\t\t\t\t\t$rights \t= FlexicontentHelperPerm::checkAllItemAccess($uid, 'item', $id);\r\n\t\t\t\t\t$canEdit \t= in_array('flexicontent.editall', $rights) || $permission->CanEdit;\r\n\t\t\t\t\t$canEditOwn\t= (in_array('flexicontent.editown', $rights) && ($item->created_by == $user->id));\r\n\t\t\t\t\tif ($canEdit || $canEditOwn) return true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "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 }", "public function canEdit() {\n\t\treturn $this->_perms->checkModuleItem ( $this->_tbl_module, 'edit' );\n\t}", "abstract public function canEdit($user_guid = 0);", "public function isEditOnlyMode();", "public function is_editing() {\n\n\t\tif ( 'edit' !== Param::get( 'action' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn Param::get( 'redirection', false, FILTER_VALIDATE_INT );\n\t}", "function userCanEditPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageEdit(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}", "public function can_edit() {\n\t\t$can_edit = false;\n\t\t\n\t\t// is the user the owner of the package and the package is in edit mode?\n\t\tif ( ($this->get_user_id() == get_current_user_id()) && ($this->status == 1) ) {\n\t\t\t$can_edit = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_edit_other_packages' ) ) {\n\t\t\t\t$can_edit = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_edit;\n\t}", "function user_can_edit_user($user_id, $other_user)\n {\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 eman_can_edit( $post, $user_id=false )\n{\n\t/**\n\t * If you can't view this post, then you can't edit it...\n\t */\n\tif ( ! eman_can_view($post, $user_id) ) return false;\n\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! is_object($post) ) return false;\n\tif ( ! $user_id ) $user_id = get_current_user_id();\n\t$user = get_user_by('id', $user_id);\n\t$status = emanager_post::status($post, 'slug');\n\t$bic_userlogin = emanager_bic::get_bic($post, 'user_login');\n\n\t/**\n\t * Test if user has capability to edit\n\t */\n\n\t// Issues have different criteria\n\tif ( 'em_issue' == $post->post_type )\n\t{\n\t\t// Original author\n\t\tif ( emanager_post::is_author($post) || emanager_post::same_company_as_post($post) || eman_check_role('turner') ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// PCO Request exception for allowances. Allow user to edit if in their court and status is before sent to owner.\n\tif ( 'em_noc' == $post->post_type )\n\t{\n\t\tif (($bic_userlogin === $user->user_login) && in_array($status, array('draft','manager','ready'))) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (eman_check_role('turner') && in_array($status, array('draft'))) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// If the post is editable\n\tif ( eman_post_editable($post) )\n\t{\n\t\t// Original author\n\t\tif ( emanager_post::is_author($post) ) {\n\t\t\treturn true;\n\t\t}\n\t\t// Same company as original author\n\t\telseif ( emanager_post::same_company_as_post($post) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "public function isEditable()\n\t{\n\t\tif(Auth::check())\n\t\t{\n\t\t\tif(Auth::user()->id == $this->author_id)\n\t\t\t{\n\t\t\t\tif ($this->created_at->diffInMinutes(Carbon::now()) < 30)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(Auth::user()->hasRole(['moderator', 'administrator', 'super user'])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function canBeEdited() {}", "public function getCanEditAttribute()\n {\n // Are you the owner if the note?\n return Auth::id() == $this->user_id;\n }", "function auth_can_edit_user($user, $target)\n{\n global $min_user_editing_level;\n \n // Always allowed to modify your own stuff\n if(strcasecmp($user, $target) == 0)\n {\n return 1;\n }\n\n if(authGetUserLevel($user) >= $min_user_editing_level)\n {\n return 1;\n }\n\n // Unathorised access\n return 0;\n}", "private function allowModify()\n { \n if($this->viewVar['loggedUserRole'] <= 40 )\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "public function is_allowed_to_edit_content_object()\n {\n return $this->is_allowed(WeblcmsRights::EDIT_RIGHT, $this->publication) &&\n $this->publication->get_allow_collaboration();\n }", "protected function allowEdit($data = array(), $key = 'id')\n\t{\n\t\treturn JFactory::getUser()->authorise('core.manage', $this->option);\n\t}", "function canEdit(User $user) {\n return $user->isFinancialManager();\n }", "public function isEditable()\n\t{\n\t\tif (($this->getName() === 'publicid') || ($this->getName() === 'posturl')) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "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 authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}", "function caldol_can_edit_file($authorID){\n\tglobal $current_user;\n\n\t\n\t//echo $current_user->ID. \", \" . $post->post_author;\n\tif($current_user->ID == $authorID || current_user_can('edit_others_posts')){\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }", "public function canBeEdited()\n {\n return false;\n }", "public function isFrontendEditingActive() {}", "protected function check_edit_permission($comment)\n {\n }", "function canEditPage(Page $page) {\n return ($this->isAdmin() || ($this->id == $page->getCreatorId()));\n }", "public function canEdit($userId) {\n\t\t$aCat = TeamCategory::read($this->getCategory());\n\t\treturn ($this->getAdmin() == $userId or $aCat->getUser() == $userId);\n\t}", "function canEdit($user) {\n if($user->getId() == $this->getId()) {\n return true; // user can change his own account\n } // if\n\n return $user->isCompanyManager($this->getCompany());\n }", "public function canEdit($user = null)\n {\n if (!$user = Auth::getUser()) {\n return false;\n }\n\n return $this->user_id == $user->id;\n }", "function can_do_edit() {\n // ends\n $association_id = $this->required_param('association_id', PARAM_INT);\n $record = new clustertrack($association_id);\n $clusterid = $record->clusterid;\n $trackid = $record->trackid;\n\n return clusterpage::_has_capability('block/curr_admin:associate', $clusterid)\n && trackpage::_has_capability('block/curr_admin:associate', $trackid);\n }", "public function isSwitchToEditEnabled();", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Lof_Outlet::outlet_edit');\n }", "function CheckEditAccess($item=array())\n {\n return $this->CheckShowAccess($item);\n }", "public function can_object2_edit_object1() {\n\t\tif ( $this->object2->can_user_edit( $this->object1->get_wp_id() ) )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "protected function isFrontendEditActive() {}", "protected function isFrontendEditActive() {}", "public function canEdit($member = null) {\n\t\treturn false;\n\t}", "public function edit()\n {\n return Auth::check();\n }", "public function canEdit($member = null) {\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }", "static function has_edit_screen(): bool { return true; }", "protected function allowEdit($data=array(),$key='id'){\n return parent::allowEdit($data=array(),$key='id');\n /*\n $user=JFactory::getUser();\n $recordId=(int)isset($data[$key])?$data[$key]:0;\n $categoryId=0;\n\n if($recordId){\n $categoryId=(int)$this->getModel()->getItem($recordId)->catid;\n }\n\n if($categoryId){\n // The category has been set. Check the category permissions.\n return $user->authorise('core.edit',$this->option.'.category.'.$categoryId);\n }else{\n // Since there is no asset tracking, revert to the component permissions.\n return parent::allowEdit($data,$key);\n }\n */\n }", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "function canEdit($user) {\n return $user->isCompanyManager($this);\n }", "function user_can_edit_post($user_id, $post_id, $blog_id = 1)\n {\n }", "public function canEdit($userId)\n {\n return ($userId > 0) && ($this->user_id == $userId);\n }", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}", "protected function allowEdit($data = array(), $key = 'a_id')\n\t{\n\t\treturn true;\n\t}", "public function can_object1_edit_object2() {\n\t\tif ( $this->object1->can_user_edit( $this->object2->get_wp_id() ) )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "protected function is_edit_page() {\n\t\treturn false;\n\t}", "public static function edit($id){\n return Auth::check() && Auth::user()->id == $id;\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }", "public function edit(User $user)\n {\n return $user->hasPermission('user-edit');\n }", "function canEditPost(Post $post) {\n return ($this->isAdmin() || ($this->id == $post->getCreatorId()));\n }", "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 authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }", "public function authorize()\n {\n return $this->user()->canUpdateSecurity();\n }", "public function can_edit($userID = '') {\n\t\t\t$order = SalesOrder::load($this->orderno);\n\t\t\treturn $order->can_edit($userID);\n\t\t}", "public function isAuthorized($user)\n{\n if (in_array($this->request->action,['postjob','apply','posted','applied','getjob'])) {\n return true;\n }\n // The owner of an job can edit and delete it\n if (in_array($this->request->action, ['edit', 'delete'])) {\n $jobId = (int)$this->request->params['pass'][0];\n if ($this->Jobs->isOwnedBy($jobId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}", "public function edit(User $user)\n {\n return $user->role->can_edit_post == 1;\n }", "function field_edit($name)\r\n {\r\n if (right::superuser()) return (true);\r\n \r\n $rightArray = right::get_field($name);\r\n $userRight = right::get(\"rights\");\r\n\r\n if ($rightArray[edit]) return($userRight & $rightArray[edit]);\r\n else return(false); // default no edit\r\n }", "protected function allowEdit($data = array(), $key = 'id')\n {\n return true;\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\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 isEditable() {}", "public function isAuthorized($user) {\n if ($this->action === 'add') {\n return true;\n }\n\n // The owner of a post can edit and delete it\n if (in_array($this->action, array('edit', 'delete'))) {\n $presupuestoId = $this->request->params['pass'][0];\n if ($this->Post->isOwnedBy($presupuestoId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}", "public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }", "public function canEdit()\n {\n if ($this->isOptionsUpdated()) {\n return true;\n }\n if (!$this->getRequisitionListProduct()) {\n return false;\n }\n\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n return $this->productChangesAvailabilityChecker->isProductEditable($product);\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }", "public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }", "public function canEdit($member = null) {\n if (!$member)\n $member = Member::currentUser();\n\n if ($member->ID == $this->OwnerID || Permission::check('CMS_ACCESS_CMSMain', 'any', $member)) {\n return true;\n }\n\n return false;\n }", "public function is_editable() {\n\t\treturn false;\n\t}", "function can_do_bulkedit() {\n $id = $this->required_param('id');\n return cmclasspage::_has_capability('block/curr_admin:track:enrol', $id);\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 return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }", "public function edit($id)\n {\n \n $editAblePost=Post::find($id);\n // if(Gate::allows('edit-post',$editAblePost)){\n // return view('posts.edit',compact('editAblePost'));\n // }\n \n if(auth::user()->can('update',$editAblePost)){\n\n return view('posts.edit',compact('editAblePost'));\n\n }\n else{\n\n return redirect('posts')->with(['msgClass'=>'alert-danger',\"message\"=>\"You are not allowed to edit this post\"]);\n\n }\n\n\n\n\n }", "public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }", "public function isEditable(User $u){\n\t\t\tif( $u->id == $this->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}", "public function authorize()\n {\n return $this->user()->can('update_users');\n }", "public function authorize(): bool\n {\n return $this->user()->can('update_contact');\n }", "function eman_post_editable( $post )\n{\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! is_object($post) ) return false;\n\n\t// Settings area always editable\n\tif ( emanager_post::is_settings($post) ) return true;\n\n\t$status = emanager_post::status($post, 'slug');\n\n\t// If no status yet or is in draft or revise, it is editable\n\tif ( 'draft' == $status || 'revise' == $status ) return true;\n\n\treturn false;\n}", "function EditOwnSettings()\n\t{\n\t\tif ($this->Admin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->editownsettings;\n\t}", "protected function canEdit(Model $model)\n {\n return true;\n }", "public function canEdit($election = null) {\n\t\tif(empty($election)) {\n\t\t\treturn $this->user['isAdmin'];\n\t\t}\n\t\tif($this->user['isSuperAdmin']) {\n\t\t\treturn true;\n\t\t}\n\t\treturn $election['userID'] == $this->user['userID'];\n\t}", "public function authorize()\n {\n return $this->user()->hasPermission('update-title');\n }", "public function authorize()\n {\n return (\\Auth::user()->hasRole('admin')) || (\\Auth::user()->hasRole('editor')) || \\Auth::user()->canDo('UPDATE_POLLS');\n }", "private function isEditMode(){\n\t\tif(isset($this->AddRecordInsertData) and count($this->AddRecordInsertData) > 0 )\n\t\t\treturn true;\n\t\treturn false;\n\t}", "protected function allowEdit($data = array(), $key = 'id')\n\t\t{\n\t\t\t\t// Check specific edit permission then general edit permission.\n\t\t\t\treturn JFactory::getUser()->authorise('core.edit', 'com_helloworld.message.' . ((int) isset($data[$key]) ? $data[$key] : 0)) or parent::allowEdit($data, $key);\n\t\t}", "public function _addOrEdit() {\n\t\tif($this->getRequest()->getParam('id')) { return true; } else { return false; }\n\t}" ]
[ "0.8721974", "0.82822216", "0.82467526", "0.804492", "0.80428416", "0.80101234", "0.80065876", "0.79710704", "0.7946323", "0.7837917", "0.78118604", "0.7730594", "0.7674492", "0.75978494", "0.7586931", "0.7571168", "0.74990517", "0.74599916", "0.7420578", "0.7404507", "0.7351051", "0.7282049", "0.7255578", "0.72475874", "0.72474605", "0.71754456", "0.71727604", "0.7161217", "0.71375537", "0.7134163", "0.71235335", "0.7102523", "0.7070994", "0.7068364", "0.7059026", "0.7056571", "0.7049303", "0.70405126", "0.70295763", "0.70225286", "0.701259", "0.69980973", "0.69916344", "0.69879633", "0.69818205", "0.6977458", "0.6973514", "0.69695777", "0.69695777", "0.69660914", "0.69595367", "0.6955858", "0.6947601", "0.6945647", "0.69451064", "0.69410104", "0.6927211", "0.69194114", "0.691019", "0.69098324", "0.6909046", "0.6903223", "0.689588", "0.68754715", "0.6871878", "0.686899", "0.68646675", "0.6863604", "0.6862651", "0.6842401", "0.6831313", "0.6827667", "0.6827138", "0.6823761", "0.68233216", "0.68186295", "0.68084574", "0.6801659", "0.67976236", "0.6795896", "0.67919004", "0.67872465", "0.67554855", "0.67432594", "0.6741148", "0.6740251", "0.6733942", "0.6728218", "0.67172605", "0.67127216", "0.6712168", "0.6711769", "0.6709266", "0.67091185", "0.6704377", "0.6694242", "0.6688096", "0.6682389", "0.6674331", "0.66672355", "0.66658807" ]
0.0
-1
Return a raw query for further data extraction
function query($sql, $arguments = null) { $query = $this->connection->prepare($sql); try { $query->execute($arguments); } catch (Exception $ex) { throw new Exception($ex->getMessage() . " \n" . $sql); } return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function get_query();", "public function rawQuery($query);", "public function getQuery(): string {\n\t\t// Store previous output before changing to temp\n\t\t$output = $this->get('output');\n\t\t\n\t\ttry {\n\t\t\t$this->set('output', SqlAdapter::SQL_QUERY);\n\t\t\t$result = $this->run();\n\t\t} finally {\n\t\t\t$this->set('output', $output);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function getQuery()\n {\n $query = 'SELECT ';\n $query .= implode(', ', $this->select) . ' ';\n $query .= \"FROM $this->kind \";\n \n if ( ! empty($this->where) )\n {\n $query .= \"WHERE $this->where \";\n }\n \n if ( ! empty($this->groupBy) )\n {\n $query .= \"GROUP BY $this->groupBy \";\n }\n \n if ( ! empty($this->orderBy) )\n {\n $query .= \"ORDER BY $this->orderBy $this->orderByDirection \";\n }\n \n if ( $this->limit !== null )\n {\n $query .= \"LIMIT $this->limit \";\n }\n \n if ( $this->offset !== null )\n {\n $query .= \"OFFSET $this->offset\";\n }\n \n return trim($query);\n }", "public function Query(){\r\n\t\treturn self::get_query();\r\n\t}", "public function getQuery(){\n $sql = \"select %s from %s %s %s %s %s %s\";\n\n return sprintf($sql, $this->param, $this->table,\n empty($this->join) ? '' : implode($this->join),\n empty($this->where) ? '' : 'where '. $this->where,\n empty($this->having)? '' : 'having '. $this->having,\n empty($this->order) ? '' : 'order by '. $this->order,\n empty($this->setOperations) ? '' : implode($this->setOperations)\n );\n }", "abstract public function queryRaw($q);", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function toQuery();", "public static function get_query()\n\t{\n\t\treturn self::new_instance_records()->get_query();\n\t}", "private function createBaseQuery(): string\n {\n // Prefix the table columns with 'entries.'\n $tableColumns = array_map(function ($column) {\n return 'entries.' . $column;\n }, self::TABLE_COLUMNS);\n\n if ($this->listView) {\n // Filter out the properties that are not available to the listview\n $jsonColumns = array_filter($this->properties, function (Collection\\Property $property) {\n return $property->getIncludeInJsonListView();\n });\n }\n\n // Create the select syntax for the json data column\n $jsonColumns = array_map(function (Collection\\Property $property) {\n return $this->jsonUnquote($property->getIdentifier()) . ' AS `' . $property->getIdentifier() . '`';\n }, $jsonColumns ?? $this->properties);\n\n // Merge both of the above\n $columns = array_merge($tableColumns, $jsonColumns);\n\n // Create the select statement\n $select = implode(', ', $columns);\n\n // Create the query\n // We need the entries.data to be able to perform a HAVING query on it, when parsing the entry, the DATA object is removed\n return 'SELECT entries.data, ' . $select . ' FROM collection_entries AS entries WHERE entries.collection_id = :collection_id AND entries.active = 1 ';\n }", "private function query() {\n return ApplicationSql::query($this->_select, $this->_table, $this->_join, $this->_where, $this->_order, $this->_group, $this->_limit, $this->_offset);\n }", "public function get_query(){\n return $this->build_query()->query;\n }", "abstract function getSQL();", "abstract protected function buildQuery(): string;", "public static function toRAW()\n {\n $query = self::$query;\n self::$query = \"\";\n self::$where = false;\n self::$bindParams = array();\n return $query;\n }", "private function getQuery()\n {\n return $this->connection->table($this->table);\n }", "public abstract function getQuery();", "function rawQuery ($sql)\n\t{\n\t\t$clauses = array('RAW' => $sql);\n\t\treturn new Db_Query_Mysql($this, Db_Query::TYPE_RAW, $clauses);\n\t}", "public function getQuerySql() {\n $sql = parent::getQuerySql();\n $connection = $this->model->getMeta()->getConnection();\n\n return $this->parseVariablesIntoSql($sql, $connection);\n }", "public function getSQL();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "function runQuery()\n\t{\n\t\treturn $this->query;\n\t}", "public function generateQuery(): string\n {\n $query = $this->template;\n $query = str_replace('{{columns}}', $this->generateColumns(), $query);\n $query = str_replace('{{pagination}}', $this->generatePagination(), $query);\n $query = str_replace('{{tables}}', $this->generateTables(), $query);\n $matches = [];\n $i = preg_match('/{{where(\\|([a-zA-Z .,\\-]*))?}}/', $query, $matches);\n if ($i) {\n $prepend = $matches[2] ?? null;\n $query = str_replace($matches[0], $this->generateWhere($prepend), $query);\n }\n $i = preg_match('/{{sort(\\|([a-zA-Z .,\\-]*))?}}/', $query, $matches);\n if ($i) {\n $prepend = $matches[2] ?? null;\n $query = str_replace($matches[0], $this->generateSort($prepend), $query);\n }\n return $query;\n }", "function createQuery() ;", "public function getquery(){\n\t\treturn $this->query;\n\t}", "public function query()\n {\n return $this->_query;\n }", "abstract public function\r\n\t\tget_query_for_something();", "function buildQuery(){\n\t\t$r = ($this->fieldName == \"\") ? \"SELECT * FROM \" . $this->tableName . \";\" : \"SELECT * FROM \" . $this->tableName . \" WHERE \" . $this->fieldName . \" = \" . $this->fieldValue . \";\";\n\t\t//print \"executing $r <br/>\";\n\t\treturn $r;\n\t}", "public function getQuery() {}", "public function getQuery() {}", "public static function query();", "public function getQuery(): string\r\n {\r\n return $this->query;\r\n }", "private function getSumoQuery() {\n $query = file_get_contents(__DIR__ . '/query.txt');\n $query = strtr($query, [\n '[site_realm]' => $this->profile->getSiteRealm(),\n '[site_short_name]' => $this->profile->getSiteShortName()\n ]);\n $query = trim(preg_replace('/\\s\\s+/', ' ', $query));\n $query = str_replace([\"\\n\", \"\\r\"], ' ', $query);\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Sumologic query: {$query}\");\n }\n return $query;\n }", "public function query(): string;", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "function query()\n\t{\n\t\treturn $this->query;\n\t}", "public function build_query(/* ... */)\n {\n $query = [\"SELECT\"];\n $model = $this->get_model();\n // Field selection\n $fields = [];\n foreach ($this->_fields as $_field) {\n $fields[] = $this->_build_select_field($_field);\n }\n $query[] = implode(', ', $fields);\n // Table Selection\n $query[] = 'FROM';\n $query[] = '`' . $model->get_table() . '`';\n // WHERE lookup\n $query[] = $this->build_where();\n if (null !== $this->_orderby) {\n $query[] = $this->_orderby;\n }\n if (null !== $this->_limit) {\n $query[] = $this->_limit;\n }\n return $model->get_connection()->prepare(implode(\" \", $query));\n }", "public function getQuery()\n {\n return $this->get(self::_QUERY);\n }", "protected function _getQuery()\n {\n return $this->_queryFactory->get();\n }", "public function getQUERY()\n {\n return $this->QUERY;\n }", "abstract protected function getQuery();", "public function getQuery() {\n return $this->query;\n }", "public function getQuery()\r\n\t{\r\n\t\treturn $this->query;\r\n\t}", "protected function genQuery(){\n $secretKey = $this->store->getSecretAccessKey();\n \n unset($this->options['Signature']);\n $this->options['Timestamp'] = $this->genTime();\n $this->options['Signature'] = $this->_signParameters($this->options, $secretKey);\n return $this->_getParametersAsString($this->options);\n }", "protected function getQuery()\n {\n return $this->connection->table($this->table);\n }", "public function getQuery()\r\n {\r\n return $this->db->table(self::TABLE);\r\n }", "final public static function toSQL()\n {\n $select = false;\n foreach (self::$starts as $reserved) {\n if (strpos(self::$query, $reserved . ' ') === 0) {\n $select = true;\n break;\n }\n }\n\n if (!$select) {\n self::$query = \"SELECT * FROM \" . self::tableName() . self::$query;\n }\n\n\n $values = [];\n for ($i = 0; $i < sizeof(self::$bindParams); $i++) {\n foreach (self::$bindParams[$i] as $item) {\n $values[] = $item;\n }\n }\n\n if (sizeof($values) > 0) {\n $query = self::$query;\n self::$query = \"\";\n self::$where = false;\n self::$bindParams = array();\n $query = str_replace(\"?\", \"#%s#\", $query);\n $query = sprintf($query, ...$values);\n $query = str_replace(\"#\", \"'\", $query);\n return sprintf($query, ...$values);\n }\n return self::$query;\n }", "public function getQuery(){\n \n return $this->query;\n \n }", "public function getQuery()\n {\n return $this->db->table(self::TABLE);\n }", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "public static function getQuery()\n {\n return self::$__query;\n }", "public function getQuery()\n\t{\n\t\treturn $this->query;\n\t}", "public function query() {\n\t\treturn Documents::instance()->query();\n\t}", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function get()\n {\n $query = $this->getForString();\n $query .= $this->getInnerExpressionsString();\n $query .= $this->getSortString();\n $query .= $this->getLimitString();\n $query .= $this->getReturnString();\n return $query;\n }", "protected function getQuery()\n {\n return $this->connection->table(\n $this->config['table']\n );\n }", "public function getSQL() {\n return $this->_connection->processQuery($this, true);\n }", "public function rawQuery($sql){\n\n\t\t$queried_rep_repository = $this->rep_repository->get_database_utils()->rawQuery($sql);\n\n\t\tif($this->build == \"eng-build\"){\n\t\t\treturn $this->query_eng_build($queried_rep_repository);\n\t\t}\n\t\tif($this->build == \"user-build\"){\n\t\t\treturn $this->query_user_build($queried_rep_repository);\n\t\t}\n\t}", "public function getQuery() {\n return $this->query;\n }", "public function readAllQuery(): string\n {\n return 'SELECT * FROM products';\n }", "public function query();", "public function query();", "public function query();", "protected function getQuery()\n {\n return self::$_query;\n }", "function query() {}", "public function __toString(): string\n {\n $this->buildQuery();\n return $this->query;\n }", "function getQuery() ;", "public function buildQuery() {\n\t\t$where = (sizeof($this->wheres) > 0) ? ' WHERE '.implode(\" \\n AND \\n\\t\", $this->wheres) : '';\n\t\t$order = (sizeof($this->orders) > 0) ? ' ORDER BY '.implode(\", \", $this->orders) : '' ;\n\t\t$group = (sizeof($this->groups) > 0) ? ' GROUP BY '.implode(\", \", $this->groups) : '' ;\n\t\t$query = 'SELECT '.implode(\", \\n\\t\", $this->fields).\"\\n FROM \\n\\t\".$this->class->table.\"\\n \".implode(\"\\n \", $this->joins).$where.' '.$group.' '.$order.' '.$this->limit;\n\t\treturn($query);\n\t}", "public function data() {\n\t\treturn $this->query;\n\t}", "public function sql() {\n\t\t$sqlT = \\lulo\\twig\\TwigTemplate::factoryHtmlResource(\\lulo\\query\\Query::PATH . \"/select/query.twig.sql\");\n\t\treturn $sqlT->render([\"query\" => $this]);\n\t}", "public function getQuery()\n {\n return $this->_query;\n }", "public function getQuery(): string\n {\n return (string) $this->query;\n }", "public function createQuery()\n\t{\n\t\t$this->tab[] = $this->action;\n\t\t$this->tab[] = !is_array($this->field) ? $this->field : join(', ',$this->field);\n\t\t$this->tab[] = ' FROM '.$this->from;\n\t\tif(!empty($this->where)){$this->tab[] = 'WHERE '.$this->where;}\n\t\tif(!empty($this->and)){$this->tab[] = 'AND '.$this->and;}\n\t\tif(!empty($this->or)){$this->tab[] = 'OR '.$this->or;}\n\t\tif(!empty($this->in)){$this->tab[] = 'IN '.$this->in;}\n\t\tif(!empty($this->beetween)){$this->tab[] = 'BEETWEEN '.$this->beetween;}\n\t\tif(!empty($this->not)){$this->tab[] = 'NOT '.$this->not;}\n\t\tif(!empty($this->like)){$this->tab[] = 'LIKE '.$this->like;}\n\t\tif(!empty($this->order)){$this->tab[] = 'ORDER BY '.$this->order;}\n\t\treturn join(\" \",$this->tab);\n\t}" ]
[ "0.7516332", "0.73904306", "0.72637755", "0.72450346", "0.71253395", "0.70575446", "0.70334584", "0.7026673", "0.7026673", "0.7026673", "0.7026673", "0.7026673", "0.7026673", "0.7026673", "0.7026673", "0.7026673", "0.7012429", "0.6961094", "0.6948483", "0.69324744", "0.6920075", "0.6909545", "0.6839832", "0.683263", "0.6817252", "0.6809461", "0.68010867", "0.6782018", "0.67701393", "0.6758043", "0.6758043", "0.6758043", "0.6758043", "0.6758043", "0.6758043", "0.6758043", "0.6758043", "0.6758043", "0.6744707", "0.6726334", "0.6725302", "0.6696241", "0.6681872", "0.6671166", "0.66512483", "0.6650234", "0.6650234", "0.6644252", "0.6641416", "0.66357803", "0.6635489", "0.662854", "0.662854", "0.662854", "0.66220623", "0.6616297", "0.6611335", "0.6610271", "0.66100496", "0.6605482", "0.6593397", "0.6578526", "0.6577466", "0.65723735", "0.65544045", "0.6540039", "0.6520416", "0.651642", "0.6515511", "0.65129375", "0.651075", "0.6504133", "0.6503771", "0.6503771", "0.6503771", "0.6503771", "0.6503771", "0.6503771", "0.6503771", "0.6503771", "0.6503771", "0.6503771", "0.64944905", "0.64924103", "0.6484288", "0.6483614", "0.6481143", "0.64800197", "0.6472891", "0.6472891", "0.6472891", "0.6471457", "0.64636993", "0.6445653", "0.64365876", "0.6434075", "0.6426786", "0.64247173", "0.6423074", "0.6404096", "0.6400797" ]
0.0
-1
Return an array of associative arrays
function query_array($sql, $parameters = null) { $query = $this->query($sql, $parameters); return $query->fetchAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray() {\r\n return $this->associativeArray();\r\n }", "public function toAssociativeArray() {\n // TODO\n }", "public function toAssociativeArray() {\n // TODO\n }", "abstract public function toAssoc(): array;", "public function toArray()\n\t{\n\t\t$array = array();\n\n\t\tforeach ($this as $key => $value)\n\t\t{\n\t\t\t$array[$key] = $value;\n\t\t}\n\n\t\treturn $array;\n\t}", "public function toArray() {\n\t\t$array = array();\n\n\t\tforeach($this as $k => $v) {\n\t\t\t$array[$k] = $v;\n\t\t}\n\n\t\treturn $array;\n\t}", "public function toArray() {\n $array = array();\n\n $this->each(function($key, $value) use (&$array) {\n $array[$key] = $value;\n });\n\n return $array;\n }", "public function as_assoc();", "public function toArray() {\n $data = [];\n foreach ($this->config as $field => $c) {\n $data[$field] = $this->get($field);\n }\n return $data;\n }", "public function toArray() : array\n {\n return [\n 'Key' => $this->m_key,\n 'Value' => $this->m_value,\n ];\n }", "public function toArray() {\n\t\t\t$result = array();\n\t\t\tforeach (array_keys(static::$_fields) as $key) {\n\t\t\t\t$result[$key] = $this->getData($key);\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "public function toArray()\n {\n $array = [];\n $data = $this->_data;\n foreach ($data as $key => $value) {\n if ($value instanceof Zend_Config) {\n $array[$key] = $value->toArray();\n } else {\n $array[$key] = $value;\n }\n }\n return $array;\n }", "function to_array() \n {\n $d = array();\n $d[\"vocab\"] = $this->vocab;\n $d[\"meta_name\"] = $this->meta_name;\n $d[\"text\"] = $this->text;\n $d[\"lang\"] = $this->lang;\n foreach($this->attrs as $key => $value) {\n $d[$key] = $value;\n }\n return $d;\n }", "function toArray()\n {\n $retorno = array();\n foreach ($this as $key => $value) {\n array_push($retorno, $value);\n }\n return $retorno;\n }", "public function toArray()\n {\n $a = [];\n if (($e = $this->first) != null) {\n do {\n $key = $e->getKey();\n $value = $e->getValue();\n $a[$key] = $value;\n } while (($e = $e->next) != null);\n }\n return $a;\n }", "public function associative()\n\t{\n\t\t$sSQL\t\t= \"SELECT collection, name, value FROM \" . $this->table . \" WHERE _active=1 ORDER BY collection, name\";\n\t\t\n\t\t$this->oDB->query( $sSQL );\n\t\t\n\t\t$aResult\t= $this->oDB->result();\n\n\t\tforeach( $aResult as $sKey => $vValue )\n\t\t{\n\t\t\t$aTmp[ $vValue[ \"collection\" ] ][ $vValue[ \"name\" ] ]\t= $vValue[ \"value\" ];\n\t\t}\n\t\t\n\t\treturn $aTmp;\n\t}", "public function toArray() {\n return $this->keysMap->toArray();\n }", "public function toArray()\n {\n $returnArr = [];\n\n $this->attributes->each(function($attribute) use (&$returnArr){\n /* @var ConfigurationAttribute $attribute **/\n $returnArr[$attribute->getName()] = $attribute->getValue();\n });\n\n return $returnArr;\n }", "public function toArray() {\n return\n [\n 'Key' => $this->getKey(),\n 'Value' => $this->getValue()\n ];\n }", "private function ToArray()\n {\n $array = [];\n foreach($this as $k => $v)\n {\n $array[$k] = $v;\n }\n return $array;\n }", "function data_from_ASSOC() {\n\t$dbh = db_connect(); #DATABASE CONNEXION\n\n\t// SQL - REQ -------------------------------------------\n\t$stmt = $dbh->query('SELECT ID, SAMPLE_ID, ARTIST_ID FROM SAMPLES_ARTISTS');\n\n\t// ENREGISTREMENT DES DONNÉES DANS UN ARRAY\n\t$assoc = [];\n\twhile ($data = $stmt->fetch()) {\n\t\tarray_push($assoc, ['ID' => $data['ID'], 'SAMPLE_ID' => $data['SAMPLE_ID'], 'ARTIST_ID' => $data['ARTIST_ID']]);\n\t}\n\n\treturn $assoc;\n}", "public function to_array() {\n\t\t$config = array();\n\t\t\n\t\tforeach( $this->sections as $id => $section ) {\n\t\t\t$config[$id] = $section->to_array();\n\t\t}\n\t\t\n\t\treturn $config;\n\t}", "public function toArray(): array\n {\n return [\n 'key' => $this->type,\n 'values' => $this->values,\n 'opt_type' => $this->logic,\n ];\n }", "public function toArray()\n\t{\n\t\t$data = [];\n\t\tforeach ($this->settings() as $setting) {\n\t\t\t$data[$setting->key()] = $setting->value();\n\t\t}\n\t\treturn $data;\n\t}", "function getAdditionalValuesAsArray() {\n\t\t$values = parent::getAdditionalValuesAsArray ();\n\t\t$tables = array_keys ($this->owner);\n\t\t$values ['owner'] = Array ();\n\t\tforeach ($tables as $table) {\n\t\t\tforeach ($this->owner [$table] as $id) {\n\t\t\t\t$values ['owner'] [$table] [$id] = $id;\n\t\t\t}\n\t\t}\n\t\t$values ['headerstyle'] = $this->row ['headerstyle'];\n\t\t$values ['bodystyle'] = $this->row ['bodystyle'];\n\t\treturn $values;\n\t}", "public function getKeysAndValues() {\n return array(\n array('key', 'key', 'value'),\n array('KEY', 'key', 'value'),\n array('Some_key', 'some-key', 'value'),\n array('SOME-KEY', 'some-key', 'value'),\n );\n }", "public function asArray()\n\t{\n\t\t$fields = [\n\t\t\t'@type' => $this->type(),\n\t\t\t'@key' => $this->key()\n\t\t];\n\n\t\tforeach ($this->fields as $name => $field)\n\t\t{\n\t\t\t$fields[$name] = $field->value;\n\t\t}\n\n\t\treturn $fields;\n\t}", "public function collectAsKeyValue(): array {\n\t\t$result = [];\n\t\tforeach ($this as [$key, $value]) {\n\t\t\t$result[$key] = $value;\n\t\t}\n\t\treturn $result;\n\t}", "function toArray()\n {\n $ary = array('name' => $this->_name, 'identifier' => $this->_identifier);\n if (count($this->indexes) > 0) {\n $ary['indexes'] = $this->indexes;\n }\n return $ary;\n }", "public function toArray()\n {\n $a = parent::toArray();\n if ($this->accounts) {\n $ab = array();\n foreach ($this->accounts as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['accounts'] = $ab;\n }\n if ($this->addresses) {\n $ab = array();\n foreach ($this->addresses as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['addresses'] = $ab;\n }\n if ($this->emails) {\n $ab = array();\n foreach ($this->emails as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['emails'] = $ab;\n }\n if ($this->homepage) {\n $a[\"homepage\"] = $this->homepage->toArray();\n }\n if ($this->identifiers) {\n $ab = array();\n foreach ($this->identifiers as $i => $x) {\n $ab[$i] = array();\n foreach ($x as $j => $y) {\n $ab[$i][$j] = $y->getValue();\n }\n }\n $a['identifiers'] = $ab;\n }\n if ($this->names) {\n $ab = array();\n foreach ($this->names as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['names'] = $ab;\n }\n if ($this->openid) {\n $a[\"openid\"] = $this->openid->toArray();\n }\n if ($this->phones) {\n $ab = array();\n foreach ($this->phones as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['phones'] = $ab;\n }\n return $a;\n }", "public function toArray()\n {\n $_data = array();\n \n foreach ($this->_data as $key=>$val) {\n $_data[$key] = method_exists($val, 'toArray') ? $val->toArray() : $val;\n }\n \n return $_data;\n }", "public function toArray(): array\n {\n $config = [];\n\n if ($this->config->has('key')) {\n $config['key'] = $this->getKey();\n } else {\n $config['key'] = Key::generate($this->getKey(), 'field');\n }\n\n if ($this->config->has('conditional_logic')) {\n $config['conditional_logic'] = $this->getConditionalLogic();\n }\n\n if ($this->config->has('layouts')) {\n $config['layouts'] = $this->getLayouts();\n }\n\n if ($this->config->has('sub_fields')) {\n $config['sub_fields'] = $this->getSubFields();\n }\n\n return array_merge($this->config->toArray(), $config);\n }", "public function toArray(): array\n {\n $values = array_map(function ($value) {\n return $value instanceof static ? $value->toArray() : $value;\n }, $this->values(), $this->keys());\n\n return array_combine($this->keys(), $values);\n }", "public function toArray(): array\n\t{\n\t\t$values = [];\n\n\t\tforeach ((array) $this as $key => $value) {\n\t\t\t// Private and protected properties have ugly array key prefixes which we remove\n\t\t\t$key = preg_replace('~^.+\\0~', '', $key);\n\t\t\t$values[$key] = $value;\n\t\t}\n\n\t\treturn $values;\n\t}", "public function toArray() {\n\t\treturn array(\n\t\t\t'name' => $this->config['name'],\n\t\t\t'hops' => $this->config['hops'],\n\t\t\t'prices' => $this->prices\n\t\t);\n\t}", "public function toArray() {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = array();\n\t\t\t\n\t\t\t// Build Array\n\t\t\tforeach($this->_data as $entry) {\n\t\t\t\tforeach($entry as $key => $value) {\n\t\t\t\t\tif(get_class($value) == 'Bedrock\\\\Common\\\\DataFormat\\\\YAML') {\n\t\t\t\t\t\t$result[] = array($key => $value->toArray());\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$result[] = array($key => $value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Common\\DataFormat\\Exception('A problem was encountered while attempting to generate an array.');\n\t\t}\n\t}", "public function toArray($prefix='') {\n $r = array();\n foreach($this as $field => $data) {\n if(! is_object($data) && ! is_array($data)) {\n $r[$field] = $data;\n }\n }\n return $r;\n }", "public function as_array() {\n\t\t$result = array(\n\t\t\t'id' \t\t\t\t => $this->_id,\n\t\t\t'country_id' \t => $this->_country_id,\n\t\t\t'name' \t\t\t\t => $this->_name,\n\t\t\t'code' \t\t\t => $this->_code,\n\t\t\t'tax' \t\t\t\t => $this->_tax,\n\t\t);\n\t\treturn $result;\n\t}", "public function asArray() {\n\t\treturn $this->_sth->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function getDataAsAssociativeArray()\n\t\t{\n\t\t\t$csv = array();\n foreach($this->csvData as $row)\n {\n \t$csv[] = array_combine($this->csvHeaders, $row);\n }\n\n\t\t\treturn $csv;\n\t\t}", "public function associativeArray() {\r\n\r\n if ($this->object->loadRule()) {\r\n $crud = $this->myCRUD();\r\n return $crud->associativeArrayFromEncapsuledObject($this->object);\r\n } else {\r\n return false;\r\n }\r\n }", "function to_array() {\r\n\t\t$out = array();\r\n\t\t\r\n\t\tforeach($this->input as $item) {\r\n\t\t\t$out[$item['name']] = $item['value'];\r\n\t\t}\r\n\t\t\r\n\t\treturn $out;\r\n\t}", "public function toArray() {\n\t\treturn array(\n\t\t\tself::FIELD_CODI_ESPECTACLE=>$this->getCodiEspectacle(),\n\t\t\tself::FIELD_DATA=>$this->getData(),\n\t\t\tself::FIELD_HORA=>$this->getHora());\n\t}", "private function arrayify(): array\n {\n return $this->toArray();\n }", "function getDataArray( $contentObjectattribute )\n {\n $cv = eZContentObjectVersion::fetchVersion( $contentObjectattribute->attribute( 'version' ), $contentObjectattribute->attribute( 'contentobject_id' ) );\n $data_map = $cv->attribute( 'data_map' );\n \n $ini = eZINI::instance( 'content.ini' );\n $key_map = $ini->variable( 'GISSettings', 'attributes' );\n $keys = array_keys( $key_map );\n \n foreach ( $keys as $key )\n {\n if ( is_object( $data_map[$key] ) )\n $return[$key_map[$key]] = $data_map[$key]->content();\n }\n return $return;\n }", "public function toArray(): array\n {\n return [\n 'accessKey' => $this->accessKey,\n 'customerId' => $this->customerId,\n 'storeId' => $this->storeId,\n 'loanTypeId' => $this->loanTypeId,\n 'loanApplication' => [\n 'FundingType' => $this->fundingType,\n 'Amount' => $this->amount,\n 'PromotionalCode' => $this->promotionalCode,\n ],\n ];\n }", "public function GetArray(): array\n {\n return array('mac' => $this->GetMac(), 'name' => $this->GetName());\n }", "public function toArray() {\n\t\t$data\t= array(\n\t\t\t'hash'\t\t=> $this->getHash(),\n\t\t\t'dims'\t\t=> $this->dims,\n\t\t\t'measures'\t=> $this->measures\n\t\t);\n\n\t\tif (!is_null($this->time)){\n\t\t\t$data['time']\t= $this->time;\n\t\t}\n\n\t\treturn $data;\n\t}", "public function toArray() {\n $attrs = $this->_private_attributes;\n $result = array();\n foreach ($attrs as $key => $attr) {\n if (method_exists($this, \"get\" . underscore_to_camel_case($key, true))) {\n eval('$result[\"' . $key . '\"] = $this->get' . underscore_to_camel_case($key, true) . '();');\n } else {\n $result[$key] = $attr;\n }\n }\n return $result;\n }", "private function toArray()\n {\n \treturn array(\n \t\t'Locus'\t\t\t\t=> $this->getLoucs(),\n \t\t'Length'\t\t\t=> $this->getLength(),\n \t\t'Strandedness'\t\t=> $this->getStrandedness(),\n \t\t'mulType'\t\t\t=> $this->getMulType(),\n \t\t'Topology'\t\t\t=> $this->getTopology(),\n \t\t'PriAccession'\t\t=> $this->getPriAccession(),\n \t\t'AccessionVersion'\t=> $this->getAccessionVersion(),\n \t\t'OtherSeqIds'\t\t=> $this->getOtherSeqIds(),\n \t\t'Organism'\t\t\t=> $this->getOrganism(),\n \t\t'Taxonomy'\t\t\t=> $this->getTaxonomy(),\n \t\t'Source'\t\t\t=> $this->getSource(),\n \t\t'Refferences'\t\t=> $this->getRefs(),\n \t\t'Comment'\t\t\t=> $this->getComment(),\n \t\t'Features'\t\t\t=> $this->getFeatures(),\n \t\t'Sequence'\t\t\t=> $this->getSequence()\n \t);\n }", "public function getArray(): array\n {\n $output = [];\n foreach (get_object_vars($this) as $key => $value) {\n $output[$key] = gettype($value) === 'object' ? $value->getArray() : $value;\n }\n return $output;\n }", "public function toArray(): array\n {\n return array_values($this->internalMap);\n }", "private function to_array() {\n\t\t$values = array(\n\t\t\t'id' => $this -> id,\n\t\t\t'name' => $this -> name);\n\t\treturn $values;\n\t}", "public function all(): array\n {\n return collect($this->getKeys())\n ->mapWithKeys(fn (string $key) => [$key => $this->get($key)])\n ->toArray();\n }", "public function toArrayProviders()\n\t{\n\t\t$ret = array();\n\t\t$vars = $this->getVars();\n\t\tforeach (array_keys($vars) as $var) {\n\t\t\t$ret[$var] = $this->getVar('{$var}');\n\t\t}\n\t\treturn $ret;\n\t}", "public function toArray()\n {\n $return = array();\n foreach ( $this as $property => $value ) {\n if ( '__' == substr( $property, 0, 2 ) || '' === $value || is_null( $value ) || ( is_array( $value ) && empty( $value ) ) ) {\n continue;\n }\n $return[ $property ] = $value;\n }\n\n return $return;\n }", "public function toArray(): array\r\n {\r\n return array(\r\n \"id\" => (int)$this->ID,\r\n \"hash\" => $this->Hash,\r\n \"dltc_results\" => $this->DLTC_Results,\r\n \"cld_results\" => $this->CLD_Results,\r\n \"ld_results\" => $this->LD_Results,\r\n \"last_updated\" => (int)$this->LastUpdated,\r\n \"created\" => (int)$this->Created\r\n );\r\n }", "public function toArray()\r\n {\r\n $a = array();\r\n if ($this->survivorResources) {\r\n $ab = array();\r\n foreach ($this->survivorResources as $i => $x) {\r\n $ab[$i] = $x->toArray();\r\n }\r\n $a['survivorResources'] = $ab;\r\n }\r\n if ($this->duplicateResources) {\r\n $ab = array();\r\n foreach ($this->duplicateResources as $i => $x) {\r\n $ab[$i] = $x->toArray();\r\n }\r\n $a['duplicateResources'] = $ab;\r\n }\r\n if ($this->conflictingResources) {\r\n $ab = array();\r\n foreach ($this->conflictingResources as $i => $x) {\r\n $ab[$i] = $x->toArray();\r\n }\r\n $a['conflictingResources'] = $ab;\r\n }\r\n if ($this->survivor) {\r\n $a[\"survivor\"] = $this->survivor->toArray();\r\n }\r\n if ($this->duplicate) {\r\n $a[\"duplicate\"] = $this->duplicate->toArray();\r\n }\r\n return $a;\r\n }", "public function toArray(): array\n {\n /* Enable extraction of data and priority */\n $this->setExtractFlags(self::EXTR_BOTH);\n\n /* Prepare output */\n $data = [];\n\n /* Iterate yourself */\n foreach ($this as $item) {\n $data[] = $item;\n }\n\n return $data;\n }", "final protected function getKeysProperty(): ArrObject\n {\n return arr(array_keys($this->items));\n }", "public function getKeys(): array;", "public function toArray(): array\n\t{\n\t\treturn\n\t\t\t[\n\t\t\t\t\"id\" => $this->getId(),\n\t\t\t\t\"name\" => $this->name,\n\t\t\t\t\"completable\" => $this->completable,\n\t\t\t\t\"classes\" => $this->classes\n\t\t\t];\n\t}", "public function getAsArray(): array {\n\t\t$result = [];\n\t\tforeach ( self::FIELD_MAPPING as $field => $_ ) {\n\t\t\t$result[$field] = $this->$field;\n\t\t}\n\t\treturn $result;\n\t}", "public function toArray()\n {\n $array = [];\n if (! empty($this->data)) {\n $array['data'] = $this->data->toIdentifier();\n }\n if (! empty($this->meta)) {\n $array['meta'] = $this->meta;\n }\n if (! empty($this->links)) {\n $array['links'] = $this->links;\n }\n\n return $array;\n }", "public function toArray()\n {\n $array = parent::toArray();\n\n foreach ($array as $k => &$v) {\n $v['_count'] = $k;\n }\n\n return $array;\n }", "public function toArray() {\n $a = array();\n return $a;\n }", "public function getAsArray();", "function asArray() {\n\t\t\n\t\t\t$myArray = array();\n\t\t\t\n\t\t\tforeach (get_object_vars($this) as $column => $value) {\n\t\t\t\tif (substr($column, 0, 1) != '_') {\n\t\t\t\t\t$myArray[$column] = $value;\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $myArray;\n\t\t\t\n\t\t}", "public function toArray(): array\n {\n $dataArray = parent::toArray();\n $dataArray[self::KEY_PASSWORD_GROUP_ID] = $this->getPasswordGroupId();\n $dataArray[self::KEY_PASSWORD_GROUP_NAME] = $this->getPasswordGroupName();\n $dataArray[self::KEY_PASSWORDS_JSONS] = $this->getPasswordsJsons();\n\n return $dataArray;\n }", "public function toArray($preserveKeys = true): array;", "function to_array() \n {\n $d = array();\n $d[\"id\"] = $this->id;\n $d[\"offset\"] = $this->offset;\n $d[\"title\"] = $this->title;\n $d[\"description\"] = $this->description;\n return $d;\n }", "public function toArray()\n\t{\n\t\treturn array();\n\t}", "public function arrayKeysValues()\n {\n return array(\n\t\t\t\"FirstName\" => $this->firstName,\n\t\t\t\"LastName\" => $this->lastName,\n\t\t\t\"Gender\" => $this->gender,\n\t\t\t\"YearOfBirth\" => $this->yearOfBirth,\n \"IdGenre\" => $this->genre,\n \"IsInGroup\" => $this->group\n\t\t);\n }", "public function getToArrayValues()\r\n\t\t{\r\n\t\t\t$obj = \t$this->getObject();\r\n\t\t\t$arrayValues = array();\r\n\t\t\tforeach ($obj as $key => $value) {\r\n\t\t\t\t$arrayValues[\":\".strtoupper($key)] = $value;\r\n\t\t\t}\r\n\t\t\treturn $arrayValues;\r\n\t\t}", "public static function toArray() {\n $str = \"\n SELECT id, firstName, lastName, email, password\n FROM indPrj_persons\";\n \n // Obtain an array of persons records.\n $records = Database::query($str);\n \n // Push each row into a new array to be outputted.\n $x = 0;\n $output = array();\n while($row = mysql_fetch_array($records)){\n $output[$x]['id'] = $row['id'];\n $output[$x]['firstName'] = $row['firstName'];\n $output[$x]['lastName'] = $row['lastName'];\n $output[$x]['email'] = $row['email'];\n $output[$x]['password'] = $row['password'];\n $x++;\n }\n \n return $output;\n }", "public function toArray()\n {\n $result = [];\n foreach ($this->visibleProperties() as $property) {\n $value = $this->get($property);\n if (is_array($value)) {\n $result[$property] = [];\n foreach ($value as $k => $object) {\n $result[$property][$k] = $object;\n }\n } else {\n $result[$property] = $value;\n }\n }\n\n return $result;\n }", "public function GetList()\n {\n $key1 = [\n 'items' => [\n '0' => [\n 'attribute_id',\n 'attribute_code',\n 'attribute_label',\n 'attribute_label',\n 'swatches',\n ]\n ]\n ];\n $key2 = [\n 'items' => [\n '0' => [\n 'swatches' => [\n '49' => [\n 'swatch_id',\n 'option_id',\n 'store_id',\n 'type',\n 'value',\n ]\n ],\n ]\n ]\n ];\n return [\n 'key1' => $key1,\n 'key2' => $key2,\n ];\n }", "public function toArray(): array\n\t{\n\t\t$array = [];\n\n\t\tforeach ($this->propertyData as $key => $value) {\n\t\t\t$value = $this->$key;\n\n\t\t\tif (is_object($value) === true) {\n\t\t\t\t$value = $value->toArray();\n\t\t\t}\n\n\t\t\t$array[$key] = $value;\n\t\t}\n\n\t\treturn $array;\n\t}", "public function as_array(){\n return isset($this->data[$this->alias])? $this->data[$this->alias] : $this->data;\n }", "public function keys(): array;", "public function keys(): array;", "public function keys(): array;", "public function arrayStructure()\n\t{\n\t\treturn array();\n\t}", "public function toArray()\n {\n $result = [];\n foreach (array_keys($this->_properties) as $property) {\n $value = $this->get($property);\n if (is_array($value)) {\n $result[$property] = [];\n foreach ($value as $k => $entity) {\n $result[$property][$k] = $entity;\n }\n } else {\n $result[$property] = $value;\n }\n }\n\n return $result;\n }", "public function fetchKeyedArray()\n\t{\n\t\t$arr = $this->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_ASSOC);\n\t\t$arr = array_map('reset', $arr);\n\t\t$keys = array_keys($arr);\n\t\t// if there's only one item in the lower arrays, we might as well\n\t\t// remove the array element\n\t\tif (count($keys) && count($arr[$keys[0]]) == 1)\n\t\t{\n\t\t\t$arr = array_map('reset', $arr);\n\t\t}\n\n\t\treturn $arr;\n\t}", "public function toArray(): array\n {\n return [\n 'name' => $this->name,\n 'email' => $this->email,\n 'url' => $this->url,\n 'summary' => $this->summary,\n 'experiences' => $this->itemsToArray($this->experiences),\n 'education' => $this->itemsToArray($this->education),\n ];\n }", "public function toArray(): array\n {\n return $this->getStructure();\n }", "public function toArray()\n {\n $a = parent::toArray();\n return $a;\n }", "public function toArray()\n {\n $a = parent::toArray();\n if ($this->descriptionRef) {\n $a[\"description\"] = $this->descriptionRef;\n }\n if ($this->attribution) {\n $a[\"attribution\"] = $this->attribution->toArray();\n }\n if ($this->qualifiers) {\n $ab = array();\n foreach ($this->qualifiers as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['qualifiers'] = $ab;\n }\n return $a;\n }", "public function getArray() {\n return array(\n \"id\" => $this->id, \n \"nombreGrupo\" => $this->nombre, \n //\"idag\" => $this->idap, \n );\n }", "public function assoc()\n {\n $array = array(\n 'self' => $this->self\n );\n\n if (isset($this->first)) {\n $array['first'] = $this->first;\n }\n\n if (isset($this->prev)) {\n $array['prev'] = $this->prev;\n }\n\n if (isset($this->next)) {\n $array['next'] = $this->next;\n }\n\n if (isset($this->last)) {\n $array['last'] = $this->last;\n }\n\n return $array;\n }", "public function toArray() : array{\n return get_object_vars( $this );\n }", "public function toArray()\n {\n // build an array containing all the MashTemperature objects in\n // $this->mashTemperatures;\n $arrayOfMashTemperatureArrays = [];\n foreach ($this->mashTemperatures as $mashTemperature) {\n $mashTemperatureAsArray = $mashTemperature->toArray();\n $arrayOfMashTemperatureArrays[] = $mashTemperatureAsArray;\n }\n\n return [\n \"mash_temperature\" => $arrayOfMashTemperatureArrays,\n \"fermentation\" => $this->fermentation->toArray(),\n \"twist\" => $this->twist\n ];\n }", "public function toArray()\n {\n return array(\n 'prefix' => $this->prefix,\n 'title' => $this->title,\n 'isdefault' => $this->isdefault,\n );\n }", "public function toArray() {\n\t\t$array = [ ];\n\t\t$vars = get_object_vars($this);\n\t\tforeach ( $vars as $property => $value ) {\n\t\t\t$array[$property] = $value;\n\t\t}\n\n\t\treturn $array;\n\t}", "public function createKeyArray(){\n\t$keyArray = array();\n\tif (isset($this->id)) $keyArray[\"id\"] = $this->id;\n\tif (isset($this->codice_categoria)) $keyArray[\"codice_categoria\"] = $this->codice_categoria;\n\tif (isset($this->codice)) $keyArray[\"codice\"] = $this->codice;\n\tif (isset($this->descrizione)) $keyArray[\"descrizione\"] = $this->descrizione;\n\treturn $keyArray;\n}", "function util_rowSetToAssocArray($rowset)\n{\n\t// We have a 2D array. We need them as a name value pair with the first element being the key.\n\t$assocArray = array();\n\tforeach ($rowset as $row)\n\t{\n\t\t$assocArray[$row[0]] = $row[1] ;\n\t}\n\treturn $assocArray ;\n}", "public function toArray(): array\n {\n $array = [];\n $str = new Str();\n\n foreach (\\get_object_vars($this) as $property => $value) {\n $array[$str->snake($property)] = $value;\n }\n\n return $array;\n }", "public function toArray();", "public function toArray();", "public function toArray();" ]
[ "0.7666401", "0.7527602", "0.7527602", "0.7365434", "0.73491395", "0.7305586", "0.7296502", "0.7219342", "0.7192991", "0.7187884", "0.71866655", "0.70720685", "0.7052379", "0.7033692", "0.7012061", "0.70039487", "0.6995781", "0.69949126", "0.69531137", "0.6918888", "0.6917448", "0.69166285", "0.68989086", "0.68758965", "0.68409145", "0.681099", "0.68091476", "0.67913926", "0.67879736", "0.67830443", "0.6781454", "0.67798615", "0.67768824", "0.67721885", "0.6768369", "0.675796", "0.6753225", "0.6731771", "0.67198807", "0.6710242", "0.67090863", "0.6681731", "0.66742605", "0.66697216", "0.6669187", "0.6668235", "0.6667465", "0.66542685", "0.6646976", "0.6646964", "0.6644433", "0.66425484", "0.66391724", "0.66251624", "0.6622024", "0.66205585", "0.66187245", "0.6617825", "0.66010195", "0.6598614", "0.65899676", "0.6582292", "0.65749943", "0.6572124", "0.6569992", "0.6568315", "0.65571624", "0.65555376", "0.6554075", "0.65512776", "0.65501577", "0.65474564", "0.6544334", "0.6541632", "0.6540303", "0.6540209", "0.6537832", "0.6531211", "0.65277416", "0.6527139", "0.6527139", "0.6527139", "0.6526733", "0.6525855", "0.65234864", "0.652265", "0.652004", "0.6518882", "0.6518607", "0.65182424", "0.65167534", "0.65034455", "0.6503401", "0.6501898", "0.6493847", "0.6489611", "0.6478827", "0.6474876", "0.6467584", "0.6467584", "0.6467584" ]
0.0
-1
Return an array of objects
function query_objects($sql, $parameters = null) { $query = $this->query($sql, $parameters); // This may not be the most optimal way to get an array of objects // from PDO, but it functions properly for now and can be discretely // optimized later. return $query->fetchAll(PDO::FETCH_CLASS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function getObjects();", "public static function getAll() : array {\n return self::$objects;\n }", "public function toArray() : array{\n return get_object_vars( $this );\n }", "public function getObjectArray()\n {\n $this->_cache->load($this->_cache_key, $this->_data_version);\n\n return $this->_cache->objects;\n }", "public function objectToArray()\n {\n return get_object_vars($this);\n }", "public static function arrayWithObjects()\n {\n return new RsoArray(func_get_args());\n }", "public function all() {\r\n\t\t$objects = []\r\n\t\twhile($this->hasNext()) {\r\n\t\t\t$next = $this->next();\r\n\t\t\tif($next == FALSE) break;\r\n\t\t\t$objects->push($next);\r\n\t\t}", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() :array {\n return get_object_vars($this);\n }", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function return_results_objects($result){\n\n $objectsArr = [];\n foreach($result as $result){\n $obj = new $this->model();\n $obj->populate_object_data($result);\n $objectsArr[] = $obj;\n }\n\n return $objectsArr;\n\n }", "public function __toArray(): array\n {\n return call_user_func('get_object_vars', $this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function toArray(): array\r\n {\r\n return get_object_vars($this);\r\n }", "public function toArray()\n\t{\n\t\t$result = new \\stdClass();\n\t\t\n\t\t// Objetos adicionadas a esta classe\n\t\tforeach ($this as $key => $entity) {\n\t\t\t$result->$key = clone $entity;\n\t\t}\n\t\treturn $result;\n\t}", "public function toArray() {\n return get_object_vars($this);\n }", "public function getAsArray() {\n return array(\"id\" => $this->id, \"name\" => $this->name, \"park\" => get_object_vars($this->park), \"code\" => $this->code);\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function all()\n {\n $records = R::findAll( $this->table_name(), \" order by id \");\n\n $object = array_map( function($each_record) {\n return $this->map_reford_to_object( $each_record );\n },\n $records\n );\n\n return array_values( $object );\n }", "function toArray()\n {\n $retorno = array();\n foreach ($this as $key => $value) {\n array_push($retorno, $value);\n }\n return $retorno;\n }", "public function getObjects()\n {\n return get_object_vars($this);\n }", "public function getObjects()\n {\n return get_object_vars($this);\n }", "public function get(): array\n {\n return Arr::map(\n $this->query->get(),\n fn($item) => call_user_func($this->class . \"::__createInstanceFromArray\", $item)\n );\n }", "public function fetchAll()\n {\n $objectArray = [];\n while($fetchedObject = $this->fetch())\n {\n $objectArray[] = $fetchedObject;\n }\n\n return $objectArray;\n }", "public function getAsArray();", "function fetch_object_array($resource) {\n $result = array();\n if ($this->num_rows($resource) > 0) {\n while($row_obj = mysql_fetch_object($resource)) {\n array_push($result, $row_obj);\n }\n }\n\n return $result;\n }", "function toArray($object);", "public function get_all(){\n return get_object_vars($this);\n }", "public function getInstances() {\n\t\t$instances = array();\n\t\tforeach ($this->objects as $objectName => $information) {\n\t\t\tif (isset($information['i'])) {\n\t\t\t\t$instances[$objectName] = $information['i'];\n\t\t\t}\n\t\t}\n\t\treturn $instances;\n\t}", "public static function getAll(): array;", "public function getArray(): array\n {\n $output = [];\n foreach (get_object_vars($this) as $key => $value) {\n $output[$key] = gettype($value) === 'object' ? $value->getArray() : $value;\n }\n return $output;\n }", "public function as_array( $objects = TRUE )\n {\n $array = array();\n\n // Iterate using wrapper\n if($objects)\n {\n foreach($this as $key => $value)\n {\n $array[$key] = $value;\n }\n }\n\n // Iterate bypassing wrapper\n else\n {\n $this->rewind();\n foreach($this->_cursor as $key => $value)\n {\n $array[$key] = $value;\n }\n }\n return $array;\n }", "public function arr() {\n\t\t\treturn \\uri\\generate::to_array($this->object);\n\t\t}", "protected function &getItemsAsArray() {\n\n if ($this->_itemArray !== null) {\n return $this->_itemArray;\n }\n\n $this->_itemArray = array();\n $q = $this->query();\n\n while($row = $q->fetchRow()) {\n\n $item = $this->createModelInstance($row);\n $this->_itemArray[] = $item;\n\n }\n\n if ($this->_comparatorFunction) {\n\n // Error suppression is because of\n // https://bugs.php.net/bug.php?id=50688\n @usort($this->_itemArray, $this->_comparatorFunction);\n\n }\n\n if ($this->_offset && $this->_maxRecords) {\n\n $this->_itemArray = array_slice($this->_itemArray, $this->_offset, $this->_maxRecords);\n\n } else if ($this->_maxRecords) {\n\n $this->_itemArray = array_slice($this->_itemArray, 0, $this->_maxRecords);\n\n } else if ($this->_offset) {\n\n $this->_itemArray = array_slice($this->_itemArray, $this->_offset);\n\n }\n\n return $this->_itemArray;\n\n }", "public function getItemsArray();", "public function objectify(){ return array( 'aID' => $this->ulA()->ID, 'bID' => $this->ulB()->ID, 'connection' => $this->connection() ); }", "public function asObject() {\n\t\treturn $this->_sth->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function __toArray()\n {\n return $this->toArray();\n }", "public function getAll() : array;", "public function getAll(): array;", "public function getAll(): array;", "public function getAll(): array;", "public function getObjects()\n {\n return $this->objects;\n }", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public static function as_object_array($result) {\n\t\t$output = array();\n foreach ($result as $r) {\n $output[] = $r->as_array();\n }\n return $output;\n }", "public function generateArray()\n {\n return $this->getProperties();\n }", "public function getItems(): array;", "public function getItems(): array;", "public static function getAll() {\n $entities = [];\n $sqlResult = DatabaseConnection::getResult(\"SELECT * FROM \" . static::$table);\n\n foreach($sqlResult as $row) {\n $object = new static();\n foreach($row as $property => $value) {\n $object -> $property = $value;\n }\n\n $entities[] = $object;\n }\n\n return $entities;\n }", "function getAllCars(){\n\t\t\t$query=\"select * from cars\";\n\t\t\t$result = pg_query($query);\n\n\t\t\t$data = [];\n\n\t\t\twhile ($record = pg_fetch_assoc($result)) {\n\t\t\t\t$car = new Car($record['id'],$record['model_name'], $record['model_type'], $record['model_brand'], $record['model_year'], $record['model_date_added'], $record['model_date_modified'] );\n\t\t\t\tarray_push($data, $car);\n\t\t\t}\n\n\t\t\treturn $data;\n\n\t\t}", "public static function findAll()\n {\n $model = new static();\n $fetchResult = Db::getInstance()->fetchAll($model->getTableName());\n if (!$fetchResult) {\n return null;\n }\n $arrayOfObjects = [];\n foreach ($fetchResult as $objectState) {\n $object = new static();\n $object->initStateFromArray($objectState);\n $arrayOfObjects[] = $object;\n }\n\n return $arrayOfObjects;\n }", "public function toArray() {\n\t\t$array = [ ];\n\t\t$vars = get_object_vars($this);\n\t\tforeach ( $vars as $property => $value ) {\n\t\t\t$array[$property] = $value;\n\t\t}\n\n\t\treturn $array;\n\t}", "public function toArray() : array\n {\n return $this->all();\n }", "public function getAll()\n {\n $resultSet = $this->oMapper->getAll();\n\n $className = get_class($this);\n\n// $return = array();\n $dto = new EntityDTO($this->oDb, $this->oLogger);\n foreach ($resultSet as $key => $row) {\n $obj = new $className($dto);\n $obj->fillByObject($row);\n\n $this->aCollection[] = $obj;\n }\n unset($resultSet);\n\n return $this->aCollection;\n }", "public static function instanceToArray() : array{\n\n if(!method_exists(self::class,'instance')):\n return [];\n endif;\n\n return self::instance()->toArray();\n }", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();" ]
[ "0.73555136", "0.7135129", "0.7096606", "0.70870876", "0.70093685", "0.6986791", "0.6901352", "0.68386674", "0.68350196", "0.6827249", "0.6827249", "0.6827249", "0.6827249", "0.6827249", "0.6827249", "0.6827249", "0.6827249", "0.6827249", "0.6806729", "0.6806729", "0.6804488", "0.6794693", "0.6775933", "0.67729867", "0.6772698", "0.6762062", "0.67214745", "0.670333", "0.66877115", "0.66875386", "0.66875386", "0.6682164", "0.66737026", "0.66719276", "0.66719276", "0.6666436", "0.6665505", "0.66651577", "0.66639894", "0.6639368", "0.66323525", "0.6617022", "0.6615661", "0.6604848", "0.6601045", "0.6594573", "0.6590194", "0.65850383", "0.65736234", "0.65627366", "0.65390104", "0.6535447", "0.65295416", "0.65295416", "0.65295416", "0.65283227", "0.6509772", "0.6509772", "0.6509772", "0.6509772", "0.6509772", "0.6509772", "0.6509772", "0.6509772", "0.6509772", "0.6509772", "0.6509427", "0.6509427", "0.6509427", "0.6509427", "0.6509067", "0.6509067", "0.65069103", "0.65051705", "0.65023583", "0.65023583", "0.65010154", "0.6497253", "0.64925927", "0.64850855", "0.6480945", "0.64774674", "0.6476563", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174", "0.64603174" ]
0.0
-1
Return a single value
function query_value($sql, $parameters = null) { $query = $this->query($sql, $parameters); return $query->fetchColumn(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValue(): mixed;", "public function getValue(): mixed;", "public function getValue()\n {\n return 1;\n }", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function value();", "public function value();", "public function value();", "public function &getValue();", "public function firstValue()\n\t{\n\t\treturn $this->first()->value;\n\t}", "abstract public function getValue();", "abstract public function getValue();", "abstract public function getValue();", "abstract protected function getValue();", "public function GetValue() {\n\t\treturn $this->_value;\n\t}", "public function value(): string;", "public function getValue(string $value): mixed;", "public function getValue(){ }", "public function get_value()\n {\n }", "public function get_value()\n {\n }", "public function getValue(): mixed\n {\n return $this->value;\n }", "public static function getValue()\n {\n return self::getInstance()->getValue(func_get_args());\n }", "public function getValue() {\n \n return $this->toScalar();\n }", "public function getValue()\n {\n return $this->get(self::_VALUE);\n }", "public function getValue()\n {\n return $this->get(self::_VALUE);\n }", "public function getValue()\n {\n\treturn $this->value;\n }", "public function value(): int;", "public function getValue(){\n \treturn $this->value;\n }", "public function value() { return $this->_m_value; }", "public function get_value() {\n\t\t$row = $this->get_row();\n\t\tif ($row) {\n\t\t\treturn current($row);\n\t\t}\n\t}", "function getValue(){\r\n\t\treturn $this->value;\r\n\t}", "function get_value() {return $this->get();}", "public function getValue(): mixed\n {\n return $this->field?->getValue();\n }", "public function valueOf() {\n return $this->_value;\n }", "public function getValue()\n {\n\t\treturn $this->value;\n\t}", "public function getValue()\n {\n $value = $this->value;\n\n switch ($this->type) \n {\n case 'boolTrue':\n $value = true;\n break;\n\n case 'boolFalse':\n $value = false;\n break;\n\n case 'string':\n $value = str_replace(\"\\\\\", \"\", substr($value, 1, -1));\n break;\n\n case 'number':\n $value = $value + 0;\n break;\n\n case 'null':\n $value = null;\n break;\n }\n\n return $value;\n }", "public function getReturnedValue();", "public function get_value()\n\t{\n\t\treturn $this->value;\n\t}", "public function getSingleResult()\n {\n }", "public function getValue()\n {\n return $this->get(self::VALUE);\n }", "public function getValue()\n {\n return $this->get(self::VALUE);\n }", "function getValue()\n\t{\n\t\treturn $this->value;\n\t}", "function getValue()\n\t{\n\t\treturn $this->value;\n\t}", "public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}", "public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}", "public function getValue(){\n return $this->value2 ? $this->value2 : $this->value1;\n }", "public function getValue()\r\n\t{\r\n\t\treturn $this->value;\r\n\t}", "public function get_value()\n {\n return $this->value;\n }", "public function getValue()\r\n {\r\n return $this->value;\r\n }", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "protected function getValue() {\r\n return $this->_value;\r\n }", "public function value() { }", "public function value() { }", "public function getValue() {\n\t\treturn $this -> value;\n\t}", "function first_value(): mixed\n {\n $args = func_get_args();\n\n return \\Midnite81\\Core\\Functions\\first_value(...$args);\n }", "public function get_value() {\n\t\treturn $this->_value;\n\t}", "public function getValue() {\n\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }" ]
[ "0.773586", "0.773586", "0.7533902", "0.74860805", "0.74860805", "0.74860805", "0.74860805", "0.74860805", "0.74860805", "0.74860805", "0.74860805", "0.74860805", "0.74860805", "0.74860805", "0.74860805", "0.74860805", "0.74860805", "0.74849313", "0.74849313", "0.74849313", "0.74849313", "0.74849313", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.74309677", "0.73402053", "0.73402053", "0.73402053", "0.7305408", "0.71835315", "0.7162267", "0.7162267", "0.7160942", "0.7080059", "0.6968371", "0.6957625", "0.69309276", "0.6929839", "0.68722874", "0.68722874", "0.6861411", "0.68591183", "0.68563807", "0.6850561", "0.6850561", "0.684751", "0.684106", "0.6817854", "0.6815278", "0.6813831", "0.68045354", "0.6796183", "0.67941046", "0.6784474", "0.67810297", "0.67796236", "0.67629075", "0.6753704", "0.6742786", "0.6735827", "0.6735827", "0.67345357", "0.67345357", "0.6720116", "0.6720116", "0.6719612", "0.6714964", "0.6697699", "0.66862524", "0.6685307", "0.6685307", "0.6685307", "0.6685307", "0.6685307", "0.6685307", "0.667575", "0.66730815", "0.66730815", "0.667246", "0.66720754", "0.66649735", "0.6661081", "0.6660208" ]
0.0
-1
Return an array of single values, usually a list of ids or names
function query_values($sql, $parameters = null) { $query = $this->query($sql, $parameters); return $query->fetchAll(PDO::FETCH_COLUMN, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValues(): array;", "public function getValues(): array;", "public function getValues();", "public function getValuesList(){\n return $this->_get(1);\n }", "public function getValues()\r\n {\r\n $values = $this->getValue();\r\n\r\n if (!is_array($values)) {\r\n $values = explode(',', $values);\r\n }\r\n\r\n if (!sizeof($values)) {\r\n return [];\r\n }\r\n\r\n $collection = $this->collectionFactory->create()\r\n ->addIdFilter($values);\r\n\r\n $options = [];\r\n foreach ($collection as $tag) {\r\n $options[] = $tag->getId();\r\n }\r\n\r\n return $options;\r\n }", "protected function getValueAsArray()\n {\n if(strpos($this->value, '|') > 1){\n $values = array_filter(explode(\"|\", $this->value));\n } else {\n $values = [$this->value];\n }\n return $values;\n }", "public function values() : array;", "public function getValuesList() {\n return $this->_get(2);\n }", "public function getValues()\n {\n return $this->getVal('value', []);\n }", "public function getValues(): array\n {\n return array_map(function ($model) {\n return $model->value;\n }, $this->values);\n }", "public function getAsArray();", "public function getValues()\n {\n $values = array();\n\n foreach ($this->items as $item) {\n $values[] = $item['value'];\n }\n\n return $values;\n }", "public function getValues()\n\t{\n\t\t$params = array();\n\n\t\tforeach($this->values as $value)\n\t\t{\n\t\t\tswitch($value[self::TYPE])\n\t\t\t{\n\t\t\t\tcase self::TYPE_RAW:\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::TYPE_IN:\n\n\t\t\t\t\t$params+= $value[self::VALUE];\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::TYPE_SCALAR:\n\t\t\t\tdefault:\n\n\t\t\t\t\t$params[] = $value[self::VALUE];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $params;\n\t}", "public function getValuesList() {\n return $this->_get(3);\n }", "abstract public static function getValues(): array;", "public function getValues() {}", "public function getValues() {}", "public function getIdValue()\n {\n $valores = array();\n \n foreach ($this->findBy(array(), array('nome' => 'ASC')) as $item) {\n $valores[$item->getId()] = $item->getNome();\n }\n\n return $valores;\n }", "abstract public function values(): array;", "function getValues(){\n $values = [];\n \n foreach($this as $valor){\n $values[] = $valor;\n }\n \n return $values;\n }", "public function getValues() : array\n {\n return $this->values;\n }", "public function scalarArray()\n {\n if($this->result_array) {\n $arr = array();\n $keys = array_keys($this->result_array[0]);\n foreach($this->result_array as $v) {\n $arr[] = $v[$keys[0]];\n }\n return $arr;\n }\n return [];\n }", "function get_value_list()\n\t{\n\t\treturn $this->value;\n\t}", "public function getValue()\r\n\t{\r\n\t\treturn $this->getValues(true);\r\n\t}", "public function getValues(): array\n {\n return $this->values;\n }", "public function values();", "public function values();", "public function values();", "public function values();", "public function values();", "public function getValues(): array\n {\n return $this->getEntityDao()->getValues();\n }", "public function toArray()\n\t{\n\t\treturn $this->values;\n\t}", "public function toArray()\n\t{\n\t\treturn $this->values;\n\t}", "public function getValue(): array {\n\t\t\treturn $this->value;\n\t\t}", "public function getValue($name)\n {\n $result = array();\n foreach ($this->entities as $entity) \n {\n $values = $entity->getValues(array($name));\n $result[] = $values[$name];\n }\n \n return $result;\n }", "public function valueOf() {\n return $this->_values;\n }", "public function getArray () {\n\n return $this->values;\n\n }", "public function values(): array\n {\n return $this->values;\n }", "abstract public function values(): Seq;", "public function get_values() {\n\t\t$values = [];\n\n\t\tforeach ( $this->fields as $field ) {\n\t\t\t$values[$field->name] = $field->get_value();\n\t\t}\n\n\t\treturn $values;\n\t}", "public function getValues()\n\t\t{\n\t\t\treturn $this->values;\n\t\t}", "public function getData() {\n if ($this->_multiple) {\n return $this->_data;\n }\n return isset($this->_data[0])? $this->_data[0] : [];\n }", "public function getValues()\n {\n\n\t\t$record = ProductAttributeValues::whereIn('avid',[1,6])->get();\n\t\t$rec = $record->pluck('pro_att_value');\n\t\treturn $rec;\n }", "private function to_array() {\n\t\t$values = array(\n\t\t\t'id' => $this -> id,\n\t\t\t'name' => $this -> name);\n\t\treturn $values;\n\t}", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n\t{\n\t\treturn $this->_values;\n\t}", "function getValues()\n {\n return $this->type->getValues();\n }", "static function idValueArray(array $input) \n\t{\n\t\t$return = array();\n\t\tforeach ($input as $key => $value) {\n\n\n\t\t\tif (is_array($value))\n\t\t\t\t$value = self::idValueArray($value);\n\n\t\t\t$return[] = ['id' => $key, 'value' => $value];\n\t\t}\n\n\t\treturn $return;\n\t}", "public function toArray()\n {\n return $this->values;\n }", "public function toArray()\n {\n return $this->values;\n }", "public function getValues()\n\t{\n\t\t$returnValue = NULL;\n\n\t\treturn $returnValue;\n\t}", "function getArray() {\n\treturn array('Red', 'Green', 'Blue');\n}", "public function getParts()\n {\n if (is_null($this->value)) {\n return [];\n } elseif (is_array($this->value)) {\n return $this->value;\n } else {\n return [$this->value];\n }\n }", "public function values(): array\n\t{\n\t\treturn $this->fields()->values()->all();\n\t}", "public function getValues()\n {\n return array_values($this->data);\n }", "public function getData()\n\t{\n\t\treturn array_merge($this->values, $this->rest, array('id' => $this->getID()));\n\t}", "public function values()\n {\n return $this->values;\n }", "public function values()\n {\n return $this->values;\n }", "public function values()\n {\n return $this->values;\n }", "public function values()\n {\n return $this->values;\n }", "public function getValues() {\n return $this->values;\n }", "public function getValues() {\n return $this->values;\n }", "public function getValues()\n {\n $values = array();\n \n foreach ($this->_fields as $name => $info) {\n $values[$name] = (isset($info['value'])) ? $info['value'] : null;\n }\n \n return $values;\n }", "public function toArray ( )\n {\n return (array) $this->_values;\n }", "public function getFieldValues()\n {\n if($this->isNewRecord){\n return []; //TODO: LOAD DEFAULT FIELDS OF TYPE\n }\n\n //pull meta values from DB\n $table = self::tablePrefix().'cms_post_field';\n $strSql = \"SELECT id, field_id, value \n\t\t\t\t\tFROM {$table}\n\t\t\t\t\tWHERE post_id = :pid\n\t\t\t\t \";\n $cmd = self::getDb()->createCommand($strSql);\n $cmd->bindValue(\":pid\",$this->id,\\PDO::PARAM_STR);\n $arrResults = $cmd->queryAll();\n\n return ArrayHelper::index($arrResults, 'id', 'field_id');\n }", "public function getValues()\n {\n return $this->_values;\n }", "public function get_values(){ return $this->values; }", "public function values() {\n\t\treturn array_values($this->_value);\n\t}", "protected function _getValues()\n {\n $values = $this->getColumn()->getValues();\n return $this->_converter->toFlatArray($values);\n }", "public static function listOfValues()\n {\n return array_values((new static)->_all);\n }", "public static function getValues() \n\t{\n\n\t\t$categories = Category::all();\n\n\t\t$categoryValues = [];\n\n\t\tforeach ($categories as $category) \n\t\t{\n\t\t\t\n\t\t\t$categoryValue = static::getValue( Auth::user()->id, $category->id );\n\n\t\t\t$categoryValues[strtolower( $category->name ) . 'Value'] = $categoryValue;\n\n\t\t}\n\n\t\treturn $categoryValues;\n\n\t}", "public function get(): array;", "public function get(): array;", "public function get() : array;", "public function getData()\n {\n //let's assume that this array is from a database\n return array('persian', 'bob', 'tabby', 'stray');\n }", "public function getValues () {\n\n return array_values($this->values);\n\n }", "final public function getValues()\n {\n return $this->values;\n }", "public function toArray(): array\n {\n return $this->values;\n }", "public function getAsArray(): array\n {\n return \\GuzzleHttp\\json_decode(\\GuzzleHttp\\json_encode($this->values), true);\n }", "public function getAllValues();", "public function getArray()\n {\n return $this->get(self::_ARRAY);\n }", "public function getWeatherIDSArray() {\n\t\t$array = explode(',',$this->_weather_ids);\n\t\t$weather = array();\n\t\tforeach ($array as $value) {\n\t\t\t$weather[$value] = $value;\n\t\t}\n\t\treturn $weather;\n\t}", "public function Values()\n {\n return $this->values;\n }", "public function GetSingleRow() : ARRAY\r\n {\r\n return($this->preparedStatement->fetch(\\PDO::FETCH_ASSOC));\r\n }", "public function getResult():array {\n\n # Return value\n return $this->values;\n\n }", "public function getValues($names)\n {\n $result = array();\n foreach ($this->entities as $entity) \n {\n $result[] = $entity->getValues($names);\n }\n \n return $result;\n }", "public function values() {\n\t\treturn array_values($this->toArray());\n\t}", "public function all(): array\n {\n return $this->values;\n }", "public function getAll()\n {\n return $this->values;\n }", "public function getAll()\n {\n return $this->values;\n }", "public function getIdentityValues()\n {\n return $this->identity_values;\n }", "public function values() {\n return array_merge(\n array(null),\n $this->primitives(),\n $this->arrays(),\n $this->maps(),\n $this->objects()\n );\n }", "public static function getValues() {\n\t\t$roleModel = new self ( );\n\t\t$select = $roleModel->select ();\n\t\t$arr=array();\n\t\t$rows= $roleModel->fetchAll ( $select );\n\t\tforeach ($rows as $row) {\n\t\t$arr[$row->name]=$row->detail;\n\t\t}\n\t\treturn $arr;\n\t}", "public function getAsArray() {\n if($this->xmldb->xml) {\n $vals = array();\n $nodeList = $this->xmldb->xml->documentElement->childNodes;\n foreach ($nodeList as $node) {\n if (is_a($node, \"DOMElement\")) {\n #extract the child text value from each node\n $vals[] = $node->firstChild->nodeValue;\n }\n }\n \n return $vals;\n }\n }", "public function getValue()\n\t{\n\t\t$data = array();\n\t\tforeach($this->_collection as $subform)\n\t\t{\n\t\t\tforeach($subform->_collection as $name => $item)\n\t\t\t{\n\t\t\t\t$data[$name] = $item->getValue();\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "public function values() : array\n {\n return array_values($this->entries);\n }", "public function getValues(): Collection\n {\n return $this->values;\n }", "public function getExpressionData()\n {\n $values = $this->valueSet;\n if ($values instanceof Select) {\n $specification = '%s IN %s';\n $types = array(self::TYPE_VALUE);\n $values = array($values);\n } else {\n $specification = '%s IN (' . implode(', ', array_fill(0, count($values), '%s')) . ')';\n $types = array_fill(0, count($values), self::TYPE_VALUE);\n }\n\n array_unshift($values, $this->identifier);\n array_unshift($types, self::TYPE_IDENTIFIER);\n\n return array(\n array(\n $specification,\n $values,\n $types,\n )\n );\n }" ]
[ "0.7365303", "0.7365303", "0.7026987", "0.69971454", "0.6968361", "0.69678265", "0.6948893", "0.69192225", "0.6828458", "0.6827112", "0.67558235", "0.67548436", "0.6750289", "0.67357963", "0.6708839", "0.6704814", "0.6704814", "0.6697995", "0.66343874", "0.6624599", "0.66012305", "0.6595012", "0.65890163", "0.6576262", "0.6565996", "0.6550327", "0.6550327", "0.6550327", "0.6550327", "0.6550327", "0.6546825", "0.65029687", "0.65029687", "0.6479606", "0.64655924", "0.64632916", "0.64544255", "0.6444997", "0.64422655", "0.6386661", "0.6374449", "0.6370529", "0.6345782", "0.63401234", "0.6333138", "0.6333138", "0.6333138", "0.6333138", "0.6331562", "0.6321639", "0.630254", "0.6294132", "0.6294132", "0.6283493", "0.62823", "0.6279635", "0.6273489", "0.6261775", "0.62441325", "0.6241158", "0.6241158", "0.6241158", "0.6241158", "0.6237874", "0.6237874", "0.6232465", "0.6229281", "0.6224018", "0.62126", "0.6210999", "0.6187265", "0.61790156", "0.61740535", "0.6172777", "0.6160235", "0.6160235", "0.6158318", "0.6155817", "0.61488956", "0.6136714", "0.6128215", "0.6108674", "0.6107877", "0.6102384", "0.609677", "0.6096408", "0.6089362", "0.6081236", "0.60780424", "0.60741115", "0.60726166", "0.60708207", "0.60708207", "0.60633886", "0.6051194", "0.6033899", "0.60119563", "0.5992203", "0.59873384", "0.5983848", "0.59803164" ]
0.0
-1
Saves inmemory state to the persistent storage. It is used to flush inmemory changes to the database between requests/actions.
protected function saveState(): void { $em = $this->getEntityManager(); $em->flush(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n {\n $this->persist($this->state);\n }", "public function store()\n {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }", "public function persist() {}", "public function save()\n {\n if ( !$this->unsaved ) {\n // either nothing has been changed, or data has not been loaded, so\n // do nothing by returning early\n return;\n }\n\n $this->write();\n $this->unsaved = false;\n }", "public function persist();", "public function persist()\n {\n persistableCollection::getInstance($this->resourceName)->persistObject($this);\n $this->loaded = true;\n $this->persisted = true;\n }", "public function saveObjectState() {\n $this->objectState = base64_encode(serialize($this));\n $this->isNewRecord = false;\n $this->update();\n $this->reconstructCombatants();\n }", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "function persist() ;", "public function persistAll() {}", "public function store()\n {\n $this->storeKeys();\n }", "public function save($state)\n\t{\n\t\t$content=serialize($state);\n\t\t$saveFile=true;\n\t\tif(($cache=$this->getApplication()->getCache())!==null)\n\t\t{\n\t\t\tif($cache->get(self::CACHE_NAME)===$content)\n\t\t\t\t$saveFile=false;\n\t\t\telse\n\t\t\t\t$cache->set(self::CACHE_NAME,$content);\n\t\t}\n\t\tif($saveFile)\n\t\t{\n\t\t\t$fileName=$this->getStateFilePath();\n\t\t\tfile_put_contents($fileName,$content,LOCK_EX);\n\t\t}\n\t}", "public function persist()\n {\n $uid = $this->getIdentifier() == 0 ? 'NEW' . rand(100000, 999999) : $this->getIdentifier();\n $data = [\n trim(static::$storageTableName) => [\n $uid => $this->getPersistableDataArray()\n ]\n ];\n // New records always must have a pid\n if ($this->getIdentifier() == 0) {\n $data[trim(static::$storageTableName)][$uid]['pid'] = 0;\n }\n /** @var \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $tce */\n $tce = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\DataHandling\\DataHandler::class);\n $tce->start($data, []);\n $tce->process_datamap();\n }", "function persistAll() ;", "private function persist() {\n $session = new Session();\n $items = $this->getItems();\n $session->set('inspiration_board', json_encode($items));\n }", "protected function saveState() {\n $filename = $this->tempPath() . self::STATEFILE_STUB;\n return file_put_contents($filename, serialize($this->state));\n }", "public function flush()\n {\n $this->store()->flush();\n }", "public function saveSettings()\n {\n $this->store->save($this->data);\n }", "public function persist()\n {\n }", "public function persist()\n {\n $this->eventManager->dispatchEvent(['persist_before'], [get_class($this)]);\n if (!empty($this->handlerInterface)) {\n $result = $this->handlerFactory->create($this->handlerInterface)->persist($this);\n if (!empty($result)) {\n foreach ($result as $key => $value) {\n $this->data[$key] = $value;\n }\n }\n }\n $this->eventManager->dispatchEvent(['persist_after'], [get_class($this)]);\n }", "public function persist()\n {\n //\n }", "public function save()\n\t{\n\t\t$this->container->save($this);\n\t}", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "public function markAsPersisted(): void;", "public function save()\r\n\t{\r\n\t\t$this->getCache()->save($this->key, ob_get_flush(), $this->frame);\r\n\t\t$this->key = $this->frame = NULL;\r\n\t}", "public function save($state)\n\t{\n\t\tIOHelper::writeToFile($this->stateFile, serialize($state));\n\t}", "protected function save(): void\n {\n if ($this->connection == 'database') {\n $this->cart->each(\n function ($item) {\n if ($cart = $this->storage->has($item['id'])) {\n $cart->update(\n [\n 'rowId' => $item['id'],\n 'price' => $item['price'],\n 'quantity' => $item['quantity'],\n 'cartable_id' => $item['cartable_id'],\n 'cartable_type'=> $item['cartable_type'],\n ]\n );\n } else {\n $this->storage->create(\n [\n 'rowId' => $item['id'],\n 'user_id' => $this->user->id,\n 'price' => $item['price'],\n 'quantity' => $item['quantity'],\n 'cartable_id' => $item['cartable_id'],\n 'cartable_type'=> $item['cartable_type'],\n ]\n );\n }\n }\n );\n } elseif ($this->sessionStatus) {\n $this->storage->put([$this->instanceName => $this->cart]);\n }\n }", "public function save()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n {\n $entity->delete();\n } \n else if ($entity->getMarkedAsUpdated())\n {\n $entity->saveWithDetails();\n }\n }\n }\n );\n }", "public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public final function save() {\n }", "public function flushDataStore()\n {\n $this->database->flushAll(); \n }", "public function saveCache()\n {\n if($this->isCacheExists()){\n if($this->isUpdateRequired()){\n $this->updateCache();\n }\n } else {\n $this->packData()->writeFile();\n }\n }", "public function save() \r\n\t{\r\n\t\t$this->saveNewProducts();\r\n\t\t$this->saveUpdateProducts();\r\n\t\t$this->saveRemoveProducts();\t\t\t\r\n\t\t$this->destroyCache(); \r\n\t}", "public final function save()\n {\n }", "public function flush()\r\r\n\t{\r\r\n\t\t$this->_storage->flush();\r\r\n\t}", "static protected function persist() {\n\t\t$objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Object\\ObjectManager::class);\n\t\t$persistanceManager = $objectManager->get(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager::class);\n\t\t$persistanceManager->persistAll();\n\t}", "public function flush(/* ... */)\n {\n $this->_storage = [[], [], []];\n $this->_event_history = [];\n $this->set_state(STATE_DECLARED);\n }", "public function save($state);", "public function save(): void\n {\n $json = [];\n /** @var SetCookie $cookie */\n foreach ($this as $cookie) {\n if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {\n $json[] = $cookie->toArray();\n }\n }\n\n $_SESSION[$this->sessionKey] = \\json_encode($json);\n }", "public function save()\n\t{\n\t\t// No operation. This is a CLI session, we save nothing.\n\t}", "public function save()\n {\n $this->readCache();\n\n file_put_contents($this->filePath, json_encode($this->cacheContents));\n }", "private function persist()\n {\n $content = $this->adapter->read();\n\n $content = $this->builder->apply($content);\n\n return $this->adapter->write($content);\n }", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public function save(): void\n {\n $this->session?->put('shop.cart', $this->toArray());\n }", "public function store()\n\t{\n\t\treturn $this->repo->saveRecord($this->storeInput());\n\t}", "public function store()\n {\n return $this->save();\n }", "protected function persistObjects() {}", "function saveToSession() {\n\t\t// Unset sessions since this info is elsewhere in the database\n\t\tunset($this->_questions);\n\t\ttx_wecassessment_sessiondata::storeSessionData($this, $this->getPID());\n\t}", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "public function save()\n {\n try {\n $instanceState = $this->toArray();\n if (empty($instanceState['id'])) {\n unset($instanceState['id']);\n Db::getInstance()->insert($this->getTableName(), $instanceState);\n } else {\n Db::getInstance()->update($this->getTableName(), $instanceState, ['id' => $instanceState['id']]);\n }\n\n return true;\n } catch (DbException $e) {\n return false;\n }\n }", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\tif(is_array($this->value))\n\t\t\t{\n\t\t\t\tforeach($this->value as $key=>$session)\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[$key] = $session;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(is_string($this->value) and is_string($this->name))\n\t\t\t{\n\t\t\t\t$_SESSION[$this->name] = $this->value;\n\t\t\t}\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "public function saveThis()\n {\n \t\tPersistentSession::getInstance()->saveOrUpdate($this);\n }", "protected function saving() {\n // This will get reimplemented by children when necessary\n }", "function storeAndNew() {\n $this->store();\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 persist($data);", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\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.80036056", "0.70927566", "0.69049233", "0.67950064", "0.668239", "0.666752", "0.66617435", "0.66009516", "0.6598909", "0.6588894", "0.65590644", "0.6544981", "0.65260375", "0.6491668", "0.648954", "0.64518416", "0.64183927", "0.6407187", "0.63682103", "0.63417727", "0.6340031", "0.6269146", "0.62418354", "0.62240297", "0.62177235", "0.61884755", "0.6185753", "0.6173101", "0.6168447", "0.6146383", "0.6124243", "0.6112808", "0.6112782", "0.6104828", "0.60959166", "0.6090161", "0.6089955", "0.6089657", "0.60762835", "0.60676706", "0.606014", "0.6055313", "0.6024233", "0.59932005", "0.5992278", "0.5990266", "0.5982511", "0.5980321", "0.5978035", "0.59762245", "0.59762245", "0.59762245", "0.59644204", "0.5961966", "0.5914846", "0.5891849", "0.58886075", "0.5880455", "0.58763033", "0.58763033", "0.58763033", "0.5868188", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529", "0.5867529" ]
0.75336987
1
over write before save, load file
public function beforeSave() { if (parent::beforeSave()) { $this->last_modified = time(); if ($this->isNewRecord) { Yii::log("new pic uploaded and processed."); if ($this->data!=null) { $this->resizefile(); return true; } else { Yii::log("process pic failed with data = null", "error"); Yii::log("process pic failed with data = null"); return false; } } else { return true; } } else { Yii::log("process pic failed with parent save = null", "error"); Yii::log("process pic failed with parent save = null"); return (false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function save() {\n\t\tif(self::$data===null) throw new Excepton('Save before load!');\n\t\t$fp=fopen(self::$datafile,'w');\n\t\tif(!$fp) throw new Exception('Could not write data file!');\n\t\tforeach (self::$data as $item) {\n\t\t\tfwrite($fp,$item); // we use the __toString() here\n\t\t}\n\t\tfclose($fp);\n\t}", "function save($filePath);", "public function save() {\t\t\t\t\n\t\tif (file_put_contents($this->filename, $this->objects)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function saveToFile() {\n\n $file = $this->getExtractedFile();\n\n $file->close();\n\n $this->extractedFile = false;\n }", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "public function updateOriginal()\n {\n // @todo Bug#1101: shouldn't just serialise this object\n // because some things change for the original\n // loaded_width\n // loaded_height\n $this->write($this->getOriginalSourceFilename());\n }", "public function save(): void\n {\n foreach ($this->getChunks() as $chunk) {\n $this->getFile()->seek(0, SeekType::SEEK_END);\n $chunk->setOffset($this->getFile()->tell() / 4096);\n $chunkData = $chunk->getChunkData();\n $this->getFile()->write($chunkData);\n $this->getFile()->seek($this->calcOffset($chunk->getCoordinates()),\n SeekType::SEEK_SET\n );\n $chunkLocation = $chunk->getLocation();\n $this->getFile()->write($chunkLocation);\n }\n }", "public function save()\n {\n if ( !$this->unsaved ) {\n // either nothing has been changed, or data has not been loaded, so\n // do nothing by returning early\n return;\n }\n\n $this->write();\n $this->unsaved = false;\n }", "protected function _save()\n\t{\n\t\t$_file = $this->_storagePath . DIRECTORY_SEPARATOR . $this->_fileName;\n\n\t\t$_data = json_encode( $this->contents() );\n\n\t\tif ( $this->_compressStore )\n\t\t{\n\t\t\t$_data = Utility\\Storage::freeze( $this->contents() );\n\t\t}\n\n\t\tif ( false === file_put_contents( $_file, $_data ) )\n\t\t{\n\t\t\tUtility\\Log::error( 'Unable to store Oasys data in \"' . $_file . '\". System error.' );\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function save()\n {\n return file_put_contents($this->getFilepath(), $this->read());\n }", "public function save($path);", "function saveAndFlushCalculationCaches() {\n\n $this->saveToFile();\n\n $file = $this->getExtractedFile();\n\n $this->flushFileCachedValues();\n\n $this->saveToFile();\n }", "public function save() {\n $tmpHandle = new \\SplFileObject('php://temp', 'w+');\n $tmpData = '';\n\n $tmpHandle->fputcsv($this->model->columns());\n\n foreach($this->all() as $record) {\n $tmpHandle->fputcsv($record->toArray());\n $record->exists = true;\n }\n\n $tmpHandle->rewind();\n\n while ( ! $tmpHandle->eof()) {\n $tmpData .= $tmpHandle->fgets();\n }\n\n $this->file->flock(\\LOCK_EX | \\LOCK_NB);\n $this->file->ftruncate(0);\n $this->file->rewind();\n $this->file->fwrite($tmpData);\n $this->file->flock(\\LOCK_UN);\n }", "public function save(IO\\File $file) {\n\t\t\tfile_put_contents($file, $this->render());\n\t\t\t$this->file = $file;\n\t\t}", "public function save()\n {\n $this->readCache();\n\n file_put_contents($this->filePath, json_encode($this->cacheContents));\n }", "public function save() {\n\t\t$fileContent = trim(file_get_contents($this->filepath));\n\t\tif ($this->rows) {\n\t\t\t$fp = fopen($this->filepath, 'w');\n\t\t\t$rowcount = count($this->rows);\n\t\t\tfor ($index = 0; $index < $rowcount; ++$index) {\n\t\t\t\t$row = $this->rows[$index];\n\t\t\t\tif ($row->isEditable()) {\n\t\t\t\t\t$variableName = $row->variableName();\n\t\t\t\t\t$pattern = '/\\$'.$variableName.'[\\s]+=([^;]+);/';\n\t\t\t\t\t$replacement = $row->toString();\n\t\t\t\t\t$fileContent = preg_replace($pattern, $replacement, $fileContent);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfwrite($fp, $fileContent);\n\t\t\tfclose($fp);\n\t\t}\n\t}", "private function save(): void\n {\n foreach ($this->dataToSave as $file => $data) {\n $this->langFilesManager->fillKeys($file, $data);\n }\n }", "public function _afterSave()\n {\n Mage::getResourceModel('bpost_shm/tablerates_international')->uploadAndImport($this);\n }", "public function save($path,$content,$lock = false) ;", "private function saveConfig() {\n \tself::$_configInstance = (object)$this->_data; \n file_put_contents($this->_data['cache_config_file'],serialize(self::$_configInstance)); \n }", "public final function save() {\n }", "public function save()\n {\n $data = $this->read_file();\n\n if (( ! $data))\n {\n $data = array();\n }\n\n $data[$this->id] = array(\n 'id' => $this->id,\n 'email' => $this->email,\n 'firstname' => $this->firstname,\n 'lastname' => $this->lastname,\n 'password' => $this->password,\n 'token' => $this->token,\n 'logins' => $this->logins,\n );\n\n $this->write_file($data);\n }", "public function afterSave()\n {\n if (!$this->files) {\n return;\n } else if ($this->contentAttribute) {\n $this->owner->updateAttributes([$this->contentAttribute => $this->processContentFiles(true)['content']]);\n } else {\n /** @var UploadedFile $file */\n foreach ($this->files as $key => $file) {\n $this->files[$key] = $this->saveFile($file->tempName, $file->name);\n }\n }\n $this->setAttributeValue(\\array_map(function($v){ return basename($v); }, array_filter($this->files)));\n }", "protected function saving() {\n // This will get reimplemented by children when necessary\n }", "function save() {\n \tfile_put_contents(\"threads/{$this->id}\", serialize($this));\n }", "public function save($file, $path);", "protected function _after_save(){\n if(file_exists($this->_path))\n $this->_path_infos = pathinfo($this->_path);\n }", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "public function save(){\n return parent::writeFile( $this->outputFile, $this->template);\n }", "private function _saveExt() {\r\n\r\n }", "public function storeTo($path = './') {\n\t\tfile_put_contents($path . $this->filename, $this->content);\t\n\t}", "protected function fixFiles()\n {\n\n \tforeach (glob(base_path($this->passport_path) . '*.php') as $filename)\n \t{\n \t $file = file_get_contents($filename);\n \t file_put_contents($filename, str_replace($this->laravel_model, $this->mongo_model, $file));\n \t //$this->info($filename . \" has been Checked/Modified\");\n \t}\n\n }", "public function saveTo(string $path);", "public final function save()\n {\n }", "public function saveToFile($file)\n {\n \n }", "public function save()\n\t{\n\t\treturn file_put_contents(self::filepath($this->name), $this->content);\n\t}", "public function saveCache()\n {\n if($this->isCacheExists()){\n if($this->isUpdateRequired()){\n $this->updateCache();\n }\n } else {\n $this->packData()->writeFile();\n }\n }", "public function save()\n\t {\n\t\tif (isset($this->_advert->date) === true && isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$bigfile = new BigFile(\"base-\" . $this->_advert->phone, 10);\n\t\t\t$bigfile->addrecord($this->_advert->date);\n\t\t } //end if\n\n\t }", "public function save()\n {\n if ($this->createDirectoryStructure($this->getPath())) {\n $content = $this->generateContents();\n file_put_contents($this->getPathname(), $content);\n }\n }", "public function save($filename) {\r\n file_put_contents($filename, $this->contents);\r\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "function save() {\r\n\t\t$this->log .= \"save() called<br />\";\r\n\t\tif (count($this->data) < 1) {\r\n\t\t\t$this->log .= \"Nothing to save.<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//create file pointer\r\n\t\tif (!$fp=@fopen($this->filename,\"w\")) {\r\n\t\t\t$this->log .= \"Could not create or open \".$this->filename.\"<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//write to file\r\n\t\tif (!@fwrite($fp,serialize($this->data))) {\r\n\t\t\t$this->log .= \"Could not write to \".$this->filename.\"<br />\";\r\n\t\t\tfclose($fp);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//close file pointer\r\n\t\tfclose($fp);\r\n\t\treturn true;\r\n\t}", "public abstract function save();", "function salva()\n\t{\n\t\trestauraConObj($this->mapa,$this->postgis_mapa);\n\t\t$this->mapa->save($this->arquivo);\n\t}", "function load() {\n $this->log .= \"load() called<br />\";\n if (!file_exists($this->filename)) {\n $this->log .= $this->filename.\" does not exist.<br />\";\n return false;\n }\n if (!$x = @file_get_contents($this->filename)) {\n $this->log .= \"Could not read \".$this->filename.\"<br />\";\n return false;\n }\n if (!$this->data = unserialize($x)) {\n $this->log .= \"unserialize failed<br />\";\n $this->data = array();\n return false;\n }\n touch($this->filename);\n return true;\n }", "function loadFileFromDB() {\n\t\t// If file contents are in bin_data column, fetch data and store in file.\n\t\tif (isset($this->data_array[\"bin_data\"]) && \n\t\t\ttrim($this->data_array[\"bin_data\"]) != \"\") {\n\n\t\t\t// Need to decode the string first.\n\t\t\t$theFileContent = base64_decode($this->data_array[\"bin_data\"]);\n\n\t\t\t$theDir = dirname($this->getFile());\n\t\t\tif (!file_exists($theDir)) {\n\t\t\t\t// Its parent directory does not exist yet. Create it.\n\t\t\t\tmkdir($theDir);\n\t\t\t}\n\n\t\t\t// Create the file for future use.\n\t\t\t$fp = fopen($this->getFile(), \"w+\");\n\t\t\tfwrite($fp, $theFileContent);\n\t\t\tfclose($fp);\n\t\t}\n\t}", "public function save(){ \r\n return $this->xmlfile->save($this->absolutepath);\r\n }", "public function save() {\n $this->lastModified = new \\DateTime();\n parent::save();\n }", "function save();", "function save();", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "public function autosaved()\n {\n }", "public function doNotSaveFiles() {\n $this->_saveToFile = false;\n }", "public function beforeSave()\n {\n $fileService = $this->getCustomizationService();\n $fileService->prepareFile($this);\n $fileService->save($this);\n return parent::beforeSave();\n }", "public function saveDataToFile()\n {\n\n }", "public function save() {\n\t\t\t\n\t\t}", "public function file_put_contents($file, $content);", "private function changeLangFileContent() \n {\n $this->read();\n $this->arrayLang[$this->key] = $this->value;\n $this->save();\n }", "public function save() {}", "public function save() {}", "public function save() {}", "public function save()\n\t{\n\t\t// -> means the file was never loaded because no setting was changed\n\t\t// -> means no need to save\n\t\tif ($this->settings === null) return;\n\t\t\n\t\t$yaml = Spyc::YAMLDump($this->settings);\n\t}", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public function flushFile()\n {\n $this->em->flush();\n }", "public function postImport() {\n $this->closeFile();\n }", "function save ()\n {\n parent::_save ( $this->relationships, $this->basepath ) ;\n }", "function save($path, $file) {\n $input = fopen(\"php://input\", \"r\");\n $temp = tmpfile();\n $realSize = stream_copy_to_stream($input, $temp);\n fclose($input);\n\n if ($realSize != $this->getSize()){\n return false;\n }\n\n\n $target = fopen($path.$file, \"w\");\n fseek($temp, 0, SEEK_SET);\n stream_copy_to_stream($temp, $target);\n fclose($target);\n\n // создать миниатюру\n $image = new SimpleImage();\n $image->load($path.$file);\n $image->resizeToHeight(200);\n $image->save($path.'small/small_'.$file);\n ;\n\n return true;\n }", "public function save() \n\t{\n\t\tif (is_null ( $this->getDataFile () )) \n\t\t{\n\t\t\tthrow new Exception ( 'Data File is not set' );\n\t\t}\n\t\t\n\t\tif (!is_dir(dirname($this->getDataFile())))\n\t\t{\n\t\t\tthrow new Exception('Directory holding data file does not exist');\n\t\t}\n\t\t\n\t\tif (!$handle = fopen($this->getDataFile(), 'w')) \n\t\t{\n\t\t\tthrow new Exception('Cannot open file');\n\t\t}\n\t\t\n\t\t// Write $somecontent to our opened file.\n\t\tif (fwrite($handle, $this) === FALSE) \n\t\t{\n\t\t\tthrow new Exception('Cannot write to file');\n\t\t}\n\t\t\n\t\tfclose($handle);\n\t\t\n\t\treturn true;\n\t}", "function save($path) {\n $input = fopen(\"php://input\", \"r\");\n $temp = tmpfile();\n $realSize = stream_copy_to_stream($input, $temp);\n fclose($input);\n\n if ($realSize != $this->getSize()){\n return false;\n }\n\n $target = fopen($path, \"w\");\n fseek($temp, 0, SEEK_SET);\n stream_copy_to_stream($temp, $target);\n fclose($target);\n\n return true;\n }", "function save($path) {\n $input = fopen(\"php://input\", \"r\");\n $temp = tmpfile();\n $realSize = stream_copy_to_stream($input, $temp);\n fclose($input);\n if ($realSize != $this->getSize()) {\n return false;\n }\n $target = fopen($path, \"w\");\n fseek($temp, 0, SEEK_SET);\n stream_copy_to_stream($temp, $target);\n fclose($target);\n return true;\n }", "public function preSave() {}", "function save($path) { \n $input = fopen(\"php://input\", \"r\");\n $temp = tmpfile();\n $realSize = stream_copy_to_stream($input, $temp);\n fclose($input);\n \n if ($realSize != $this->getSize()){ \n return false;\n }\n \n $target = fopen($path, \"w\"); \n fseek($temp, 0, SEEK_SET);\n stream_copy_to_stream($temp, $target);\n fclose($target);\n \n return true;\n }", "function save($path) { \n $input = fopen(\"php://input\", \"r\");\n $temp = tmpfile();\n $realSize = stream_copy_to_stream($input, $temp);\n fclose($input);\n \n if ($realSize != $this->getSize()){ \n return false;\n }\n \n $target = fopen($path, \"w\"); \n fseek($temp, 0, SEEK_SET);\n stream_copy_to_stream($temp, $target);\n fclose($target);\n \n return true;\n }", "protected function save()\n {\n $css = setcooki_path('plugin') . '/var/app.min.css';\n $json = setcooki_path('plugin'). '/var/options.json';\n $options = Option::get('wunderlist_todo_options', array());\n\n if(is_file($css))\n {\n @unlink($css);\n }\n if(is_file($json))\n {\n @chmod($json, 0755);\n }\n @file_put_contents($json, json_encode($options));\n }", "public function onSave()\n {\n // first, use the default onSave()\n $object = parent::onSave();\n \n // if the object has been saved\n// if ($object instanceof Voo)\n// {\n// // $source_file = 'tmp/'.$object->photo_path;\n// // $target_file = 'images/' . $object->photo_path;\n// // $finfo = new finfo(FILEINFO_MIME_TYPE);\n// \n// // if the user uploaded a source file\n// if (file_exists($source_file) AND $finfo->file($source_file) == 'image/png')\n// {\n// // move to the target directory\n// // rename($source_file, $target_file);\n// \n// try\n// {\n// TTransaction::open($this->database);\n// // update the photo_path\n// // $object->photo_path = 'images/'.$object->photo_path;\n// $object->store();\n// TTransaction::close();\n// }\n// catch (Exception $e) // in case of exception\n// {\n// new TMessage('error', '<b>Error</b> ' . $e->getMessage());\n// TTransaction::rollback();\n// }\n// }\n// }\n }", "function save ($info) {\r\n\t\t// 2) copy $this into store\t\r\n\t}", "private function save() \n {\n $content = \"<?php\\n\\nreturn\\n[\\n\";\n\n foreach ($this->arrayLang as $this->key => $this->value) \n {\n $content .= \"\\t'\".$this->key.\"' => '\".$this->value.\"',\\n\";\n }\n\n $content .= \"];\";\n\n file_put_contents($this->path, $content);\n\n }", "function save() {\n $this->log .= \"save() called<br />\";\n if (count($this->data) < 1) {\n $this->log .= \"Nothing to save.<br />\";\n return false;\n }\n //create file pointer\n $this->log .= \"Save file name: \".$this->filename.\"<br />\";\n if (!$fp=@fopen($this->filename,\"w\")) {\n $this->log .= \"Could not create or open \".$this->filename.\"<br />\";\n return false;\n }\n //write to file\n if (!@fwrite($fp,serialize($this->data))) {\n $this->log .= \"Could not write to \".$this->filename.\"<br />\";\n fclose($fp);\n return false;\n }\n //close file pointer\n fclose($fp);\n return true;\n }", "function salva()\n {\n if (isset($this->layer)) {\n $this->recalculaSLD();\n }\n restauraConObj($this->mapa, $this->postgis_mapa);\n $this->mapa->save($this->arquivo);\n }", "protected function save()\n {\n // Add the version to the map\n $this->map['version'] = $this->version;\n\n // try to serialize into the known path\n if (file_put_contents($this->mapPath, serialize((array) $this->map)) >= 0) {\n // Remove the version entry and return the result\n unset($this->map['version']);\n\n return true;\n\n } else {\n // Remove the version entry and return the result\n unset($this->map['version']);\n\n return false;\n }\n }" ]
[ "0.65135854", "0.63704044", "0.6322883", "0.6266109", "0.6250194", "0.6215735", "0.6212859", "0.6170606", "0.6168287", "0.61315745", "0.6122028", "0.611647", "0.610031", "0.60948324", "0.6094399", "0.6074358", "0.6071155", "0.5983432", "0.5968431", "0.59569514", "0.59226376", "0.5909224", "0.5907997", "0.5904689", "0.59010774", "0.58960164", "0.5893969", "0.58708555", "0.58708555", "0.58708555", "0.58708555", "0.58708555", "0.58638513", "0.5844301", "0.58373624", "0.583304", "0.5817669", "0.58062035", "0.5803795", "0.5800551", "0.57913244", "0.57789683", "0.5754172", "0.5751344", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5748094", "0.5745759", "0.5720468", "0.568637", "0.5682702", "0.5678289", "0.56758434", "0.5674383", "0.5671498", "0.5671498", "0.56700283", "0.56670487", "0.5655027", "0.5654962", "0.56401247", "0.5636849", "0.56352466", "0.5633499", "0.5630739", "0.5630739", "0.5629961", "0.5622904", "0.56122005", "0.559426", "0.5592606", "0.557826", "0.5575355", "0.5566496", "0.55579036", "0.5554179", "0.55534524", "0.5551654", "0.5551654", "0.55466485", "0.55432814", "0.5539688", "0.5531663", "0.5525233", "0.5518569", "0.5516102" ]
0.0
-1
'co_prioridad'=>'co_prioridad', public $columFiltros = array('co_usuario'=>'co_usuario','co_naturaleza'=>'co_naturaleza','co_modalidad'=>'co_modalidad','co_regimen_lab'=>'co_regimen_lab');
public function convertArrayKeysToUtf88($array1) { $convertedArray1 = array(); $convertedArray = array(); foreach($array1 as $array) { foreach($array as $key => $value) { if(!mb_check_encoding($value, 'UTF-8')) {$value = utf8_encode($value); } $convertedArray[$key] = $value; } $convertedArray1[] = $convertedArray; } return $convertedArray1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function conf()\n {\n $dato_anio = toba::memoria()->get_parametro('filtro_anio');\n $dato_ua = toba::memoria()->get_parametro('filtro_ua');\n if(isset($dato_anio)){//el anio es filtro obligatorio asi que siempre vuelve con este dato\n $auxiliar['valor']=$dato_anio;\n $auxiliar['condicion']='es_igual_a';\n $auxiliar2['anio']=$auxiliar;\n\n if(isset($dato_ua)){//viene desde informe de estado actual\n $auxiliar['valor']=$dato_ua;\n $auxiliar['condicion']='es_igual_a';\n $auxiliar2['uni_acad']=$auxiliar;\n }\n $this->s__datos_filtro=$auxiliar2;\n }\n }", "function iniciarFiltro(&$filtro) {\n\n if (isset($_GET['order']))\n $filtro->order($_GET['order']);\n $filtro->nombres[] = 'Nombre';\n $filtro->valores[] = array('input', 'nombre', $filtro->filtro('nombre'));\n $filtro->nombres[] = 'Descripci&oacute;n';\n $filtro->valores[] = array('input', 'descripcion', $filtro->filtro('descripcion'));\n }", "public function paramsFilter(){\n\t\t\t\n\t\t\t$f = [];\n\t\t\t\n\t\t\t// Установка металла\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Металл',\n 'variabled' => 'metall',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$metallList = ['Комбинированное золото','Красное золото','Белое золото','Золочёное серебро','Чернёное серебро'];\n\t\t\t$metallListVals = ['kombinZoloto','krasnZoloto','belZoloto','zoloZoloto','chernZoloto']; \n\t\t\tforeach( $metallList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $metallListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка для кого\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Для кого',\n 'variabled' => 'sex',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$dlaKogo = ['Для женщин','Для мужчин', 'Для женщин, Для мужчин'];\n\t\t\t$dlaKogoVals = ['woman','men', 'unisex']; \n\t\t\tforeach( $dlaKogo as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $dlaKogoVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка размера\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Размер',\n 'variabled' => 'size',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$razmerList = ['2.0','12.0','13.0','13.5','14.0','14.5','15.0','15.5','16.0','16.5','17.0','17.5','18.0','18.5','19.0','19.5','20.0','20.5','21.0','21.5','22.0','22.5','23.0','23.5','24.0','24.5','25.0'];\n\t\t\t$razmerListVals = ['2_0','12_0','13_0','13_5','14_0','14_5','15_0','15_5','16_0','16_5','17_0','17_5','18_0','18_5','19_0','19_5','20_0','20_5','21_0','21_5','22_0','22_5','23_0','23_5','24_0','24_5','25_0']; \n\t\t\tforeach( $razmerList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $razmerListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add; \n\t\t\t\n\t\t\t// Установка вставки\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Вставка',\n 'variabled' => 'kamen',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$kamenList = ['Бриллиант','Сапфир','Изумруд','Рубин','Жемчуг','Топаз','Аметист','Гранат','Хризолит','Цитрин','Агат','Кварц','Янтарь','Опал','Фианит'];\n\t\t\t$kamenListVals = ['brilliant','sapfir','izumrud','rubin','jemchug','topaz','ametist','granat','hrizolit','citrin','agat','kvarc','jantar','opal','fianit']; \n\t\t\tforeach( $kamenList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $kamenListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка формы вставки\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Форма вставки',\n 'variabled' => 'forma_vstavki',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t];\t\t\t\n\t\t\t$formaList = ['Кабошон','Круг','Овал','Груша','Маркиз', 'Багет', 'Квадрат', 'Октагон', 'Триллион', 'Сердце', 'Кушон', 'Пятигранник', 'Шестигранник', 'Восьмигранник'];\n\t\t\t$formaListVals = ['Kaboshon','Krug','Oval','Grusha','Markiz', 'Baget', 'Kvadrat', 'Oktagon', 'Trillion', 'Serdtce', 'Kushon', 'Piatigranniq', 'Shestigranniq', 'Vosmigrannic']; \n\t\t\tforeach( $formaList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $formaListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n \n /*\n\t\t\t\techo json_encode( $f );\n\t\t\t*/\n\t\t\techo \"<pre>\";\n\t\t\tprint_r( $f );\n\t\t\techo \"</pre>\";\t\n\t\t\t\n\t\t\t\n \n \n // металл\n \n // для кого\n \n // размер\n \n // Камень\n \n // Форма вставки\n \n \n /*{\"type\":\"checkbox-group\",\"title\":\"Размер\",\"variabled\":\"Razmer\",\"impact\":\"products\",\"data\":[{\"title\":\"2.0\",\"value\":\"\",\"variabled\":\"2_0\"},{\"title\":\"12.0\",\"value\":\"\",\"variabled\":\"12_0\"},{\"title\":\"13.0\",\"value\":\"\",\"variabled\":\"13_0\"},{\"title\":\"13.5\",\"value\":\"\",\"variabled\":\"13_5\"},{\"title\":\"14.0\",\"value\":\"\",\"variabled\":\"14_0\"},{\"title\":\"14.5\",\"value\":\"\",\"variabled\":\"14_5\"},{\"title\":\"15.0\",\"value\":\"\",\"variabled\":\"15_0\"},{\"title\":\"15.5\",\"value\":\"\",\"variabled\":\"15_5\"},{\"title\":\"16.0\",\"value\":\"\",\"variabled\":\"16_0\"}]},\n\t\t\t\t\n\t\t\t\t{\"type\":\"checkbox-group\",\"title\":\"Проба\",\"variabled\":\"Proba\",\"impact\":\"products\",\"data\":[{\"title\":\"585\",\"value\":\"\",\"variabled\":\"proba_585\"},{\"title\":\"925\",\"value\":\"\",\"variabled\":\"proba_925\"}]},\n\t\t\t\t\n\t\t\t{\"type\":\"checkbox-group\",\"title\":\"Металл\",\"variabled\":\"Metall\",\"impact\":\"products\",\"data\":[{\"title\":\"Золото\",\"value\":\"\",\"variabled\":\"met_zoloto\"},{\"title\":\"Серебро\",\"value\":\"\",\"variabled\":\"met_serebro\"}]}*/\n \n\t\t\t/*\n\t\t\t[{\"type\":\"range-values\",\"title\":\"Цена\",\"variabled\":\"Cena\",\"impact\":\"price\",\"data\":[{\"title\":\"Цена от:\",\"value\":\"0\",\"variabled\":\"_ot\"},{\"title\":\"Цена до:\",\"value\":\"900000\",\"variabled\":\"_do\"}]},{\"type\":\"checkbox-group\",\"title\":\"Размер\",\"variabled\":\"Razmer\",\"impact\":\"products\",\"data\":[{\"title\":\"2.0\",\"value\":\"\",\"variabled\":\"2_0\"},{\"title\":\"12.0\",\"value\":\"\",\"variabled\":\"12_0\"},{\"title\":\"13.0\",\"value\":\"\",\"variabled\":\"13_0\"},{\"title\":\"13.5\",\"value\":\"\",\"variabled\":\"13_5\"},{\"title\":\"14.0\",\"value\":\"\",\"variabled\":\"14_0\"},{\"title\":\"14.5\",\"value\":\"\",\"variabled\":\"14_5\"},{\"title\":\"15.0\",\"value\":\"\",\"variabled\":\"15_0\"},{\"title\":\"15.5\",\"value\":\"\",\"variabled\":\"15_5\"},{\"title\":\"16.0\",\"value\":\"\",\"variabled\":\"16_0\"}]},{\"type\":\"checkbox-group\",\"title\":\"Проба\",\"variabled\":\"Proba\",\"impact\":\"products\",\"data\":[{\"title\":\"585\",\"value\":\"\",\"variabled\":\"proba_585\"},{\"title\":\"925\",\"value\":\"\",\"variabled\":\"proba_925\"}]},{\"type\":\"checkbox-group\",\"title\":\"Металл\",\"variabled\":\"Metall\",\"impact\":\"products\",\"data\":[{\"title\":\"Золото\",\"value\":\"\",\"variabled\":\"met_zoloto\"},{\"title\":\"Серебро\",\"value\":\"\",\"variabled\":\"met_serebro\"}]}]*/\n\t\t\t\n\t\t\t\n\t\t}", "function get_cfilter($filtro, $cfiltros = array()){\n return isset($cfiltros[$filtro]) ? $cfiltros[$filtro] : SIN_FILTRO;\n}", "function getArrayListFilterCol() {\n\t\t\t$data['kodeunit'] = 'u.kodeunit';\n\t\t\t\n\t\t\treturn $data;\n\t\t}", "function tamanhosColunasMatriculaFinal($oFiltros) {\n\n $oFiltros->iColunaAfastado = 46;\n $oFiltros->iColunaEvasaoMes = 23;\n $oFiltros->iColunaTransferenciaMes = 23;\n $oFiltros->iColunaTransferencia = 24;\n $oFiltros->iColunaResultadoFinal = 25;\n $oFiltros->iAlturaLinhaCabecalho = 12;\n $oFiltros->iMaximoAlunosPorPagina = 32;\n}", "private function getFiltroCulinaria()\n {\n return (array)$this->filtros['culinaria'];\n }", "function get_init_filters($filtros = array(), $valores = array()){\n $res = array();\n foreach ($filtros as $filtro){\n $res[$filtro] = get_cfilter($filtro, $valores);\n }\n return $res;\n}", "protected function setFiltroBusqueda()\n {\n \tsfLoader::loadHelpers('Date');\n\n \t$parcial = '';\n \t$modulo = $this->getModuleName();\n\n\t\t$this->cajaBsq = $this->getRequestParameter('caja_busqueda');\n\t\t$this->desdeBsq = $this->getRequestParameter('desde_busqueda');\n\t\t$this->hastaBsq = $this->getRequestParameter('hasta_busqueda');\n\t\t$this->ambitoBsq= $this->getRequestParameter('ambito_busqueda');\n\t\t\n\t\tif (!empty($this->cajaBsq)) {\n\t\t\t$parcial .= \" AND (titulo LIKE '%$this->cajaBsq%')\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowcaja', $this->cajaBsq);\n\t\t}\n\t\tif (!empty($this->desdeBsq)) {\n\t\t\t$parcial .= \" AND fecha >= '\".format_date($this->desdeBsq,'d').\"'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowdesde', $this->desdeBsq);\n\t\t}\n\t\tif (!empty($this->hastaBsq)) {\n\t\t\t$parcial .= \" AND fecha <= '\".format_date($this->hastaBsq,'d').\"'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowhasta', $this->hastaBsq);\n\t\t}\n\t\tif (!empty($this->ambitoBsq)) {\n\t\t\t$parcial .= \" AND ambito = '$this->ambitoBsq'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowambito', $this->ambitoBsq);\n\t\t}\n\t\t//\n\t\tif (!empty($parcial)) {\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowfilter', $parcial);\n\t\t} else {\n\t\t\tif ($this->hasRequestParameter('btn_buscar')) {\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowfilter');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcaja');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdesde');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowhasta');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowambito');\n\t\t\t} else {\n\t\t\t\t$parcial = $this->getUser()->getAttribute($modulo.'_nowfilter');\n\t\t\t\t$this->cajaBsq = $this->getUser()->getAttribute($modulo.'_nowcaja');\n\t\t\t\t$this->desdeBsq = $this->getUser()->getAttribute($modulo.'_nowdesde');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowhasta');\n\t\t\t\t$this->ambitoBsq= $this->getUser()->getAttribute($modulo.'_nowambito');\n\t\t\t}\n\t\t}\n\t\tif ($this->hasRequestParameter('btn_quitar')){\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowfilter');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcaja');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdesde');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowhasta');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowambito');\n\t\t\t$parcial = \"\";\n\t\t\t$this->cajaBsq = '';\n\t\t\t$this->desdeBsq = '';\n\t\t\t$this->hastaBsq = '';\n\t\t\t$this->ambitoBsq= '';\n\t\t}\n\t\t$this->roles = UsuarioRol::getRepository()->getRolesByUser($this->getUser()->getAttribute('userId'),1);\n\t\t$finalFilter = 'deleted = 0'.$parcial;\n\n\t\tif (!Common::array_in_array(array('1'=>'1', '2'=>'2'), $this->roles)) {\n\t\t\t$finalFilter .= ' AND destacada = 1';\n\t\t}\n\t\treturn $finalFilter;\n }", "protected function getSearchColumnsForFilter()\n {\n return sfConfig::get('app_ull_user_phone_book_search_columns', array(\n 'first_name',\n 'last_name',\n 'UllLocation->name',\n 'UllLocation->short_name',\n 'UllLocation->phone_base_no',\n 'UllDepartment->name',\n 'UllJobTitle->name',\n ));\n }", "private function iniciarFiltros($consultas = null) {\n $filtros = array();\n $filtros['categoria'] = '';\n $filtros['preco'] = '';\n $filtros['estado'] = '';\n if (is_array($consultas)){\n $filtros = $consultas;\n }\n return $filtros;\n }", "public function condicionesFiltros($filtros = null)\n\t{\n\t\t$condiciones\t\t= array();\n\t\tif ( ! empty($filtros['filtro']) )\n\t\t{\n\t\t\t// LIBRE\n\t\t\tif ( ! empty($filtros['filtro']['buscar']) )\n\t\t\t{\n\t\t\t\t// Cuando la busqueda libre es un numero\n\t\t\t\tif ( is_numeric($filtros['filtro']['buscar']) )\n\t\t\t\t{\n\t\t\t\t\tarray_push($condiciones, array(\n\t\t\t\t\t\t'OR'\t=> array(\n\t\t\t\t\t\t\t'Compra.id'\t\t\t\t\t=> $filtros['filtro']['buscar'],\n\t\t\t\t\t\t\t'Compra.total'\t\t\t\t=> $filtros['filtro']['buscar'],\n\t\t\t\t\t\t\t'Usuario.celular'\t\t\t=> $filtros['filtro']['buscar'],\n\t\t\t\t\t\t)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tarray_push($condiciones, array(\n\t\t\t\t\t\t'OR'\t=> array(\n\t\t\t\t\t\t\t'[Usuario].[nombre] + [Usuario].[apellido_paterno] + [Usuario].[apellido_materno] + [Usuario].[email] LIKE' => sprintf('%%%s%%', $filtros['filtro']['buscar'])\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// FECHA INICIAL\n\t\t\tif ( ! empty( $filtros['filtro']['fecha_min']) )\n\t\t\t{\n\t\t\t\t/** Se agrega la condicion al arreglo */\n\t\t\t\tarray_push($condiciones, array(\n\t\t\t\t\t'OR'\t=> array(\n\t\t\t\t\t\t'Compra.created >='\t\t=> sprintf('%s 00:00:00', $filtros['filtro']['fecha_min'])\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t}\n\t\t\t// FECHA FINAL\n\t\t\tif ( ! empty( $filtros['filtro']['fecha_max']) )\n\t\t\t{\n\t\t\t\t/** Se agrega la condicion al arreglo */\n\t\t\t\tarray_push($condiciones, array(\n\t\t\t\t\t'OR'\t=> array(\n\t\t\t\t\t\t'Compra.created <= '\t=> sprintf('%s 23:59:59', $filtros['filtro']['fecha_max'])\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t}\n\t\t\t// ESTADO COMPRA\n\t\t\tif ( ! empty( $filtros['filtro']['estado']) )\n\t\t\t{\n\t\t\t\tarray_push($condiciones, array(\n\t\t\t\t\t'OR'\t=> array(\n\t\t\t\t\t\t'Compra.estado_compra_id'\t=> $filtros['filtro']['estado']\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t}\n\t\t\t// RANGO ID\n\t\t\tif ( ! empty($filtros['filtro']['oc_min']) )\n\t\t\t{\n\t\t\t\tarray_push($condiciones, array(\n\t\t\t\t\t'AND'\t=> array(\n\t\t\t\t\t\t'Compra.id >='\t\t=> $filtros['filtro']['oc_min'],\n\t\t\t\t\t\t'Compra.id <='\t\t=> $filtros['filtro']['oc_max']\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t}\n\t\t\t// RANGO VALOR\n\t\t\tif ( ! empty($filtros['filtro']['monto_min']) )\n\t\t\t{\n\t\t\t\tarray_push($condiciones, array(\n\t\t\t\t\t'AND'\t=> array(\n\t\t\t\t\t\t'Compra.total >='\t\t=> $filtros['filtro']['monto_min'],\n\t\t\t\t\t\t'Compra.total <='\t\t=> $filtros['filtro']['monto_max']\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\tif ( ! empty($condiciones) )\n\t\t{\n\t\t\treturn $condiciones;\n\t\t}\n\t\treturn false;\n\t}", "protected function setFiltroBusqueda()\n {\n \tsfLoader::loadHelpers('Date');\n \t$parcial = '';\n \t$modulo = $this->getModuleName();\n\n\t\t$this->cajaBsq = $this->getRequestParameter('caja_busqueda');\n\t\t$this->categoriaBsq = $this->getRequestParameter('archivo_d_o[categoria_organismo_id]');\n\t\t$this->subcategoriaBsq = $this->getRequestParameter('archivo_d_o[subcategoria_organismo_id]');\n\t\t$this->organismoBsq = $this->getRequestParameter('archivo_d_o[organismo_id]');\n\t\t$this->documentacionBsq = $this->getRequestParameter('archivo_d_o[documentacion_organismo_id]');\n\t\t$this->desdeBsq = $this->getRequestParameter('desde_busqueda');\n\t\t$this->hastaBsq = $this->getRequestParameter('hasta_busqueda');\n\t\t\n\n\t\tif (!empty($this->cajaBsq)) {\n\t\t\t$parcial .= \" AND (ao.nombre LIKE '%$this->cajaBsq%')\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowcaja', $this->cajaBsq);\n\t\t}\n\t\tif (!empty($this->categoriaBsq)) {\n\t\t\t$parcial .= \" AND ao.categoria_organismo_id =\".$this->categoriaBsq ;\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowcategoria', $this->categoriaBsq);\n\t\t}\n\t\tif (!empty($this->subcategoriaBsq)) {\n\t\t\t$parcial .= \" AND ao.subcategoria_organismo_id =\".$this->subcategoriaBsq ;\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowsubcategoria', $this->subcategoriaBsq);\n\t\t}\n\t\tif (!empty($this->organismoBsq)) {\n\t\t\t$parcial .= \" AND ao.organismo_id =\".$this->organismoBsq ;\n\t\t\t$this->getUser()->setAttribute($modulo.'_noworganismos', $this->organismoBsq);\n\t\t}\n\t\tif (!empty($this->documentacionBsq)) {\n\t\t\t$parcial .= \" AND ao.documentacion_organismo_id =\".$this->documentacionBsq ;\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowdocumentacion', $this->documentacionBsq);\n\t\t}\n\t\tif (!empty($this->desdeBsq)) {\n\t\t\t$parcial .= \" AND ao.fecha >= '\".format_date($this->desdeBsq,'d').\"'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowdesde', $this->desdeBsq);\n\t\t}\n\t\tif (!empty($this->hastaBsq)) {\n\t\t\t$parcial .= \" AND ao.fecha <= '\".format_date($this->hastaBsq,'d').\"'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowhasta', $this->hastaBsq);\n\t\t}\n\n\n\t\tif (!empty($parcial)) {\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowfilter', $parcial);\n\t\t} else {\n\t\t\tif ($this->hasRequestParameter('btn_buscar')) {\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowfilter');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcaja');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdesde');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowhasta');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcategoria');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowsubcategoria');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_noworganismos');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdocumentacion');\n\t\t\t} else {\n\t\t\t\t$parcial = $this->getUser()->getAttribute($modulo.'_nowfilter');\n\t\t\t\t$this->cajaBsq = $this->getUser()->getAttribute($modulo.'_nowcaja');\n\t\t\t\t$this->desdeBsq = $this->getUser()->getAttribute($modulo.'_nowdesde');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowhasta');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowcategoria');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowsubcategoria');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_noworganismos');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowdocumentacion');\n\t\t\t}\n\t\t} \n\n\t\t\n\t\tif ($this->hasRequestParameter('btn_quitar')){\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowfilter');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcaja');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdesde');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowhasta');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcategoria');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowsubcategoria');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_noworganismos');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdocumentacion');\n\t\t\t$parcial=\"\";\n\t\t\t$this->cajaBsq = \"\";\n\t\t\t$this->categoriaBsq = '';\n\t\t\t$this->subcategoriaBsq = '';\n\t\t\t$this->organismoBsq = '';\n\t\t\t$this->documentacionBsq = '';\n\t\t\t$this->desdeBsq = '';\n\t\t\t$this->hastaBsq = '';\n\t\t}\n\t\t$organismos = Organismo::IdDeOrganismo($this->getUser()->getAttribute('userId'),1);\n $this->roles = UsuarioRol::getRepository()->getRolesByUser($this->getUser()->getAttribute('userId'),1);\n\t\tif(Common::array_in_array(array('1'=>'1', '2'=>'2', '6'=>'6'), $this->roles))\n\t\t{\n\t\t\treturn \"ao.deleted=0\".$parcial.\" AND (do.owner_id = \".$this->getUser()->getAttribute('userId').\" OR do.estado != 'guardado')\";\n\t\t}\n\t\telse\n\t\t{\n $responsables = ArchivoDO::getUSerREsponsables();\n return \"ao.deleted=0\".$parcial.\" AND ao.organismo_id IN \".$organismos.\" AND (do.owner_id = \".$this->getUser()->getAttribute('userId').\" OR do.estado != 'guardado') AND (ao.owner_id \".$responsables.\" OR do.confidencial != 1 OR ao.owner_id = \".$this->getUser()->getAttribute('userId').\")\";\n }\n\t\t \n\n }", "function getPago($filter) {\n \n $where = \" WHERE Id_pago LIKE :Id_pago OR Estatus LIKE :Estatus\";\n $array = array(\n 'Id_pago' => '%' . $filter . '%',\n 'Estatus' => '%' . $filter . '%',\n );\n $columns = \"`Id_pago`, `Nombre`, `Email`, `Fecha_anterior`, `Pago`, `Proxima_fecha`, `Estatus`, `Id_cliente`\";\n return $this->db->select1($columns, \"pagos\", $where, $array);\n }", "protected function getParametrosWhere(){\n\t\t\t$parametros = array();\n\t\t\t$parametros[\":pkusuario\"] = $this->pkUsuario;\n\t\t\treturn $parametros;\n\t}", "private function getFiltroPreco()\n {\n return (array)$this->filtros['precos'];\n }", "public function setFilter($arrFilter);", "function getListFilter($col,$key) {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'thnkurikulum': return \"p.thnkurikulum = '$key'\";\n\t\t\t\tcase 'unit': return \"p.kodeunit = '$key'\";\n\t\t\t\tcase 'matkul': return \"p.kodemk1 = '$key'\";\n\t\t\t\tcase 'matkul': return \"p.kodemk2 = '$key'\";\n\t\t\t\t\n\t\t\t}\n\t\t}", "public function getfilterColumns()\n\t{\n\t\treturn array(\"name\",\"last_name\", \"country\");\n\t}", "public function getFilter() :array;", "public function filtro($dados) {\n\n $data_de = $dados[\"data_de\"];\n $data_ate = $dados[\"data_ate\"];\n $id_usuario = $dados['id_usuario'];\n \n $param = \"\";\n \n if ($data_de != NULL && $data_ate != NULL):\n $objDateFormat = $this->DateFormat;\n $data_de = $objDateFormat->date_mysql($data_de);\n $data_ate = $objDateFormat->date_mysql($data_ate);\n \n $param .= \"and DATE(c.data) BETWEEN '$data_de' AND '$data_ate'\"; \n \n endif;\n \n\n if ($dados[\"id_usuario\"] != NULL):\n $param .= \" and c.id_usuario = $id_usuario\";\n\n endif;\n \n\n \n $query = $this->db->query(\"select c.data,p.codigo,u.login,f.nome,c.valor_venda,c.percentual,(c.valor_venda/100) * c.percentual as 'receber' from fin_comissao c\n inner join com_pedidos p\n on(c.id_pedido = p.id_pedido)\n inner join acesso_usuarios u\n on(c.id_usuario = u.id_usuario)\n inner join rh_colaboradores f\n on(u.id_colaborador = f.id_colaborador) \".$param.\" and p.faturado = 1 \");\n \n $result = $query->result_array();\n\n return $result;\n \n }", "function filterMap(): array\n {\n return [\n 'couponNameFilter'=>['coupon'],\n ];\n }", "function Viradeco_add_user_columns($column) {\n $column['viraclub'] = __('ViraClub ID','itstar');\n $column['phone'] = __('Phone','itstar');\n $column['email'] = __('Email','itstar');\n \n return $column;\n}", "function PreciosField( $Filter )\n {\n $Field = 'pPrecHab';\n if( !empty($Filter->Casa) ) $Field = 'pPrecAll';\n if( !empty($Filter->PMes) ) $Field = 'pPrc1Mes';\n if( !empty($Filter->Estd) ) $Field = 'pPrecEst';\n \n return $Field;\n }", "public function filtrarListaAlumnos($tipo_filtro, $valor)\n {\n //`al`.`carrera_especialidad`\n $filtro = \"\";\n switch ($tipo_filtro){\n case \"1\":\n //Filtro por sexo\n $filtro = \" AND p.sexo = \".$valor;\n break;\n case \"2\":\n //Filtro por municipio\n $filtro = \" AND al.id_municipio = \".$valor;\n break;\n case \"3\":\n //Filtro por por estatus de la cuenta (activa/inactva)\n $filtro = \" AND p.estatus = \".$valor;\n break;\n case \"4\":\n //Filtro por por Id de iniversidad\n $filtro = \" AND al.id_universidad = \".$valor;\n break;\n case \"5\":\n //Filtro por tipo de procedenceia\n $filtro = \" AND al.tipo_procedencia = \".$valor;\n break;\n case \"6\":\n //Filtro por carrera\n $filtro = \" AND al.carrera_especialidad = \".$valor;\n break;\n default:\n $filtro = \"\";\n break;\n }\n $query = \"SELECT \n al.id_alumno, p.nombre, p.app, \n p.apm, p.telefono, p.sexo, \n p.estatus AS estatus_p, al.id_municipio, \n al.id_universidad, al.id_persona, \n al.matricula, al.nombre_uni, al.carrera_especialidad, \n al.email, al.fecha_registro, al.perfil_image, al.estatus \n AS estatus_al, tp.id_tipo_procedencia, tp.tipo_procedencia\n FROM alumno al,persona p , tipo_procedencia tp\n WHERE al.id_persona = p.id_persona \n AND al.id_tipo_procedencia_fk = tp.id_tipo_procedencia\n AND p.estatus = 1 \".$filtro.\" ORDER BY `p`.`nombre` ASC\";\n $this->connect();\n $result = $this->getData($query);\n $this->close();\n return $result;\n }", "protected function setFilterArray() {\n $primary_keys = getPrimaryKeys($this->table_name);\n foreach ($primary_keys as $pk) {\n if (isset($_GET[$pk])) {\n $this->filter[$pk] = Mysql::SQLValue($_GET[$pk]);\n }\n }\n }", "function oda_ordenanza_columns_head($defaults){\n if ( $_GET['post_type'] == 'ordenanza' ){\n unset($defaults['comments']);\n unset($defaults['taxonomy-temas']);\n unset($defaults['date']);\n $defaults['ciudad'] = 'Ciudad';\n $defaults['tramite'] = 'Número de Trámite';\n $defaults['presentacion'] = 'Fecha de Presentación';\n $defaults['iniciativa'] = 'Iniciativa';\n $defaults['date'] = __('Fecha', 'oda');\n }\n return $defaults;\n}", "function column(){\n\t\t$column_array = array(\n\t\t\t\t0 => 'A.date_add',//default order sort\n\t\t\t\t1 => 'A.po_number',\n\t\t\t\t2 => 'A.po_date',\n\t\t\t\t3 => 'B.nama_supplier',\t\t\n\t\t\t\t4 => 'A.state_received',\t\n\t\t\t\t5 => 'A.active',\t\n\t\t\t\t6 => 'A.add_by',\n\t\t\t\t7 => 'A.date_add',\n\t\t);\n\t\treturn $column_array;\n\t}", "public function buscarPorFiltros($filters, $personalShopper = 0) {\n// echo \"<pre>\";\n// print_r($filters);\n// echo \"</pre>\";\n// Yii::app()->end();\n\n $criteria = new CDbCriteria;\n \n $criteria->with = array();\n //$criteria->select = array();\n //$criteria->select[] = \"t.*\";\n \n $havingPrecio = '';\n \n for ($i = 0; $i < count($filters['fields']); $i++) {\n \n $column = $filters['fields'][$i];\n $value = $filters['vals'][$i];\n $comparator = $filters['ops'][$i];\n \n if($i == 0){\n $logicOp = 'AND'; \n }else{ \n $logicOp = $filters['rels'][$i-1]; \n } \n \n if($column == 'campana')\n {\n \n $value = ($comparator == '=') ? \"=\".$value.\"\" : $value;\n \n $criteria->compare('campana.nombre', $value,\n true, $logicOp);\n \n \n $criteria->with[] = 'campana';\n \n \n continue;\n }\n \n if($column == 'precio')\n {\n $criteria->addCondition('(select sum(precios.precioDescuento) from `tbl_look_has_producto` `productos_productos`, `tbl_producto` `productos`, `tbl_precio` `precios` \n where `t`.`id`=`productos_productos`.`look_id` and `productos`.`id`=`productos_productos`.`producto_id` and \n `precios`.`tbl_producto_id`=`productos`.`id`) '\n .$comparator.' '.$value.'', $logicOp); \n \n \n continue;\n } \n \n if($column == 'marca')\n { \n \n $criteria->with['productos'] = array(\n 'select'=> false,\n //'joinType'=>'INNER JOIN',\n //'condition'=>'productos.nombres = 8',\n ); \n \n //having\n if(!strpos($criteria->group, \"t.id\")){\n $criteria->group = 't.id';\n }\n \n //agregar condicion marca_id\n $criteria->addCondition('productos.marca_id'\n .$comparator.' '.$value.'', $logicOp); \n \n continue;\n } \n \n if($column == 'prendas')\n {\n $criteria->addCondition('(select count(look_id) \n from `tbl_look_has_producto` `productos_productos`\n where `t`.`id`=`productos_productos`.`look_id`)'\n .$comparator.' '.$value.'', $logicOp);\n \n continue; \n } \n \n if($column == 'cantidad')\n {\n /*\n * Por cada orden se esta contando el look como vendido una \n * sola vez asi aparezca dos veces en la misma orden\n * \n * Luego se debe corregir para que cuente correctamente si \n * el look ha sido pedido mas de una vez en una orden\n */\n \n $criteria->addCondition('\n (select count(distinct(orden.id)) from tbl_orden_has_productotallacolor o_ptc, tbl_orden orden\n where o_ptc.tbl_orden_id = orden.id\n and\n o_ptc.look_id > 0\n and\n o_ptc.look_id = t.id\n and\n orden.estado IN (3, 4, 8))'\n .$comparator.' '.$value.'', $logicOp);\n \n continue; \n } \n \n if($column == 'monto')\n {\n \n $criteria->addCondition('\n (select count(distinct(orden.id)) from tbl_orden_has_productotallacolor o_ptc, tbl_orden orden\n where o_ptc.tbl_orden_id = orden.id\n and\n o_ptc.look_id > 0\n and\n o_ptc.look_id = t.id\n and\n orden.estado IN (3, 4, 8)) \n *\n (select sum(precios.precioDescuento) from `tbl_look_has_producto` `productos_productos`, `tbl_producto` `productos`, `tbl_precio` `precios` \n where `t`.`id`=`productos_productos`.`look_id` and `productos`.`id`=`productos_productos`.`producto_id` and \n `precios`.`tbl_producto_id`=`productos`.`id`)\n '\n .$comparator.' '.$value.'', $logicOp);\n \n continue; \n } \n\n\t\t\t\tif($column == 'ocasion')\n {\n \t\n\t\t\t\t\t$criteria->compare('categoriahaslook.categoria_id', $comparator.\" \".$value,\n\t false, $logicOp);\n\t\t\t\t\t$criteria->with[] = 'categoriahaslook';\n\t\t\t\t\t\n\t\t\t\t\t continue; \n\t\t\t\t \n }\n\n\t\t\t\tif($column == 'activo')\n {\t \n\t\t\t\t\t \t $criteria->compare(\"t.activo\", $comparator.$value, \n\t false, $logicOp);\n\t\t\t\t\t \t\t\t\t\n\t\t\t\t\t continue; \n\t\t\t\t \n }\n\t\t\t\t\n\t\t\t\tif($column == 'inactivo')\n {\n\t\t\t\t\t$value = ($value == 1) ? 0 : 1; // el contrario\n\t\t\t\t\t\n\t\t\t\t\t $criteria->compare(\"t.activo\", $comparator.$value, \n\t false, $logicOp);\n\t\t\t\t\t\n\t\t\t\t\t continue; \n\t\t\t\t \n } \n \n if($column == 'created_on')\n {\n $value = strtotime($value);\n $value = date('Y-m-d H:i:s', $value);\n }\n\n\n\n $criteria->compare(\"t.\".$column, $comparator.\" \".$value,\n false, $logicOp);\n \n }\n \n// $criteria->select = 't.*';\n $criteria->having .= $havingPrecio;\n //$criteria->with = array('categorias', 'preciotallacolor', 'precios');\n $criteria->together = true;\n \n //si se estan usando los filtros en Mis Looks\n if($personalShopper){\n $criteria->compare('t.user_id', $personalShopper); //siempre los no eliminados\n }\n \n \n// echo \"Criteria:\";\n// \n// echo \"<pre>\";\n// print_r($criteria->toArray());\n// echo \"</pre>\"; \n //exit();\n\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function selectCustomizado($modo, $condicion = array(), $order = '') {\n \n if ($condicion == '')\n $condicion = array();\n\n $where = '';\n foreach ($condicion as $key => $value) {\n if (($value == 'IS NULL') || (substr($value, 0, 7) == 'BETWEEN')) {\n $where .= \" AND $key \" . $value;\n } else {\n $where .= \" AND $key = '\" . $value . \"' \";\n }\n }\n\n //echo $where;exit();\n \n $sql = \"SELECT \n com.`id` comprobante_id,\n cli.`razon_social` cli_razon_social,\n cli.ruc cli_ruc,\n tip.`tipo_documento` tipo_documento,\n serie,\n numero,\n DATE_FORMAT(com.fecha_de_emision, '%d-%m-%Y') AS fecha_de_emision,\n DATE_FORMAT(com.fecha_de_vencimiento, '%d-%m-%Y') AS fecha_de_vencimiento,\n com.total_gravada,\n com.total_igv,\n com.total_a_pagar,\n com.enviado_sunat,\n IF(estado_sunat = '1', 'Por validar','Validado') estado_sunat,\n com.`enviado_cliente`,\n com.`enviado_equipo`,\n tip.`tipo_documento` tipo_documento,\n emp.`empresa` empresa,\n mon.`abreviado`,\n mon.`moneda`,\n mon.`simbolo`\n FROM `comprobantes` com\n JOIN `clientes` cli ON com.`cliente_id` = cli.`id`\n JOIN `tipo_documentos` tip ON com.`tipo_documento_id` = tip.`id` \n JOIN `empresas` emp ON com.`empresa_id` = emp.`id`\n JOIN `monedas` mon ON com.`moneda_id` = mon.`id`\n WHERE eliminado=0 AND com.fecha_delete IS NULL \" . $where . \" \" . $order;\n \n $query = $this->db->query($sql);\n\n switch ($modo) {\n case '1':\n $resultado = '';\n if ($query->num_rows() > 0) {\n $row = $query->row_array();\n $resultado = $row[$campos];\n }\n return $resultado;\n\n case '2':\n $row = array();\n if ($query->num_rows() > 0) {\n $row = $query->row_array();\n }\n return $row;\n\n case '3':\n $rows = array();\n foreach ($query->result_array() as $row) {\n $rows[] = $row;\n }\n return $rows;\n }\n }", "public function getDefaultFilterColumns();", "public function busquda_Filtro($_Palabra,$_Orden,$_Estado,$_Calificaciones,$_Certificaciones,$_Asociaciones,$IDEMpresa){\n\t\t//primero verifico en que ordern las voy a solicitar\n\t\tif($_Orden===''){\n\t\t\t$_Orden=\"\";\n\t\t}else if($_Orden==='az'){\n\t\t\t$_Orden=\" order by Razon_Social asc\";\n\t\t}else if($_Orden==='za'){\n\t\t\t$_Orden=\" order by Razon_Social desc\";\n\t\t}\n\t\t$_Resultadosr=$this->db->query(\"SELECT IDEmpresa FROM empresa WHERE Razon_Social LIKE '%$_Palabra%'\");\n\t\t$_Resultadosr=$_Resultadosr->result_array();\n\t\t\n\t\t//busco en su nombre comercial\n\t\t$_Resultadosnc=$this->db->query(\"SELECT IDEmpresa FROM empresa WHERE Nombre_Comer LIKE '%$_Palabra%'\");\n\t\t$_Resultadosnc=$_Resultadosnc->result_array();\n\n\t\t//busco por su rfc\n\t\t$_Resultadosrfc=$this->db->query(\"SELECT IDEmpresa FROM empresa WHERE RFC LIKE '%$_Palabra%' \");\n\t\t$_Resultadosrfc=$_Resultadosrfc->result_array();\n\n\t\t//busco por su descripcion\n\t\t$_Resultadosprefil=$this->db->query(\"SELECT IDEmpresa FROM empresa WHERE Perfil LIKE '%$_Palabra%' \");\n\t\t$_Resultadosprefil=$_Resultadosprefil->result_array();\n\t\t\n\t\t//buscos por sus productos y servicios\n\t\t$_Resultadospprod=$this->db->query(\"SELECT IDEmpresa FROM productos WHERE Producto LIKE '%$_Palabra%'\");\n\t\t$_Resultadospprod=$_Resultadospprod->result_array();\n\t\t\n\n\t\t//buscos por sus productos y servicios de su descripcion\n\t\t$_Resultadospprodd=$this->db->query(\"SELECT IDEmpresa FROM productos WHERE Descripcion LIKE '%$_Palabra%'\");\n\t\t$_Resultadospprodd=$_Resultadospprodd->result_array();\n\t\t\n\n\t\n\t\n\n\t\t//buscos por sus marca\n\t\t$_Resultadosmarcas=$this->db->query(\"SELECT IDEmpresa FROM marcas WHERE Marca LIKE '%$_Palabra%'\");\n\t\t$_Resultadosmarcas=$_Resultadosmarcas->result_array();\n\n\t\t//buscos por sus normas de calidad\n\t\t$_Resultadosnormas=$this->db->query(\"SELECT IDEmpresa FROM normascalidad WHERE Norma LIKE '%$_Palabra%'\");\n\t\t$_Resultadosnormas=$_Resultadosnormas->result_array();\n\n\t\t// ahohora tengo que unir todos los resultados en un solo array para obtener sus datos\n\t\t$todos=array_merge($_Resultadosr, $_Resultadosnc,$_Resultadosrfc,$_Resultadosprefil,$_Resultadospprod,$_Resultadospprodd,$_Resultadosmarcas,$_Resultadosnormas);\n\t\t\n\t\t$_Resultados=[];\n\t\t//ahora elimino los repetidos\n\t\tforeach($todos as $empresa){\n\t\t\t$bandera=false;\n\t\t\t$resulta=in_array_r($empresa[\"IDEmpresa\"],$_Resultados);\n\t\t\tif($resulta===false){\n\t\t\t\tarray_push($_Resultados,array(\"IDEmpresa\"=>$empresa[\"IDEmpresa\"]));\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t// ahora obtengo el filtro de estados\n\t\tif($_Estado!==''){\n\t\t\tforeach($_Resultados as $keys=>$_empresa){\n\t\t\t\t$_datos_empresa=$this->Datos_Empresa($_empresa[\"IDEmpresa\"]);\n\t\t\t\tif($_datos_empresa[\"Estado\"]!==$_Estado){\n\t\t\t\t\tunset($_Resultados[$keys]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$_Resultados = array_values($_Resultados);\n\n\t\t\n\t\t// ahora obtengo el filtro de Certificaciones\n\t\tif($_Certificaciones===TRUE){\n\t\t\tforeach($_Resultados as $keys=>$_empresa){\n\t\t\t\t$_datos_empresa=$this->Datos_certificaciones($_empresa[\"IDEmpresa\"]);\n\t\t\t\tif(count($_datos_empresa)===0){\n\t\t\t\t\tunset($_Resultados[$keys]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$_Resultados = array_values($_Resultados);\n\n\t\t\n\t\t// ahora obtengo el filtro de Asociaciones\n\t\tif($_Asociaciones===TRUE){\n\t\t\tforeach($_Resultados as $keys=>$_empresa){\n\t\t\t\t$_datos_empresa=$this->Datos_Asociaciones($_empresa[\"IDEmpresa\"]);\n\t\t\t\tif(count($_datos_empresa)===0){\n\t\t\t\t\tunset($_Resultados[$keys]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$_Resultados = array_values($_Resultados);\n\t\n\t\t$_Datos=[];\n\t\t\n\t\tif($_Calificaciones!==\"\"){\n\t\t\t$_DatosCalificaciones=explode('-',$_Calificaciones);\n\t\t\t\n\t\t\tforeach($_Resultados as $_Empresa){\n\t\t\t\t$_DatosEmpresa=$this->Datos_Empresa($_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$_DatosNormas=$this->Model_Norma->getall($_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$_seguida = $this->Model_Follow->getfollowtrue($IDEMpresa,$_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$ImagenCliente= $this->Model_Imagen->ImagenGen($_Empresa[\"IDEmpresa\"],'cliente');\n\t\t\t\t$ImagenProveedor= $this->Model_Imagen->ImagenGen($_Empresa[\"IDEmpresa\"],'proveedor');\n\t\t\t\t$_total=$this->db->query(\"SELECT COUNT('*') AS total FROM tbcalificaciones where IDEmpresaReceptor='\".$_Empresa[\"IDEmpresa\"].\"'\");\n\t\t\t\t$_total=$_total->row_array();\n\t\t\t\tif((int)$_total[\"total\"]>=(int)$_DatosCalificaciones[0] && (int)$_total[\"total\"]<=(int)$_DatosCalificaciones[1] ){\n\t\t\t\t\tarray_push(\n\t\t\t\t\t\t$_Datos,\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"IDEmpresa\"=>$_DatosEmpresa[\"IDEmpresa\"],\n\t\t\t\t\t\t\t\"Razon_Social\"=>$_DatosEmpresa[\"Razon_Social\"],\n\t\t\t\t\t\t\t\"RFC\"=>$_DatosEmpresa[\"RFC\"],\n\t\t\t\t\t\t\t\"Nombre_Comer\"=>$_DatosEmpresa[\"Nombre_Comer\"],\n\t\t\t\t\t\t\t\"Perfil\"=>$_DatosEmpresa[\"Perfil\"],\n\t\t\t\t\t\t\t\"Logo\"=>$_DatosEmpresa[\"Logo\"],\n\t\t\t\t\t\t\t\"Banner\"=>$_DatosEmpresa[\"Banner\"],\n\t\t\t\t\t\t\t\"Normas\"=>$_DatosNormas,\n\t\t\t\t\t\t\t\"Follow\"=>$_seguida,\n\t\t\t\t\t\t\t\"ImagenCliente\"=>$ImagenCliente,\n\t\t\t\t\t\t\t\"ImagenProveedor\"=>$ImagenProveedor\n\t\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}else{\n\t\t\tforeach($_Resultados as $_Empresa){\n\t\t\t\t\n\t\t\t\t$_DatosEmpresa=$this->Datos_Empresa($_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$_DatosNormas=$this->Model_Norma->getall($_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$_seguida = $this->Model_Follow->getfollowtrue($IDEMpresa,$_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$ImagenCliente= $this->Model_Imagen->ImagenGen($_Empresa[\"IDEmpresa\"],'cliente');\n\t\t\t\t$ImagenProveedor= $this->Model_Imagen->ImagenGen($_Empresa[\"IDEmpresa\"],'proveedor');\n\t\t\t\t$_total=$this->db->query(\"SELECT COUNT('*') AS total FROM tbcalificaciones where IDEmpresaReceptor='\".$_Empresa[\"IDEmpresa\"].\"'\");\n\t\t\t\tarray_push($_Datos,\n\t\t\t\tarray(\n\t\t\t\t\t\"IDEmpresa\"=>$_DatosEmpresa[\"IDEmpresa\"],\n\t\t\t\t\t\"Razon_Social\"=>$_DatosEmpresa[\"Razon_Social\"],\n\t\t\t\t\t\"RFC\"=>$_DatosEmpresa[\"RFC\"],\n\t\t\t\t\t\"Nombre_Comer\"=>$_DatosEmpresa[\"Nombre_Comer\"],\n\t\t\t\t\t\"Perfil\"=>$_DatosEmpresa[\"Perfil\"],\n\t\t\t\t\t\"Logo\"=>$_DatosEmpresa[\"Logo\"],\n\t\t\t\t\t\"Banner\"=>$_DatosEmpresa[\"Banner\"],\n\t\t\t\t\t\"Normas\"=>$_DatosNormas,\n\t\t\t\t\t\"Follow\"=>$_seguida,\n\t\t\t\t\t\"ImagenCliente\"=>$ImagenCliente,\n\t\t\t\t\t\"ImagenProveedor\"=>$ImagenProveedor\n\t\t\t\t));\n\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn $_Datos;\t\t\n\t}", "public function get_stock_cruzado($array_filtros=NULL,$page = 1, $cfg_pagination = NULL) {\n\n //Preparamos la consulta con los filtros de la busqueda en el caso de que se haya seleccionado alguno\n $where='';\n if(isset($array_filtros[\"id_modelo\"]) && !empty($array_filtros[\"id_modelo\"])) {\n $where .= ' AND temporal.id_device = ' . $array_filtros['id_modelo'];\n }\n if(isset($array_filtros[\"id_marca\"]) && !empty($array_filtros[\"id_marca\"])) {\n $where .= ' AND brand_device.id_brand_device = ' . $array_filtros['id_marca'];\n }\n\n $limit='';\n if(!empty($cfg_pagination)) {\n if ($page==1) {\n $limit=\" LIMIT \".$page *$cfg_pagination['per_page'];\n } else {\n if($page>1){\n $limit=\" LIMIT \".($page-1) *$cfg_pagination['per_page'].\",\". $cfg_pagination['per_page'];\n }\n }\n }\n\n $this->db->query(\" DROP VIEW IF EXISTS robados;\");\n /*Creación de una vista que guarda los datos de los terminales robados y que no han llegado al almacen*/\n $this->db->query(\"CREATE VIEW robados AS \n SELECT devices_pds.id_device,COUNT(*) as suma \n FROM devices_pds \n INNER JOIN incidencias ON incidencias.id_devices_pds=devices_pds.id_devices_pds \n WHERE (devices_pds.status = \\\"Baja\\\" AND incidencias.tipo_averia=\\\"Robo\\\" and \n incidencias.status_pds=\\\"Finalizada\\\" and incidencias.id_incidencia NOT IN \n (select id_incidencia from devices_almacen where id_incidencia IS NOT NULL))\n GROUP BY devices_pds.id_device\");\n /*\n * OR\n (devices_pds.status = \"RMA\" AND incidencias.tipo_averia=\"Robo\" and\n incidencias.status_pds=\"Finalizada\" and incidencias.id_incidencia NOT IN\n (select id_incidencia from devices_almacen where id_incidencia IS NOT NULL))\n */\n\n $query = $this->db->query('\n\t\tSELECT temporal.id_device, brand_device.brand, temporal.device, unidades_pds,\n\t\t(unidades_transito+unidades_tienda_transito) as unidades_transito, unidades_reservado,\n\t\tunidades_rma,unidades_almacen, (case when unidades_robadas is NULL then 0 else unidades_robadas end) as unidades_robadas,\n\t\tunidades_televenta,\n\t\t(case when unidades_robadas is NULL then (unidades_pds + unidades_tienda_transito+ unidades_transito + unidades_reservado + unidades_rma \n + unidades_almacen+unidades_televenta) \n else (unidades_pds + unidades_transito + unidades_reservado + unidades_tienda_transito+ unidades_rma + \n unidades_almacen+unidades_robadas+unidades_televenta) end) as total,\n\t\t(CASE WHEN unidades_pds = 0 THEN 0 ELSE CEIL(unidades_pds * 0.05 + 2) END) as stock_necesario,\n\t\t(unidades_almacen - (CASE WHEN unidades_pds = 0 THEN 0 ELSE CEIL(unidades_pds * 0.05 + 2) END)) as balance,\n\t\ttemporal.status\n\t\tFROM (\n\t\t SELECT device.id_device, device.brand_device, device.device, device.status,\n (\n SELECT COUNT(*)\n FROM devices_pds\n WHERE (devices_pds.id_device = device.id_device) AND\n (devices_pds.status = \"Alta\" || devices_pds.status = \"Incidencia\" )\n )\n as unidades_pds,\n\n (\n SELECT COUNT(*)\n FROM devices_almacen\n WHERE (devices_almacen.id_device = device.id_device) AND\n (devices_almacen.status = \"En stock\")\n )\n as unidades_almacen,\n ( SELECT COUNT(*)\n FROM devices_almacen\n WHERE (devices_almacen.id_device = device.id_device) AND (devices_almacen.status = \"Transito\") \n )\n as unidades_transito,\n ( SELECT COUNT(*)\n FROM devices_pds\n WHERE devices_pds.id_device = device.id_device AND devices_pds.status = \"RMA\"\n )\n as unidades_tienda_transito,\n ( SELECT COUNT(*)\n FROM devices_almacen\n WHERE (devices_almacen.id_device = device.id_device) AND (devices_almacen.status = \"Reservado\") \n )\n as unidades_reservado,\n ( SELECT COUNT(*)\n FROM devices_almacen\n WHERE (devices_almacen.id_device = device.id_device) AND (devices_almacen.status = \"RMA\") \n )\n as unidades_rma,\n ( SELECT suma FROM robados \n WHERE robados.id_device = device.id_device \n ) \n as unidades_robadas ,\n ( SELECT COUNT(*)\n FROM devices_almacen\n WHERE (devices_almacen.id_device = device.id_device) AND (devices_almacen.status = \"Televenta\") \n )\n as unidades_televenta\n\n FROM device\n ) as temporal\n\n JOIN brand_device ON temporal.brand_device = brand_device.id_brand_device\n WHERE temporal.status = \"Alta\" ' .$where. ' ORDER BY brand_device.brand ASC, temporal.device ASC '.$limit);\n\n//echo $this->db->last_query(); exit;\n\n return $query->result();\n }", "public function getFilterParameters(): array;", "private function set_search_form_filters() {\n $ci =& get_instance();\n $fields = array();\n\n// We need keys for searhing data\n $keys = $this->search_form['filters'];\n\n /**\n * If no keys defined\n * get fields from table config\n * if no fields table config found, get from query\n */\n if (! $keys) {\n # jika ada definisi field yang akan ditampilkan\n if (count($this->table['fields']) > 0) {\n $fields = $this->table['fields'];\n }\n\n# jika tidak ada definisi field, ambil langsung dari query\n else {\n if (is_object($this->table['query']) && $this->table['query']->num_rows() > 0) {\n $list_fields = $this->table['query']->list_fields();\n foreach ($list_fields as $field) {\n $fields[$field] = ucwords( str_replace(\"_\", \" \", $field) );\n }\n }\n\n $this->table['fields'] = $fields;\n }\n\n# kopikan field tabel untuk field kunci pencarian\n $keys = array(\n 'keywords' => array('fields' => array_keys($fields))\n );\n }\n\n # hapus session sebelumnya\n $this->ci->session->unset_userdata(\"search_form_filters\");\n\n # simpan session baru\n $this->ci->session->set_userdata(\"search_form_filters\", array(\"{$this->class_path}\" => $keys));\n\n# simpan nilai default jika ada\n $values = array();\n\n foreach ($keys as $key => $val) {\n if (isset($val['value'])) {\n if (is_array($val['fields'])) {\n foreach ($val['fields'] as $fkey) {\n $values[$fkey] = array('value' => $post_value, 'opt' => 'or_like');\n }\n }\n else {\n $values[$val['fields']] = array('value' => $val['value'], 'opt' => 'and');\n }\n\n $ci->session->set_userdata(\"current_{$key}\", $val['value']);\n }\n }\n\n# hapus session sebelumnya\n $this->ci->session->unset_userdata(\"search_form_values\");\n\n # simpan session yang baru\n $this->ci->session->set_userdata(\"search_form_values\", array(\"{$this->class_path}\" => $values));\n }", "function chamadosEncerrados(){\n\t\t$this->pageTitle = \"Chamados Encerrados\";\n\n\t\t$conditions = array();\n\t\tif($this->usuarioGrupo == 5){\n\n\t\t\t// administrador geral\n\t\t\t$conditions = array (\n\t\t\t\t'(VwChamado.chamado_status_id =2 or VwChamado.chamado_status_id = 4 or VwChamado.chamado_status_id = 5)',\t\n\t\t\t);\n\t\t}elseif($this->usuarioGrupo == 2){\n\t\t\t$conditions = array (\n\t\t\t\t'VwChamado.solicitante_setor_id' => $this->usuarioSetor,\n\t\t\t\t'VwChamado.chamado_status_id =2 or VwChamado.chamado_status_id = 4 or VwChamado.chamado_status_id = 5',\n\t\t\t);\n\t\t}\n\t\t\n\t\t$filtro = array();\n\t\tforeach ($this->passedArgs as $chave=>$valor){\n\t\t\t// verifica se foi passado algum filtro como argumento\n\t\t\t// neste primeiro momento só será aceito um filtro\n\t\t\tif($chave == 'fil_remove' && $valor=='true'){\n\t\t\t\t$this->Session->del('ChamadosEncerradosFiltro.filtro');\n\t\t\t}else{\n\t\t\t\tif(substr($chave, 0, 4) == 'fil_'){\n\t\t\t\t\tif(!is_numeric($valor)){\n\t\t\t\t\t\t//$filtro = array(\"VwChamado.chamado_titulo like '\".$valor.\"%'\");\n\t\t\t\t\t\t$filtro = array(\"VwChamado.\".$campo. \"like '\".$valor.\"%'\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$filtro = array('VwChamado.'.substr($chave, 4) => $valor);\n\t\t\t\t\t}\n\t\t\t\t\t$this->Session->write('ChamadosEncerradosFiltro.filtro', $filtro);\n\t\t\t\t\t$conditions = array_merge($conditions,$filtro);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//pr($conditions );\n\t\tif (count($filtro) == 0 ){\n\t\t\tif ($this->Session->read('ChamadosEncerradosFiltro.filtro') && is_array($this->Session->read('ChamadosEncerradosFiltro.filtro'))){\n\t\t\t\t$filtro = $this->Session->read('ChamadosEncerradosFiltro.filtro');\n\t\t\t\t$conditions = array_merge($conditions,$filtro);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (isset($this->passedArgs['limit'])){\n\t\t\t// foi informado a quantidade de registros via combo\n\t\t\t$quantidade = $this->passedArgs['limit'];\n\t\t\t$this->Session->write('ChamadosEncerrados.limit', $quantidade);\n\t\t}else{\n\t\t\t// não foi informado a quantidade de registro então pega da sessão\n\t\t\t//$this->Session->del('MeusChamados.limit');\n\t\t\tif ($this->Session->read('ChamadosEncerrados.limit') && is_numeric($this->Session->read('ChamadosEncerrados.limit'))){\n\t\t\t\t$quantidade = $this->Session->read('ChamadosEncerrados.limit');\n\t\t\t}else{\n\t\t\t\t// caso não seja ainda definido na seção\n\t\t\t\t$quantidade = 5;\n\t\t\t\t// grava na seção\n\t\t\t\t$this->Session->write('ChamadosEncerrados.limit', $quantidade);\n\t\t\t}\n\t\t}\n\n\n\t\t//die();\n\t\t$this->paginate = array(\n\t\t\t'limit' =>$quantidade, \n\t\t\t'conditions' => $conditions,\n\t\t\t'order' => array ('VwChamado.chamado_id DESC')\n\t\t);\n\t\t\n\t\t//$this->Chamado->recursive = 2;\n\t\t$this->set('vw_chamados', $this->paginate('VwChamado'));\n\t\t$this->set('quantidade', $quantidade);\n\t}", "public function datatable_setor_tunai_tabungan()\n\t{\n\t\t$aColumns = array( 'c.cif_no','c.nama','a.account_saving_no','a.amount','a.trx_date','');\n\t\t\t\t\n\t\t/* \n\t\t * Paging\n\t\t */\n\t\t$sLimit = \"\";\n\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\n\t\t{\n\t\t\t$sLimit = \" OFFSET \".intval( $_GET['iDisplayStart'] ).\" LIMIT \".\n\t\t\t\tintval( $_GET['iDisplayLength'] );\n\t\t}\n\t\t\n\t\t/*\n\t\t * Ordering\n\t\t */\n\t\t$sOrder = \"\";\n\t\tif ( isset( $_GET['iSortCol_0'] ) )\n\t\t{\n\t\t\t$sOrder = \"ORDER BY \";\n\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n\t\t\t\t{\n\t\t\t\t\t$sOrder .= \"\".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\" \".\n\t\t\t\t\t\t($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc') .\", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\n\t\t\tif ( $sOrder == \"ORDER BY\" )\n\t\t\t{\n\t\t\t\t$sOrder = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* \n\t\t * Filtering\n\t\t */\n\t\t$sWhere = \"\";\n\t\tif ( isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" )\n\t\t{\n\t\t\t$sWhere = \"AND (\";\n\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower( $_GET['sSearch'] ).\"%' OR \";\n\t\t\t}\n\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\n\t\t\t$sWhere .= ')';\n\t\t}\n\t\t\n\t\t/* Individual column filtering */\n\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t{\n\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t{\n\t\t\t\tif ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\n\t\t\t\t{\n\t\t\t\t\tif ( $sWhere == \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere = \"AND \";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere .= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower($_GET['sSearch_'.$i]).\"%' \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$rResult \t\t\t= $this->model_transaction->datatable_setor_tunai_tabungan($sWhere,$sOrder,$sLimit); // query get data to view\n\t\t$rResultFilterTotal = $this->model_transaction->datatable_setor_tunai_tabungan($sWhere); // get number of filtered data\n\t\t$iFilteredTotal \t= count($rResultFilterTotal); \n\t\t$rResultTotal \t\t= $this->model_transaction->datatable_setor_tunai_tabungan(); // get number of all data\n\t\t$iTotal \t\t\t= count($rResultTotal);\t\n\t\t\n\t\t/*\n\t\t * Output\n\t\t */\n\t\t$output = array(\n\t\t\t\"sEcho\" => intval($_GET['sEcho']),\n\t\t\t\"iTotalRecords\" => $iTotal,\n\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\n\t\t\t\"aaData\" => array()\n\t\t);\n\t\t\n\t\tforeach($rResult as $aRow)\n\t\t{\n\t\t\t$row = array();\n\t\t\t$row[] = $aRow['cif_no'];\n\t\t\t$row[] = $aRow['nama'];\n\t\t\t$row[] = $aRow['account_saving_no'];\n\t\t\t$row[] = '<div align=\"right\">Rp '.number_format($aRow['amount'],0,',','.').',-</div>';\n\t\t\t$row[] = $this->format_date_detail($aRow['trx_date'],'id',false,'/');\n\t\t\t$row[] = '<div align=\"center\"><a href=\"javascript:;\" class=\"btn red mini\" trx_detail_id=\"'.$aRow['trx_detail_id'].'\" account_saving_no=\"'.$aRow['account_saving_no'].'\" nama=\"'.$aRow['nama'].'\" id=\"link-delete\">Delete</a></div>';\n\n\t\t\t$output['aaData'][] = $row;\n\t\t}\n\t\t\n\t\techo json_encode( $output );\n\t}", "function payments_table_gateway_column_sortable( $columns ){\r\n //$columns['status'] = array('status', false);\r\n return $columns;\r\n}", "public function columnasLista(){\n $gridlista=array(\n array('name'=>'nombre','type'=>'raw','value'=>'CHtml::link($data->nombre,array(\"update\",\"id\"=>$data->id))'),\n 'cantidadpresentacion',\n 'salida',\n // 'idempresa',\n array('name'=>'idempresa','type'=>'raw','value'=>'$data->getNombreEmpresa()'),\n );\n\n return $gridlista;\n }", "function LocalidadFilter( $Filter )\n {\n if( !empty($Filter->Loc) ) \n {\n $Loc = $Filter->Loc;\n return 'AND pLoc=\"'.$Loc.'\" ';\n }\n \n if( isset( $Filter->Prov ) ) \n return 'AND pProv='.$Filter->Prov.' ';\n\n return ''; \n }", "public function selectFilter($categoria, $arrayBairros, $arrayFormPag, $arrayFacilidades, $arrayPlano, $limit, $count = \"not\")\n {\n\n $sql = \"SELECT * FROM Anuncio\n INNER JOIN Forma_pagamento ON Anuncio.anuncio_id = Forma_pagamento.forma_pag_anuncio_ref\n INNER JOIN Link ON Anuncio.anuncio_id = Link.link_anuncio_ref\n INNER JOIN Endereco ON Anuncio.anuncio_endereco = Endereco.endereco_id\n INNER JOIN Horario_funcionamento ON Anuncio.anuncio_id = Horario_funcionamento.horario_func_anuncio_ref\n INNER JOIN Cont_views ON Anuncio.anuncio_id = Cont_views.cont_views_anuncio_ref\n INNER JOIN Plano_saude ON Anuncio.anuncio_id = Plano_saude.plano_saude_anuncio_ref\n INNER JOIN Facilidades ON Anuncio.anuncio_id = Facilidades.facilidades_anuncio_ref\n INNER JOIN Sub_categoria ON Anuncio.anuncio_categoria = Sub_categoria.sub_categoria_id\n INNER JOIN Categoria ON Sub_categoria.sub_categoria_cat_ref = Categoria.tipo_categoria_id\n WHERE \";\n\n\n #se os valores foram setados e não estão vazios, adiciona os mesmos na cláusula WHERE\n if (isset($categoria) && !empty($categoria)) {\n\n #retorna somente registros que atendam a categoria marcada juntamente com as outras cláusulas concatenadas mais abaixo.\n $sql .= \" (Anuncio.anuncio_titulo LIKE '{$categoria}%' OR Anuncio.anuncio_descricao LIKE '{$categoria}%' OR Anuncio.anuncio_breve_descricao LIKE '{$categoria}%' OR Sub_categoria.sub_categoria_descricao LIKE '{$categoria}%' OR Categoria.tipo_categoria_descricao LIKE '{$categoria}%') \"; //verificar a necessidade de emendar com AND\n\n }\n\n #adiciona os bairros no where caso estes sejam selecionados.\n if (isset($arrayBairros) && !empty($arrayBairros)) {\n\n $sql .= \" AND (\";\n\n for ($i = 0; $i < count($arrayBairros); $i++) {\n\n $sql .= \" Endereco.endereco_bairro = '{$arrayBairros[$i]}' \";\n\n #verificar penultima posição para não acrescentar o OR\n if ($i != count($arrayBairros) - 1) {\n $sql .= \" OR \";\n }\n\n }\n\n $sql .= \" ) \";\n\n }\n\n #adiciona as formar de pagamento como obrigatórias no retorno, se tiver sido setada.\n if (isset($arrayFormPag) && !empty($arrayFormPag)) {\n\n $sql .= \" AND \";\n\n for ($i = 0; $i < count($arrayFormPag); $i++) {\n\n switch ($arrayFormPag[$i]) {\n\n case \"boleto\" :\n $sql .= \" Forma_pagamento.forma_pag_boleto = 1 \";\n break;\n case \"credito\" :\n $sql .= \" Forma_pagamento.forma_pag_credito = 1 \";\n break;\n case \"debito\" :\n $sql .= \" Forma_pagamento.forma_pag_debito = 1 \";\n break;\n case \"vale alimentação\" :\n $sql .= \" Forma_pagamento.forma_pag_vale_alimentacao = 1 \";\n break;\n case \"cheque\" :\n $sql .= \" Forma_pagamento.forma_pag_cheque = 1 \";\n break;\n case \"dinheiro\" :\n $sql .= \" Forma_pagamento.forma_pag_dinheiro = 1 \";\n break;\n case \"outrosFormPag\" :\n $sql .= \" Forma_pagamento.forma_pag_outros_formPag = 1 \";\n break;\n default:\n ;\n\n }\n\n #adiciona o AND até antes da penultima iteração\n if ($i < count($arrayFormPag) - 1) {\n\n $sql .= \" AND \";\n\n }\n\n }\n }\n\n #adiciona as facilidades no where\n if (isset($arrayFacilidades) && !empty($arrayFacilidades)) {\n\n $sql .= \" AND \";\n\n for ($i = 0; $i < count($arrayFacilidades); $i++) {\n\n switch ($arrayFacilidades[$i]) {\n\n case \"wifi\":\n $sql .= \" Facilidades.facilidades_wifii = 1 \";\n break;\n case \"reserva\":\n $sql .= \" Facilidades.facilidades_reservar = 1 \";\n break;\n case \"animais\":\n $sql .= \" Facilidades.facilidades_permite_animais = 1 \";\n break;\n case \"cupons\":\n $sql .= \" Facilidades.facilidades_cupons_desconto = 1 \";\n break;\n case \"estacionamento\":\n $sql .= \" Facilidades.facilidades_estacionamento = 1 \";\n break;\n case \"seguranca\":\n $sql .= \" Facilidades.facilidades_seguranca = 1 \";\n break;\n case \"acessibilidades\":\n $sql .= \" Facilidades.facilidades_acessibilidade = 1 \";\n break;\n case \"arCondicionado\":\n $sql .= \" Facilidades.facilidades_ar_condicionado = 1 \";\n break;\n case \"delivery\":\n $sql .= \" Facilidades.facilidades_delivery = 1 \";\n break;\n case \"criancas\":\n $sql .= \" Facilidades.facilidades_criancas = 1 \";\n break;\n default:\n ;\n\n }\n\n #adiciona o AND até antes da penultima iteração\n if ($i < count($arrayFacilidades) - 1) {\n\n $sql .= \" AND \";\n\n }\n\n }\n\n }\n\n #adiciona os planos de saude caso se tratar de uma pesquisa na área da saúde.\n if (isset($arrayPlano) && !empty($arrayPlano)) {\n\n $sql .= \" AND \";\n\n for ($i = 0; $i < count($arrayPlano); $i++) {\n\n switch ($arrayPlano[$i]) {\n\n case \"unimed\":\n $sql .= \" Plano_saude.plano_saude_unimed = 1 \";\n break;\n case \"saudeVida\":\n $sql .= \" Plano_saude.plano_saude_saudevida = 1 \";\n break;\n case \"prontomed\":\n $sql .= \" Plano_saude.plano_saude_prontomed = 1 \";\n break;\n case \"promed\":\n $sql .= \" Plano_saude.plano_saude_promed = 1 \";\n break;\n case \"outros\":\n $sql .= \" Plano_saude.plano_saude_outros = 1 \";\n break;\n\n default:\n ;\n\n }\n\n #adiciona o AND até antes da penultima iteração\n if ($i < count($arrayPlano) - 1) {\n\n $sql .= \" AND \";\n\n }\n\n }\n\n\n }\n\t\n\t //Limita a exibição de anuncios online\n\t $sql .= \" AND Anuncio.anuncio_excluido = 0 AND (Anuncio.anuncio_status = 4 OR Anuncio.anuncio_status = 11 OR Anuncio.anuncio_status = 3) ORDER BY Anuncio.anuncio_titulo ASC, Anuncio.anuncio_id ASC \";\n\n\n #caso não for realizar a contagem, retornar apenas o sql\n if($count == \"not\"){\n\n #adiciona o limite de quantidade de exibição.\n $sql .= \" LIMIT {$limit}\";\n\n echo $sql;\n\n } else {\n\n\n #realiza select no banco de dados\n if($row = $this->runSelect($sql)){\n\n echo count($row);\n\n } else {\n\n echo \"A pesquisa não retornou nenhum resiltado.\";\n\n }\n\n }\n\n\n }", "public function getListColumns(){\n\treturn \"id, codice_categoria, codice, descrizione\";\n}", "function filterBy_S_A_F_E_C($SEDE, $AREA, $FACULTAD, $ESCUELA, $CARRERA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? AND car_ia = ? \");\n $parametros = array(\"iiiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA, &$CARRERA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "public function getFiltroTipoCargo()\n {\n $resultado = array();\n $sql = \"\n SELECT STRING_AGG(v.condicion,',') AS o_resultado FROM ( \nSELECT\nco.condicion\nFROM cargos c \nINNER JOIN finpartidas f ON c.fin_partida_id = f.id\nINNER JOIN condiciones co ON f.condicion_id = co.id\nWHERE c.baja_logica=1 \nGROUP BY co.condicion\nORDER BY co.condicion asc \n) AS v\";\n $this->_db = new Cargos();\n $arr = new Resultset(null, $this->_db, $this->_db->getReadConnection()->query($sql));\n if (count($arr) > 0) {\n /**\n * Para agregar un valor nulo al inicio se añade una coma\n */\n $res = $arr[0]->o_resultado;\n $resultado = explode(\",\", $res);\n }\n return $resultado;\n }", "private function setExercicio(){\n\t\t$this->Enunciado = $this->Data['enunciado'];\n\t\t$this->A = $this->Data['opA'];\n\t\t$this->B = $this->Data['opB'];\n\t\t$this->C = $this->Data['opC'];\n\t\t$this->D = $this->Data['opD'];\n\t\t$this->E = $this->Data['opE'];\n\t\t$this->Correta = $this->Data['correta'];\n\n\t\t$this->Query = ['c_enumexer' => $this->Enunciado,\n\t\t\t\t\t\t'c_altaexer' => $this->A,\n\t\t\t\t\t\t'c_altbexer' => $this->B,\n\t\t\t\t\t\t'c_altcexer' => $this->C,\n\t\t\t\t\t\t'c_altdexer' => $this->D,\n\t\t\t\t\t\t'c_alteexer' => $this->E,\n\t\t\t\t\t\t'c_correxer' => $this->Correta];\n\n\t}", "public function setFiltros($filtros)\n {\n $this->filtros = $filtros;\n }", "function getListFilter($col, $key) {\n switch ($col) {\n case 'unit':\n global $conn, $conf;\n require_once($conf['gate_dir'] . 'model/m_unit.php');\n\n $row = mUnit::getData($conn, $key);\n\n return \"u.infoleft >= \" . (int) $row['infoleft'] . \" and u.inforight <= \" . (int) $row['inforight'];\n break;\n case 'tahun':\n if ($key != 'all')\n return \"date_part('year', tmtmulai) = '$key'\";\n else\n return \"(1=1)\";\n\n break;\n case 'tunjangan':\n if ($key != 'all')\n return \"g.kodetunjangan = '$key'\";\n else\n return \"(1=1)\";\n\n break;\n case 'tahunpot':\n if ($key != 'all')\n return \"date_part('year', g.tglmulai) = '$key'\";\n else\n return \"(1=1)\";\n\n break;\n case 'potonganparam':\n if ($key != 'all')\n return \"g.kodepotongan = '$key'\";\n else\n return \"(1=1)\";\n\n break;\n case 'jenispegawai':\n if ($key != 'all')\n return \"p.idjenispegawai = '$key'\";\n else\n return \"(1=1)\";\n\n break;\n case 'periodegaji':\n return \"g.periodegaji = '$key'\";\n break;\n case 'periodetarif':\n return \"g.periodetarif = '$key'\";\n break;\n case 'golongan':\n return \"g.idpangkat = '$key'\";\n break;\n case 'jnstunjangan':\n return \"g.kodetunjangan = '$key'\";\n break;\n case 'periodehist':\n return \"g.gajiperiode = '$key'\";\n break;\n case 'hubungankerja':\n if ($key != 'all')\n return \"p.idhubkerja = '$key'\";\n else\n return \"(1=1)\";\n \n break;\n case 'tunda':\n if (!empty($key)) {\n if ($key == 'Y')\n return \"g.istunda = 'Y'\";\n else\n return \"(g.istunda = 'T' or g.istunda is null)\";\n }\n break;\n case 'bayar':\n if (!empty($key)) {\n if ($key == 'Y')\n return \"g.isfinish = 'Y'\";\n else\n return \"(g.isfinish = 'T' or g.isfinish is null)\";\n }\n break;\n case 'bayartunj':\n if (!empty($key)) {\n if ($key == 'Y')\n return \"g.isdibayar = 'Y'\";\n else\n return \"(g.isdibayar = 'T' or g.isdibayar is null)\";\n }\n break;\n case 'bayarlembur':\n if (!empty($key)) {\n if ($key == 'Y')\n return \"g.isbayar = 'Y'\";\n else\n return \"(g.isbayar = 'T' or g.isbayar is null)\";\n }\n break;\n case 'periodepenilaian':\n return \"kodeperiode='$key'\";\n break;\n case 'pendidikan':\n return \"idpendidikan='$key'\";\n break;\n case 'tipepegawai':\n if ($key != 'all')\n return \"p.idtipepeg = '$key'\";\n else\n return \"(1=1)\";\n\n break;\n }\n }", "public function datatable_kantor_cabang_setup($sWhere='',$sOrder='',$sLimit='')\n\t{\n\t\t$param = array();\n\t\t$branch_code = $this->session->userdata('branch_code');\n\t\t$flag_all_branch = $this->session->userdata('flag_all_branch');\n\t\t$sql = \"SELECT\n\t\t\t\t\t\t\tmfi_branch.branch_id,\n\t\t\t\t\t\t\tmfi_branch.branch_name,\n\t\t\t\t\t\t\tmfi_branch.branch_status,\n\t\t\t\t\t\t\tmfi_branch.branch_code,\n\t\t\t\t\t\t\tmfi_branch.branch_induk,\n\t\t\t\t\t\t\tmfi_branch.branch_class,\n\t\t\t\t\t\t\tmfi_branch.branch_grade,\n\t\t\t\t\t\t\tmfi_branch.tanggal_buka,\n\t\t\t\t\t\t\tmfi_branch.branch_officer_name,\n\t\t\t\t\t\t\tmfi_branch.branch_officer_title,\n\t\t\t\t\t\t\tmfi_jabatan.kode_jabatan as code_value,\n\t\t\t\t\t\t\tmfi_jabatan.nama_jabatan as display_text\n\t\t\t\tFROM\n\t\t\t\t\t\t\tmfi_branch\n\t\t\t\tLEFT JOIN mfi_jabatan ON mfi_branch.branch_officer_title = mfi_jabatan.kode_jabatan\n\t\t\t\tWHERE mfi_branch.branch_code!='00000'\t\t\t\t\n\t\t\t\t \";\n\n\t\t\tif ($flag_all_branch==0) {\n\t\t\t\t$sql .= \" AND mfi_branch.branch_code IN (SELECT branch_code FROM mfi_branch_member WHERE branch_induk=?) \";\n\t\t\t\t$param[] = $branch_code;\n\t\t\t}\n\t\t\n\t\tif ( $sWhere != \"\" )\n\t\t\t$sql .= \"$sWhere \";\n\n\t\tif ( $sOrder != \"\" )\n\t\t\t$sql .= \"$sOrder \";\n\n\t\tif ( $sLimit != \"\" )\n\t\t\t$sql .= \"$sLimit \";\n\n\t\t$query = $this->db->query($sql,$param);\n\n\t\treturn $query->result_array();\n\t}", "function filter_TR_By_S_A_F_E_C($SEDE, $AREA, $FACULTAD, $ESCUELA, $CARRERA,$TABLE_R)\n{\n global $mysqli;\n $TRES = $TABLE_R;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio))AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,ps,pca,pcg,gatb,verbal,numer,indice FROM \" .$TRES. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? AND car_ia = ? \");\n $parametros = array(\"iiiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA, &$CARRERA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "protected function fijarAtributos(){\n \n return array(\"cod_categoria\",\"nombre\");\n \n }", "function get_form_filter() {\n\n $val_ = new OrSysvalue();\n if (!is_null($var_)) {\n foreach ($val_->filter AS $id => $value) {\n //echo '$id [ ' . $id . ' ] = [ ' . $value . ' ] <br>' ;\n if ($id != 'filter_by') {\n if (!$this->filter_use[$id]) {\n $my_filter = new OrFieldHidden($id, 'val_filter[' . $id . ']');\n $my_filter->OP_[auto_post]->set(true);\n $my_filter_tag .= $my_filter->get_tag();\n\n if ($val_->compare[$id] == 'BETWEEN' OR $val_->message[$id . '_II'] != '') {\n $my_filter = new OrFieldHidden($id . '_II', 'val_msg[' . $id . '_II]');\n $my_filter->OP_[auto_post]->set(true);\n $my_filter_tag .= $my_filter->get_tag();\n }\n }\n $my_compare = new OrFieldHidden('val_compare_' . $id . '_', 'val_compare[' . $id . ']');\n $my_compare->OP_[auto_post]->set(true);\n $my_filter_tag .= $my_compare->get_tag();\n }\n }\n }\n\n\n /* $my_table = new OrTable('table_query');\n $my_table->OP_[align_table]->set('center');\n $my_table->OP_[class_name]->set('tbl_body');\n $my_table->set_col(' ค้นหา ' . $this->get_control_filter() . ' เรียง ' . $this->get_control_order() . ' ' . $this->get_button_filter() . $my_filter_tag );\n $my_table->set_row(); */\n $my_table = (' ค้นหา ' . $this->get_control_filter() . ' เรียง ' . $this->get_control_order() . ' ' . $this->get_button_filter() . $my_filter_tag );\n return $my_table;\n }", "public function getFilters(): array;", "public function selectColsArrayAction()\n {\n $view = new ViewModel();\n $sl = $this->getServiceLocator();\n $adapter = $sl->get('dbadapter');\n $tableGateway = new TableGateway('categoria', $adapter);\n $view->data = $tableGateway->select(function (Select $select){\n $select->columns(array('nombre','activo'));\n })->toArray();\n return $view;\n }", "function fieldCek()\r\n {\r\n $f = array(\r\n 'kodeorg'=>'Kode Organisasi' \r\n );\r\n return $f;\r\n }", "public function index() {\n $anuncio = new anuncios();\n //$usuario = new usuario();\n \n // $pag = \"inicial\";\n // $result = \"\";\n // if (isset($_GET['pag']) && !empty($_GET['pag'])){\n // $pag=$_GET['pag'];\n // }\n // if (isset($_GET['result']) && !empty($_GET['result'])){\n // $result=$_GET['result'];\n // }\n \n $refat = 1;\n $qtdPag = 2;\n if (isset($_GET['refat']) && !empty($_GET['refat'])){\n $refat = $_GET['refat'];\n }\n \n if (isset($_GET['filtros'])){\n $filtros = $this->iniciarFiltros($_GET['filtros']);\n if (!empty($filtros['categoria'])){\n $anuncio->setIDCategoria($filtros['categoria']);\n }\n if (!empty($filtros['preco'])){\n $preco = explode(\"-\", $filtros['preco']);\n //print_r($preco);\n $anuncio->setValor($preco);\n }\n if (!empty($filtros['estado'])){\n $anuncio->setEstado($filtros['estado']);\n }\n } else {\n $filtros = $this->iniciarFiltros();\n }\n \n //$filtros = array(\n // 'categoria' => '',\n // 'preco' => '',\n // 'estado' => ''\n //);\n \n //if (isset($_GET['filtros'])){\n // $filtros = $_GET['filtros'];\n // if (!empty($filtros['categoria'])){\n // $anuncio->setIDCategoria($filtros['categoria']);\n // }\n // if (!empty($filtros['preco'])){\n // $preco = explode(\"-\", $filtros['preco']);\n // //print_r($preco);\n // $anuncio->setValor($preco);\n // }\n // if (!empty($filtros['estado'])){\n // $anuncio->setEstado($filtros['estado']);\n // }\n //}\n \n $result = $anuncio->selecionarALLAnuncios($refat, $qtdPag);\n if ($anuncio->numRows() == 1){\n $result = array();\n $result[] = $anuncio->result();\n }\n \n $resultQTD = $anuncio->getQTDAnuncios();\n $totAnuncios = $resultQTD['qtd'];\n \n //$categorias = $cat->selecionarAllCategorias();\n //if ($cat->numRows() == 1){\n // $categorias = array();\n // $categorias[] = $cat->result();\n //}\n \n //$usuario->selecionarALLUser();\n //$totUsuarios = $usuario->numRows();\n \n //$totalPag = ceil($totAnuncios / $qtdPag);\n \n $dados = $this->getTemplateDados();\n $dados[\"refat\"] = $refat;\n $dados[\"filtros\"] = $filtros;\n $dados[\"result\"] = $result;\n //$dados[\"categorias\"] = $categorias;\n $dados[\"totAnuncios\"] = $totAnuncios;\n //$dados[\"totUsuarios\"] = $totUsuarios;\n $dados[\"totalPag\"] = ceil($totAnuncios / $qtdPag);\n \n $this->loadTemplate(\"inicial\", $dados);\n }", "private function generaFiltrosPruebas(Request $request){\n \t$filtros = array ();\n \t$nombre = $request->get('nombrePruebaBusca');\n \t$descripcion = $request->get('descripcionPruebaBusca');\n \t$activo = $request->get('activoPruebaBusca');\n \tif($activo == null)\n \t $activo = \"-1\";\n \n \tif(trim($nombre) != ''){\n \t\t$filtros[] = ['prueba.nombre', 'LIKE', '%' . $nombre . '%'];\n \t}\n \tif(trim($descripcion) != ''){\n \t $filtros[] = ['prueba.definicion', 'LIKE', '%' . $descripcion . '%'];\n \t}\n \tif(trim($activo) != '-1'){\n \t\t$filtros[] = ['prueba.activo', '=', $activo];\n \t}\n \treturn $filtros;\n }", "function filterBy_S_A_F_E($SEDE, $AREA, $FACULTAD, $ESCUELA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? \");\n $parametros = array(\"iiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "public function convensionInit() {\n return [\n// 'Admin' => 'All',\n// 'Customer' => 'actionname',\n// 'Performer' => 'actionname2',\n// 'Guest' => 'actionname-toLogin actionname2-toLogin',\n ];\n }", "function criaArrayModeloDeCompra()\n{\n $compra = array(\n 'id' => null,\n 'id_colaborador' => '',\n 'id_produto' => '',\n 'data_compra' => '',\n 'horario_compra' => '',\n 'email' => '',\n 'envio_email' => '',\n 'quantidade' => null\n );\n\n return $compra;\n\n}", "function ysg_edit_columns( $columns ) {\n $columns = array(\n 'cb' => '<input type=\"checkbox\" />',\n 'ysg_image' => __( 'Imagem do V&iacute;deo', 'youtube-simple-gallery' ),\n 'ysg_title' => __( 'T&iacute;tulo', 'youtube-simple-gallery' ),\n 'ysg_categories' => __(\"Categoria\", 'youtube-simple-gallery' ),\n 'ysg_url' => __( 'Link do V&iacute;deo', 'youtube-simple-gallery' )\n );\n\n return $columns;\n}", "public function select($actividades_fuera);", "private function getFiltroReputacao()\n {\n return (array)$this->filtros['reputacao'];\n }", "public function get_filtros(){\n\t\treturn Filtro::get();\n\t}", "function change_order_columns_filter( $columns ) {\n unset($columns['shipping_address']);\n unset($columns['customer_message']);\n unset($columns['order_total']);\n return $columns;\n}", "function get_search_cols()\n {\n $columns = array(\n 'tag' => 'Shortcode Name',\n 'kind' => 'Kind',\n 'description' => 'Description',\n 'example' => 'Example',\n 'code' => 'Code',\n 'created_datetime' => 'Created Datetime'\n );\n return $columns;\n }", "function PreciosFilter( $Filter )\n {\n $Field = PreciosField( $Filter );\n \n $where = \"\";\n if( !empty($Filter->precMin) ) $where = 'AND '.$Field.'>='.$Filter->precMin.' ';\n if( !empty($Filter->precMax) && $Filter->precMax<150) $where .= 'AND '.$Field.'<='.$Filter->precMax.' ';\n\n if( !empty($where) ) $where .= 'AND '.$Field.'>0 ';\n return $where; \n }", "public function filtroComboTipoContrato($idContratoGlobal=NULL, $opcSelected){\r\n\t\t$mostrarOpcion = true;\r\n\t\t$arrayOpciones = array();\r\n\t\t$query = new Query ();\r\n\t\t$sqlBC = \"SELECT usuario_id, `refempresaafiliada` FROM dbcontratosglobales WHERE reftipocontratoglobal IN (1,2) AND \tusuario_id = \".$this->getUsuarioId().\" \";\r\n\t\t$query->setQuery($sqlBC);\r\n\t\t$res1 = $query->eject();\r\n\t\t$numero = $query->numRows($res1);\r\n\t\t\r\n\t\tif($numero>=1){\r\n\t\t\t\r\n\t\t\t$selectOPC = \"SELECT dbcea.reftipocontratoglobal as tipoCredito FROM `dbcontratoempresaafiliada` dbcea JOIN dbcontratosglobales dbcg ON dbcg.refempresaafiliada = dbcea.`refempresaafiliada` WHERE dbcg.usuario_id = \".$this->getUsuarioId().\" AND dbcea.reftipocontratoglobal NOT IN (1,2) \";\r\n\r\n\t\t\t\r\n\t\t\t$query->setQuery($selectOPC);\r\n\t\t\t$resQ = $query->eject();\r\n\t\t\twhile($objOPC = $query->fetchObject($resQ) ){\r\n\t\t\t\t\r\n\t\t\t\t$arrayOpciones[] = $objOPC->tipoCredito;\r\n\t\t\t}\r\n\t\t\tif($opcSelected != ''){\r\n\t\t\t\t$arrayOpciones[] = $opcSelected;\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\r\n\t\t}else{\r\n\t\t\t$selectOPC = \"SELECT dbcea.reftipocontratoglobal as tipoCredito FROM `dbcontratoempresaafiliada` dbcea JOIN dbcontratosglobales dbcg ON dbcg.refempresaafiliada = dbcea.`refempresaafiliada` WHERE dbcg.usuario_id = \".$this->getUsuarioId().\" \";\r\n\t\t\t$query->setQuery($selectOPC);\r\n\t\t\t$resQ = $query->eject();\r\n\t\t\twhile($objOPC = $query->fetchObject($resQ) ){\r\n\t\t\t\t$arrayOpciones[] = $objOPC->tipoCredito;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t$arrayOpciones = array_unique($arrayOpciones);\r\n\t\treturn $arrayOpciones;\t\r\n\r\n\t}", "function acf_set_filters($filters = array())\n{\n}", "function get_columns() {\n\t\t$columns = [\n\t\t\t'jumlahHTTPS' => 'Jumlah Domain HTTPS',\n\t\t\t'totalDomain' => 'Total Domain', \n\t\t\t'jumlahCert' => 'Jumlah Sertifikat Aktif',\n\t\t\t'totalCert' => 'Total Sertifikat'\n\t\t];\n\n\t\treturn $columns;\n\t}", "function readfilter()\n\t{\n\t\t$field = $this->input->post(\"namafield\");\n\t\t$value = $this->input->post(\"valfilter\");\n\n\t\treturn array(\n\t\t\t\t\"field\" => $field,\n\t\t\t\t\"value\" => $value\n\t\t\t);\n\t}", "public function setFiltroEnvios($fil='') {\n $this->filtroEnvios = $this->arreglarFiltro($fil);\n $this->filtrarPersonas();\n }", "public function filters(){\r\r\n\t\treturn CMap::mergeArray(parent::filters(),array(\r\r\n\t\t\t\r\r\n\t\t));\r\r\n\t}", "public function getColumns()\n {\n return [\n 'form' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['form'],\n 'exclude' => true,\n 'inputType' => 'select',\n 'foreignKey' => 'tl_form.title',\n 'eval' => [\n 'includeBlankOption' => true,\n 'style' => 'width:300px',\n 'chosen' => true,\n 'columnPos' => 'checkout',\n ],\n ],\n 'step' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['step'],\n 'inputType' => 'select',\n 'options_callback' => ['Isotope\\Backend\\Module\\OrderConditionFields', 'getSteps'],\n 'eval' => [\n 'decodeEntities' => true,\n 'includeBlankOption' => true,\n 'style' => 'width:300px',\n 'columnPos' => 'checkout',\n ],\n ],\n 'position' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['position'],\n 'default' => 'before',\n 'inputType' => 'select',\n 'options' => ['before', 'after'],\n 'reference' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['position'],\n 'eval' => [\n 'style' => 'width:300px',\n 'columnPos' => 'checkout',\n ],\n ],\n 'product_types' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['product_types'],\n 'inputType' => 'select',\n 'foreignKey' => 'tl_iso_producttype.name',\n 'eval' => [\n 'multiple' => true,\n 'style' => 'width:300px',\n 'columnPos' => 'product_type',\n ],\n ],\n 'product_types_condition' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['product_types_condition'],\n 'inputType' => 'select',\n 'options' => ['oneAvailable', 'allAvailable', 'onlyAvailable'],\n 'reference' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['product_types_condition'],\n 'eval' => [\n 'style' => 'width:300px',\n 'columnPos' => 'product_type',\n ],\n ],\n ];\n }", "function simbolos_por_palabra_con_filtro($palabra,$id_tipo_palabra,$id_tipo_simbolo,$registrado,$marco,$contraste,$tipo_letra,$mayusculas,$minusculas,$castellano,$ruso,$rumano,$arabe,$chino,$bulgaro,$polaco,$ingles,$frances,$catalan) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_registradas=\"AND simbolos.registrado=0\";\n\t\t}\n\t\t\n\t\tif ($tipo_letra==99) { $sql_tipo_letra=''; } \n\t\telse { $sql_tipo_letra='AND (simbolos.sup_font='.$tipo_letra.' OR simbolos.inf_font='.$tipo_letra.')'; }\n\t\t\n\t\tif ($minusculas == 1 && $mayusculas == 1) {\n\t\t \t$sql_mayusculas='AND (simbolos.inf_mayusculas=1 OR simbolos.inf_mayusculas=0)';\n\t\t} elseif ($minusculas == 1) { \n\t\t $sql_mayusculas='AND (simbolos.inf_mayusculas=0)';\n\t\t} elseif ($mayusculas == 1) { \n\t\t\t$sql_mayusculas='AND (simbolos.inf_mayusculas=1)';\n\t\t} elseif ($minusculas == 0 && $mayusculas == 0) { \n\t\t\t$sql_mayusculas='AND (simbolos.inf_mayusculas=1 OR simbolos.inf_mayusculas=0)';\n\t\t}\n\t\t\n\t\t\n\t\tif ($castellano==0 &&($ruso==1 || $rumano==1 || $arabe==1 || $chino==1 || $bulgaro==1 || $polaco==1 || $ingles==1 || $frances==1 || $catalan==1)) { \n\t\t\n\t\t\t$sql_idioma_superior='AND simbolos.sup_con_texto=0 ';\n\t\t\t$sql_idioma_inferior='AND (simbolos.inf_idioma=99999 ';\n\t\t\t\t\tif ($castellano==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=0 '; } \n\t\t\t\t\tif ($ruso==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=1 '; } \n\t\t\t\t\tif ($rumano==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=2 '; } \n\t\t\t\t\tif ($arabe==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=3 '; } \n\t\t\t\t\tif ($chino==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=4 '; } \n\t\t\t\t\tif ($bulgaro==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=5 '; } \n\t\t\t\t\tif ($polaco==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=6 '; } \n\t\t\t\t\tif ($ingles==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=7 '; }\n\t\t\t\t\tif ($frances==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=8 '; }\n\t\t\t\t\tif ($catalan==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=9 '; } \n\t\t\t$sql_idioma_inferior.= ' )';\n\t\t\t$sql_tipo_letra=''; \t\t\t\n\t\t\n\t\t} elseif ($castellano==1) { \n\t\t\n\t\t\tif ($ruso==1 || $rumano==1 || $arabe==1 || $chino==1 || $bulgaro==1 || $polaco==1 || $ingles==1 || $frances==1 || $catalan==1) {\n\t\t\t\n\t\t\t$sql_idioma_inferior='AND simbolos.inf_idioma=0 ';\n\t\t\t$sql_idioma_superior='AND (simbolos.inf_idioma=99999 ';\n\t\t\t\t\tif ($ruso==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=1 '; } \n\t\t\t\t\tif ($rumano==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=2 '; } \n\t\t\t\t\tif ($arabe==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=3 '; } \n\t\t\t\t\tif ($chino==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=4 '; } \n\t\t\t\t\tif ($bulgaro==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=5 '; } \n\t\t\t\t\tif ($polaco==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=6 '; } \n\t\t\t\t\tif ($ingles==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=7 '; }\n\t\t\t\t\tif ($frances==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=8 '; }\n\t\t\t\t\tif ($catalan==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=9 '; } \n\t\t\t$sql_idioma_superior.= ' )';\n\t\t\t\n\t\t\t} elseif ($ruso==0 && $rumano==0 && $arabe==0 && $chino==0 && $bulgaro==0 && $polaco==0 && $ingles==0 && $frances==0 && $catalan==0) {\n\t\t\t\n\t\t\t\t$sql_idioma_superior='AND simbolos.sup_con_texto=0 ';\n\t\t\t\t$sql_idioma_inferior='AND simbolos.inf_idioma=0 ';\n\t\t\t\n\t\t\t}\n\t\t\n\t\t} elseif ($castellano==0 && $ruso==0 && $rumano==0 && $arabe==0 && $chino==0 && $bulgaro==0 && $polaco==0 && $ingles==0 && $frances==0 && $catalan==0) {\n\t\t\n\t\t\t$sql_idioma_inferior='';\n\t\t\t$sql_idioma_inferior='';\n\t\t}\n\t\t\n\t\tif ($id_tipo_palabra==99) { $sql_tipo_palabra=''; } \n\t\telse { $sql_tipo_palabra='AND palabras.id_tipo_palabra='.$id_tipo_palabra.''; }\n\t\t\n\t\tif ($marco==99) { $sql_marco=''; } \n\t\telse { $sql_marco='AND simbolos.marco='.$marco.''; }\n\t\t\n\t\tif ($contraste==99) { $sql_contraste=''; } \n\t\telse { $sql_contraste='AND simbolos.contraste='.$contraste.''; }\n\t\t\n\t\tif ($id_tipo_simbolo==99) { $sql_tipo_simbolo='AND simbolos.id_tipo_simbolo=tipos_simbolos.id_tipo'; } \n\t\telse { $sql_tipo_simbolo='AND simbolos.id_tipo_simbolo='.$id_tipo_simbolo.' AND tipos_simbolos.id_tipo='.$id_tipo_simbolo.''; }\n\t\t\n\t\t$query = \"SELECT simbolos.*, palabras.*, tipos_simbolos.*\n\t\tFROM simbolos, palabras, tipos_simbolos\n\t\tWHERE simbolos.id_palabra=palabras.id_palabra\n\t\tAND palabras.palabra LIKE '%$palabra%'\n\t\t$sql_tipo_simbolo\n\t\t$sql_tipo_palabra\n\t\t$sql_marco\n\t\t$sql_contraste\n\t\t$sql_tipo_letra\n\t\t$sql_mayusculas\n\t\t$sql_idioma_inferior\n\t\t$sql_idioma_superior\n\t\t$mostrar_registradas\n\t\tORDER BY palabras.palabra asc\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function fieldCek()\n {\n $f = array(\n 'idpotongantype'=>'idpotongantype' \n );\n return $f;\n }", "public function makeColumns(){\n $hijosDetalle=$this->\n getReportedetalle()->\n where(['and', \"esdetalle='1'\", \"visiblecampo='1'\"])->\n orderBy('orden')->all();\n //echo count( $hijosDetalle);die();\n $columns=[];\n foreach($hijosDetalle as $fila){\n $columns[]=[\n 'attribute'=>$fila->nombre_campo,\n 'label'=>$fila->aliascampo,\n 'format'=>'raw',\n 'options'=>['width'=>\n $this->sizePercentCampo($fila->nombre_campo).'%'],\n ];\n \n \n }\n return $columns;\n \n }", "public function defineFilters() {\n\t\treturn array(\n 'join' => array(\n 'car' => array(\n 'on' => array(\n '[car].id = [this].car_id'\n )\n )\n ),\n 'where' => array(\n 'id' => array(\n '[this].id = :id'\n )\n ),\n 'orderby' => array(\n 'date' => array(\n '[this].date :dir'\n )\n )\n );\n\t}", "public function _populateFiltros($data){\n\t\t$this->_objectFilter = new Model_Aclusuariosonline();\n\t\tif($data == null)return;\n\t\t$this->setPerezoso(false);\n\t\t$this->_objectFilter = $this->_populate($data);\n\t\tif(array_key_exists(\"buscar\", $data)) $this->_objectFilter->set_Fbuscar($data[\"buscar\"]);\n\t\tif(array_key_exists(\"sort\", $data) && strlen($data[\"sort\"]) > 1)\t$this->_objectFilter->addOrderBy($data[\"sort\"]);\n\t}", "function filter_TR_By_S_A_F_E($SEDE, $AREA, $FACULTAD, $ESCUELA,$TABLE_R)\n{\n global $mysqli;\n $TRES = $TABLE_R;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,ps,pca,pcg,gatb,verbal,numer,indice FROM \" .$TRES. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? \");\n $parametros = array(\"iiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "public function getDefaultFilterParameters(): array;", "function uc_group_columns( $columns ) {\n unset( $columns['date'] );\n $columns['school_year'] = __( 'School Year', UPTOWNCODE_PLUGIN_NAME );\n $columns['class'] = __( 'Class', UPTOWNCODE_PLUGIN_NAME );\n $columns['activity'] = __( 'Activity', UPTOWNCODE_PLUGIN_NAME );\n $columns['signup'] = __( 'Signup', UPTOWNCODE_PLUGIN_NAME );\n return $columns;\n}", "function add_custom_fields_columns ( $columns ) {\n return array_merge ( $columns, array (\n 'ingredienti' => __ ( 'Ingredienti' ),\n 'prezzo' => __ ( 'Prezzo' )\n ) );\n}", "function getListFilter($col,$key,$tahun='',$bulan='') {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'periode': \n\t\t\t\t\treturn \"datepart(year,p.tglperolehan) = '$tahun' and datepart(month,p.tglperolehan) = '$bulan' \"; \n\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tcase 'unit':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once('m_unit.php');\n\t\t\t\t\t\n\t\t\t\t\t$row = mUnit::getData($conn,$key);\n\t\t\t\t\t\n\t\t\t\t\treturn \"infoleft >= \".(int)$row['infoleft'].\" and inforight <= \".(int)$row['inforight'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "function getListFilter($col,$key) {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'periode': return \"periode = '$key'\";\n\t\t\t\tcase 'sistemkuliah': return \"sistemkuliah = '$key'\";\n\t\t\t\tcase 'unit':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once(Route::getModelPath('unit'));\n\t\t\t\t\t\n\t\t\t\t\t$row = mUnit::getData($conn,$key);\n\t\t\t\t\t\n\t\t\t\t\treturn \"u.infoleft >= \".(int)$row['infoleft'].\" and u.inforight <= \".(int)$row['inforight'];\n\t\t\t\tcase 'basiskampus':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once(Route::getModelPath('sistemkuliah'));\n\t\t\t\t\t$sistem = mSistemkuliah::getIdByBasisKampus($conn,modul::getBasis(),modul::getKampus());\n\t\t\t\t\treturn \" sistemkuliah in ('\".implode(\"','\",$sistem).\"') \";\n\t\t\t\t\t\n\t\t\t}\n\t\t}", "function getTipoParqueo()\n{\n return array(\n array('codigo' => 'MTO', 'valor' => 'Moto'),\n array('codigo' => 'CAR', 'valor' => 'Carro'),\n array('codigo' => 'TRK', 'valor' => 'Camion'),\n );\n}", "function simbolos_por_id_palabra_con_filtro($id_palabra,$id_tipo_palabra,$id_tipo_simbolo,$registrado,$marco,$contraste,$tipo_letra,$mayusculas,$minusculas,$castellano,$ruso,$rumano,$arabe,$chino,$bulgaro,$polaco,$ingles,$frances,$catalan) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_registradas=\"AND simbolos.registrado=0\";\n\t\t}\n\t\t\n\t\tif ($tipo_letra==99) { $sql_tipo_letra=''; } \n\t\telse { $sql_tipo_letra='AND (simbolos.sup_font='.$tipo_letra.' OR simbolos.inf_font='.$tipo_letra.')'; }\n\t\t\n\t\tif ($minusculas == 1 && $mayusculas == 1) {\n\t\t \t$sql_mayusculas='AND (simbolos.inf_mayusculas=1 OR simbolos.inf_mayusculas=0)';\n\t\t} elseif ($minusculas == 1) { \n\t\t $sql_mayusculas='AND (simbolos.inf_mayusculas=0)';\n\t\t} elseif ($mayusculas == 1) { \n\t\t\t$sql_mayusculas='AND (simbolos.inf_mayusculas=1)';\n\t\t} elseif ($minusculas == 0 && $mayusculas == 0) { \n\t\t\t$sql_mayusculas='AND (simbolos.inf_mayusculas=1 OR simbolos.inf_mayusculas=0)';\n\t\t}\n\t\t\n\t\t\n\t\tif ($castellano==0 &&($ruso==1 || $rumano==1 || $arabe==1 || $chino==1 || $bulgaro==1 || $polaco==1 || $ingles==1 || $frances==1 || $catalan==1)) { \n\t\t\n\t\t\t$sql_idioma_superior='AND simbolos.sup_con_texto=0 ';\n\t\t\t$sql_idioma_inferior='AND (simbolos.inf_idioma=99999 ';\n\t\t\t\t\tif ($castellano==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=0 '; } \n\t\t\t\t\tif ($ruso==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=1 '; } \n\t\t\t\t\tif ($rumano==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=2 '; } \n\t\t\t\t\tif ($arabe==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=3 '; } \n\t\t\t\t\tif ($chino==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=4 '; } \n\t\t\t\t\tif ($bulgaro==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=5 '; } \n\t\t\t\t\tif ($polaco==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=6 '; } \n\t\t\t\t\tif ($ingles==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=7 '; }\n\t\t\t\t\tif ($frances==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=8 '; }\n\t\t\t\t\tif ($catalan==1) { $sql_idioma_inferior.='OR simbolos.inf_idioma=9 '; } \n\t\t\t$sql_idioma_inferior.= ' )';\n\t\t\t$sql_tipo_letra=''; \t\t\t\n\t\t\n\t\t} elseif ($castellano==1) { \n\t\t\n\t\t\tif ($ruso==1 || $rumano==1 || $arabe==1 || $chino==1 || $bulgaro==1 || $polaco==1 || $ingles==1 || $frances==1 || $catalan==1) {\n\t\t\t\n\t\t\t$sql_idioma_inferior='AND simbolos.inf_idioma=0 ';\n\t\t\t$sql_idioma_superior='AND (simbolos.inf_idioma=99999 ';\n\t\t\t\t\tif ($ruso==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=1 '; } \n\t\t\t\t\tif ($rumano==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=2 '; } \n\t\t\t\t\tif ($arabe==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=3 '; } \n\t\t\t\t\tif ($chino==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=4 '; } \n\t\t\t\t\tif ($bulgaro==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=5 '; } \n\t\t\t\t\tif ($polaco==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=6 '; } \n\t\t\t\t\tif ($ingles==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=7 '; }\n\t\t\t\t\tif ($frances==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=8 '; }\n\t\t\t\t\tif ($catalan==1) { $sql_idioma_superior.='OR simbolos.sup_idioma=9 '; } \n\t\t\t$sql_idioma_superior.= ' )';\n\t\t\t\n\t\t\t} elseif ($ruso==0 && $rumano==0 && $arabe==0 && $chino==0 && $bulgaro==0 && $polaco==0 && $ingles==0 && $frances==0 && $catalan==0) {\n\t\t\t\n\t\t\t\t$sql_idioma_superior='AND simbolos.sup_con_texto=0 ';\n\t\t\t\t$sql_idioma_inferior='AND simbolos.inf_idioma=0 ';\n\t\t\t\n\t\t\t}\n\t\t\n\t\t} elseif ($castellano==0 && $ruso==0 && $rumano==0 && $arabe==0 && $chino==0 && $bulgaro==0 && $polaco==0 && $ingles==0 && $frances==0 && $catalan==0) {\n\t\t\n\t\t\t$sql_idioma_inferior='';\n\t\t\t$sql_idioma_inferior='';\n\t\t}\n\t\t\n\t\tif ($id_tipo_palabra==99) { $sql_tipo_palabra=''; } \n\t\telse { $sql_tipo_palabra='AND palabras.id_tipo_palabra='.$id_tipo_palabra.''; }\n\t\t\n\t\tif ($marco==99) { $sql_marco=''; } \n\t\telse { $sql_marco='AND simbolos.marco='.$marco.''; }\n\t\t\n\t\tif ($contraste==99) { $sql_contraste=''; } \n\t\telse { $sql_contraste='AND simbolos.contraste='.$contraste.''; }\n\t\t\n\t\tif ($id_tipo_simbolo==99) { $sql_tipo_simbolo='AND simbolos.id_tipo_simbolo=tipos_simbolos.id_tipo'; } \n\t\telse { $sql_tipo_simbolo='AND simbolos.id_tipo_simbolo='.$id_tipo_simbolo.' AND tipos_simbolos.id_tipo='.$id_tipo_simbolo.''; }\n\t\t\n\t\t$query = \"SELECT simbolos.*, palabras.*, tipos_simbolos.*\n\t\tFROM simbolos, palabras, tipos_simbolos\n\t\tWHERE simbolos.id_palabra=palabras.id_palabra\n\t\tAND simbolos.id_palabra='$id_palabra'\n\t\t$sql_tipo_simbolo\n\t\t$sql_tipo_palabra\n\t\t$sql_marco\n\t\t$sql_contraste\n\t\t$sql_tipo_letra\n\t\t$sql_mayusculas\n\t\t$sql_idioma_inferior\n\t\t$sql_idioma_superior\n\t\t$mostrar_registradas\n\t\tORDER BY palabras.palabra asc\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "public function makeColumnas($proveedorestilo,$amontobase,$amontoagregado,$idreporte){\n\t$arraycolumnas=array();\n\n // $totalesuma=$proveedordatos->Total();\n\t/*var_dump($amontobase);\n\tyii::app()->end();*/\n\t$camposadosables=Coordreporte::adosables($idreporte); //\tObtiene los campos\n\t//que alojan un campo de texto u otro valor para concatenar en la misma celda del GRID\n\t// pej array('descripcion'=>'comentario', 'preciounitario'=>'comentario2', ...etc)\n\tforeach( $proveedorestilo as $registroestilo)\n\t{\n\n\n\t\t if(($registroestilo->esdetalle+0) > 0)\n\t\t {\n\t\t\t // foreach( $proveedordatos->getData() as $recorde)\n\t\t\t \t\t//{\n\t\t\t // print_r($camposadosables);yii::app()->end();\n\t\t\t //$arreglotextos=array('htmlOptions'=> array ( 'width' => $registroestilo->longitudcampo*5 ));\n\t\t\t $arreglopropiedades=array(\n\t\t\t\t 'name'=>$registroestilo->nombre_campo,\n\t\t\t\t 'header'=>$registroestilo->aliascampo,\n\t\t\t\t 'type'=>'raw',\n\t\t\t\t // array_keys($arreglotextos)=>array_values($arreglotextos),\n\t\t\t\t //'value'=>'is_numeric($data->'.$registroestilo->nombre_campo.')?MiFactoria::decimal($data->'.$registroestilo->nombre_campo.',2):$data->'.$registroestilo->nombre_campo.'',\n\t\t\t\t //'footer'=>(in_array($registroestilo->nombre_campo,array_keys($amontobase)))? ($amontobase[$registroestilo->nombre_campo]+$amontoagregado[$registroestilo->nombre_campo]).'':'',\n\t\t\t\t 'footer'=>($registroestilo->totalizable=='1')? MiFactoria::decimal(($amontobase[$registroestilo->nombre_campo]+$amontoagregado[$registroestilo->nombre_campo])).'':'',\n\t\t\t\t //'footer'=>\n\t\t\t\t 'htmlOptions'=> array ( 'width' => $registroestilo->longitudcampo*5 ),\n\t\t\t\t 'footerHtmlOptions'=>array('class' =>'piegrid'),\n\t\t\t );\n\t\t\t if($registroestilo->esnumerico=='1'){\n\t\t\t\t $arreglopropiedades['value']='MiFactoria::decimal($data->' . $registroestilo->nombre_campo.',2)';\n\n\t\t\t }\n\n\t\t\t IF(in_array($registroestilo->nombre_campo ,array_keys($camposadosables)))\n\t\t\t {\n\t\t\t\t //$arreglotextos = array('value' => '$data->' . $registroestilo->nombre_campo . '.CHtml::tag(\"<br>\").$data->' . $camposadosables[$registroestilo->nombre_campo] . '');\n\t\t\t\t // if($registroestilo->{})\n\t\t\t\t $arreglopropiedades['value']='$data->' . $registroestilo->nombre_campo .'.CHtml::tag(\"br\").CHtml::openTag(\"span\",array(\"style\"=>\"font-size:9px;\")).$data->'.$camposadosables[$registroestilo->nombre_campo].'.CHtml::closeTag(\"span\")';\n\n\t\t\t }\n\t\t\t $arraycolumnas[ ] =$arreglopropiedades ;\n\n\n\t\t }\n\t}\n\t//$arraycolumnas['footerHtmlOptions']=array('style' =>\" font-size:12px;\");\n\t/*print_r($arraycolumnas);\n\tyii::app()->end();*/\nreturn array_values($arraycolumnas);\n}", "public function datatable_deposito_setup()\n\t{\n\t\t/* Array of database columns which should be read and sent back to DataTables. Use a space where\n\t\t * you want to insert a non-database field (for example a counter or static image)\n\t\t */\n\t\t$aColumns = array( '','mfi_cif.cif_no','mfi_cif.nama','account_deposit_no','' );\n\t\t\t\t\n\t\t/* \n\t\t * Paging\n\t\t */\n\t\t$sLimit = \"\";\n\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\n\t\t{\n\t\t\t$sLimit = \" OFFSET \".intval( $_GET['iDisplayStart'] ).\" LIMIT \".\n\t\t\t\tintval( $_GET['iDisplayLength'] );\n\t\t}\n\t\t\n\t\t/*\n\t\t * Ordering\n\t\t */\n\t\t$sOrder = \"\";\n\t\tif ( isset( $_GET['iSortCol_0'] ) )\n\t\t{\n\t\t\t$sOrder = \"ORDER BY \";\n\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n\t\t\t\t{\n\t\t\t\t\t$sOrder .= \"\".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\" \".\n\t\t\t\t\t\t($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc') .\", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\n\t\t\tif ( $sOrder == \"ORDER BY\" )\n\t\t\t{\n\t\t\t\t$sOrder = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* \n\t\t * Filtering\n\t\t */\n\t\t$sWhere = \"\";\n\t\tif ( isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" )\n\t\t{\n\t\t\t$sWhere = \"WHERE (\";\n\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t\t\t$sWhere .= \"LOWER(\".$aColumns[$i].\") LIKE '%\".strtolower($_GET['sSearch']).\"%' OR \";\n\t\t\t}\n\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\n\t\t\t$sWhere .= ')';\n\t\t}\n\t\t\n\t\t/* Individual column filtering */\n\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t{\n\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t{\n\t\t\t\tif ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\n\t\t\t\t{\n\t\t\t\t\tif ( $sWhere == \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere = \"WHERE \";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere .= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t\t$sWhere .= \"LOWER(\".$aColumns[$i].\") LIKE '%\".strtolower($_GET['sSearch_'.$i]).\"%' \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$rResult \t\t\t= $this->model_transaction->datatable_deposito_setup($sWhere,$sOrder,$sLimit); // query get data to view\n\t\t$rResultFilterTotal = $this->model_transaction->datatable_deposito_setup($sWhere); // get number of filtered data\n\t\t$iFilteredTotal \t= count($rResultFilterTotal); \n\t\t$rResultTotal \t\t= $this->model_transaction->datatable_deposito_setup(); // get number of all data\n\t\t$iTotal \t\t\t= count($rResultTotal);\t\n\t\t\n\t\t/*\n\t\t * Output\n\t\t */\n\t\t$output = array(\n\t\t\t\"sEcho\" => intval($_GET['sEcho']),\n\t\t\t\"iTotalRecords\" => $iTotal,\n\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\n\t\t\t\"aaData\" => array()\n\t\t);\n\t\t\n\t\tforeach($rResult as $aRow)\n\t\t{\n\t\t\t$row = array();\n\t\t\t$row[] = '<input type=\"checkbox\" value=\"'.$aRow['account_deposit_id'].'\" id=\"checkbox\" class=\"checkboxes\" >';\n\t\t\t$row[] = $aRow['cif_no'];\n\t\t\t$row[] = $aRow['nama'];\n\t\t\t$row[] = $aRow['account_deposit_no'];\n\t\t\t$row[] = '<a href=\"javascript:;\" account_deposit_id=\"'.$aRow['account_deposit_id'].'\" id=\"link-edit\">Edit</a>';\n\n\t\t\t$output['aaData'][] = $row;\n\t\t}\n\t\t\n\t\techo json_encode( $output );\n\t}", "public function datatable_rekening_tabungan_setup()\n\t{\n\t\t$aColumns = array( '','mfi_cif.cif_no','mfi_cif.nama','product_name','account_saving_no','');\n\t\t\t\t\n\t\t/* \n\t\t * Paging\n\t\t */\n\t\t$sLimit = \"\";\n\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\n\t\t{\n\t\t\t$sLimit = \" OFFSET \".intval( $_GET['iDisplayStart'] ).\" LIMIT \".\n\t\t\t\tintval( $_GET['iDisplayLength'] );\n\t\t}\n\t\t\n\t\t/*\n\t\t * Ordering\n\t\t */\n\t\t$sOrder = \"\";\n\t\tif ( isset( $_GET['iSortCol_0'] ) )\n\t\t{\n\t\t\t$sOrder = \"ORDER BY \";\n\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n\t\t\t\t{\n\t\t\t\t\t$sOrder .= \"\".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\" \".\n\t\t\t\t\t\t($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc') .\", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\n\t\t\tif ( $sOrder == \"ORDER BY\" )\n\t\t\t{\n\t\t\t\t$sOrder = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* \n\t\t * Filtering\n\t\t */\n\t\t$sWhere = \"\";\n\t\tif ( isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" )\n\t\t{\n\t\t\t$sWhere = \"WHERE (\";\n\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower( $_GET['sSearch'] ).\"%' OR \";\n\t\t\t}\n\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\n\t\t\t$sWhere .= ')';\n\t\t}\n\t\t\n\t\t/* Individual column filtering */\n\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t{\n\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t{\n\t\t\t\tif ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\n\t\t\t\t{\n\t\t\t\t\tif ( $sWhere == \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere = \"WHERE \";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere .= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower($_GET['sSearch_'.$i]).\"%' \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$rResult \t\t\t= $this->model_transaction->datatable_rekening_tabungan_setup($sWhere,$sOrder,$sLimit); // query get data to view\n\t\t$rResultFilterTotal = $this->model_transaction->datatable_rekening_tabungan_setup($sWhere); // get number of filtered data\n\t\t$iFilteredTotal \t= count($rResultFilterTotal); \n\t\t$rResultTotal \t\t= $this->model_transaction->datatable_rekening_tabungan_setup(); // get number of all data\n\t\t$iTotal \t\t\t= count($rResultTotal);\t\n\t\t\n\t\t/*\n\t\t * Output\n\t\t */\n\t\t$output = array(\n\t\t\t\"sEcho\" => intval($_GET['sEcho']),\n\t\t\t\"iTotalRecords\" => $iTotal,\n\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\n\t\t\t\"aaData\" => array()\n\t\t);\n\t\t\n\t\tforeach($rResult as $aRow)\n\t\t{\n\t\t\t$rembug='';\n\t\t\tif($aRow['cm_name']!=\"\"){\n\t\t\t\t$rembug=' <a href=\"javascript:void(0);\" class=\"btn mini green-stripe\">'.$aRow['cm_name'].'</a>';\n\t\t\t}\n\t\t\t$row = array();\n\t\t\t$row[] = '<input type=\"checkbox\" value=\"'.$aRow['account_saving_id'].'\" id=\"checkbox\" class=\"checkboxes\" >';\n\t\t\t$row[] = $aRow['cif_no'];\n\t\t\t$row[] = $aRow['nama'].$rembug;\n\t\t\t$row[] = $aRow['product_name'];\n\t\t\t$row[] = $aRow['account_saving_no'];\n\t\t\t$row[] = '<div align=\"center\"><a href=\"javascript:;\" class=\"btn mini purple\" account_saving_id=\"'.$aRow['account_saving_id'].'\" id=\"link-edit\"><i class=\"icon-edit\"></i> Edit</a></div>';\n\n\t\t\t$output['aaData'][] = $row;\n\t\t}\n\t\t\n\t\techo json_encode( $output );\n\t}", "public function column()\r\n {\r\n if (!empty($this->configs->column))\r\n return $this->configs->column;\r\n\r\n return ZArrayHelper::merge(parent::column(), [\r\n \r\n 'user' => function (Form $column) {\r\n\r\n $column->title = Az::l('Пользователь');\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'amount' => function (Form $column) {\r\n\r\n $column->title = Az::l('Количество потоков');\r\n \r\n return $column;\r\n },\r\n \r\n \r\n \r\n\r\n\r\n\r\n ], $this->configs->replace);\r\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 getListFilter($col,$key) {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'p.kodeunit': return \"p.kodeunit = '$key'\";\n\t\t\t\tcase 'periode': return \"periode = '$key'\";\n\t\t\t\tcase 'jalurpenerimaan': return \"jalurpenerimaan = '$key'\";\n\t\t\t\tcase 'jenistagihan': return \"jenistagihan = '$key'\";\n\t\t\t\tcase 'isedit': return \"isedit = '$key'\";\n\t\t\t\tcase 'sistemkuliah': return \"p.sistemkuliah = '$key'\";\n\t\t\t\tcase 'flaglunas': \n\t\t\t\t$key = implode(\"','\", $key);\n\t\t\t\treturn \"flaglunas in ('$key')\";\n\t\t\t\tcase 'unitdesc':\n\t\t\t\t\tglobal $conn;\n\t\t\t\t\t$sql = \"select infoleft,inforight from gate.ms_unit where kodeunit = '$key'\";\n\t\t\t\t\t$row = $conn->GetRow($sql);\n\t\t\t\t\treturn \"infoleft >= \".(int)$row['infoleft'].\" and inforight <= \".(int)$row['inforight'];\n\t\t\t\tcase 'basiskampus':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once(Route::getModelPath('sistemkuliah'));\n\t\t\t\t\t$sistem = mSistemkuliah::getIdByBasisKampus($conn,modul::getBasis(),modul::getKampus());\n\t\t\t\t\treturn \" p.sistemkuliah in ('\".implode(\"','\",$sistem).\"') \";\n\t\t\t\t\t\n\t\t\t}\n\t\t}", "function rovoko_archive_grid_col(){\n return apply_filters('rovoko_archive_grid_col','8');\n}", "function columns_filter ( $columns ) {\r\n\r\n\t\t$columns = array(\r\n\t\t\t'cb'\t\t\t\t\t=> '<input type=\"checkbox\" />',\r\n\t\t\t'listing_thumbnail'\t\t=> __( 'Thumbnail', 'apl' ),\r\n\t\t\t'title'\t\t\t\t\t=> __( 'Listing Title', 'apl' ),\r\n\t\t\t'listing_details'\t\t=> __( 'Details', 'apl' ),\r\n\t\t\t'listing_features'\t\t=> __( 'Features', 'apl' ),\r\n\t\t\t'listing_categories'\t=> __( 'Categories', 'apl' )\r\n\t\t);\r\n\r\n\t\treturn $columns;\r\n\r\n\t}", "public function filters()\n {\n return array(\n 'accessControl', /// perform access control for CRUD operations\n array(\n 'application.filters.UserLoginFilter + index, AdminPositionCode, CrearPosition ',/*cuando no estas logeado*/\n ),\n array(\n 'application.filters.UserUpdateFilter + index, AdminPositionCode, CrearPosition',\n )\n );\n }", "function eddenvato_add_id($columns) {\n //$columns['user_id'] = 'User ID';\n $columns['purchase_codes'] = 'Purchase Codes';\n return $columns;\n}", "function cunsultas()\n {\n \t $data['categoria']=categoria::get();\n \t\t$data['unidad']=unidad::get();\n\n \t\treturn $data;\n }", "function tabledata_Cde_select($table , $field,$trisens,$trival, $key, $idWhere = false)\r\n{\r\n global $connect_statut, $spip_lang, $connect_id_auteur;\r\n\r\n //echo \"table : $table , field : $field, trisens : $trisens, trival $trival, key $key, Where $idWhere\";\r\n //echo \"<br/>field : \";print_r($field);\r\n //echo \"<br/>key : \";print_r($key);\r\n //echo \"<br/>Where : \";print_r($idWhere);\r\n\r\n //$boolCleMultiple = (is_array($key['PRIMARY KEY']))?true:false;\r\n\r\n $leschamps = array();\r\n $lestables = $table;\r\n $clauseWhere = array();\r\n $clauseGroupby = array();\r\n $clauseOrderby = array();\r\n $clauseLimit = array();\r\n $clauseHaving = array();\r\n\r\n // Dans la suite : Le nombre de champs à afficher est dynamique.\r\n // Et : l'Identifiant (Id Ligne) doit être le premier champ retourné par SELECT\r\n\r\n foreach ($field as $cle=>$txtChamp)\r\n {\r\n $leschamps [] = $cle;\r\n } // foreach ($field as $cle=>$txtChamp)\r\n\r\n if ($idWhere!=false)\r\n {\r\n $clauseWhere[] = ($idWhere) ; // Limitation1\r\n } // if ($idWhere)\r\n else\r\n {\r\n if ( isset($trival) && $trival!=\"\")\r\n {\r\n $clauseOrderby[] = $trival.($trisens==\"D\"?\" DESC\":\"\");\r\n }\r\n else if ( is_array($key['PRIMARY KEY']) && isset($key['PRIMARY KEY']) )\r\n {\r\n $clauseOrderby[] = implode(\" , \",$key['PRIMARY KEY']) ; // Limitation1\r\n } //if ( isset($key['PRIMARY KEY']))\r\n } // if ($idWhere)\r\n\r\n $Rselect = sql_select( $leschamps,$table,$clauseWhere\r\n ,$clauseGroupby,$clauseOrderby\r\n ,$clauseLimit,$clauseHaving);\r\n\r\n $nbenreg = sql_count($Rselect) ;\r\n\r\n //-------- Voir le code de la requête\r\n //echo \"<hr/>\",sql_get_select( $leschamps,$table,$clauseWhere,$clauseGroupby,$clauseOrderby,$clauseLimit,$clauseHaving),\"<br/> ressource : \";\r\n\r\n echo ($nbenreg==1)?\"\":\" Nb enreg. dans la s&#233;lection : \".$nbenreg.\"<hr/>\";\r\n\r\n return $Rselect;\r\n\r\n}", "function getColumns(){\r\n return array(\r\n 'log_id'=>array('label'=>'日志id','class'=>'span-3','readonly'=>true), \r\n 'member_id'=>array('label'=>'用户','class'=>'span-3','type'=>'memberinfo'), \r\n 'mtime'=>array('label'=>'交易时间','class'=>'span-2','type'=>'time'), \r\n 'memo'=>array('label'=>'业务摘要','class'=>'span-3'), \r\n 'import_money'=>array('label'=>'存入金额','class'=>'span-3','type'=>'import_money'), \r\n 'explode_money'=>array('label'=>'支出金额','class'=>'span-3','type'=>'explode_money'), \r\n 'member_advance'=>array('label'=>'当前余额','class'=>'span-3'), \r\n 'paymethod'=>array('label'=>'支付方式','class'=>'span-3'), \r\n 'payment_id'=>array('label'=>'支付单号','class'=>'span-3'), \r\n 'order_id'=>array('label'=>'订单号','class'=>'span-3'), \r\n 'message'=>array('label'=>'管理备注','class'=>'span-3'), \r\n 'money'=>array('label'=>'出入金额','class'=>'span-3','readonly'=>true), \r\n 'shop_advance'=>array('label'=>'商店余额','class'=>'span-3','readonly'=>true), \r\n );\r\n }", "public function obterUnidadesCidMunicipio($cids, $atendimentoDomicilio, $municipio, $municipiosProximos, $tipologiaId = '') {\n $filtro = new BSFilter();\n $condicoes = array();\n $joins= array();\n\n\n if(!empty($cids) && count($cids) > 0 && !empty($cids[0])){\n $cids[] = 0;//garantia de mais de um elemento\n $joins[] = array(\n 'table' => 'unidade_atendimento_cid',\n 'alias' => 'UnidadeAtendimentoCid',\n 'type' => 'inner',\n 'conditions' => array('UnidadeAtendimentoCid.unidade_atendimento_id = UnidadeAtendimento.id')\n );\n $condicoes['UnidadeAtendimentoCid.cid_id in'] = $cids;\n }\n $condicoes['Endereco.municipio_id'] = $municipio;\n\n if($atendimentoDomicilio == true){\n $condicoes['UnidadeAtendimento.atendimento_domicilio'] = true;\n }\n\n \n $filtro->setJoins($joins);\n $filtro->setTipo('all');\n $filtro->setCamposRetornadosString('id', 'nome');\n $filtro->setCamposOrdenados('UnidadeAtendimento.id');\n $filtro->setCondicoes($condicoes);\n\n\n $resultado = $this->listar($filtro);\n \n\n if($municipiosProximos == true){\n \n\n $joins2[] = array(\n 'table' => 'unidade_atendimento_cid',\n 'alias' => 'UnidadeAtendimentoCid',\n 'type' => 'inner',\n 'conditions' => array('UnidadeAtendimentoCid.unidade_atendimento_id = UnidadeAtendimento.id')\n );\n\n $joins2[] = array(\n 'table' => 'unidade_atendimento_municipio',\n 'alias' => 'UnidadeAtendimentoMunicipio',\n 'type' => 'inner',\n 'conditions' => array('UnidadeAtendimentoMunicipio.unidade_atendimento_id = UnidadeAtendimento.id')\n );\n\n $filtro2 = new BSFilter();\n $condicoes2 = array(); \n\n // $condicoes2['UnidadeAtendimentoCid.cid_id'] = $cidId;\n if(isset($cids) && !empty($cids)){\n $condicoes2['UnidadeAtendimentoCid.cid_id in'] = $cids;\n }\n $condicoes2['UnidadeAtendimentoMunicipio.municipio_id'] = $municipio;\n $condicoes2['UnidadeAtendimento.atendimento_domicilio'] = true;\n $filtro2->setJoins($joins2);\n $filtro2->setTipo('all');\n $filtro2->setCamposRetornadosString('id', 'nome');\n $filtro2->setCamposOrdenados('UnidadeAtendimento.id');\n $filtro2->setCondicoes($condicoes2);\n $filtro2->setCamposAgrupados('UnidadeAtendimento.id');\n\n $resultado2 = $this->listar($filtro2);\n $resultado = array_merge($resultado, $resultado2);\n }\n\n $retorno = array();\n foreach ($resultado as $registro) {\n $retorno[$registro['UnidadeAtendimento']['id']] = $registro['UnidadeAtendimento']['nome'];\n }\n\n // return $this->listar($filtro);\n // pr($retorno);die;\n return $retorno;\n }", "public function listar_abonos_informe_table_filtro($desde, $hasta) {\n $dato = [];\n\n //--- Datos del Logeado ---//\n $userdata = $this->session->all_userdata();\n //--- datos ---//\n $abonos = $this->app_model->get_abonos_desde_hasta($desde, $hasta);\n $estados = $this->app_model->get_estados();\n\n if ($abonos) {\n foreach ($abonos as $key => $value) {\n $texto = \"\";\n $class = \"\";\n if ($value['idEstado'] == 1) :\n $class = \"btn-info\";\n $texto = \"Activado\";\n elseif ($value['idEstado'] == 2):\n $class = \"btn-success\";\n $texto = \"Pausado\";\n elseif ($value['idEstado'] == 3):\n $class = \"btn-danger\";\n $texto = \"Terminado\";\n else:\n $class = \"btn-warning\";\n $texto = \"Sin Estado\";\n endif;\n\n $opcion = '<div class=\"btn-group\">' .\n '<button class=\"btn ' . $class . '\" style=\"padding: 3px;font-size: 0.8em;\">' . $texto . '</button>' .\n '</div>';\n\n $dato[] = array(\n $opcion,\n $value['fechaEmision'],\n $value['fechaVtoCobro'],\n $value['nombEmpresa'],\n $value['descripModalidad'],\n $value['ventasCreadas'],\n \"$\" . number_format($value['total'] + $value['descuentoTotal'], 2, \",\", \".\"),\n \"$\" . number_format($value['descuentoTotal'], 2, \",\", \".\"),\n \"$\" . number_format($value['total'], 2, \",\", \".\"),\n \"$\" . number_format($value['total'], 2, \",\", \".\"),\n $value['nombreVend'],\n \"DT_RowId\" => $value['idAbono']\n );\n }\n }\n\n $aa = array(\n 'sEcho' => 1,\n 'iTotalRecords' => count($dato),\n 'iTotalDisplayRecords' => 10,\n 'aaData' => $dato\n );\n\n echo json_encode($aa);\n }" ]
[ "0.6488054", "0.6164636", "0.6093107", "0.6080668", "0.5973518", "0.5901899", "0.58672994", "0.58649206", "0.5856721", "0.58523655", "0.5807635", "0.5776656", "0.57594126", "0.5663137", "0.5638683", "0.5629808", "0.5593232", "0.5587226", "0.55845433", "0.5580304", "0.55662787", "0.55658376", "0.55644697", "0.5562463", "0.5556682", "0.5525891", "0.55139154", "0.5511761", "0.55092376", "0.54947966", "0.54911906", "0.54909074", "0.54904497", "0.5472406", "0.5471388", "0.5469027", "0.54680115", "0.54455245", "0.5435362", "0.5433735", "0.54222834", "0.54019874", "0.5400823", "0.5391263", "0.5386482", "0.5379823", "0.53748864", "0.5372544", "0.53715605", "0.5365056", "0.5350035", "0.53437227", "0.53357536", "0.53326553", "0.53324664", "0.53224516", "0.53104204", "0.5301697", "0.5300293", "0.52967125", "0.52921146", "0.52868295", "0.5285442", "0.52853215", "0.52840805", "0.52831876", "0.5281898", "0.5278948", "0.52747506", "0.5270703", "0.5270258", "0.5267276", "0.5266564", "0.52636635", "0.52597654", "0.52595735", "0.5256594", "0.5255595", "0.52546215", "0.5250384", "0.52469283", "0.52433836", "0.5242698", "0.5239909", "0.52374905", "0.5224418", "0.52206135", "0.52197", "0.52189076", "0.5218003", "0.52175426", "0.52107865", "0.5202816", "0.52003425", "0.5198603", "0.5196515", "0.5193765", "0.5192616", "0.51917195", "0.5184635", "0.51829714" ]
0.0
-1
/echo ''; $result = mysql_query("SET NAMES 'utf8'", $conex); print_r($usrDocEdo); print_r($Resultados); print_r($condiciones); echo '';
public function actualizar($var2, $condiciones) { //print_r($registro); $var_3 = array_intersect_key($var2, $this->columArt); //print_r($var_3); $oper2 = $this->pdo->_update('c004t_proceso', $var_3, $condiciones); //print_r($var_3); //echo 'hola1'; if($oper2){ return true; } else{ return "Ha ocurrido un error al intentar actualizar los datos del Documento."; //$oper1.$oper2; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function set_charset() {\n\t\t//regresa bool\n\t\t$this->conn->set_charset(\"utf8\");\n\t}", "function conmysql(){\n $con=mysql_connect('localhost','root','');\n if(!$con){\n die('ء¬½ست§°ـ£؛'.mysql_error());\n }\n mysql_set_charset('utf-8');\n mysql_select_db('fnp2p');\n return $con;\n}", "function seguridad_utf8($entrada){\n\t\tglobal $mysqli;\n\t\treturn addslashes($mysqli -> real_escape_string(nl2br(trim($entrada))));\n\t}", "final public function setUTF() {\n mysqli_query($this->resourceId,\"SET NAMES 'utf8'\");\n }", "public function __construct(){\n // Conectar no banco de dados\n mysql_connect(DBHOST, DBUSER, DBPASS) or die ('Erro ao conectar no banco: '. mysql_error());\n // Selecionar o banco \n mysql_select_db(DBNAME);\n \n $this->execQuery('SET character_set_connection=utf8');\n $this->execQuery('SET character_set_client=utf8');\n $this->execQuery('SET character_set_results=utf8');\n }", "function consuCsit(){\r\n \t$conexao = getConexao();\r\n\t\t$query = \"SELECT * FROM TBCSIT ORDER BY TIPO\";\r\n \t$resultado = mysql_query($query) or die(mysql_error());\r\n \tmysql_close($conexao);\r\n\t\treturn($resultado);\r\n }", "function Confirma_NominaWeb($IDESTABLECIWEB){\n\t$resultadoText = '';\n\ttry{\n\t\tglobal $conn;\n\t\t\n\t\t$params = array(\":IDCABECERANOMINA\" => $IDESTABLECIWEB );\t\t\t\t\t\t\t\t\n\t\t\n\t\t$sql = ObtenerDatosNominaWeb('', '', false);\t\t\n\t\t$sql = ReemplazaCaracterStr($sql, '?', '' );\n\t\t$sql = ReemplazaCaracterStr($sql, '¿', '' );\n\t\t\n\t\t$stmt = DBExecSql($conn, $sql, $params);\t\n\t\t$contador = 0;\t\t\n\t\t\n\t\tif (DBGetRecordCount($stmt) == 0) {\n\t\t\treturn utf8_encode(\"Nómina vacia.\");\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\twhile ($row = DBGetQuery($stmt)){\t\t\n\t\t\t$faltantes = '';\n\t\t\tforeach($row as $key=>$value){\t\t\t\t\t\n\t\t\t\tif( !isset($value) ) $value = '';\n\t\t\t\tif($value == '') {\n\t\t\t\t\tif($faltantes != '') $faltantes .= ', ';\n\t\t\t\t\t\n\t\t\t\t\tswitch ($key) {\n\t\t\t\t\t\tcase \"NOMBRE\":\n\t\t\t\t\t\t\t$faltantes .= 'Nombre ';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"FECING\":\n\t\t\t\t\t\t\t$faltantes .= \"Fecha ingreso \";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"FECINI\":\n\t\t\t\t\t\t\t$faltantes .= \"Fecha inicio\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"SECTOR\":\n\t\t\t\t\t\t\t$faltantes .= \"Sector \";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"PUESTO\":\n\t\t\t\t\t\t\t$faltantes .= \"Puesto \";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"LISTAESOP\":\n\t\t\t\t\t\t\t$faltantes .= \"ESOP \";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t // $faltantes .= $key;\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($faltantes != ''){\n\t\t\t\t$contador ++;\t \t\t\t\t\t\n\t\t\t\t$resultadoText .= \" CUIL \".$row['CUIL'].\". Completar: \".$faltantes.\" <p>\";\n\t\t\t}else{\n\t\t\t\t$fechaIngreso = $row['FECING']; \n\t\t\t\t$fechaInicio = $row['FECINI']; \n\t\t\t\t$resultFecha = ValidarFechas($fechaIngreso, $fechaInicio);\n\t\t\t\tif( $resultFecha != '' ){\n\t\t\t\t\t$contador ++;\t \t\t\t\t\t\n\t\t\t\t\t$resultadoText .= \" CUIL \".$row['CUIL'].\". Error: \".$resultFecha.\" <p>\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\t\t\n\t\t\n\t\tif($resultadoText != '')\n\t\t\treturn $resultadoText.\" Total registros incompletos \".$contador;\n\t\telse{\n\t\t\tGrabarEstadoNomina($IDESTABLECIWEB, 'L', false, $conn);\n\t\t\tDBCommit($conn);\t\t\t\t\t\t\n\t\t}\n\t\t\t\t\n\t\treturn $resultadoText;\n\t\t\n\t}catch (Exception $e){\t\t\t\n\t\tDBRollback($conn);\t\t\n\t\tSalvarErrorTxt( __FILE__, __FUNCTION__ , __LINE__, $e->getMessage() );\n\t\tRetronaXML($e->getMessage());\t\t\t\t\t\t\n\t}\n\t\n}", "function sobre($host, $user, $pass, $db, $cambio){\n if ($cone3 = new mysqli($host, $user, $pass, $db)) {\n //si la conexion es exitosa realizamos las siguientes instrucciones\n $query3=\"SELECT atracciones.nombre as atrac, atracciones.descripcion as descrip,\n atracciones.foto_url as foto, ciudad.nombre as ciudad, estados.nombre as estado\n from atracciones \n inner join ciudad on atracciones.ciudad_id = ciudad.id\n inner join estados on ciudad.estados_id = estados.id \n inner join lugares on ciudad.id = lugares.ciudad_id where lugares.id = $cambio\";\n $res3 = $cone3->query($query3); \n while ($fila3 = $res3->fetch_assoc()) {\n //creamos el html de forma dinamica pasando los datos de la base\n echo utf8_encode(\"<div class='imagen'>\n <img src='\".$fila3['foto'].\"' /></div>\n <h1>Sobre \".$fila3['ciudad'].\", \".$fila3['estado'].\"</h1>\n <h2>\".$fila3['atrac'].\"</h2>\n <p>\".$fila3['descrip'].\"</p>\");\n }\n //cerramos la conexion\n $cone3->close();\n $res3->close();\n }else{\n //si la conexion a la base tuvo algún error mostramos el siguiente texto\n echo \"Por el momento no se puede mostrar la informacion comuniquese con el administrador de la pagina\";\n }\n}", "function THR_ConnectToDatabase()\r\n\r\n{\r\n\tmysql_connect(\"localhost\", \"root\", \"\") or die(\"Impossibile connettersi al database: \" . mysql_error());\r\n\tmysql_select_db(\"crm\");\r\n\tmysql_query(\"SET NAMES utf8\");\r\n}", "function fsentencia(){\n\t\t//$this->muestra=1;\n\t\t$this->resultado=\"\";\n\t\t$temp_resultado=\"\";\n\t\t$temp = explode(\" \",$this->sentencia);\n\t\t$temp[0] = strtoupper($temp[0]);\n\t\t$this->fconectar();\n\t\tif ($this->muestra == 1) echo $this->sentencia.\";<br>\";\n\t\t$result = $this->conexion->query($this->sentencia);\n\t\tif (!$result){\n\t\t\t$this->error = $this->conexion->error;\n\t\t\t$this->debug();\n\t\t\t$this->fdesconectar();\n\t\t\treturn false;\n\t\t}else{\n\t\t\tif ($temp[0] == \"INSERT\"){ //ejecuto un select\n\t\t\t\t$this->ultimo_id = $this->conexion->insert_id;\n\t\t\t}else if ($temp[0] == \"SELECT\" || $temp[0] == \"SHOW\"){ //ejecuto un select\n\t\t\t\t$temp_while=\"\";\t\n\t\t\t\twhile($temp_while = $result->fetch_array()){\n\t\t\t\t\t$temp_resultado[] = $temp_while;\n\t\t\t\t}\n\t\t\t\tif ($temp_resultado == \"\"){\n\t\t\t\t\t$this->resultado = NULL;\n\t\t\t\t}else{\n\t\t\t\t\t$this->resultado = $temp_resultado;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->conexion->warning_count) {\n\t\t\t if ($result = $this->conexion->query(\"SHOW WARNINGS\")) {\n\t\t\t $this->error= $result->fetch_row();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($this->error != \"\"){\n\t\t\t$this->debug();\n\t\t\tdie();\n\t\t}\n\t\t//mysqli_free_result($result);\n\t\t$this->fdesconectar();\n\t\tunset($temp,$result,$temp_while);\n\t}", "function grabar_consulta($variable_array){\n//creo el xajaxResponse para generar una salida\n$respuesta = new xajaxResponse('ISO-8859-1');\n$id_campo = $variable_array[\"id_campo\"];\n$id_especialista = $variable_array[\"id_especialista\"];\n$id_usuario = $variable_array[\"id_usuario\"];\n$id_turno = $variable_array[\"id_turno\"];\n$tipo = $variable_array[\"tipo\"];\n$cie_10 = $variable_array[\"29\"];\n$cabeza = $variable_array[\"22\"];\n$cuello = $variable_array[\"23\"];\n$torax = $variable_array[\"24\"];\n$abdomen = $variable_array[\"25\"];\n$timestamp = time(); \n$link=conectarse();\nmysql_query(\"SET NAMES 'utf8'\");\n\n/// CAMPOS OBLIGATORIOS\nif ($cie_10 == ''){\n$nuevo_select =\"<center><h1><img src='images/atencion.gif' alt='!'>No ha especificado un código de diagnóstico</h1><h2>Los datos no se guardarán!</h2></center>\";\n$respuesta->addAssign(\"consulta_dinamico\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// comprueba si el cie 1o es valido\n$sql=mysql_query(\"SELECT * FROM cie_10 WHERE codigo = '$cie_10' LIMIT 1\",$link);\n\nif (mysql_num_rows($sql)=='0'){\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n$nuevo_select =\"<center><h1><img src='images/atencion.gif' alt='!'> $cie_10 No es un código válido!</h1><h2>Los datos no se guardarán!</h2></center>\";\n\t\t\t\t\t\t\t\t\t\t\n\n$respuesta->addAssign(\"consulta_dinamico\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n\t\t\t\t\t\t\t\t\t\t}\n\nif ($cabeza == ''){\n$sql=mysql_query(\"SELECT contenido FROM consulta_datos WHERE id_campo = '22' AND id_turno='$id_turno' LIMIT 1\",$link);\nif (mysql_num_rows($sql)=='0'){\n$nuevo_select =\"<center><img src='images/atencion.gif' alt='!'>\n<input type='button' onClick=\\\"xajax_campos_consulta_dinamico('8','Exámen físico','<? echo $id_usuario; ?>');\\\" \n\t\t\t\tvalue='El campo CABEZA en exámen fisico, no puede estar vacio'>\n\t\t\t\t\t\t\t<h2>Los datos no se guardarán!</h2>\n\t\t\t\t\t\t\t</center>\";\n$respuesta->addAssign(\"alerta\",\"innerHTML\",$nuevo_select);\nreturn $respuesta; }\n\t\t\t\t\t\t\t\t\t\t}\n\nif ($cuello == ''){\n$sql=mysql_query(\"SELECT contenido FROM consulta_datos WHERE id_campo = '23' AND id_turno='$id_turno' LIMIT 1\",$link);\nif (mysql_num_rows($sql)=='0'){\n$nuevo_select =\"<center><img src='images/atencion.gif' alt='!'>\n<input type='button' onClick=\\\"xajax_campos_consulta_dinamico('8','Exámen físico','<? echo $id_usuario; ?>');\\\" \n\t\t\t\tvalue='El campo CUELLO en exámen fisico, no puede estar vacio'>\n\t\t\t\t\t\t\t<h2>Los datos no se guardarán!</h2>\n\t\t\t\t\t\t\t</center>\";\n$respuesta->addAssign(\"alerta\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n\t\t\t\t\t\t\t\t\t\t}}\nif ($torax == ''){\n$sql=mysql_query(\"SELECT contenido FROM consulta_datos WHERE id_campo = '24' AND id_turno='$id_turno' LIMIT 1\",$link);\nif (mysql_num_rows($sql)=='0'){\n$nuevo_select =\"<center><img src='images/atencion.gif' alt='!'>\n<input type='button' onClick=\\\"xajax_campos_consulta_dinamico('8','Exámen físico','<? echo $id_usuario; ?>');\\\" \n\t\t\t\tvalue='El campo TORAX en exámen fisico, no puede estar vacio'>\n\t\t\t\t\t\t\t<h2>Los datos no se guardarán!</h2>\n\t\t\t\t\t\t\t</center>\";\n$respuesta->addAssign(\"alerta\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n\t\t\t\t\t\t\t\t\t\t}}\nif ($abdomen == ''){\n$sql=mysql_query(\"SELECT contenido FROM consulta_datos WHERE id_campo = '25' AND id_turno='$id_turno' LIMIT 1\",$link);\nif (mysql_num_rows($sql)=='0'){\n$nuevo_select =\"<center><img src='images/atencion.gif' alt='!'>\n<input type='button' onClick=\\\"xajax_campos_consulta_dinamico('8','Exámen físico','<? echo $id_usuario; ?>');\\\" \n\t\t\t\tvalue='El campo ABDOMEN en exámen fisico, no puede estar vacio'>\n\t\t\t\t\t\t\t<h2>Los datos no se guardarán!</h2>\n\t\t\t\t\t\t\t</center>\";\n$respuesta->addAssign(\"alerta\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n\t\t\t\t\t\t\t\t\t\t}}\n\n/// FIN CAMPOS OBLIGATORIOS\n\n\t\t\t\t\t\t\t\t\t\t\n\n\nif ($tipo == 'mostrar'){\n\nforeach ($variable_array as $campo => $contenido)\n\t{\n$campos=mysql_query(\"\n \t\tSELECT id_consulta_campo, campo_nombre\n\t\tFROM `consulta_campos`\n\t\tWHERE id_consulta_campo = '$campo'\n\t\t\",$link);\n\nwhile( $row = mysql_fetch_array( $campos ) ) {\nif($contenido != \"\"){ \n/// revisando si el campo ya fue grabado en el mismo turno\n$sql_campo=mysql_query(\"SELECT * \n\t\t\t\t\t\t\t\t\t\t\t\tFROM consulta_datos \n\t\t\t\t\t\t\t\t\t\t\t\tWHERE id_campo = '$campo'\n\t\t\t\t\t\t\t\t\t\t\t\tAND id_turno='$id_turno' \n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT 1\",$link);\n\nif (mysql_num_rows($sql_campo)!='0'){\nwhile( $row = mysql_fetch_array( $sql_campo ) ) { \n$id_consulta_datos = $row['id_consulta_datos'];\n\n\n//\t\t\t\t\t\t\t$nuevo_select .= \"$timestamp EXISTIA - $id_consulta_campos -\";\t\n\t\t\t\tmysql_query(\"\nUPDATE `consulta_datos` SET \n`id_especialista` = '$id_especialista',\n`id_usuario` = '$id_usuario',\n`contenido` = '$contenido',\n`timestamp` = '$timestamp',\n`id_turno` = '$id_turno' WHERE`id_consulta_datos` = '$id_consulta_datos' LIMIT 1 \",$link);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\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}else {\t\n//\t\t\t\t\t\t\t\t$nuevo_select .= \"nuevo\";\t\t\nmysql_query(\"\nINSERT INTO `consulta_datos` ( `id_consulta_datos` , `id_campo` , `id_especialista` , `id_usuario` , `contenido` , `timestamp` , `id_turno` )\nVALUES (NULL , '$campo', '$id_especialista', '$id_usuario', '$contenido', '$timestamp', '$id_turno')\",$link);\n// $nuevo_select .= \"$campo --- $contenido <br>\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\n\t\n\n\t}\t\n//\t\t$nuevo_select .= \"<h1>La consulta fu&eacute; guardada</h1>\t<a href=?page=plan&id_turno=$id_turno>Recetar</a>; \n\t\t\n$respuesta->addAssign(\"cabecera\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n$nuevo_select .= \"<h1>Los siguientes datos ser&aacute;n guardados en la consulta:</h1>\";\n\n \n$nuevo_select .= \"<ol>\";\n\nforeach ($variable_array as $campo => $valor)\n\t{\n\n$campos=mysql_query(\"\n \t\tSELECT id_consulta_campo, campo_nombre\n\t\tFROM `consulta_campos`\n\t\tWHERE id_consulta_campo = '$campo'\n\t\t\",$link);\n\nwhile( $row = mysql_fetch_array( $campos ) ) {\n$nuevo_select .= \"<li>\". $row['id_consulta_campo'].\" \" . $row['campo_nombre'].\":\" .$valor.\"</li>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t}\n\t\n\t\n\n//while( $row = mysql_fetch_array( $sql ) ) {\n//$nuevo_select .= '' . $row['id'] . '\">' . $row['nombre_completo'] . '<br>';\n//}\n$nuevo_select .= \"<input type='text' name='tipo' id='tipo' value='guardar'>\n\t\t\t\t\t\t<input type='button' onClick=\\\"xajax_grabar_consulta(xajax.getFormValues('consulta'));confirmacion(); \\\" value='Confirmar' >\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\";\n$respuesta->addAssign(\"cabecera\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n}", "function convert_to_utf8($obj)\n{\n global $config;\n $ret = $obj;\n // wenn die Verbindung zur Datenbank nicht auf utf8 steht, dann muessen die Rückgaben in utf8 gewandelt werden,\n // da die Webseite utf8-kodiert ist\n if (!isset($config['mysql_can_change_encoding'])) {\n get_sql_encodings();\n }\n\n if ($config['mysql_can_change_encoding'] == false && $config['mysql_standard_character_set'] != 'utf8') {\n if (is_array($obj)) {\n foreach ($obj as $key => $val) {\n //echo \"<br> Wandle \" . $val . \" nach \";\n $obj[$key] = utf8_encode($val);\n //echo $obj[$key];\n }\n }\n if (is_string($obj)) {\n $obj = utf8_encode($obj);\n }\n $ret = $obj;\n }\n\n return $ret;\n}", "function convert_utf8($echo_results = false)\n\t{\n\t\tglobal $db, $dbname, $table_prefix;\n\n\t\t$db->sql_return_on_error(true);\n\n\t\t$sql = \"ALTER DATABASE {$db->sql_escape($dbname)}\n\t\t\tCHARACTER SET utf8\n\t\t\tDEFAULT CHARACTER SET utf8\n\t\t\tCOLLATE utf8_bin\n\t\t\tDEFAULT COLLATE utf8_bin\";\n\t\t$db->sql_query($sql);\n\n\t\t$sql = \"SHOW TABLES\";\n\t\t$result = $db->sql_query($sql);\n\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t{\n\t\t\t// This assignment doesn't work...\n\t\t\t//$table = $row[0];\n\n\t\t\t$current_item = each($row);\n\t\t\t$table = $current_item['value'];\n\t\t\treset($row);\n\n\t\t\t$sql = \"ALTER TABLE {$db->sql_escape($table)}\n\t\t\t\tDEFAULT CHARACTER SET utf8\n\t\t\t\tCOLLATE utf8_bin\";\n\t\t\t$db->sql_query($sql);\n\n\t\t\tif (!empty($echo_results))\n\t\t\t{\n\t\t\t\techo(\"&bull;&nbsp;Table&nbsp;<b style=\\\"color: #dd2222;\\\">$table</b> converted to UTF-8<br />\\n\");\n\t\t\t}\n\n\t\t\t$sql = \"SHOW FIELDS FROM {$db->sql_escape($table)}\";\n\t\t\t$result_fields = $db->sql_query($sql);\n\n\t\t\twhile ($row_fields = $db->sql_fetchrow($result_fields))\n\t\t\t{\n\t\t\t\t// These assignments don't work...\n\t\t\t\t/*\n\t\t\t\t$field_name = $row_fields[0];\n\t\t\t\t$field_type = $row_fields[1];\n\t\t\t\t$field_null = $row_fields[2];\n\t\t\t\t$field_key = $row_fields[3];\n\t\t\t\t$field_default = $row_fields[4];\n\t\t\t\t$field_extra = $row_fields[5];\n\t\t\t\t*/\n\n\t\t\t\t$field_name = $row_fields['Field'];\n\t\t\t\t$field_type = $row_fields['Type'];\n\t\t\t\t$field_null = $row_fields['Null'];\n\t\t\t\t$field_key = $row_fields['Key'];\n\t\t\t\t$field_default = $row_fields['Default'];\n\t\t\t\t$field_extra = $row_fields['Extra'];\n\n\t\t\t\t// Let's remove BLOB and BINARY for now...\n\t\t\t\t//if ((strpos(strtolower($field_type), 'char') !== false) || (strpos(strtolower($field_type), 'text') !== false) || (strpos(strtolower($field_type), 'blob') !== false) || (strpos(strtolower($field_type), 'binary') !== false))\n\t\t\t\tif ((strpos(strtolower($field_type), 'char') !== false) || (strpos(strtolower($field_type), 'text') !== false))\n\t\t\t\t{\n\t\t\t\t\t//$sql_fields = \"ALTER TABLE {$db->sql_escape($table)} CHANGE \" . $db->sql_escape($field_name) . \" \" . $db->sql_escape($field_name) . \" \" . $db->sql_escape($field_type) . \" CHARACTER SET utf8 COLLATE utf8_bin\";\n\n\t\t\t\t\t$sql_fields = \"ALTER TABLE {$db->sql_escape($table)} CHANGE \" . $db->sql_escape($field_name) . \" \" . $db->sql_escape($field_name) . \" \" . $db->sql_escape($field_type) . \" CHARACTER SET utf8 COLLATE utf8_bin \" . (($field_null != 'YES') ? \"NOT \" : \"\") . \"NULL DEFAULT \" . (($field_default != 'None') ? ((!empty($field_default) || !is_null($field_default)) ? (is_string($field_default) ? (\"'\" . $db->sql_escape($field_default) . \"'\") : $field_default) : (($field_null != 'YES') ? \"''\" : \"NULL\")) : \"''\");\n\t\t\t\t\t$db->sql_query($sql_fields);\n\n\t\t\t\t\tif (!empty($echo_results))\n\t\t\t\t\t{\n\t\t\t\t\t\techo(\"\\t&nbsp;&nbsp;&raquo;&nbsp;Field&nbsp;<b style=\\\"color: #4488aa;\\\">$field_name</b> (in table <b style=\\\"color: #009900;\\\">$table</b>) converted to UTF-8<br />\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($echo_results))\n\t\t\t{\n\t\t\t\techo(\"<br />\\n\");\n\t\t\t\tflush();\n\t\t\t}\n\t\t}\n\n\t\t$db->sql_return_on_error(false);\n\t\treturn true;\n\t}", "public function __construct()\n\t{\n\t\t$db = Db::conectar();\n\t\t$select = $db->query(\"SET NAMES 'utf8'\");\n\t}", "public function __construct()\n\t{\n\t\t$db = Db::conectar();\n\t\t$select = $db->query(\"SET NAMES 'utf8'\");\n\t}", "function testarQuery($res){\n\t\tif (!$res) {\n echo \"</br><strong>Erro na consulta MySQL: </strong></br>\" . mysql_error().\"</br>\";\n }\n\t}", "function formulario_consulta_procesar($variable_array){\n//creo el xajaxResponse para generar una salida\n$respuesta = new xajaxResponse('ISO-8859-1');\n$id_especialista = $variable_array[\"id_especialista\"];\n$campo_nombre = $variable_array[\"campo_nombre\"];\n$campo_descripcion = $variable_array[\"campo_descripcion\"];\n$campo_tipo = $variable_array[\"campo_tipo\"];\n$campo_area = $variable_array[\"campo_area\"];\n$misma_area = $variable_array[\"misma_area\"];\n$campo_orden = $variable_array[\"campo_orden\"];\n$campo_identificador = $variable_array[\"campo_identificador\"];\n$tipo = $variable_array[\"tipo\"];\n$editar = $variable_array[\"editar\"];\n$id_campo_editar = $variable_array[\"id_campo_editar\"];\n$link=Conectarse(); \nmysql_query(\"SET NAMES 'utf8'\");\nif ($editar == 'editar'){\nmysql_query(\"\n\t\t\t\t\t\tUPDATE `consulta_campos` \n\t\t\t\t\t\tSET `campo_nombre` = '$campo_nombre',\n\t\t\t\t\t\t`campo_descripcion` = '$campo_descripcion',\n\t\t\t\t\t\t`orden` = '$campo_orden' ,\n\t\t\t\t\t\t`campo_area` = '$campo_area',\n\t\t\t\t\t\t`campo_tipo` = '$campo_tipo'\n\t\t\t\t\t\tWHERE `consulta_campos`.`id_consulta_campo` ='$id_campo_editar'\n\t\t\t\t\t\tLIMIT 1 ;\",$link);\n$w_campo = \"id_consulta_campo = '$id_campo_editar'\";\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t}else {\n\nmysql_query(\"\n\t\t\t\tinsert into `consulta_campos` \n\t\t\t(`id_especialista`, `campo_nombre`,`campo_descripcion`,`campo_tipo`, `campo_area`, `orden`, `activo`, `identificador`) \n values ('$id_especialista','$campo_nombre','$campo_descripcion','$campo_tipo','$campo_area','$campo_orden','1','$campo_identificador')\",$link); \n$w_campo= \"identificador = '$campo_identificador'\";\n\t\t\t\t\t\t\t\t\t\t}\n\n $campos=mysql_query(\"\n \t\tSELECT id_consulta_campo, campo_nombre, campo_descripcion, tipo_campo_accion, campo_area, orden\n\t\tFROM `consulta_campos` , `tipo_campo`\n\t\tWHERE $w_campo\n\t\t\n\t\tAND consulta_campos.campo_tipo = tipo_campo.id_tipo_campo\n\t\tLIMIT 1\",$link);\n\n$campos_formulario = \"\";\n$campos_formulario .= \"<div name='crear_campos_consulta_$campo_area' id='crear_campos_consulta_$campo_area'>\t</div>\";\t\nwhile( $row = mysql_fetch_array( $campos ) ) {\nif ($row['tipo_campo_accion']=='textarea'){\n$campos_formulario .= \"<div name='id_campos_consulta_\".$row['id_consulta_campo'].\"' id='id_campos_consulta_\".$row['id_consulta_campo'].\"'><form name='Xcampo_editar\".$row['id_consulta_campo'].\"' id='Xcampo_editar\".$row['id_consulta_campo'].\"'><input name='id_campo_editar' id='id_campo_editar' value='\".$row['id_consulta_campo'].\"' type='hidden'><input type='hidden' name='Xarea' id='Xarea' value='\".$row['campo_area'].\"' type='hidden'><input name='id_campo_editar' type='hidden' id='id_campo_editar' value='\".$row['id_consulta_campo'].\"'></form>\".$row['orden'].\"<input type='button' style='width: 200;text-align: left;' value='\".$row['campo_nombre'].\"' OnClick=\\\"xajax_crear_campos_consulta(xajax.getFormValues('Xcampo_editar\".$row['id_consulta_campo'].\"'));\\\" title='\".$row['campo_descripcion'].\"'><br><textarea name='\".$row['campo_nombre'].\"' rows='5' cols='70'></textarea></div><br><br>\";}\nelse{\n$campos_formulario .= \"<div name='id_campos_consulta_\".$row['id_consulta_campo'].\"' id='id_campos_consulta_\".$row['id_consulta_campo'].\"'><form name='Xcampo_editar\".$row['id_consulta_campo'].\"' id='Xcampo_editar\".$row['id_consulta_campo'].\"'><input name='id_campo_editar' id='id_campo_editar' value='\".$row['id_consulta_campo'].\"' type='hidden' ><input type='hidden' name='Xarea' id='Xarea' value='\".$row['campo_area'].\"' ><input name='id_campo_editar' id='id_campo_editar' value='\".$row['id_consulta_campo'].\"' type='hidden'></form>\".$row['orden'].\"<input type='button' style='width: 200;text-align: left;' value='\".$row['campo_nombre'].\"' OnClick=\\\"xajax_crear_campos_consulta(xajax.getFormValues('Xcampo_editar\".$row['id_consulta_campo'].\"'));\\\" title='\".$row['campo_descripcion'].\"'><br> <input name='\".$row['campo_nombre'].\"' id='\".$row['campo_nombre'].\"' type='\".$row['tipo_campo_accion'].\"' size='72'></div><br><br>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\n$respuesta->addAssign(\"formulario_campos_$misma_area\",\"innerHTML\",$campos_formulario);\nreturn $respuesta;\n}", "static public function conectar(){\n /* SE CREA UN OBJETO LLAMADO PDO */\n $link = new PDO(\"mysql:host=localhost;dbname=sefaureo2\",\n \"jaengine_sef219\",\n \"yD$4QM4LJ2s2\");\n\n /* LA FUNCION EXEC SIRVE PARA QUE ACEPTE LOS CARACTERES LATINOS */\n $link->exec(\"set names utf8\");\n \n return $link;\n\n }", "function insert($connection,$query) {\n\t\n\t\tmysql_query(\"SET NAMES 'utf8_spanish_ci'\", $connection);\n\t\tmysql_query($query,$connection);\n}", "function insertarCajadiaria($fecha,$inicio,$fin) {\r\n$sql = \"insert into tbcajadiaria(idcajadiaria,fecha,inicio,fin)\r\nvalues ('','\".utf8_decode($fecha).\"',\".$inicio.\",\".($fin == '' ? 0 : $fin).\")\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}", "function extraeRazas()\n{\n $link = conection();\n $parseUTF8 = array();\n $contador = null;\n \n $query = \"select * from Raza\";\n $result = mysqli_query($link, $query);\n \n $array = mysqli_num_rows($result);\n \n if($array > 0)\n {\n while ($rows = mysqli_fetch_assoc($result))\n {\n $contador ++;\n \n $parseUTF8 [$contador] = [\"idRaza\" => $rows[\"idRaza\"],\n \"nombreRaza\" => utf8_encode($rows[\"nombreRa\"]),\n \"idTipo\" => $rows[\"idTipo\"]];\n }\n }\n \n mysqli_close($link);\n \n return $parseUTF8;\n}", "function mysql12($campos,$tabla,$columna1,$queBuscar1){\n\t$query01=\"SELECT $campos FROM $tabla WHERE $columna1 = '$queBuscar1'\";\n $query02=mysql_query($query01);\n\t$resultado = array();\n\twhile($line = mysql_fetch_array($query02, MYSQL_ASSOC)){\n\t\t$resultado[] = $line;\n\t}\n\treturn $resultado;\n\n/*\nComo ver los datos\n\nforeach( $resultado as $value){\n\tforeach( $value as $value){\n\t\techo $value.\"<br />\";\n\t}\n}\n*/\n}", "public function efectuarConsulta($consulta){\n\n mysqli_query($this->conexion, \"SET lc_time_names = 'es_ES'\" ); \n //Añade el uso de caracteres especiales como tildes con el formato utf8\n mysqli_query($this->conexion, \"SET NAMES 'utf8'\");\n mysqli_query($this->conexion, \"SET CHARACTER 'utf8'\");\n\n $this->resultadoConsulta = mysqli_query($this->conexion, $consulta);\n \n \n return $this->resultadoConsulta; \n }", "function buscar_eu_completo($texto_buscar,$sql) {\n\t\n\t\t$mostrar_visibles=\"AND eu_estado=1\n\t\t\";\n\t\t$idioma=='es';\n\t\t\t\n\t\t$sql_texto=\"AND (eu.eu_titulo LIKE '%$texto_buscar%' \n\t\t\tOR eu_descripcion.eu_descripcion LIKE '%$texto_buscar%') \n\t\t\";\n\t\t\n\t\t$query = \"SELECT eu.*, eu_descripcion.*\n\t\tFROM eu, eu_descripcion\n\t\tWHERE eu.id_eu=eu_descripcion.id_eu\n\t\t$sql\n\t\t$sql_texto\n\t\t$mostrar_visibles\n\t\tORDER BY eu.id_eu desc\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function get_documentoanulado($fecha){\n\t\tinclude(\"application/config/conexdb_db2.php\");\n\t\t\n\t\t$sql =\"select YHSUCDOC,YHTIPDOC,YHNROPDC,YHNUMSER,YHNUMCOR,YHSTS,YHCODSUC FROM LIBPRDDAT.MMYHREL0 a WHERE a.YHSTS='I' AND a.YHCODCIA='10' and a.YHFECDOC>='\".$fecha.\"'\";\n\t\t$dato = odbc_exec($dbconect, $sql)or die(\"<p>\" . odbc_errormsg());\n\t\tif (!$dato) {\n\t\t\t$data = FALSE;\n\t\t} else { \n\t\t\t$nr = odbc_num_rows($dato);\n\t\t\t$data = ($nr>0)?$dato:false;\n\t\t} \n\t\treturn $data;\n\t\t\n\t}", "function startsql()\r\n{\r\n require \".inc/config.php\"; // import configuration\r\n $db = new PDO(\"$db_type:host=$db_host;dbname=$db_name\",$db_user,$db_pass); // initialize DB connection\r\n $db->query(\"SET NAMES 'utf8' COLLATE 'utf8_general_ci'\"); // set UTF8 as character set\r\n $db->query('SET CHARACTER SET utf8');\r\n return $db; // function returns the PDO class\r\n}", "public function AgregarMatriculasMasivas($numInsercion,$lin_inf, $conexion,$idTablaGeneral) { \n header(\"Content-Type: text/html;charset=utf-8\"); \n $IdUsuario = $_SESSION['idUsuario']; \n $registro = explode(\";\", $lin_inf);\n \n $sql = \"CALL SPAGREGARMATRICULASMASIVAS('$registro[0]',$registro[1],$registro[2],$registro[3],'$registro[4]',$registro[5],'$registro[6]','$registro[7]',$registro[8]);\";\n $resultado=1;\n $rs=null;\n $array=\"\";\n //$conexion->getPDO()->query(\"SET NAMES 'utf8'\");\n $inserto = 0;\n if ($rs = $conexion->getPDO()->query($sql)) {\n if ($filas = $rs->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas as $fila) {\n $array = $fila['pIdTabla'];\n }\n }\n $rs->closeCursor();\n $IdMatricula = $array;\n //----- Inicio envío de correos de las matriculas -----//\n if ($IdMatricula > 0){\n $rs1=null;\n $array1=array();\n $conexion->getPDO()->query(\"SET NAMES 'utf8'\");\n $sql1 = \"CALL SPCONSULTARDATOSCORREOMATRICULA($IdMatricula);\";\n if ($rs1 = $conexion->getPDO()->query($sql1)){\n if ($filas = $rs1->fetchAll(PDO::FETCH_ASSOC)){\n //----- Inicio código para enviar el correo al estudiante luego de la matrícula -----//\n foreach ($filas as $fila) {\n $array1[] = $fila; \n }\n $rs1->closeCursor();\n $utilidades = new clsUtilidades();\n $rs2=null;\n $array2=array();\n $IdTercero = $array1[0]['Id'];\n $sql2 = \"CALL SPCONSULTARCORREOSESTUDIANTES($IdTercero);\";\n if ($rs2 = $conexion->getPDO()->query($sql2)) {\n if ($filas2 = $rs2->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas2 as $fila1) {\n $array2[] = $fila1; \n }\n }\n $rs2->closeCursor();\n $clave = array_pop($array2)['Email'];\n $correode = array_pop($array2)['Email'];\n $rs3=null;\n $array3=array(); \n $sql3 = \"CALL SPCONSULTARCORREOUSUARIO($IdUsuario);\";\n if ($rs3 = $conexion->getPDO()->query($sql3)) {\n if ($filas3 = $rs3->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas3 as $fila3) {\n $array3[] = $fila3; \n }\n }\n $rs3->closeCursor();\n }\n if (count($array2)>0){\n $estudiante = $array1[0]['Estudiante'];\n $tipoidentificacion = $array1[0]['TipoIdentificacion'];\n $cedula = $array1[0]['NumeroIdentificacion'];\n $correoElectronico = $array1[0]['CorreoElectronico'];\n $salon = $array1[0]['Salon'];\n $curso = $array1[0]['Curso'];\n $ruta = $array1[0]['Ruta'];\n $duracionCurso = $array1[0]['DuracionCurso'];\n $diasCurso = $array1[0]['DiasCurso'];\n $fechaInicial = $array1[0]['FechaInicial'];\n $fechaFinal = $array1[0]['FechaFinal'];\n $horaInicial = $array1[0]['HoraInicial'];\n $horaFinal = $array1[0]['HoraFinal'];\n $modulo = $array1[0]['Modulo'];\n $duracionModulo = $array1[0]['DuracionModulo'];\n $modalidad = $array1[0]['Modalidad'];\n $sede = $array1[0]['Sede'];\n $docente = $array1[0]['Docente'];\n $usuario = $_SESSION['nombreUsuario'];\n $usuarioe = $array3[0]['CorreoElectronico'];\n $asunto = \"ID DE MATRICULA\";\n $correo=$utilidades->enviarCorreoEstudiante($estudiante,$tipoidentificacion,$cedula,$correoElectronico,$salon,$curso,$ruta,$duracionCurso,$diasCurso,$fechaInicial,$fechaFinal,$horaInicial,$horaFinal,$modulo,$duracionModulo,$modalidad,$sede,$docente,$IdMatricula,$usuario,$usuarioe,$correode,$clave,$asunto);\n }else{\n print_r(\"Error2\");\n $data[\"error\"]=\"No se encontraron correos de estudiantes\";\n }\n }else{\n print_r(\"No consulta correo estudiante\");\n $data[\"error\"]=\"No se consultaron los correos\";\n print_r($conexion->getPDO()->errorInfo()); die();\n } \n }\n }else{\n print_r(\"No consulta datos correo matricula <br>\");\n }\n }\n //----- Fin envío de correos de las matriculas -----//\n } \n return $array;\n }", "function extraeUsuario($sesion)\n{\n $link = conection(); \n \n $query = \"select * from Cliente where sesion like '$sesion'\";\n $result = mysqli_query($link, $query);\n $aPaterno = \"\";\n $aMaterno = \"\";\n \n $array = mysqli_fetch_assoc($result);\n $space = explode(\",\", $array[\"apellidosCl\"]);\n \n if(count($space) === 2)\n {\n $aMaterno = utf8_encode($space[1]);\n $aPaterno = utf8_encode($space[0]);\n }\n \n $parseUTF8 = [\"nombre\" => utf8_encode($array[\"nombreCl\"]), \"aPaterno\" => $aPaterno,\n \"aMaterno\" => $aMaterno, \"fNacimiento\" => utf8_encode($array[\"fn\"]),\n \"idCliente\" => $array[\"idCliente\"], \"idArchivo\" => $array[\"idArchivo\"],\n \"correo\" => utf8_encode($array[\"correo\"])];\n \n mysqli_close($link);\n return $parseUTF8;\n}", "public function get_Docente(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n $sql=\"select * from docente;\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->execute();\r\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\r\n }", "function extraeTipo($idTipo)\n{\n $link = conection();\n \n $query = \"select * from Tipo_Raza where idTipo = '$idTipo'\";\n $result = mysqli_query($link, $query);\n \n $array = mysqli_fetch_assoc($result);\n \n $parseUTF8 = [\"idTipo\" => $array[\"idTipo\"],\n \"tamano\" => utf8_encode($array[\"tamano\"])];\n \n mysqli_close($link);\n return $parseUTF8;\n}", "function db_connect(){\n\t$link = mysql_connect(\"localhost\", USER, PASS)\n\tor die(\"Keine Verbindung möglich: \" . mysql_error());\n// \techo \"Verbindung zum Datenbankserver erfolgreich<br/>\";\n\n\tmysql_select_db(DATABASE) or die(\"Auswahl der Datenbank fehlgeschlagen</br>\");\n\t\n\t// UTF8 ist cool!\n\t$query = \"set names 'utf8';\";\n $result = mysql_query($query);\n if(!$result){\n echo \"set names 'utf8': Anfrage fehlgeschlagen: \" . mysql_error() . \"<br/>\";\n }\n\t\n\t\n\treturn $link;\n}", "function titulo_janela() {\n\n\t$sql_comando = \"SELECT * FROM ce_config WHERE Comando='Titulo_Janela'\";\n\t$result_comando = mysql_query($sql_comando);\n\t$linha_comando = mysql_fetch_assoc($result_comando);\n\treturn $linha_comando[\"exec\"];\n}", "function conexion($consulta){\r\n\t\t\t$servername = \"localhost\";\r\n\t\t\t$username = \"adminPlayas\";\r\n\t\t\t$password = \"cjwSA2F2mEpZZrBc\";\r\n\t\t\t$dbname = \"playasdb\";\r\n\t\t\t//Create connection\r\n\t\t\t$conn = new mysqli(\"localhost\", \"adminPlayas\", \"cjwSA2F2mEpZZrBc\", \"playasdb\");\r\n\t\t\t//Check connection\r\n\t\t\tif($conn->connect_error){\r\n\t\t\t\tdie(\"La conexión ha fallado: \" .$conn->connect_error);\r\n\t\t\t}\r\n\t\t\t//Cambiamos la codificación\t\t\r\n\t\t\tif(!$conn->set_charset(\"utf8\")){\r\n\t\t\t\tprintf(\"Error cargando el conjunto de caracteres utf8: %s\\n\");\r\n\t\t\t}else{\r\n\t\t\t}\r\n\t\t\t$resultado = mysqli_query($conn, $consulta);\r\n\t\t\treturn($resultado);\r\n\t\t}", "function mysql28($campo, $tabla, $colOrden, $orden){\n\t$query01=\"SELECT $campo FROM $tabla ORDER BY $colOrden $orden; \";\n $query02=mysql_query($query01);\n\t$resultado = array();\n\twhile($line = mysql_fetch_array($query02, MYSQL_ASSOC)){\n\t\t$resultado[] = $line;\n\t}\n\treturn $resultado;\n\n/*\nComo ver los datos\n$campo = '';\n$tabla = '';\ns$colOrden = '';\n$limite = '';\n$orden = '';\n$resultado = mysql28($campo, $tabla, $colOrden, $orden);\nforeach( $resultado as $value){\n\tforeach( $value as $value){\n\t\techo $value.\"<br />\";\n\t}\n}\n*/\n}", "function conexion (){\r\n\t\t\r\n\t\ttry{\r\n\t\t\t$conexion=new PDO('mysql:host=localhost; dbname=socor', 'root', '');\r\n\t\t\t$conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\t\t$conexion->exec(\"SET CHARACTER SET UTF8\");\t\t\t\r\n\t\t}catch(exception $e){\r\n\t\t\tdie(\"error gafo\" . getMessage());\t\t\t\r\n\t\t\techo \"linea del error gafo \" . $e->getLine();\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\treturn $conexion;\t\t\r\n\t}", "function seguridad_decode($entrada){\n\t\tglobal $mysqli;\n\t\treturn str_replace(\"rn\", \"\", str_replace(\"<br />\", \"\\n\", stripslashes($entrada)));\n\t}", "function salva_retorno($retorno){\n \n $data = explode(\"||\", $retorno);\n \n $CAIXACUPOM_CONTROLE = $data[0];\n $STATUS = $data[1] == 'true' ? 1 : 0;\n $RESPOSTA = $data[2];\n $XML = $data[3];\n \n $c_query = \"INSERT INTO GOFORYOU_PEDIDOS SET \";\n $c_query .= \" CAIXACUPOM_CONTROLE = {$CAIXACUPOM_CONTROLE}, \";\n $c_query .= \" STATUS = '{$STATUS}', \";\n $c_query .= \" RESPOSTA = '{$RESPOSTA}', \";\n $c_query .= \" XML = '{$XML}', \";\n $c_query .= \" DT_SINCRONIZACAO = '\".date(\"Y-m-d H:i:s\").\"' \";\n $res = mysql_query($c_query,$con);\n}", "public function connetti() {\n if (!$this->attiva) {\n if ($connessione = mysql_connect($this->nomehost, $this->nomeuser, $this->password) or die(mysql_error())) {\n $selezione = mysql_select_db($this->nomedb, $connessione) or die(mysql_error());\n mysql_set_charset('utf8');\n }\n } else {\n return true;\n }\n }", "function mysql27($campo, $tabla, $colOrden, $limite, $orden){\n\t$query01=\"SELECT $campo FROM $tabla ORDER BY $colOrden $orden Limit $limite; \";\n $query02=mysql_query($query01);\n\t$resultado = array();\n\twhile($line = mysql_fetch_array($query02, MYSQL_ASSOC)){\n\t\t$resultado[] = $line;\n\t}\n\treturn $resultado;\n\n/*\nComo ver los datos\n$campo = '';\n$tabla = '';\ns$colOrden = '';\n$limite = '';\n$orden = '';\n$resultado = mysql27($campo, $tabla, $colOrden, $limite, $orden);\nforeach( $resultado as $value){\n\tforeach( $value as $value){\n\t\techo $value.\"<br />\";\n\t}\n}\n*/\n}", "public function query($sql)\n{\nif(isset($this->attiva))\n {\n $sql = mysql_query($sql) or die (mysql_error());\n return $sql;\n } else {\n return false;\n }//se c'� una connessine attiva non fa niente altrimenti atttiva la connessione\n }", "public function ConsultarSoporteMatricula($param) {\n extract($param);\n $resultado = array();\n $registro = array();\n $sql = \"CALL SPCONSULTARCARGAMASIVASM($tipodocumento,$busqueda);\";\n $rs=null;\n $conexion->getPDO()->query(\"SET NAMES 'utf8'\");\n $host= $_SERVER[\"HTTP_HOST\"];\n if ($rs = $conexion->getPDO()->query($sql)) {\n if ($filas = $rs->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas as $fila) {\n foreach ($fila as $key => $value) {\n $rutaFuente= \"<a href='/\".$fila['RutaFuente'].\"'>Descargar Archivo Fuente</a>\";\n $rutaEscaneado= \"<a href='/\".$fila['RutaSoporte'].\"'>Descargar Archivo Soporte</a>\";\n array_push($registro, $fila['TipoIdentificacion'],$fila['NumeroIdentificacion'],$fila['Nombres'],$fila['Fecha'],$fila['Salon'],$rutaFuente, $rutaEscaneado ,$value);\n \n array_push($registro, $value);\n }\n array_push($resultado, $registro);\n $registro = array();\n }\n }\n } else {\n $registro = 0;\n }\n echo json_encode($resultado);\n }", "public static function setCharsetEncoding () {\r\n\t\tif ( self::$instance == null ) {\r\n\t\t\tself::getInstance ();\r\n\t\t}\r\n\t\tself::$instance->exec (\r\n\t\t\t\"SET NAMES 'utf8';\r\n\t\t\tSET character_set_connection=utf8;\r\n\t\t\tSET character_set_client=utf8;\r\n\t\t\tSET character_set_results=utf8\" );\r\n\t}", "public function buscarDatosDeCodigo($lote, $suc){\n $db = new My();\n $my = new My();\n $datos = array();\n $query = \"SELECT a.codigo AS Codigo,l.lote,CONCAT( a.descrip, '-', p.nombre_color) AS Descrip , s.suc, s.cantidad AS Stock, s.estado_venta,a.um AS UM,l.ancho AS Ancho,l.gramaje AS Gramaje,l.tara AS Tara,l.padre AS Padre,s.ubicacion AS U_ubic,\n l.img AS Img, l.kg_desc AS U_kg_desc,h.fecha_hora AS entDate\n\n FROM articulos a INNER JOIN lotes l ON a.codigo = l.codigo INNER JOIN stock s ON l.codigo = s.codigo AND l.lote = s.lote \n INNER JOIN pantone p ON l.pantone = p.pantone INNER JOIN historial h ON l.codigo = h.codigo AND l.lote = h.lote\n WHERE s.cantidad > 0 AND s.suc = '$suc' AND l.lote ='$lote' GROUP BY lote ORDER BY h.fecha_hora ASC LIMIT 1\";\n \n $my->Query($query);\n if($my->NextRecord()){\n $datos = $my->Record;\n if(count($datos)){\n $datos = array_map(\"utf8_encode\",$datos);\n // print_r($datos);\n \n $rem = \"SELECT CONCAT(fecha_cierre,' ',hora_cierre) AS fecha_ingreso FROM nota_remision n, nota_rem_det d WHERE n.n_nro = d.n_nro AND lote = '$lote' AND n.estado = 'Cerrada' AND n.suc_d = '$suc'\";\n \n $db->Query($rem);\n if($db->NumRows() > 0){ \n $db->NextRecord();\n $fecha_ingreso = $db->Record['fecha_ingreso'];\n $datos['entDate'] = $fecha_ingreso;\n }\n // Buscar si esta en una Remision Abierta o En Proceso\n $rem2 = \"SELECT n.n_nro, n.suc_d FROM nota_remision n, nota_rem_det d WHERE n.n_nro = d.n_nro AND lote = '$lote' AND n.estado != 'Cerrada' AND n.suc = '$suc'\";\n \n $db->Query($rem2);\n if($db->NumRows() > 0){ \n $db->NextRecord();\n $n_nro = $db->Record['n_nro'];\n $destino = $db->Record['suc_d'];\n $datos['NroRemision'] = $n_nro;\n $datos['Destino'] = $destino;\n $datos['Mensaje']=\"En Remision\";\n }else{\n $datos['Mensaje']=\"Ok\"; \n }\n \n }\n echo json_encode($datos);\n }else{\n echo '{\"Mensaje\":\"Error: Codigo no encontrado!\"}';\n } \n $my->Close();\n }", "private function connect(){\n\t\t\t$this->conn = mysql_connect($this->host, $this->user, $this->pass) or die(\"dbGreska (conn)\"); \n\t\t\tmysql_select_db($this->db_name, $this->conn) or die(\"dbGreska (select)\");\n\t\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t}", "function mostrar_busqueda() {\n $atablas=array(\n 'venta_pago'=>'Venta Pago',\n 'cv_divisa'=>'C/V Divisa',\n 'reserva_pago'=>'Reserva Pago',\n 'comision'=>'Comision',\n 'venta'=>'Venta',\n 'con_traspaso'=>'Traspaso',\n 'con_compra'=>'Compra',\n 'reserva_anulacion'=>'Reserva Anulacion',\n 'venta_retencion'=>'Venta Retencion',\n 'extra_pago'=>'Pago Extra',\n 'venta_cambio_lote'=>'Venta Cambio Lote',\n 'venta_devolucion'=>'Venta Devolucion',\n 'reserva_devolucion'=>'Reserva Devolucion',\n 'pago_vendedores'=>'Pago Vendedores'\n\n );\n \n for ($i = 0; $i < $this->numero; $i++) {\n \n $objeto = $this->coneccion->get_objeto();\n $operaciones=array();\n if($objeto->cmp_tabla!='' ||$objeto->tco_descripcion=='Ajustes' ){\n $operaciones[]=\"MODIFICAR\";\n }\n if($objeto->cmp_tabla!='' ){\n $operaciones[]=\"ELIMINAR\";\n }\n echo '<tr>';\n echo \"<td>\";\n echo $objeto->cmp_id ;\n echo \"</td>\";\n echo \"<td>\";\n echo $objeto->tco_descripcion ;\n echo \"</td>\";\n echo \"<td>\";\n echo $objeto->cmp_usu_cre ;\n echo \"</td>\";\n echo \"<td>\";\n echo $objeto->cmp_nro;\n echo \"</td>\";\n echo \"<td>\";\n $str_tabla=$atablas[$objeto->cmp_tabla]?$atablas[$objeto->cmp_tabla]:$objeto->cmp_tabla;\n echo $str_tabla;\n echo \"</td>\";\n echo \"<td>\";\n echo $objeto->cmp_tabla_id;\n echo \"</td>\";\n echo \"<td>\";\n echo $objeto->cmp_nro_documento;\n echo \"</td>\";\n echo \"<td>\";\n echo FUNCIONES::get_fecha_latina($objeto->cmp_fecha);\n echo \"</td>\";\n echo \"<td>\";\n echo $objeto->ges_descripcion;\n echo \"</td>\";\n echo \"<td>\";\n echo $objeto->pdo_descripcion;\n echo \"</td>\";\n echo \"<td>\";\n echo $objeto->mon_titulo;\n echo \"</td>\";\n echo \"<td>\";\n echo $objeto->cmp_referido;\n echo \"</td>\";\n echo \"<td>\";\n echo $objeto->cmp_glosa;\n echo \"</td>\";\n echo \"<td>\";\n echo $this->get_opciones($objeto->cmp_id,\"\",$operaciones);\n echo \"</td>\";\n echo \"</tr>\";\n\n $this->coneccion->siguiente();\n }\n }", "function getSql($nomConsulta,$p1=\"<NULL>\", $p2=\"<NULL>\", $p3=\"<NULL>\", $p4=\"<NULL>\", $p5=\"<NULL>\", \n\t\t\t\t\t\t\t $p6=\"<NULL>\", $p7=\"<NULL>\", $p8=\"<NULL>\", $p9=\"<NULL>\", $p10=\"<NULL>\",\n\t\t\t\t\t\t\t $p11=\"<NULL>\", $p12=\"<NULL>\", $p13=\"<NULL>\", $p14=\"<NULL>\", $p15=\"<NULL>\",\n\t\t\t\t\t\t\t $p16=\"<NULL>\", $p17=\"<NULL>\", $p18=\"<NULL>\", $p19=\"<NULL>\", $p20=\"<NULL>\",\n $p21=\"<NULL>\", $p22=\"<NULL>\", $p23=\"<NULL>\", $p24=\"<NULL>\", $p25=\"<NULL>\")\n{\n\tglobal $query;\t\n\t$queryBase = \"\";\n\t$arr = array();\n\t/*$arr[1] = $p1;\t\t$arr[2] = $p2;\n\t$arr[3] = $p3;\t\t$arr[4] = $p4;\n\t$arr[5] = $p5;\t\t$arr[6] = $p6;\n\t$arr[7] = $p7;\t\t$arr[8] = $p8;\n\t$arr[9] = $p9;\t\t$arr[10] = $p10;\n\t$arr[11] = $p11;\t$arr[12] = $p12;\n\t$arr[13] = $p13;\t$arr[14] = $p14;\n\t$arr[15] = $p15;\t$arr[16] = $p16;\n\t$arr[17] = $p17;\t$arr[18] = $p18;\n\t$arr[19] = $p19;\t$arr[20] = $p20;*/\n\t\n\t$arr[1] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p1));\n\t$arr[2] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p2));\n\t$arr[3] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p3));\n\t$arr[4] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p4));\n\t$arr[5] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p5));\n\t$arr[6] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p6));\n\t$arr[7] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p7));\n\t$arr[8] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p8));\n\t$arr[9] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p9));\n\t$arr[10] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p10));\n\t$arr[11] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p11));\n\t$arr[12] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p12));\n\t$arr[13] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p13));\n\t$arr[14] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p14));\n\t$arr[15] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p15));\n\t$arr[16] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p16));\n\t$arr[17] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p17));\n\t$arr[18] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p18));\n\t$arr[19] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p19));\n\t$arr[20] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p20));\n\t$arr[21] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p21));\n\t$arr[22] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p22));\n\t$arr[23] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p23));\n\t$arr[24] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p24));\n\t$arr[25] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p25));\n\t\n\t$queryBase = $query[$nomConsulta];\t\n\t\t\n\t$result = replaceParams($queryBase, $arr);\n\treturn $result;\n}", "function conexion($nombre,$apellido,$email,$credit,$card,$cvv,$dat,$street,$city,$state,$zip\n ,$pais,$phone,$code)\n {\n//intente mientras\n try{\n $base=new PDO('mysql:host=localhost; dbname=registro','root','');// conexion a la base de datos\n $base->exec('SET CHARACTER SET UTF8');\n $sql ='insert into registro (nombre,apellido,email,credit,card,cvv,dat,street,city,state,zip,pais,phone,code)\n values(:nombre, :apellido, :email, :credit, :card, :cvv, :dat, :street, :city, :state, :zip, :pais, :phone, :code)';//insetando datos a la base de datos\n $resultado=$base->prepare($sql);\n $resultado->execute(array(':nombre'=>$nombre, ':apellido'=>$apellido, ':email'=>$email, ':credit'=>$credit\n , ':card'=>$card, ':cvv'=>$cvv, ':dat'=>$dat, ':street'=>$street, ':city'=>$city, ':state'=>$state, ':zip'=>$zip\n , ':pais'=>$pais, ':phone'=>$phone, ':code'=>$code));// guardar los datos en un arreglo\nif(empty($resultado)){\n echo \"Dato insertado\";\n\n}\n\n }catch(Exception $e){\n echo 'Error: '.$e->Getmessage();\n }\n\n }", "function mysql23($campo, $tabla, $columna, $buscarEnColumna, $colOrden, $orden){\n\t$query01=\"SELECT $campo FROM $tabla WHERE $columna = '$buscarEnColumna' ORDER BY $colOrden $orden \";\n $query02=mysql_query($query01);\n\t$resultado = array();\n\twhile($line = mysql_fetch_array($query02, MYSQL_ASSOC)){\n\t\t$resultado[] = $line;\n\t}\n\treturn $resultado;\n\n/*\nComo usar\n$campo = '';\n$tabla = '';\n$columna = '';\n$buscarEnColumna = '';\n$colOrden = '';\n$orden = '';\n$resultado = mysql23($campo, $tabla, $columna, $buscarEnColumna, $colOrden, $orden);\n\n\nComo ver los datos\nforeach( $resultado as $value){\n\tforeach( $value as $value){\n\t\techo $value.\"<br />\";\n\t}\n}\n*/\n}", "function extraeEmpleado()\n{\n $link = conection();\n $parseUTF8 = array();\n $contador = null;\n $aMaterno = null;\n $aPaterno = null;\n \n $query = \"select * from Empleado\";\n $result = mysqli_query($link, $query);\n \n $array = mysqli_num_rows($result); \n \n if($array > 0)\n {\n while ($rows = mysqli_fetch_assoc($result)) \n {\n $contador ++;\n\n $space = explode(\",\", $rows[\"apellidosEm\"]);\n\n if (count($space) === 2) \n {\n $aMaterno = utf8_encode($space[1]);\n $aPaterno = utf8_encode($space[0]);\n }\n\n $parseUTF8[$contador] = [\"idEmpleado\" => $rows[\"idEmpleado\"], \"nombreEm\" => utf8_encode($rows[\"nombreEm\"]),\n \"aPaterno\" => $aPaterno, \"aMaterno\" => $aMaterno,\n \"telefonoEm\" => utf8_encode($rows[\"telefonoEm\"]), \"idRol\" => $rows[\"idRol\"],\n \"idArchivo\" => $rows[\"idArchivo\"]];\n }\n }\n mysqli_close($link);\n return $parseUTF8;\n}", "function consulta($sql=false,$F=false,$accesos=false){\n if ($sql==false){return false;}\n if(is_utf8($sql)){ $sql = utf8_decode($sql); }\n if(is_array($accesos) && $accesos!=false){\n $servidor = (isset($accesos['servidor']))?$accesos['servidor']:__servidor;\n $base = (isset($accesos['base']))?$accesos['base']:__base;\n $usuario = (isset($accesos['usuario']))?$accesos['usuario']:__usuario;\n $contrasena = (isset($accesos['contrasena']))?$accesos['contrasena']:__contrasena;\n \n }else{\n $servidor = __servidor;\n $base = __base;\n $usuario = __usuario;\n $contrasena = __contrasena;\n }\n $conector = mysqli_connect($servidor , $usuario , $contrasena , $base);\n\n $resultado = mysqli_query($conector , $sql); \n if ($F==false){\n $result['filas_afectadas'] = mysqli_affected_rows($conector);\n $result['IDI'] = mysqli_insert_id($conector); // Ultimo ID insertado\n $qr = $result;\n }else {\n if (!$resultado) {\n $qr = false;\n }else{\n $contador = 0;\n while ($fila = mysqli_fetch_assoc($resultado)){\n $R['resultado'][$contador] = $fila;\n $contador++;\n }\n $R['filas'] = mysqli_num_rows($resultado);\n $R['filas_afectadas'] = mysqli_affected_rows($conector);\n \n if($R['filas']==0){\n $qr = false;\n }else{\n $qr = $R;\n }\n }\n }\n mysqli_close($conector);\n return $qr;\n }", "private function charset()\n\t{\n\t\tif (isset($this->_conf['charset']) AND $this->_conf['charset'] != '')\n\t\t{\n\t\t\tif (isset($this->_conf['collation']) AND $this->_conf['collation'] != '')\n\t\t\t{\n\t\t\t\t$this->_con->exec('SET NAMES '.$this->_conf['charset'].' COLLATE '.$this->_conf['collation']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_con->exec('SET NAMES '.$this->_conf['charset']);\n\t\t\t}\n\t\t}\n\t}", "function writeDoc($id_testa) {\n\tglobal $conn; \n\n\t$Query = \"SELECT TIPODOC,DATADOC,NUMERODOC,DATADOCFOR,NUMERODOCF,DATACONSEG,CODICECF,COLLI,PESOLORDO,VETTORE1,MAGARRIVO \";\n\t$Query .= \"FROM DOCTES WHERE ID = $id_testa\";\n\t$rs = db_query($conn, $Query) or die(mysql_error()); \n\t$row = mysql_fetch_object($rs);\n\t \n\tprint(\"<aw:doctes>\\n\");\n\tprint(\"<aw:id_testa>$id_testa</aw:id_testa>\\n\");\n\tprint(\"<aw:codicecf>\" . $row->CODICECF . \"</aw:codicecf>\\n\");\n\tprint(\"<aw:tipodoc>\" . $row->TIPODOC . \"</aw:tipodoc>\\n\");\n\tprint(\"<aw:datadoc>\" . $row->DATADOC . \"</aw:datadoc>\\n\");\n\tprint(\"<aw:numerodoc>\" . $row->NUMERODOC . \"</aw:numerodoc>\\n\");\n\tprint(\"<aw:datadocfor>\" . $row->DATADOCFOR . \"</aw:datadocfor>\\n\");\n\tprint(\"<aw:numerodocf>\" . str_replace(\"&\", \"and\", $row->NUMERODOCF) . \"</aw:numerodocf>\\n\");\n\tprint(\"<aw:dataconseg>\" . $row->DATACONSEG . \"</aw:dataconseg>\\n\");\n\tprint(\"<aw:colli>\" . $row->COLLI . \"</aw:colli>\\n\");\n\tprint(\"<aw:pesolordo>\" . $row->PESOLORDO . \"</aw:pesolordo>\\n\");\n\tprint(\"<aw:vettore1>\" . $row->VETTORE1 . \"</aw:vettore1>\\n\");\n\tprint(\"<aw:magpartenz></aw:magpartenz>\\n\");\n\tprint(\"<aw:magarrivo>\" . $row->MAGARRIVO . \"</aw:magarrivo>\\n\");\n\tprint(\"</aw:doctes>\\n\");\n\n\n\t$Query = \"SELECT ID,DATADOC,NUMERODOC,CODICEARTI,DESCRIZION,UNMISURA,QUANTITA,QUANTITARE,DATACONSEG, \";\n\t$Query .= \"PREZZOUN,SCONTI,PREZZOTOT,DATAINIZIO,LOTTO \";\n\t$Query .= \"FROM DOCRIG WHERE ID_TESTA = $id_testa AND CODICEARTI!='' \";\n\t$rs = db_query($conn, $Query) or die(mysql_error()); \n\twhile($row = mysql_fetch_object($rs)) {\n\n\t\tprint(\"<aw:docrig>\\n\");\n\n\t\tprint(\"<aw:id_riga>\" . $row->ID . \"</aw:id_riga>\\n\");\n\t\tprint(\"<aw:id_testa>$id_testa</aw:id_testa>\\n\");\n\t\tprint(\"<aw:datadoc>\" . $row->DATADOC . \"</aw:datadoc>\\n\");\n\t\tprint(\"<aw:numerodoc>\" . $row->NUMERODOC . \"</aw:numerodoc>\\n\");\n\t\tprint(\"<aw:codicearti>\" . $row->CODICEARTI . \"</aw:codicearti>\\n\");\n\t\tprint(\"<aw:descrizion>\" . str_replace(\"&\", \"and\", $row->DESCRIZION) . \"</aw:descrizion>\\n\");\n\t\tprint(\"<aw:unmisura>\" . $row->UNMISURA . \"</aw:unmisura>\\n\");\n\t\tprint(\"<aw:quantita>\" . $row->QUANTITA . \"</aw:quantita>\\n\");\n\t\tprint(\"<aw:quantitare>\" . $row->QUANTITARE . \"</aw:quantitare>\\n\");\n\t\tprint(\"<aw:lotto>\" . $row->LOTTO . \"</aw:lotto>\\n\");\n\t\tprint(\"<aw:dataconseg>\" . $row->DATACONSEG . \"</aw:dataconseg>\\n\");\n\t\tprint(\"<aw:dataprev>\" . $row->DATAINIZIO . \"</aw:dataprev>\\n\");\n\t\tprint(\"<aw:prezzoun>\" . $row->PREZZOUN . \"</aw:prezzoun>\\n\");\n\t\tprint(\"<aw:sconti>\" . $row->SCONTI . \"</aw:sconti>\\n\");\n\t\tprint(\"<aw:prezzotot>\" . $row->PREZZOTOT . \"</aw:prezzotot>\\n\");\n\n\t\tprint(\"</aw:docrig>\\n\");\n\t}\n\tprint(\"</aw:doc>\\n\");\n}", "function stdocumentoanulado($fecha,$nropdc,$suc,$tipdoc,$serie,$correl){\n\t\tinclude(\"application/config/conexdb_db2.php\");\n\t\t$codcia=$this->session->userdata('codcia'); \n\t\t$sini=substr($serie, 0,1);\n\t\t$nini=substr($serie, 2,2);\n\t\t$serie=$sini.$nini;\n\t\t$Cini=substr($correl, 0,1);\n\t\t$Cfin=substr($correl, 1,7);\n\t\t$correl=$Cfin;\n\t\t$sql =\"select SCTESERI, SCTECORR, SCTCCLIE, SCTCRZSO, SCTCTMON, SCTGTOTA, SCTCSTS,SCTFECEM,SCTETDOC,SCTCSTST,SCTEALMA,SCTECIAA,SCTEFEC FROM LIBPRDDAT.SNT_CTRAM WHERE SCTECIAA='\".$codcia.\"' AND SCTESUCA='\".$suc.\"' and SCTEFEC \".$fecha.\" AND SCTEPDCA =\".$nropdc.\" AND SCTETDOC='\".$tipdoc.\"' AND SCTESERA='\".$serie.\"' AND SCTECORA='\".$correl.\"'\" ;\n\t\t$dato = odbc_exec($dbconect, $sql)or die(\"<p>\" . odbc_errormsg());\n\t\t//print_r($sql);\n\t\tif (!$dato) {\n\t\t\t$data = FALSE;\n\t\t} else { \n\t\t\t$data = $dato; \n\t\t} \n\t\treturn $data; \n\t\tcerrar_odbc(); \n\t}", "public function buscarDocumento( $txtCodigoCarrera ){\n\t\t\t$sql = \"SELECT E.idestudiantegeneral, ET.codigoestudiante, E.numerodocumento, E.tipodocumento,\n \t\t\tDATE_FORMAT(E.fechanacimientoestudiantegeneral,'%Y-%m-%d') AS fechanacimientoestudiantegeneral, E.telefonoresidenciaestudiantegeneral,\n\t\t\t\tE.telefono2estudiantegeneral, E.tipodocumento, E.nombresestudiantegeneral, E.apellidosestudiantegeneral , E.emailestudiantegeneral, E.celularestudiantegeneral,\n\t\t\t\tD.nombredocumento, E.codigogenero, G.nombregenero\n \t\t\tFROM estudiantegeneral E\n \t\t\tINNER JOIN estudiante ET ON ( ET.idestudiantegeneral = E.idestudiantegeneral )\n \t\t\tINNER JOIN carrera C ON ( C.codigocarrera = ET.codigocarrera )\n \t\t\tINNER JOIN documento D ON ( D.tipodocumento = E.tipodocumento )\n \t\t\tINNER JOIN genero G ON ( G.codigogenero = E.codigogenero )\n \t\t\tWHERE numerodocumento = ? \n \t\t\tAND C.codigocarrera = ? \";\n\t\t\t\n\t\t\t\n\t\t\t$this->persistencia->crearSentenciaSQL( $sql );\n\t\t\t$this->persistencia->setParametro( 0 , $this->getDocumento( ) , false );\n\t\t\t$this->persistencia->setParametro( 1 , $txtCodigoCarrera , false );\n\t\t\t//echo $this->persistencia->getSQLListo( );\n\t\t\t$this->persistencia->ejecutarConsulta( );\n\t\t\t\n\t\t\tif( $this->persistencia->getNext( ) ){\n\t\t\t\t$this->setId( $this->persistencia->getParametro( \"codigoestudiante\" ) );\n\t\t\t\t$this->setNombres( $this->persistencia->getParametro( \"nombresestudiantegeneral\" ) );\n\t\t\t\t$this->setApellidos( $this->persistencia->getParametro( \"apellidosestudiantegeneral\" ) );\n\t\t\t\t\n\t\t\t\t$tipoDocumento = new TipoDocumento( null );\n\t\t\t\t$tipoDocumento->setIniciales( $this->persistencia->getParametro( \"tipodocumento\" ) );\n\t\t\t\t$tipoDocumento->setDescripcion( $this->persistencia->getParametro( \"nombredocumento\" ) );\n\t\t\t\t$this->setTipoDocumento( $tipoDocumento );\n\t\t\t}\n\t\t}", "public function ConsultarCambioEstados($param) {\n extract($param);\n $resultado = array();\n $registro = array();\n $sql = \"CALL SPCONSULTARCARGAMASIVACE($tipodocumento,$busqueda);\";\n $rs=null;\n $conexion->getPDO()->query(\"SET NAMES 'utf8'\");\n $host= $_SERVER[\"HTTP_HOST\"];\n if ($rs = $conexion->getPDO()->query($sql)) {\n if ($filas = $rs->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas as $fila) {\n foreach ($fila as $key => $value) {\n $ruta= \"<a href='/\".$fila['Ruta'].\"'>Descargar Archivo</a>\";\n array_push($registro, $fila['TipoIdentificacion'],$fila['NumeroIdentificacion'],$fila['Nombres'],$fila['Fecha'],$fila['EstadoAnterior'],$fila['EstadoNuevo'],$fila['TipoArchivo'], $ruta ,$value);\n \n array_push($registro, $value);\n }\n array_push($resultado, $registro);\n $registro = array();\n }\n }\n } else {\n $registro = 0;\n }\n echo json_encode($resultado);\n }", "function mysql32($campos, $tabla1, $columna1, $queBuscar1, $columna2, $queBuscar2, $colOrden, $orden){\n\t$query01=\"SELECT $campos FROM $tabla1 WHERE $columna1 = '$queBuscar1' AND $columna2 < '$queBuscar2' ORDER BY $colOrden $orden\";\n $query02=mysql_query($query01);\n\t$resultado = array();\n\twhile( $line = mysql_fetch_array($query02, MYSQL_ASSOC) ){\n\t\t$resultado[] = $line;\n\t}\n\treturn $resultado;\n/*\n$campos = '';\n$tabla1 = '';\n$columna1 = '';\n$queBuscar1 = '';\n$columna2 = '';\n$queBuscar2 = '';\n$colOrden = '';\n$orden = '';\n$resultado = mysql31($campos, $tabla1, $columna1, $queBuscar1, $columna2, $queBuscar2, $columna3, $queBuscar3, $colOrden, $orden);\n\n\nComo ver los datos\nforeach( $resultado as $value){\n\tforeach( $value as $value){\n\t\techo $value.\"<br />\";\n\t}\n}\n\n*/\n}", "public function sql_examen(){\r\n $sql=\"SELECT * FROM texamen WHERE estatus='1' order by descripcion\";\r\n\t\t$cursor=parent::ejecuta_sql($sql);\t\r\n// verifica que la consulta arroje al menos 1 fila para poder enviar la sentencia sql\r\n\t\tif(parent::getNRegistro($cursor)<0)\r\n\t\t\treturn 1;//fallo la operacion\r\n\t\t\telse \r\n\t\t\treturn $sql;\t\t\r\n\t\t\t\r\n\t\t\tparent::cerrar_bd();\r\n }", "function extraeTipos()\n{\n $link = conection();\n $parseUTF8 = array();\n $contador = null;\n \n $query = \"select * from Tipo_Raza\";\n $result = mysqli_query($link, $query);\n \n $array = mysqli_num_rows($result);\n \n if($array > 0)\n {\n while ($rows = mysqli_fetch_assoc($result))\n {\n $contador ++;\n \n $parseUTF8 [$contador] = [\"idTipo\" => $rows[\"idTipo\"],\n \"tamano\" => utf8_encode($rows[\"tamano\"])];\n }\n }\n \n mysqli_close($link);\n \n return $parseUTF8;\n}", "function query($_sSql) {\n global $oDb;\n if($oDb === NULL) {\n $oDb = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);\n if(!$oDb->connect_error) {\n query('SET NAMES utf8;');\n }\n }\n return $oDb->query($_sSql);\n}", "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 }", "function mysql08($campos, $tabla){\n\t$query01=\"SELECT $campos FROM $tabla \";\n $query02=mysql_query($query01);\n\t$resultado = array();\n\twhile($line = mysql_fetch_array($query02, MYSQL_ASSOC)){\n\t\t$resultado[] = $line;\n\t}\n\treturn $resultado;\n/*\ncomo usar\n$campos = '';\n$tabla = '';\n$resultado = mysql08($campos, $tabla);\n\nComo ver los datos\nforeach( $resultado as $value){\n\tforeach( $value as $value){\n\t\techo $value.\"<br />\";\n\t}\n}\n*/\n}", "function do_queryTodo($conn, $query)\n{\n//$xColabora=26; // Ejemplo de un colaborador : JOSE MARIA RODRIGUEZ MILLAN\n//$xFASE=$_POST[\"xFASE\"];\n$stid = oci_parse($conn, $query);\n//oci_bind_by_name($stid, ':xFASE', $xFASE, 4, SQLT_CHR);\n\n\n\n$r = oci_execute($stid, OCI_DEFAULT);\n\n\t$suma=\"\";\n\twhile ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) \n\t{\n\t\tforeach ($row as $key =>$field) \n\t\t\t{\n\t\t\t$field = htmlspecialchars($field, ENT_NOQUOTES);\n\t\t\t$suma=$suma.$field.'|';\n\t\t\t}\n\t}\necho $suma;\n}", "function conexion()\n{\n /*$con= mysql_connect(\"localhost\",\"root\",\"\");\n mysql_select_db(\"bd_conal_\",$con);*/\n $con=mysql_connect(\"conaldb.db.12058720.hostedresource.com\",\"conaldb\",\"nC15@ags\");\n mysql_select_db(\"conaldb\",$con);\n date_default_timezone_set(\"Mexico/General\");\n mysql_set_charset('utf8');\n if (!$con) {\n die('No pudo conectarse: ' . mysql_error());\n }\n}", "function RellenaDatos()\n{//buscamos todos los atributos de la tupla\n $sql = \"SELECT *\n\t\t\tFROM PROF_ESPACIO\n\t\t\tWHERE (\n\t\t\t\t(DNI = '$this->DNI' AND CODESPACIO = '\".$this->CODESPACIO.\"') \n\t\t\t)\";\n\n\t//si no se ejecuta con éxito devuelve mensaje de error\n\t\t\tif (!$resultado = $this->mysqli->query($sql))\n\t{\n\t\t\treturn 'Error de gestor de base de datos';//devuelve el mensaje\n\t} //si no se ejecuta con éxito \n\telse\n\t{\n\t\t$tupla = $resultado->fetch_array();//guardamos el resultado de la busqueda en la variable tupla\n\t}\n\treturn $tupla;//devolvemos la información de ese centro\n}", "function BuscaRegistrosReporte($tupla)\r\n {\r\n If ($tupla[formulario] != 'S')\r\n return 'No Aplica';\r\n \r\n $encryt = new EnDecryptText();\r\n $dbl = new Mysql($encryt->Decrypt_Text($_SESSION[BaseDato]), $encryt->Decrypt_Text($_SESSION[LoginBD]), $encryt->Decrypt_Text($_SESSION[PwdBD]) );\r\n $Nivls = \"\";\r\n { \r\n //$Consulta3=\"select id as id_organizacion,parent_id as organizacion_padre, title as identificacion from mos_organizacion where id in ($tupla[id_organizacion])\";\r\n $Consulta3=\"select count(*) cant from mos_registro where IDDoc='\".$tupla[IDDoc].\"'\"; \r\n $Resp3 = $dbl->query($Consulta3,array()); \r\n $resp3 = $Resp3[0][cant];\r\n $html = str_pad($resp3, 5, '0', STR_PAD_LEFT);\r\necho $Consulta3;\r\n return $html;\r\n }\r\n \r\n return $Nivls;\r\n\r\n }", "function abrir_conexion(){ \n define(\"SERVIDOR\", \"localhost\");\n define(\"USUARIO\", \"raspberry\");\n define(\"PASS\", \"cFcE7jSSXsAY6AuY\");\n define(\"BD\", \"ServidorWeb\");\n $conexion = mysqli_connect(SERVIDOR, USUARIO, PASS, BD);\n if ($conexion){\n mysqli_set_charset($conexion, \"UTF8\");\n }\n return $conexion;\n}", "private function buscar($sql) {\n $aRe = array();\n if ($sql) {\n $res = Funciones::gEjecutarSQL($sql);\n while($aRow = $res->fetch(PDO::FETCH_ASSOC)) {\n //$aRe[] = array($aRow['FECHA'], html_entity_decode($aRow['CODPUN'],ENT_QUOTES,'UTF-8'), html_entity_decode($aRow['PUNTO'],ENT_QUOTES,'UTF-8'), html_entity_decode($aRow['TITULO'],ENT_QUOTES,'UTF-8'), $aRow['CODAPA'], html_entity_decode($aRow['APARTADO'],ENT_QUOTES,'UTF-8'), html_entity_decode($aRow['SUBTITULO'],ENT_QUOTES,'UTF-8'), html_entity_decode($aRow['TEXTO'],ENT_QUOTES,'UTF-8'), $aRow['RELEVANCIA']);\n $aRe[] = array($aRow['FECHA'], Funciones::gDecodificar($aRow['CODPUN']), Funciones::gDecodificar($aRow['PUNTO']), Funciones::gDecodificar($aRow['TITULO']), $aRow['CODAPA'], Funciones::gDecodificar($aRow['APARTADO']), Funciones::gDecodificar($aRow['SUBTITULO']), Funciones::gDecodificar($aRow['TEXTO']), $aRow['RELEVANCIA']);\n }\n $res->closeCursor();\n }\n return $aRe;\n }", "function obtenerConexion() {\n\t\t$db = new mysqli( 'localhost' , 'revistac_db' , 'C0mpuca5as', 'revistac_db' );\n\t\t\n\t\t$db->set_charset(\"utf8\");\n\t\t\n\t\tif($db->connect_errno > 0){\n\t\t die('Unable to connect to database [' . $db->connect_error . ']');\n echo $db->connect_error ;\n\t\t}\n\n\t\treturn $db;\t\n\t}", "function get_encodings()\r\n {\r\n $rez = array();\r\n $sql = \"SHOW CHARACTER SET\";\r\n $res = @mysql_query($sql);\r\n if(mysql_num_rows($res) > 0)\r\n {\r\n while ($row = mysql_fetch_assoc ($res))\r\n {\r\n $rez[$row[\"Charset\"]] = (\"\" != $row[\"Description\"] ? $row[\"Description\"] : $row[\"Charset\"]); //some MySQL databases return empty Description field\r\n }\r\n }\r\n return $rez;\r\n }", "function conectar()\n\t{\n $this->conexion = new \\mysqli($this->servidor,$this->usuario,$this->clave,$this->base) \n or die (\"Error de Conexion MySQL \".$this->conexion->connect_errno);\n $this->bandera = true;\n $this->conexion->set_charset(\"utf8\");\n return $this->conexion;\n }", "function padres_consultan_hijos($id_padre){\r\n\t\t$cn = $this->conexion();\r\n \r\n if($cn!=\"no_conexion\"){\r\n \t\r\n \t\r\n\t \t$sql=\"select * from $this->tabla_alumno where id_padre='$id_padre'\";\r\n\t\t\t\r\n\t $rs = mysql_query($sql,$cn);\r\n \r\n \t\r\n\t\t\twhile($fila=mysql_fetch_object($rs)){\r\n\t\t\t\t$cursos[]=$fila;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\t$respuesta=\"\";\r\n\t\t\tif($cursos){\r\n\t\t\t\t\t\r\n\t\t\t\tforeach($cursos as $q):\r\n\t\t\t\t\t\r\n\t\t\t\t\t$respuesta.=$q->codigo.\"{\".$q->nombres.\"{\".$q->apellido_paterno.\"{\".$q->apellido_materno.\"{\".$q->nivel.\"{\".$q->grado.\"{\".$q->seccion.\"{\";\r\n\t\t\t\t\t\r\n\t\t\t\tendforeach;\t\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t$respuesta=\"no data\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmysql_close($cn);\r\n\r\n\t\t\treturn $respuesta;\r\n\t\t}else{\r\n\t\treturn \"mysql_no\";\r\n\t\t}\r\n\t}", "function iadocumentoanulado($nroref,$suc){\n\t\tinclude(\"application/config/conexdb_db2.php\");\n\t\t$codcia=$this->session->userdata('codcia'); \n\t\t$sql =\"select IANROPDC FROM LIBPRDDAT.MMIAREP WHERE IACODCIA='\".$codcia.\"' AND IACODSUC='\".$suc.\"' AND IANROREF =\".$nroref;\n\t\t$dato = odbc_exec($dbconect, $sql)or die(\"<p>\" . odbc_errormsg());\n\t\tif (!$dato) {\n\t\t\t$data = false;\n\t\t} else { \n\t\t\t$data = $dato; \n\t\t} \n\t\treturn $data; \n\t\tcerrar_odbc(); \n\t}", "function si_mysql_client_encoding() {\r\n\t\tif (function_exists('mysql_client_encoding')) return mysql_client_encoding();\r\n\t\telse return \"\";\r\n\t}", "function mysql29($campos, $tabla1, $columna1, $queBuscar1, $columna2, $queBuscar2, $columna3, $queBuscar3, $colOrden, $orden, $limite){\n\t$query01=\"SELECT $campos FROM $tabla1 WHERE $columna1 = '$queBuscar1' AND $columna2 = '$queBuscar2' AND $columna3 = '$queBuscar3' ORDER BY $colOrden $orden Limit $limite\";\n $query02=mysql_query($query01);\n\t$resultado = array();\n\twhile( $line = mysql_fetch_array($query02, MYSQL_ASSOC) ){\n\t\t$resultado[] = $line;\n\t}\n\treturn $resultado;\n/*\n$campos = '';\n$tabla1 = '';\n$columna1 = '';\n$queBuscar1 = '';\n$columna2 = '';\n$queBuscar2 = '';\n$columna3 = '';\n$queBuscar3 = '';\n$colOrden = '';\n$orden = '';\n$limite = '';\n*/\n}", "function jrdocumentoanulado($fecha,$nropdc,$suc,$tipdoc,$serie,$correl){\n\t\tinclude(\"application/config/conexdb_db2.php\");\n\t\t$codcia=$this->session->userdata('codcia'); \n\t\t$sini=substr($serie, 0,1);\n\t\t$nini=substr($serie, 2,2);\n\t\t$serie=$sini.$nini;\n\t\t$Cini=substr($correl, 0,1);\n\t\t$Cfin=substr($correl, 1,7);\n\t\t$correl=$Cfin;\n\t\t$sql =\"select JRSTS FROM LIBPRDDAT.MMJRREP WHERE JRCODCIA='\".$codcia.\"' AND JRCODSUC='\".$suc.\"' and JRFECEMI \".$fecha.\" AND JRNRODOC =\".$nropdc.\" AND JRNROSER='\".$serie.\"' AND JRNROCOR='\".$correl.\"' AND JRTIPDOC='\".$tipdoc.\"'\";\n\t\t$dato = odbc_exec($dbconect, $sql)or die(\"<p>\" . odbc_errormsg());\n\t\tif (!$dato) {\n\t\t\t$data = FALSE;\n\t\t} else { \n\t\t\t$data = $dato; \n\t\t} \n\t\treturn $data;\n\t\tcerrar_odbc(); \n\t}", "function set_encoding($encoding=\"\")\r\n {\r\n if(\"\" == $encoding)\r\n $encoding = $this->encoding;\r\n $sql = \"SET SESSION character_set_database = \" . $encoding; //'character_set_database' MySQL server variable is [also] to parse file with rigth encoding\r\n $res = @mysql_query($sql);\r\n return mysql_error();\r\n }", "public function ConsultarSoporteRefrigerios($param) {\n extract($param);\n $resultado = array();\n $registro = array();\n $sql = \"CALL SPCONSULTARCARGAMASIVASR('$busqueda');\";\n $rs=null;\n $conexion->getPDO()->query(\"SET NAMES 'utf8'\");\n $host= $_SERVER[\"HTTP_HOST\"];\n if ($rs = $conexion->getPDO()->query($sql)) {\n if ($filas = $rs->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas as $fila) {\n foreach ($fila as $key => $value) {\n $rutaFuente= \"<a href='/\".$fila['RutaAutorizacion'].\"'>Descargar Archivo Fuente</a>\";\n $rutaEscaneado= \"<a href='/\".$fila['RutaSoporte'].\"'>Descargar Archivo Soporte</a>\";\n array_push($registro, $fila['Salon'],$fila['Fecha'],$rutaFuente, $rutaEscaneado ,$value);\n \n array_push($registro, $value);\n }\n array_push($resultado, $registro);\n $registro = array();\n }\n }\n } else {\n $registro = 0;\n }\n echo json_encode($resultado);\n }", "function armar_consulta($pdia,$udia,$anio){\n //designaciones sin licencia UNION designaciones c/licencia sin norma UNION designaciones c/licencia c norma UNION reservas\n// $sql=\"(SELECT distinct t_d.id_designacion, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac,t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n// 0 as dias_lic, case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n// FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n// LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n// LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n// LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n// LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n// LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n// LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n// LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n// LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n// LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n// LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON ( m_e.anio=\".$anio.\")\".\n// \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n// docente as t_d1,\n// caracter as t_c,\n// unidad_acad as t_ua \n// \n// WHERE t_d.id_docente = t_d1.id_docente\n// AND t_d.carac = t_c.id_car \n// AND t_d.uni_acad = t_ua.sigla \n// AND t_d.tipo_desig=1 \n// AND not exists(SELECT * from novedad t_no\n// where t_no.id_designacion=t_d.id_designacion\n// and (t_no.tipo_nov=1 or t_no.tipo_nov=2 or t_no.tipo_nov=4 or t_no.tipo_nov=5)))\n// UNION\n// (SELECT distinct t_d.id_designacion, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac, t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n// 0 as dias_lic, case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n// FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n// LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n// LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n// LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n// LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n// LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n// LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n// LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n// LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n// LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n// LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n// LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\".\n// \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n// docente as t_d1,\n// caracter as t_c,\n// unidad_acad as t_ua,\n// novedad as t_no \n// \n// WHERE t_d.id_docente = t_d1.id_docente\n// AND t_d.carac = t_c.id_car \n// AND t_d.uni_acad = t_ua.sigla \n// AND t_d.tipo_desig=1 \n// AND t_no.id_designacion=t_d.id_designacion\n// AND (((t_no.tipo_nov=2 or t_no.tipo_nov=5 ) AND (t_no.tipo_norma is null or t_no.tipo_emite is null or t_no.norma_legal is null))\n// OR (t_no.tipo_nov=1 or t_no.tipo_nov=4))\n// )\n// UNION\n// (SELECT distinct t_d.id_designacion, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac,t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n// sum((case when (t_no.desde>'\".$udia.\"' or (t_no.hasta is not null and t_no.hasta<'\".$pdia.\"')) then 0 else (case when t_no.desde<='\".$pdia.\"' then ( case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_no.hasta-'\".$pdia.\"')+1) end ) else (case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then ((('\".$udia.\"')-t_no.desde+1)) else ((t_no.hasta-t_no.desde+1)) end ) end )end)*t_no.porcen ) as dias_lic,\n// case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n// FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n// LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n// LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n// LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n// LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n// LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n// LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n// LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n// LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n// LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n// LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n// LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\".\n// \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n// docente as t_d1,\n// caracter as t_c,\n// unidad_acad as t_ua,\n// novedad as t_no \n// \n// WHERE t_d.id_docente = t_d1.id_docente\n// \tAND t_d.carac = t_c.id_car \n// \tAND t_d.uni_acad = t_ua.sigla \n// \tAND t_d.tipo_desig=1 \n// \tAND t_no.id_designacion=t_d.id_designacion \n// \tAND (t_no.tipo_nov=2 or t_no.tipo_nov=5) \n// \tAND t_no.tipo_norma is not null \n// \tAND t_no.tipo_emite is not null \n// \tAND t_no.norma_legal is not null\n// GROUP BY t_d.id_designacion,docente_nombre,t_d1.legajo,t_d.nro_cargo,anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, cat_mapuche_nombre, cat_estat, dedic,t_c.descripcion , t_d3.descripcion , t_a.descripcion , t_o.descripcion ,t_d.uni_acad, t_m.quien_emite_norma, t_n.nro_norma, t_x.nombre_tipo , t_d.nro_540, t_d.observaciones, m_p.nombre, t_t.id_programa, t_t.porc,m_c.costo_diario, check_presup, licencia,t_d.estado \t\n// )\".\n //--sino tiene novedad entonces dias_lic es 0 case when t_no.id_novedad is null \n //--si tiene novedad tipo 2,5 y no tiene norma entonces dias_lic es 0\n $sql=\" SELECT distinct t_d.id_designacion,t_d.por_permuta,t_d.tipo_desig, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac, t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n sum(case when t_no.id_novedad is null then 0 else (case when (t_no.desde>'\".$udia.\"' or (t_no.hasta is not null and t_no.hasta<'\".$pdia.\"')) then 0 else (case when t_no.desde<='\".$pdia.\"' then ( case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_no.hasta-'\".$pdia.\"')+1) end ) else (case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then ((('\".$udia.\"')-t_no.desde+1)) else ((t_no.hasta-t_no.desde+1)) end ) end )end)*t_no.porcen end) as dias_lic,\n case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n FROM designacion as t_d \n LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\n LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo)\n LEFT OUTER JOIN novedad t_no ON (t_d.id_designacion=t_no.id_designacion and t_no.tipo_nov in (2,5) and t_no.tipo_norma is not null \n \t\t\t\t\tand t_no.tipo_emite is not null \n \t\t\t\t\tand t_no.norma_legal is not null \n \t\t\t\t\tand t_no.desde<='\".$udia.\"' and t_no.hasta>='\".$pdia.\"'),\n docente as t_d1,\n caracter as t_c,\n unidad_acad as t_ua \n WHERE t_d.id_docente = t_d1.id_docente\n AND t_d.carac = t_c.id_car \n AND t_d.uni_acad = t_ua.sigla \n AND t_d.tipo_desig=1 \n GROUP BY t_d.id_designacion,t_d.por_permuta,t_d.tipo_desig,docente_nombre,t_d1.legajo,t_d.nro_cargo,anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, cat_mapuche_nombre, cat_estat, dedic,t_c.descripcion , t_d3.descripcion , t_a.descripcion , t_o.descripcion ,t_d.uni_acad, t_m.quien_emite_norma, t_n.nro_norma, t_x.nombre_tipo , t_d.nro_540, t_d.observaciones, m_p.nombre, t_t.id_programa, t_t.porc,m_c.costo_diario, check_presup, licencia,t_d.estado \t\".\n\n \" UNION\n (SELECT distinct t_d.id_designacion,0 as por_permuta,t_d.tipo_desig, 'RESERVA'||': '||t_r.descripcion as docente_nombre, 0, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac, t_d3.descripcion as id_departamento, t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n 0 as dias_lic,\n case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\".\n \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n caracter as t_c,\n unidad_acad as t_ua,\n reserva as t_r \n \n WHERE t_d.carac = t_c.id_car \n \tAND t_d.uni_acad = t_ua.sigla \n \tAND t_d.tipo_desig=2 \n \tAND t_d.id_reserva = t_r.id_reserva \t\n )\";\n //esto es para las designaciones que tienen mas de un departamento,area,orientacion\n $sql2=\"SELECT distinct sub1.id_designacion,sub1.por_permuta,sub1.tipo_desig,sub1.docente_nombre,sub1.legajo,sub1.nro_cargo,sub1.anio_acad,sub1.desde,sub1.hasta,sub1.cat_mapuche, sub1.cat_mapuche_nombre,\n sub1.cat_estat, sub1.dedic, sub1.carac,case when sub2.id_designacion is not null then sub2.dpto else sub1.id_departamento end as id_departamento,case when sub2.id_designacion is not null then sub2.area else sub1.id_area end as id_area,case when sub2.id_designacion is not null then sub2.orientacion else sub1.id_orientacion end as id_orientacion\n , sub1.uni_acad, sub1.emite_norma, sub1.nro_norma, sub1.tipo_norma, sub1.nro_540, sub1.observaciones, sub1.id_programa, sub1.programa, sub1.porc, sub1.costo_diario, sub1.check_presup, sub1.licencia, sub1.estado, sub1.dias_lic, sub1.dias_des\n FROM (\".$sql.\")sub1\"\n . \" LEFT OUTER JOIN (select d.id_designacion,excepcion_departamento(a.id_designacion)as dpto,excepcion_area(a.id_designacion) as area,excepcion_orientacion(a.id_designacion) as orientacion\n from designacion d,dao_designa a \n where d.desde <='\".$udia.\"' and (d.hasta>='\".$pdia.\"' or d.hasta is null)\n and a.id_designacion=d.id_designacion)sub2 ON (sub1.id_designacion=sub2.id_designacion)\";\n return $sql2;\n }", "function datos_ficha_eu($id) {\n\t\t\n\t\t$query = \"SELECT eu.*, eu_descripcion.*\n\t\tFROM eu, eu_descripcion\n\t\tWHERE eu.id_eu=$id\n\t\tAND eu.id_eu=eu_descripcion.id_eu\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\t$row=mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $row;\n\t\t}\n\t}", "function formatearEntrada($datos, $formato, $charset_local, $charset_remoto){\n\n switch($formato){\n\tcase \"application/php\" :\n\t\t$datos_php = unserialize(trim($datos));\n\t\tif($charset_local != $charset_remoto){\n\t\t\t$datos_php = convertir_charset_mix($datos_php, $charset_local, $charset_remoto);\n \t\t}\n\t\treturn $datos_php;\n\tcase \"text/xml\":\n\t\t/** La documentacion dice que XMLParser detecta automaticamente el encoding*/\n\t\t$factory = new XMLFactory();\n\t\t$xml_parser = $factory->getXMLToArrayInstance();\n\t\t$datos_php = $xml_parser->toArray($datos);\n\t\tif($charset_local != $charset_remoto){\n\t\t\t$datos_php = convertir_charset_mix($datos_php, $charset_local, $charset_remoto);\n\t\t}\n\t\t//echo \"Datos traidos en XML <pre>\".print_r($datos_php, TRUE).\"</pre>\";\n\t\treturn $datos_php;\n case \"application/x-www-form-urlencoded\":\n\t\tparse_str($datos, $datos_php);\n\t\tif($charset_local != $charset_remoto){\n\t\t\t$datos_php = convertir_charset_mix($datos_php, $charset_remoto, $charset_local);\n\t\t}\n\t\treturn $datos_php;\n\tcase \"application/json\" :\n\t\t/**codificacion remota obligatoria: utf-8 o ASCII*/\n\t\t//error_log(\"[\".date(\"r\").\"] get datos\".print_r($datos, TRUE).\"\\n\",3,\"error.log\");\n\t\t$datos_php = json_decode($datos, true);\n\t\t//error_log(\"[\".date(\"r\").\"] get datos\".print_r($datos_php, TRUE).\"\\n\",3,\"error.log\");\n\t\tif($charset_local != $charset_remoto){\n\t\t $datos_php = convertir_charset_mix($datos_php, $charset_local, $charset_remoto);\n\t\t}\n\t\treturn $datos_php;\n default:\n\t\treturn FALSE;\n }\n}", "function getFlash($sql){\n\n\t\t$qr = mysql_query($sql);\n\n\t\t$i =0;\n\n\t\twhile ($rs = mysql_fetch_array($qr)){\n\n\t\t\tforeach ($rs as $key => $value) {\n\t\t\t if(!is_int($key)){\n\n\t\t\t \t//$key = utf8_encode($key);\n\t\t\t \t//$value = utf8_encode($value);\n\t\t\t \t//$value = $this->EncodeConfig( htmlentities($value) );\n\t\t\t\t\t$ck = mb_detect_encoding($value, \"auto\");\n\t\t\t\t\tif($ck == \"UTF-8\"){\n\t\t\t\t\t\techo \"<H3> UTF8 $ck</H3>\";\n\t\t\t\t\t\t$value = $this->EncodeConfig( $value );\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\techo \"<H3> ANSI $ck</H3>\";\n\t\t\t\t\t\t$value = $this->EncodeConfig( utf8_encode($value) );\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\techo \"&\".$key.\"_\".$i.\"=\".$value.\"&\";\n\t\t\t\t}\n\t\t }\n\n\t\t $i++;\n\n\t\t}\n\n\t\t$row = mysql_num_rows($qr);\n\t\techo \"&__total=\".$row.\"&\";\n\n\t}", "function svc_get_var( $connection, $sql ) {\r\n\t$query = mysqli_query( $connection, $sql );\r\n\tif ( !$query ) {\r\n\t\treturn 'Error 802';\r\n\t die();\r\n\t}\r\n\t$row = mysqli_fetch_array( $query );\r\n\t$rows = array_map( 'utf8_encode', $row );\r\n\tmysqli_free_result( $query );\r\n\treturn $rows[0]; \r\n}", "function cbdocumentoanulado($fecha,$nropdc,$suc,$serie,$correl){\n\t\tinclude(\"application/config/conexdb_db2.php\");\n\t\t$codcia=$this->session->userdata('codcia'); \n\t\t$correle=substr($correl, 0,1);\n\t\t$sini=substr($serie, 0,1);\n\t\t$nini=substr($serie, 2,2);\n\t\t$serie=$sini.$nini;\n\t\t$sql =\"select CBSTS,CBSTSPDO,CBCODMON FROM LIBPRDDAT.MMCBREP WHERE CBCODCIA='\".$codcia.\"' AND CBCODSUC='\".$suc.\"' and CBFECDOC \".$fecha.\" AND CBNROSER='\".$serie.\"' AND CBNROCOR='\".$correle.\"' AND CBNROPDC =\".$nropdc;\n\t\t$dato = odbc_exec($dbconect, $sql)or die(\"<p>\" . odbc_errormsg());\n\t\tif (!$dato) {\n\t\t\t$data = false;\n\t\t} else { \n\t\t\t$data = $dato; \n\t\t} \n\t\treturn $data; \n\t\tcerrar_odbc();\n\t}", "function consultarOtro(){\n $queryconsultarOtro=$this->mdlOrdenes->consultarOtro(base64_decode($_POST[\"idAtencion\"]));\n echo json_encode($queryconsultarOtro);\n }", "function mysql14($campos, $tabla, $columna, $queBuscar, $colOrden, $limite, $orden){\n\t$query01=\"SELECT $campos FROM $tabla WHERE $columna = $queBuscar ORDER BY $colOrden $orden Limit $limite\";\n $query02=mysql_query($query01);\n\t$resultado = array();\n\twhile($line = mysql_fetch_array($query02, MYSQL_ASSOC)){\n\t\t$resultado[] = $line;\n\t}\n\treturn $resultado;\n\n/*\n$campos = '';\n$tabla = '';\n$columna = '';\n$queBuscar = '';\n$colOrden = '';\n$orden = '';\n$limite = '';\n$resultado = mysql14($campos, $tabla, $columna, $queBuscar, $colOrden, $limite, $orden);\n\nComo ver los datos\nforeach( $resultado as $value){\n\tforeach( $value as $value){\n\t\techo $value.\"<br />\";\n\t}\n}\n*/\n}", "function fxdocumentoanulado($fecha,$nropdc,$suc,$serie,$correl,$tipodoc){\n\t\tinclude(\"application/config/conexdb_db2.php\");\n\t\t$codcia=$this->session->userdata('codcia'); \n\t\t$sini=substr($serie, 0,1);\n\t\t$nini=substr($serie, 2,2);\n\t\t$serie=$sini.$nini;\n\t\t$sql =\"select FXSTS FROM LIBPRDDAT.MMFXREP WHERE FXCODCIA='\".$codcia.\"' AND FXCODSUC='\".$suc.\"' and FXFECDVL \".$fecha.\" AND FXNROPDC =\".$nropdc.\" AND FXNROSER='\".$serie.\"' AND FXNROCOR='\".$correl.\"' AND FXTIPDOC='\".$tipodoc.\"'\"; \n\t\t$dato = odbc_exec($dbconect, $sql)or die(\"<p>\" . odbc_errormsg());\n\t\tif (!$dato) {\n\t\t\t$data = FALSE;\n\t\t} else { \n\t\t\t$data = $dato; \n\t\t} \n\t\treturn $data;\n\t\tcerrar_odbc(); \n\t}", "function getDatos(){\n $res = $this->Consulta('SELECT C.*, P.id_planta FROM '.$this->Table .' C\n INNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\n INNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\n INNER JOIN\n plantas P ON P.id_planta = S.id_planta\n \n WHERE '.$this->PrimaryKey.' = '.$this->_datos);\n $resultado = $res[0];\n // $resultado = array_map('utf8_encode',$resultado);\n \n print_r( json_encode( $resultado ) );\n }", "function cargaConfActualRespAuto()\n\t\t{\n\t\t\t\n\t\t\t$sql = \"select * from config_respaldos\";\n\t\t\t$sentencia= mysql_query($sql,$this->id_con);\n\t\t\twhile($rs = mysql_fetch_array($sentencia,MYSQL_BOTH)){\n\t\t\t\techo \"<tr>\";\n\t\t\t\techo \"<td>\".$rs['Frecuencia'].\"</td>\";\n\t\t\t\tif($rs['Dia']==0){\n\t\t\t\t\techo \"<td>TODOS LOS DIAS</td>\";\n\t\t\t\t}\n\t\t\t\telse if($rs['Dia']==1){\n\t\t\t\t\techo \"<td>LUNES</td>\";\n\t\t\t\t}\n\t\t\t\telse if($rs['Dia']==2){\n\t\t\t\t\techo \"<td>MARTES</td>\";\n\t\t\t\t}\n\t\t\t\telse if($rs['Dia']==3){\n\t\t\t\t\techo \"<td>MIERCOLES</td>\";\n\t\t\t\t}\n\t\t\t\telse if($rs['Dia']==4){\n\t\t\t\t\techo \"<td>JUEVES</td>\";\n\t\t\t\t}\n\t\t\t\telse if($rs['Dia']==5){\n\t\t\t\t\techo \"<td>VIERNES</td>\";\n\t\t\t\t}\n\t\t\t\telse if($rs['Dia']==6){\n\t\t\t\t\techo \"<td>SABADO</td>\";\n\t\t\t\t}\n\t\t\t\telse if($rs['Dia']==7){\n\t\t\t\t\techo \"<td>DOMINGO</td>\";\n\t\t\t\t}\n\t\t\t\techo \"<td>\" . $rs['Hora'] . \"</td>\";\n\t\t\t\techo \"</tr>\";\n\t\t\t}\n}", "public function __construct()\n {\n // se definen los parametros de la funcion contrutor\n parent::__construct($this->host,$this->user,$this->past,$this->db_guardar_ejemplos);\n // se utiliza set_charset(\"utf8\") para el formato de decodificacion de caracteres \n $this->set_charset(\"utf8\");\n // se realiza para ver si hay algun problema con la conexion y muestre el error correspondiente\n $this->connect_errno ? die('Error en la conexion:'. mysqli_connect_error()):\n //o por el contrario que si se conecto de manera indicada\n $e =\"conectado:)\";\n // se muestra a partir de un echo\n //echo ($e);\n }", "public function conectionDB(){\n $mysqlConnect = \"mysql:host=$this->dbHost;dbname=$this->dbName\";\n $dbConnection = new PDO($mysqlConnect,$this->dbUser,$this->dbPass);\n $dbConnection -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $acentos = $dbConnection->query(\"SET NAMES 'utf8'\");\n return $dbConnection;\n\n }", "public static function conectar()\n {\n\n // $link->exec(\"set names utf8\");\n\n // // return $link;\n\n $link = new PDO(\"mysql:host=88.198.24.90;dbname=inventar_proyectofinal\", \"inventariosadsi\", \"SETQDnuHgv(_\");\n $link->exec(\"set names utf8\");\n return $link;\n\n $link->exec(\"set names utf8\");\n\n return $link;\n\n }", "function CompruebaTabla($conexionUsar, $tablaUsar, $bddUsar){ // Por último, en cada consulta, se comprueba que no vuelva\n $sentenciaTabla = \"select * from \" . $tablaUsar; // vacía ni con errores, y en caso de haberlos, se muestran por pantalla.\n $valor = true;\n $conexionUsar->select_db($bddUsar);\n $queryComprobar = mysqli_query($conexionUsar, $sentenciaTabla);\n if(!$queryComprobar){\n echo \"<h3 style=\\\"margin-left: 1%\\\">ERROR: No se encuentra la tabla \" . $tablaUsar . \"</h3>\";\n echo \"<h3 style=\\\"margin-left: 1%\\\">Base de Datos INCOMPLETA. Se debe realizar una reinstalación.</h3>\";\n $valor = false;\n }\n return($valor);\n }", "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 }", "function extraeRaza($idRaza)\n{\n $link = conection();\n \n $query = \"select * from Raza where idRaza = '$idRaza'\";\n $result = mysqli_query($link, $query);\n \n $array = (mysqli_fetch_assoc($result));\n \n $parseUTF8 = [\"idRaza\" => $array[\"idRaza\"], \n \"nombreRa\" => utf8_encode($array[\"nombreRa\"]),\n \"idTipo\" => $array[\"idTipo\"]];\n mysqli_close($link);\n \n return $parseUTF8;\n}", "function mysql11($tabla,$enQueColumna,$queBuscar){\n\t$query1=\"SELECT * FROM $tabla WHERE $enQueColumna='$queBuscar';\";\n\t$query2=mysql_query($query1);\n\t$resultado=mysql_fetch_row($query2);\n\treturn $resultado;\n\n/*\nComo usar\n\n$tabla = '';\n$enQueColumna = '';\n$queBuscar = '';\n$rtdo = mysql11($tabla,$enQueColumna,$queBuscar);\n\nComo ver datos\nforeach($rtdo as $value){\n \techo $value;\n}\n*/\n}", "public function queryInsertDocPF($dados){\n try{\n $ID = $dados['0'];\n $IDENTIFICADOR = $dados['1']; \n $CPF = preg_replace(\"/[^0-9]/\", \"\",$dados['2']);\n $RG = preg_replace(\"/[^0-9]/\", \"\",$dados['3']);\n $STATUS = $dados['4'];\n $SQL = \"INSERT INTO `documentopf` (`id`, `identificador`, `cpf`, `rg`, `status`) VALUES (?, ?, ?, ?, ?)\";\n \n $sqlDocumento = $this->conecta->conectar()->prepare($SQL);\n // print_r($sqlDocumento);\n \n $sqlDocumento->bindParam(1, $ID, PDO::PARAM_STR);\n $sqlDocumento->bindParam(2, $IDENTIFICADOR, PDO::PARAM_STR);\n $sqlDocumento->bindParam(3, $CPF, PDO::PARAM_STR);\n $sqlDocumento->bindParam(4, $RG, PDO::PARAM_STR);\n $sqlDocumento->bindParam(5, $STATUS, PDO::PARAM_STR);\n if($sqlDocumento->execute()){\n return \"ok\";\n }//else{\n // print_r($sqlDocumento->errorInfo());\n // }\n } catch (PDOException $ex) {\n return 'error '.$ex->getMessage();\n }\n }", "function mysql13($colFecha, $campos, $tabla, $fechaInicio, $fechaFinal){\n\t$query01=\"SELECT $campos FROM $tabla WHERE $colFecha BETWEEN '$fechaInicio' AND '$fechaFinal';\";\n $query02=mysql_query($query01);\n\t$resultado = array();\n\twhile($line = mysql_fetch_array($query02, MYSQL_ASSOC)){\n\t\t$resultado[] = $line;\n\t}\n\treturn $resultado;\n/*\nComo ver los datos\nforeach( $resultado as $value){\n\tforeach( $value as $value){\n\t\techo $value.\"<br />\";\n\t}\n}\n*/\n}", "function toString(){\n echo \"<br><br><br>\";\n echo \"<h2>Maestros:</h2>\";\n /* Conexion con base de datos. */\n $conexion = new PDO('mysql:host=localhost;dbname=tarea02;charset=UTF8', 'root', '');\n $conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n\n if ($conexion){\n \n /* Se define la consulta SQL */\n $consulta = \"SELECT * FROM maestro;\"; \n $stmt = $conexion->prepare($consulta);\n $stmt->execute(); \n \n $arr = $stmt->fetchAll(PDO::FETCH_ASSOC);\n foreach ($arr as $row) {\n echo $row['noEmpleado'];\n echo \" \";\n echo $row['carrera'];\n echo \" \"; \n echo $row['nombre'];\n echo \" \"; \n echo $row['telefono'];\n echo \"<br>\"; \n \n \n }\n \n\n } else {\n echo \"Hubo un problema con la conexión\";\n }\n }", "function normalise_fichier($NomComplet){\n\t\t$valRetour = str_replace(\"'\",\"\",$NomComplet);\n\t\t$valRetour = str_replace(\" \",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"-\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\",\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"¦\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"/\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"+\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"=\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"!\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"?\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"œ\",\"oe\",$valRetour);\n\t\t$valRetour = str_replace(\"æ\",\"ae\",$valRetour);\n\t\t$valRetour = mb_convert_encoding($valRetour,\"iso-8859-1\",\"UTF-8\");\n\t\t$valRetour = strtolower($valRetour);\n\t\t$valRetour = vireAccents($valRetour);\n\t\treturn($valRetour);\n\t}", "function conectarte_externo()\n{\nmysql_connect(\"www.sierrasur.gob.pe\",\"psierras_masters\",\"rumpeltinsky\") or die(\"Error:Servidor sin conexion\");\nmysql_select_db(\"psierras_usuario\") or die(\"Error:Base de datos sin conexion & No disponible\");\n}", "function datos_internacionalizacion() {\n\t\t$query = \"SELECT * FROM internacionalizacion\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t\n\t\t$result = mysql_query($query);\n\t\t$numrows = mysql_num_rows($result);\n\n\t\tif ($numrows == 0) {\n\t\t\tmysql_close($connection);\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\tmysql_close($connection);\n\t\t\treturn $result;\n\t\t}\n\t}" ]
[ "0.688817", "0.64750934", "0.6376015", "0.63369864", "0.62806016", "0.622724", "0.61923265", "0.6169269", "0.6100985", "0.606473", "0.60547507", "0.6038303", "0.5982114", "0.5971625", "0.5971625", "0.5966117", "0.5950686", "0.59382164", "0.5928948", "0.59113306", "0.58785635", "0.5865206", "0.586176", "0.58562225", "0.583859", "0.5830745", "0.5797423", "0.5795469", "0.57943237", "0.57868403", "0.57827586", "0.57692325", "0.5766859", "0.57610244", "0.57576656", "0.57492405", "0.5747831", "0.5747557", "0.5729777", "0.5721386", "0.5715591", "0.5711069", "0.5706485", "0.56990784", "0.5697516", "0.5697121", "0.5694854", "0.5693768", "0.56890273", "0.5687666", "0.56873596", "0.56834185", "0.5680283", "0.5677785", "0.56753844", "0.56690115", "0.5667736", "0.5647603", "0.56427884", "0.56426156", "0.563987", "0.56387436", "0.56348896", "0.5632149", "0.5630541", "0.5628545", "0.5626512", "0.5621229", "0.5614851", "0.5610301", "0.56034005", "0.5592702", "0.5585601", "0.55855334", "0.55851233", "0.55835235", "0.5581959", "0.5578181", "0.55774945", "0.5576926", "0.5574601", "0.5571692", "0.55600995", "0.55547", "0.5553284", "0.55522007", "0.55505", "0.55501217", "0.55467784", "0.55466205", "0.55434334", "0.5540507", "0.55385786", "0.5536158", "0.55296403", "0.5528141", "0.55239844", "0.5523457", "0.5522985", "0.5514325", "0.5514174" ]
0.0
-1
Returns the schema for this data object.
protected function createSchema() { $schema = new ModelSchema("Rental"); $schema->addColumn( new AutoIncrementColumn("RentalID"), new ForeignKeyColumn("ClientID") ); return $schema; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSchema()\n {\n return $this->get(self::SCHEMA);\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema();", "public function getSchema();", "public function getSchema();", "public function schema()\n\t{\n\t\treturn $this->schema;\n\t}", "public function get_schema() {\n\t\treturn $this->schema;\n\t}", "public function getSchema() {}", "protected function _getSchema() {\n\t\treturn $this->__schema;\n\t}", "public function getSchema()\n {\n if (empty($this->schema)) {\n return 'public';\n } else {\n return $this->schema;\n }\n }", "public function getSchema()\n {\n if ($this->schema) {\n return $this->schema;\n }\n\n return $this->schema = resolve(Bakery::getModelSchema($this));\n }", "public static function getSchema()\n {\n }", "public function getSchema() {\n return Cool::getInstance()->getSchema($this->databaseName);\n }", "public function getSchema(): Schema;", "public function getSchema()\n {\n if ($this->schema === null) {\n $this->getSchemaTables();\n }\n\n return $this->schema;\n }", "public function get_schema()\n {\n }", "public static function get_schema()\n {\n }", "public function getSchema()\n {\n return $this->source;\n }", "public function schema()\r\n {\r\n return $this->getKey('schema', true);\r\n }", "public function schema();", "public function getSchema(): string;", "public function getSchema(): string;", "protected function schema()\n {\n return $this->connection()->getSchemaBuilder();\n }", "protected function schema()\n {\n return $this->connection()->getSchemaBuilder();\n }", "protected function schema()\n {\n return $this->connection()->getSchemaBuilder();\n }", "public function getSchema(): Schema\n {\n if ($this->_schema === null) {\n $this->_schema = $this->_initializeSchema($this->getWebservice()->describe($this->getName()));\n }\n\n return $this->_schema;\n }", "public function getSchema(): Schema\n {\n if ($this->schema === null) {\n $this->schema = new Schema($this);\n }\n\n return $this->schema;\n }", "public function get_field_schema()\n {\n }", "function schema() {\n\t\tif(empty($this->table)) {\n\t\t\tthrow new ConnerException('Unknown table for schema in model '.get_class($this));\n\t\t}\n\n\t\tif(empty($this->schema)) {\n\n\t\t\t$cacheKey = 'MysqlModel.'.get_class($this).'.schema';\n\n\t\t\tif(is_null($schema = cache\\file($cacheKey, null, MONTH))) {\n\t\t\t\t$schema = array();\n\t\t\t\t$res = $this->query('DESCRIBE `'.$this->table.'`');\n\n\t\t\t\tif(empty($res)) { // false on error\n\t\t\t\t\treturn array(); // perhaps throwing an exception here may be a better way? i not sure.\n\t\t\t\t}\n\n\t\t\t\twhile ($row = $res->fetch_row()) {\n\t\t\t\t\t$schema[$row[0]] = array(\n\t\t\t\t\t\t'key'=>$row[0],\n\t//\t\t\t\t\t'type'=>$row[1], // todo: parse this into something better\n\t\t\t\t\t\t'primary'=>($row[3]=='PRI'),\n\t\t\t\t\t\t'default'=>$row[4],\n\t\t\t\t\t);\n\t\t }\n\t\t\t\t$res->free();\n\t\t\t\tcache\\file($cacheKey, $schema, MONTH);\n\t\t\t}\n\t\t\t$this->schema = $schema;\n\t\t}\n\n\t\treturn $this->schema;\n\t}", "public function getMetadataSchema()\n {\n return isset($this->metadata_schema) ? $this->metadata_schema : null;\n }", "public function jsonschema() {\n return $this->service->jsonschema();\n }", "public function getDocumentSchema()\n {\n return $this->document_schema;\n }", "public function getSchema(): SchemaInterface;", "public function getSchema() {\n\t\tif (empty($this->mSchema['subproject_content_data'])) {\n\n\t \t\t/* Schema for subproject_content_id */\n\t\t\t$this->mSchema['subproject_content_data']['subproject_content_id'] = array(\n\t\t\t\t'name' => 'subproject_content_id',\n\t\t\t\t'type' => 'reference',\n\t\t\t\t'label' => 'Sub Projects',\n\t\t\t\t'help' => 'Select the sub-projects this content belongs to',\n\t\t\t\t'table' => 'liberty_content',\n\t\t\t\t'column' => 'content_id',\n\t\t\t\t'required' => '1'\n\t\t\t);\n\t\t}\n\n\n\t\treturn $this->mSchema;\n\t}", "public function getSchema()\n {\n $cacheKey = strtolower('resource-customFieldData-schema');\n $schemaRecourceInfo = $this->getWrapper()->persistent->get($cacheKey, null);\n\n if ($schemaRecourceInfo === null) {\n // Get CustomFieldData Schema fields and update/merge with any Custom Fields\n $schemaRecourceInfo = $this->getWrapper()->schema->resource($this->getResourceName());\n $schemaRecourceInfo->fields = array_merge(\n $this->getSchemaFieldsForCustomFields(),\n $schemaRecourceInfo->fields\n );\n\n $this->getWrapper()->persistent->set($cacheKey, $schemaRecourceInfo);\n }\n return $schemaRecourceInfo;\n }", "public function schema()\n {\n $queryType = new ObjectType([\n 'name' => 'Query',\n 'fields' => $this->queries,\n ]);\n\n $mutationType = new ObjectType([\n 'name' => 'Mutation',\n 'fields' => $this->mutations,\n ]);\n\n return new Schema([\n 'query' => $queryType,\n 'mutation' => $mutationType,\n // usually inferred from 'query', but required for polymorphism on InterfaceType-based query results\n 'types' => $this->types,\n ]);\n }", "public function get_instance_schema()\n {\n }", "public function get_instance_schema()\n {\n }", "public function get_instance_schema()\n {\n }", "public function get_instance_schema()\n {\n }", "public function get_instance_schema()\n {\n }", "public function getSchemaType()\n {\n return $this->schemaType;\n }", "abstract protected function getSchema(): string;", "public static function getItemSchema() {\n if(self::$itemSchema == null) {\n self::updateSchema();\n }\n\n return self::$itemSchema;\n }", "public function getSchemaPath() : string\n {\n return $this->schema;\n }", "public function getSchema(): ?string;", "public function getSchemaName()\n {\n return $this->schemaName;\n }", "private function resolveSchema() : Schema\n {\n return resolve('Schema');\n }", "public function getSchemaName()\n {\n return $this->schemaName;\n }", "public function getSchema()\r\n {\r\n // if existed (like post): begiresh va be view pass bede\r\n // if not (like blog,index): default schema template\r\n // include schema.view\r\n }", "public function schema(): ColumnSchema\n {\n return $this->schema;\n }", "public function getFromSchema()\n {\n return $this->getMetaValue(self::META_FROM_SCHEMA, '');\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "final public static function getSchema()\n\t{\n\t\t$definition = static::define();\n\n\t\tforeach ( static::$id as $property )\n\t\t\tif ( !array_key_exists( $property, $definition ) ) {\n\t\t\t\tif ( $property === 'id' )\n\t\t\t\t\t// apply property \"id\" implicitly here\n\t\t\t\t\t// (don't rely on connection adding implicitly\n\t\t\t\t\t// here for keeping this code independent from that code)\n\t\t\t\t\t$definition['id'] = 'INTEGER NOT NULL';\n\t\t\t\telse\n\t\t\t\t\tthrow new model_exception( 'missing ID property in schema definition' );\n\t\t\t}\n\n\t\treturn $definition;\n\t}", "public function get_item_schema() {\n\t\t$options = $this->get_registered_options();\n\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'settings',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(),\n\t\t);\n\n\t\tforeach ( $options as $option_name => $option ) {\n\t\t\t$schema['properties'][ $option_name ] = $option['schema'];\n\t\t}\n\n\t\treturn $this->add_additional_fields_schema( $schema );\n\t}", "protected function getSchema()\n {\n return '{\n \"$schema\":\"http://json-schema.org/draft-04/schema#\",\n \"title\":\"' . $this->name . ' Schema\",\n \"description\":\"' . $this->description . '\",\n \"type\":\"object\",\n \"additionalProperties\":false,\n \"properties\":{\n \"string\":{\n \"type\":\"string\",\n \"description\": \"The input string to process\"\n }\n },\n \"required\":[\n \"string\"\n ]\n }';\n }", "public function getReferencedSchema(): string;", "function getFromSchema() {\n\t\treturn $this->_fromSchema;\n\t}", "public function getSchemaName(): string;", "public function GetDefaultSchema() {\n if ($cache = fastcache::cache_get('default_schema', 'schema')) {\n $this->defaultSchema = $cache->data;\n return $this->defaultSchema;\n }\n $result = $this->connection->query_direct(\"SELECT SCHEMA_NAME()\")\n ->fetchField();\n fastcache::cache_set('default_schema', $result, 'schema');\n $this->defaultSchema = $result;\n return $this->defaultSchema;\n }", "public function getSchema($force = false)\n {\n if ($force || !$this->schema) {\n $this->schema = new DatabaseSchema();\n $this->loadInformationSchema();\n }\n\n return $this->schema;\n }", "public function getUpdatedSchema()\n {\n return $this->updated_schema;\n }" ]
[ "0.85943437", "0.85231346", "0.85231346", "0.85231346", "0.85231346", "0.85231346", "0.85231346", "0.8468756", "0.8468756", "0.8468756", "0.845027", "0.8432126", "0.8300413", "0.8176533", "0.81328696", "0.80597353", "0.8050417", "0.80437356", "0.8035311", "0.8002911", "0.79806244", "0.7939531", "0.79207504", "0.7898684", "0.7671948", "0.76706386", "0.76706386", "0.76640695", "0.76640695", "0.76640695", "0.753076", "0.752032", "0.7488528", "0.7480365", "0.7441616", "0.7429671", "0.7411554", "0.73712116", "0.7327491", "0.7286199", "0.72573304", "0.7208968", "0.7208968", "0.7208968", "0.7208968", "0.7208968", "0.72079366", "0.7198387", "0.71705407", "0.7110213", "0.7046783", "0.6952629", "0.6943288", "0.69201356", "0.6875875", "0.686829", "0.6868225", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68657374", "0.68569094", "0.6854869", "0.6852011", "0.68488324", "0.68068916", "0.6790836", "0.67741734", "0.6764334", "0.67534196" ]
0.0
-1
Store a newly created resource in storage.
public function create(Request $request) { $data = [ 'title' => $request->title, 'sku' => $request->sku, 'warehouses_id' => $request->warehouse_id, 'description' => $request->description ]; Products::create($data); return; }
{ "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
Get the Product for editing.
public function show($id) { return Products::findOrFail($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit($id)\n {\n $product = Product::find($id);\n return $product;\n }", "public function edit(Product $product) {\n //\n }", "public function getEdit(){\n return view(\"admin.product.edit\" );\n }", "public function editproductAction(): object\n {\n // Sets webpage title\n $title = \"Edit product\";\n\n // Sets extended webpage title\n $titleExtended = \" | Eshop\";\n\n // Framework variables\n $response = $this->app->response;\n $session = $this->app->session;\n\n // Verifies if user is logged in\n if (!$session->get(\"loggedIn\")) {\n $response->redirect(\"eshop/login\");\n };\n\n\n // Connects to db\n $this->app->db->connect();\n\n // Retrieve content id\n $productId = getGet(\"id\");\n\n // SQL statement\n $sql = \"SELECT * FROM products WHERE id = ?;\";\n\n // Fetches data from db and stores in $resultset\n $content = $this->app->db->executeFetch($sql, [$productId]);\n\n // Data array\n $data = [\n \"title\" => $title,\n \"titleExtended\" => $titleExtended,\n \"productId\" => $productId,\n \"content\" => $content\n ];\n\n // Includes admin header\n $this->app->page->add(\"content/header_admin\");\n\n // Adds route and sends data array to view\n $this->app->page->add(\"content/edit_product\", $data);\n\n // Renders page\n return $this->app->page->render($data);\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 }", "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($id)\n {\n $product = ProductDetail::find($id);\n return $product;\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit($id)\n {\n return Product::findOrFail($id);\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 return new ProductResource($product);\n }", "public function edit(Product $product)\n {\n // Admin Only \n }", "public function edit(Product $product) //Editar\n {\n //\n }", "public function edit(Product $product)\n {\n //Agregar Policy\n //$this->authorize('author', $post);\n return view('products.edit', compact('product'));\n }", "public function edit(Product $produto)\n {\n //\n }", "public function edit($id)\n {\n $post=Product::find($id);\n // $post = DB::table('products')->get();\n return $post;\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 editproductActionPost(): object\n {\n // Connects to db\n $this->app->db->connect();\n\n // Retrieves productId\n $productId = getPost(\"id\");\n\n if (hasKeyPost(\"doDelete\")) {\n return $this->app->response->redirect(\"admin/deleteproduct&id=$productId\");\n }\n\n if (hasKeyPost(\"doSave\")) {\n $params = getPost([\n \"name\",\n \"category\",\n \"short_description\",\n \"amount\",\n \"price\",\n \"image\",\n \"id\"\n ]);\n\n // Calls editProduct method\n $this->admin->editProduct($params);\n\n // Redirects\n return $this->app->response->redirect(\"admin/products2\");\n }\n }", "public function edit()\n {\n $per = self::get_permission();\n $all = product::all();\n return view('dashboard.product.edit',compact('per','all'));\n }", "public function edit(Product $product)\n {\n return view('pharmacy.inventory.product.edit',compact('product'), [\n 'categories' => Category::where('status', 1)\n ->where('company_id', company_id())\n ->pluck('name', 'id'),\n 'manufacturers' => Manufacturer::where('status', 1)\n ->where('company_id', company_id())\n ->pluck('name', 'id'),\n ]);\n }", "public function editAction()\n {\n $request = $this->getRequest();\n\n $productId = $request->getParam('id');\n\n if(!$productId) {\n $this->redirect('/');\n }\n\n $this->_helper->viewRenderer->setRender('form');\n\n $form = new Application_Form_Product();\n\n $this->loadModel('product');\n \n if ($request->isPost()) {\n if ($form->isValid($request->getPost())) {\n\n $this->modelProduct->update($form->getValues());\n\n $this->view->success = true;\n $this->view->productName = $form->getValues()['name'];\n $this->view->actionPerformed = 'updated';\n $form->reset();\n }\n } else {\n\n $product = $this->modelProduct->findById($productId);\n\n $this->view->headTitle()->prepend('Edit Product ' . $product['name']);\n\n $categoryToProduct = $this->modelProduct->getCategoryToProduct($productId);\n\n $form->populate($product->toArray());\n\n $form->populate($categoryToProduct->toArray());\n \n }\n\n \n $this->view->form = $form;\n\n }", "public function show(Product $product_editable)\n {\n return $product_editable;\n }", "public function edit($id) {\n\t\t$product = Product::find($id);\n\n\t\treturn view('admin.products.product', ['title' => trans('admin.create_or_update_products', ['title' => $product->title]), 'product' => $product]);\n\n\t}", "public function editAction()\n {\n $productId = $this->_getParam('product_id'); \n\n $this->_model->setId($productId);\n $productModel = $this->_model; \n\n\t $form = new Core_Form_Product_Edit($productId);\n $form->setAction($this->view->url(array(\n 'module' => 'default',\n 'controller' => 'product',\n 'action' => 'edit',\n 'product_id' => $productId,\n ), NULL, TRUE\n ));\n\n if ($this->_request->isPost()) {\n\n if ($form->isValid($_POST)) {\n $productModel->edit($form->getValues());\n\t \t $this->_helper->FlashMessenger('Product item edited successfully');\n $this->_redirect($this->view->url(array(\n 'module' => 'default',\n 'controller' => 'product',\n 'action' => 'viewdetails',\n 'product_id' => $productId,\n ), null, false));\n } else {\n $form->populate($_POST);\n $this->view->form = $form;\n }\n\n } else {\n\t $this->view->form = $form;\n }\n\n }", "public function edit(Product $product)\n {\n $categories = Category::all();\n $sizes = Sizechart::all();\n return \\view('products.edit', ['categories' => $categories, 'sizes' => $sizes, 'product' => $product]);\n }", "public function edit(Product $product)\n {\n if ($product->source->is_main) {\n abort(404);\n }\n $stores = auth()->user()->competitors;\n $categories = auth()->user()->categories;\n return view('products.edit', compact('product', 'stores', 'categories'));\n }", "public function edit(Product $product)\n {\n $p = Product::where('id', $request->id)->first();\n return response()->json($p, 200);\n }", "public function edit(Product $product)\n {\n $categories = Category::orderBy('id', 'asc')->lists('name', 'id');\n $wineries = Winery::orderBy('id', 'asc')->lists('name', 'id');\n $varietals = Varietal::orderBy('id', 'asc')->lists('name', 'id');\n\n return view('admin.product.edit', compact('product', 'categories', 'wineries', 'varietals')); \n }", "public function edit(StoreProduct $storeProduct)\n {\n //\n }", "public function edit($id)\n {\n Gate::authorize('haveaccess');\n\n return inertia('Product/Edit', [\n 'product' => self::findProduct($id)\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\t{\n\t\treturn view('product.edit', compact('product'));\n\t}", "public function postEdit(){\n return view(\"admin.product.edit\" );\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Product $product)\n {\n return response()->json([\n 'product' => $product\n ],200);\n }", "public function edit($id){\n \t$product = Product::find($id);\n \treturn view('admin.products.edit',compact('product'));\n\n }", "public function edit(Product $product)\n {\n /* Product Edit form */\n if(auth()->user()->can('edit_product')){\n\n $data['subCategories'] = SubCategory::get(['id','name']);\n $data['companies'] = Company::get(['id','name']);\n return view('admin.product.edit', $data, compact('product'));\n }\n abort(403);\n }", "public function edit(Product $product)\n {\n $categories = Category::all();\n $brands = Brand::all();\n return view('admins.products.edit', compact('categories', 'brands', 'product'));\n }", "public function edit(Products $product)\n {\n //dd($product);\n //return Products::find($id);\n return view('products.edit')->with('product',$product);\n }", "public function editProduct($id)\n {\n $product = Product::find($id);\n return view('admin.product.edit-product',compact('product')); \n }", "public function edit($id)\n {\n //\n $product = Product::find($id);\n return view('admin.superadmin.products.product_edit', compact('product'));\n }", "public function edit(Product $product)\n {\n $categories = Category::all();\n $brands = Brand::all();\n $tags = Tag::all();\n return view('admin.products.edit',compact('product','categories','brands','tags'));\n }", "public function edit($id){\n $product = Products::find($id);\n return view('partners.productEdit', compact('product'));\n }", "public function getEditProduct($id)\n {\n $data = Product::find($id);\n return view('products.editservice')->with('data',$data);\n }", "public function edit(Product $product)\n {\n\n\n return view('admin.product.edit', compact( 'product'));\n }", "public function edit($product)\n {\n $response = Http::get($_SERVER['HTTP_HOST'] . '/api/products/' . $product);\n //transform api data in an object\n $responseObject = $response->object();\n //verify api response\n if($responseObject == []){\n return redirect()->route('products.index')\n ->with('error', 'Something not ideal might be happening.');\n }\n $product = $responseObject->data;\n return view('admin.products.update', compact('product'));\n }", "public function edit($product_id)\n {\n $zone = Zone::all();\n $manufacturer = Manufacturer::all();\n $calculation_unit = CalculationUnit::all();\n $item_group = ItemGroup::all();\n $quality = Quality::all();\n return view('content.product.product_edit',compact('zone','manufacturer','calculation_unit','item_group','quality','product_id'));\n }", "public function edit(Product $product)\n {\n $categories = Category::all();\n $sub_categories = Subcategory::all();\n $brands = Brand::all();\n return view('admin.products.edit')\n ->with('product', $product)\n ->with('categories', $categories)\n ->with('sub_categories', $sub_categories)\n ->with('brands', $brands);\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($product_id)\n {\n $getAdminId = Session::get('admin_id');\n if($getAdminId != NULL){\n $getProductId = Product::findOrFail($product_id);\n return view('Admin.Product.update',compact('getProductId'));\n }else{\n return Redirect()->Route('LOGINADMIN');\n }\n }", "public function edit($id)\n {\n $product = Products::find($id);\n return view('Backend.pages.product.editproduct')->with('product', $product);\n\n }", "public function edit(Product $product)\n {\n $data['title_page'] = 'Edit Produk';\n $data['product'] = $product;\n $data['categories'] = Category::where('pc_status', false)->get();\n $data['measurements'] = Measurement::where('pm_delete_at', NULL)->get();\n $data['img'] = $this->getProductImage($data['product']['pp_token'], $data['product']['pp_token_backup']);\n $data['code_page'] = 'editProduct';\n return view('backup-dashboard.update-product')->with($data);\n }", "public function edit(Product $product)\n {\n return view('product.edit');\n }", "public function edit(Product $product)\n {\n $metodo = 'editar';\n $categories = Category::orderBy('name', 'ASC')->get();\n return view('admin.products.product',compact('metodo','product','categories')); //formulario\n }", "public function edit(Product $product)\n {\n //查询供应商列表\n $supplier_list = Supplier::all(Supplier::ID,Supplier::NAME)->toArray();\n $list = [];\n foreach ($supplier_list as $item) {\n $tmp['id'] = $item[Supplier::ID];\n $tmp['text'] = $item[Supplier::NAME];\n $list[] = $tmp;\n }\n $data = $product->toArray();\n $data['list'] = $list;\n return view('homework2.edit_product', $data);\n }", "public function edit(Product $product)\n {\n $categories = Category::all();\n //use this function to have a view showing the details of the item in a form. (edit.blade.php)\n //create the form in edit.blade.ph\n return view('products.edit', compact(\"product\", \"categories\"));\n }", "public function edit(ProductRequest $productRequest)\n {\n //\n }", "public function edit($id)\n {\n $product = Product::find($id);\n // var_dump($data);\n // return;\n \n return view('admin.products.edit')->with('product', $product);\n }", "public function edit(Product $product) {\n\n\t\t$return['products'] = $product;\n\t\treturn view('/mailer/editform', $return);\n\t}", "public function edit($id)\n {\n $product = Product::find($id);\n return view('admin.products.edit',compact('product'));\n }", "public function edit(ProductReview $productReview)\n {\n //\n }", "public function edit(ProductReview $productReview)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n return view('admin.edit',['brands'=>Brand::all(), 'categories'=>Category::all(), 'product'=>$product]);\n }", "function product( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $ret = new eZProduct( $this->ProductID );\n \n return $ret;\n }" ]
[ "0.79136133", "0.78111327", "0.7717192", "0.77160114", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7696516", "0.7690677", "0.76865035", "0.7646167", "0.76441115", "0.76441115", "0.76441115", "0.7571778", "0.74859715", "0.74505085", "0.7435976", "0.73929024", "0.73346853", "0.73315346", "0.7299311", "0.7286213", "0.72477543", "0.7180365", "0.7175092", "0.71712303", "0.7163474", "0.715159", "0.7146989", "0.71402794", "0.7121381", "0.71196157", "0.7109021", "0.7101359", "0.7099132", "0.70982367", "0.70899594", "0.70865583", "0.70834875", "0.7076949", "0.7067818", "0.7061619", "0.70593995", "0.7057733", "0.70554054", "0.7054899", "0.7049992", "0.7049937", "0.70380044", "0.70157033", "0.70017886", "0.7000858", "0.6997794", "0.6996659", "0.69828385", "0.6982465", "0.69761074", "0.69700986", "0.696045", "0.6949588", "0.69449", "0.6935511", "0.6933803", "0.69319063", "0.69292355", "0.69292355", "0.6923175", "0.6923093" ]
0.0
-1
Update the Product in storage.
public function updateProduct($id, $request) { $data = [ 'title' => $request->title, 'sku' => $request->sku, 'warehouses_id' => $request->warehouse_id, 'description' => $request->description ]; $item = Products::findOrFail($id); $item->update($data); return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateProduct(Product $product);", "public function updated(Product $producto)\n {\n\n }", "public function update(ProductRequest $request, Product $product)\n {\n $unit = unit::find($request->unit_id);\n $product->name=$request->name;\n $product->stock_alert=$request->stock_alert * $unit->value;\n $product->category_id=$request->category_id;\n $product->type_id=$request->type_id;\n $product->brand_id=$request->brand_id;\n $product->unit_id=$request->unit_id;\n $product->description=$request->description;\n $product->warrenty_id=$request->warrenty_id;\n $product->tax=$request->tax;\n $product->tax_type_id=$request->tax_type_id;\n $product->warrenty_id=$request->warrenty_id;\n \n $product->is_fixed_price = $request->is_fixed_price;\n $product->price_per_unit= $this->calPricePerUnit($request->price,$request->unit_id);\n $product->save();\n \n $this->onlineSync('Product','update',$product->id);\n return redirect(route('products.index'))->withSuccess([\"Product Updated\"]);\n }", "public function update(Request $request, Product $product)\n {\n $product->name = $request->name;\n $product->price = $request->price;\n $product->stores()->detach();\n $product->stores()->attach($request->store);\n $product->save();\n\n return redirect('admin/products');\n }", "public function update(EditProductRequest $request, Product $product)\n {\n\n $img1 = $product->img1;\n $img2 = $product->img2;\n $img3 = $product->img3;\n $img4 = $product->img4;\n\n if ($request->image_one){ // If image one is provided by the user\n Storage::delete($img1);\n $image1 = $request->image_one->store('products');\n } else{\n $image1 = $img1;\n }\n\n\n if ($request->image_two){ // If image two is provided by the user\n Storage::delete($img2);\n $image2 = $request->image_two->store('products');\n } else{\n $image2 = $img2;\n }\n\n\n\n if ($request->image_three){ // If image three is provided by the user\n Storage::delete($img3);\n $image3 = $request->image_three->store('products');\n } else{\n $image3 = $img3;\n }\n\n\n\n if ($request->image_four){ // If image four is provided by the user\n Storage::delete($img4);\n $image4 = $request->image_four->store('products');\n } else{\n $image4 = $img4;\n }\n\n //Update the record in the database\n\n $product->update([\n\n 'name' => $request->name,\n 'price' => $request->price,\n 'category' => $request->category,\n 'img1' => $image1,\n 'img2' => $image2,\n 'img3' => $image3,\n 'img4' => $image4,\n 'description' => $request->description\n\n ]);\n\n Session::flash('success', 'Product updated successfully');\n return redirect(route('product.index'));\n\n }", "public function update(Request $request, Product $product)\n {\n\n $request->validate([\n 'name' => 'required|max:255',\n 'sku' => 'required',\n 'price' => 'required|regex:/^\\d+(\\.\\d{1,2})?$/',\n 'special_price' => 'regex:/^\\d+(\\.\\d{1,2})?$/',\n 'quantity' => 'required|numeric',\n ]);\n \n $product->update([\n\n 'name' => $request->name,\n 'sku' => $request->sku,\n 'description' => $request->description,\n 'short_description' => $request->short_description,\n 'quantity' => $request->quantity,\n 'weight' => $request->has('weight') ? $request->weight : 0 ,\n 'price' => $request->has('price') ? $request->price : 0 ,\n 'special_price' => $request->special_price ,\n 'status' => $request->has('status') ,\n 'featured' => $request->has('featured') ,\n 'brand_id' => $request->brand_id,\n 'tag_id' => $request->tag_id\n\n ]);\n\n if($request->has('categories'))\n {\n $product->categories()->sync($request->get('categories'));\n }\n\n\n\n // if($request->hasFile('thumbs'))\n // {\n // foreach ($request->file('thumbs') as $file) \n // {\n // $product->addMedia($file)->toMediaCollection('thumb');\n\n // }\n // }\n\n // if($request->hasFile('cover'))\n // {\n // $product->removeCover();\n // $product->addCover($request->file('cover'));\n // }\n\n return redirect()->route('admin.products.index')->with( 'message','Product Update Successfully');\n\n }", "public function updateProduct(request $request)\n { \n $data = $request->all();\n if(!empty($data['store_id']))\n {\n $storeId = $data['store_id'];\n $item = (object)$data;\n $checkProduct = StoreProduct::where(['product_id' => $item->id,'store_id' => $storeId])->first();\n\n $productData = [\n \"product_id\" => $item->id,\n \"store_id\" => $storeId,\n \"title\" => $item->title,\n \"vendor\" => $item->vendor,\n \"product_type\" => $item->product_type,\n \"handle\" => $item->handle,\n \"tags\" => $item->tags,\n \"published_scope\" => $item->published_scope,\n ];\n if($checkProduct) \n {\n StoreProduct::where(['product_id'=>$item->id])->update($productData);\n $storeProductsId = $checkProduct->id;\n }\n else\n {\n $responseModel = StoreProduct::create($productData);\n $storeProductsId = $responseModel->id;\n } \n \n /*\n * Update product images\n */ \n foreach ($item->variants as $items) \n { \n $items = (object)$items;\n\n $poductVariantData = [ \n \"store_products_id\" => $storeProductsId,\n \"store_id\" => $storeId,\n \"variant_id\" => $items->id,\n \"product_id\" => $items->product_id,\n \"title\" => $items->title,\n \"price\" => $items->price,\n \"compare_at_price\" => $items->compare_at_price,\n \"sku\" => $items->sku,\n \"position\" => $items->position,\n \"fulfillment_service\" => $items->fulfillment_service,\n \"inventory_management\"=> $items->inventory_management,\n \"inventory_quantity\" => $items->inventory_quantity,\n \"option1\" => $items->option1,\n \"option2\" => $items->option2,\n \"option3\" => $items->option3,\n \"image_id\" => $items->image_id,\n ];\n\n $checkVariant = StoreProductVariants::where(['product_id' => $item->id,'variant_id' => $items->id])->first();\n\n if($checkProduct) \n {\n StoreProductVariants::where(['variant_id'=>$items->id])->update($poductVariantData);\n }\n else\n {\n StoreProductVariants::create($poductVariantData);\n } \n }\n\n /*\n * Update product images\n */ \n foreach ($item->images as $itemimg) \n { \n $itemimg = (object)$itemimg;\n $post_data_image = [\n \"store_products_id\" => $storeProductsId,\n \"store_id\" => $storeId,\n \"image_id\" => $itemimg->id,\n \"product_id\" => $itemimg->product_id,\n \"src\" => $itemimg->src,\n \"alt\" => $itemimg->alt,\n \"position\" => $itemimg->position,\n ];\n\n $checkVariant = StoreProductImages::where(['product_id' => $item->id,'image_id' => $items->id])->first();\n\n if($checkProduct) \n {\n StoreProductImages::where(['image_id'=>$items->id])->update($post_data_image);\n }\n else\n {\n StoreProductImages::create($post_data_image);\n } \n }\n return response()->json(['status' =>true, 'message' =>'Data import','data' =>\"got product\"]); \n }\n else\n {\n return response()->json(['status' =>true, 'message' =>'Data not found','data'=>[]]);\n }\n }", "public function update()\n {\n // store the id to a variable\n $id = request()->product_id;\n // If new photo is uploaded then unlink old photo from database and store new photo info\n if (request()->hasFile('product_thumbnail_photo')) {\n request()->validate([\n 'product_thumbnail_photo' => 'image'\n ]);\n unlink(base_path('public/uploads/product_photos/' . Product::find($id)->product_thumbnail_photo));\n $uploaded_img = request()->file('product_thumbnail_photo'); // Get the file from user\n $img_name = $id . '.' . $uploaded_img->getClientOriginalExtension(); // rename image to id+file extension\n $img_url = base_path('public/uploads/product_photos/' . $img_name); // image url with path to store\n Image::make($uploaded_img)->resize(600, 622)->save($img_url); // save the new image with new name\n Product::findOrFail($id)->update([\n 'product_thumbnail_photo' => $img_name\n ]);\n }\n // Or just update other information\n Product::findOrFail($id)->update([\n 'product_price' => request()->product_price,\n 'product_quantity' => request()->product_quantity,\n 'product_short_description' => request()->product_short_description,\n 'product_long_description' => request()->product_long_description\n ]);\n\n return redirect('/add/products')->with('update_status', 'Product Updated Successfully');\n }", "public function update(Request $request, Product $product)\n {\n $this->allowedAdminAction();\n $rules = [\n 'name' => 'required|unique:products,name,'.$product->id,\n 'price' => 'numeric',\n 'stock' => 'integer'\n ];\n\n $this->validate($request, $rules);\n\n $product->fill($request->only([\n 'name',\n 'description',\n 'active',\n ]));\n \n if ($product->isClean()){\n return $this->errorResponse(\"You should specified at least one different value for the record\", 422);\n }\n\n $product->save();\n\n if($request->has(\"price\")){\n $product->price()->where('active', 1)->update(['active' => 0]);\n $product->price()->create([\n \"unit_price\" => $request->price\n ]);\n }\n\n if($request->has(\"stock\")){\n $product->inventory()->where('active', 1)->update(['active' => 0]);\n $product->inventory()->create([\n \"quantity\" => $request->stock,\n \"stock\" => $request->stock\n ]);\n }\n\n $product = Product::where(\"id\", $product->id)->withCount('likes')->with([\"currentInventory\", \"currentPrice\"])->first();\n return $this->showOne($product);\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 }", "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, Product $product)\n {\n try {\n\n $product->update([\n 'user_id' => Auth::id(),\n 'category_id' => $request->category_id,\n 'name' => $request->name,\n 'short_text' => $request->short_text,\n 'description' => $request->description,\n ]);\n\n if (isset($request->img)) {\n if ($product->img){\n File::delete($product->img);\n }\n $product->img = file_store($request->img, 'assets/uploads/photos/product_img/', 'photo_');\n $product->save();\n }\n\n if (!isset($request->old_property_id) and count($product->properties)){\n $product->properties()->delete();\n }\n\n if (isset($request->property_value)) {\n foreach ($request->property_value as $key => $property_value) {\n if (isset($request->old_property_id[$key])){\n $pp = ProductProperty::findOrFail($request->old_property_id[$key]);\n if ($property_value){\n $pp->update([\n 'property_id' => $request->property_id[$key],\n 'value' => $property_value\n ]);\n }else{\n $pp->delete();\n }\n }else {\n if ($property_value) {\n $pp = ProductProperty::create([\n 'product_id' => $product->id,\n 'property_id' => $request->property_id[$key],\n 'value' => $property_value\n ]);\n }\n }\n }\n }\n\n if (isset($request->photo)) {\n foreach ($request->photo as $key => $photo) {\n if (isset($request->photo[$key])) {\n if (isset($request->photo_id[$key])) {\n $ph = Photo::findOrFail($request->photo_id[$key]);\n if ($ph->path){\n File::delete($ph->path);\n }\n $ph->path = file_store($photo, 'assets/uploads/photos/product_photos/', 'photo_');\n $ph->save();\n\n } else {\n if (isset($photo) and $photo) {\n $ph = new Photo();\n $ph->path = file_store($photo, 'assets/uploads/photos/product_photos/', 'photo_');\n $product->photo()->save($ph);\n }\n }\n }\n }\n }\n\n return redirect()->route('product.index')->with('flash_message', 'با موفقیت انجام شد');\n }catch (\\Exception $e){\n return redirect()->back()->withInput()->with('err_message', 'خطایی رخ داده است، لطفا مجددا تلاش نمایید');\n }\n }", "public function update(Request $request, Product $product)\n {\n \n $request->validate([\n 'name' => 'required',\n 'description' => 'required',\n 'cat_id' => 'required',\n 'r_price' => 'required',\n 'size' => 'required',\n ]);\n\n \n $product->name = $request->name;\n $product->slug = Str::slug($request->name);\n $product->description = $request->description;\n $product->cat_id = $request->cat_id;\n $product->regular_price = $request->r_price;\n $product->offer_price = $request->o_price;\n $product->size = $request->size;\n $product->is_packaged = $request->package;\n $product->is_featured = $request->featured;\n $product->status = $request->status;\n $product->save();\n\n $allImage = [ 0 => $request->main_img, 1 => $request->sub_img_one, 2 => $request->sub_img_two];\n \n foreach($allImage as $key => $image){\n if($image){\n \n $existingImage = $product->images[$key];\n\n if(File::exists(public_path('images/product/'.$existingImage->image))){\n File::delete(public_path('images/product/'.$existingImage->image));\n }\n $name = time().Str::random(12).\".png\";\n Image::make($image)->encode('png', 100)->save(public_path('images/product/'.$name));\n \n $existingImage->image = $name;\n \n $existingImage->save();\n }\n }\n $request->session()->flash('update','Product updated');\n return redirect()->route('product.show');\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n $request->validate([\n 'title' => 'required|string',\n 'description' => 'required|string',\n// 'product_image' => 'sometimes|array|min:1',\n// 'product_image.*.file' => 'sometimes|string|min:1',\n 'product_variant' => 'required|array|min:1',\n 'product_variant.*.tags' => 'required|array|min:1',\n 'product_variant_prices' => 'required|array|min:1',\n ]);\n\n DB::beginTransaction();\n try {\n $product->update([\n 'title' => $request->title,\n 'description' => $request->description,\n ]);\n\n /*+++++++++++++++++++++++ Product Image Insert Into DB +++++++++++++++++++++++*/\n if (count($request->product_image) > 0){\n $product_images = [];\n foreach ($request->product_image as $image) {\n Storage::move(\"products/tmp/\" . $image['folder'] . \"/\" . $image['file'], \"products/$product->id/\" . $image['file']);\n $product_images[] = [\n 'product_id' => $product->id,\n 'file_path' => \"storage/products/$product->id/\" . $image['file'],\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ];\n Storage::deleteDirectory(\"products/tmp/\" . $image['folder']);\n }\n ProductImage::insert($product_images);\n }\n\n /*+++++++++++++++++++++++ Product Variant Insert Into DB +++++++++++++++++++++++*/\n if (count($request->product_variant) > 0){\n ProductVariant::where('product_id', $product->id)->delete();\n $product_variants = [];\n foreach ($request->product_variant as $variant) {\n foreach ($variant['tags'] as $tag) {\n $prodVariant = ProductVariant::create([\n 'variant' => $tag,\n 'variant_id' => $variant['option'],\n 'product_id' => $product->id\n ]);\n\n $product_variants[] = ['product_variant' => $prodVariant->id, 'variant' => $prodVariant->variant];\n }\n }\n }\n\n /*+++++++++++++++++++++++ Product Variant Price Insert Into DB +++++++++++++++++++++++*/\n if (count($request->product_variant_prices) > 0) {\n ProductVariantPrice::where('product_id', $product->id)->delete();\n $product_variant_prices = [];\n foreach ($request->product_variant_prices as $price) {\n $variants = explode('/', $price['title']);\n\n $product_variant_prices[] = [\n 'product_variant_one' => collect($product_variants)->where('variant', $variants[0])->first()['product_variant'],\n 'product_variant_two' => isset($variants[1]) && !empty($variants[1]) ? collect($product_variants)->where('variant', $variants[1])->first()['product_variant'] : null,\n 'product_variant_three' => isset($variants[2]) && !empty($variants[2]) ? collect($product_variants)->where('variant', $variants[2])->first()['product_variant'] : null,\n 'price' => $price['price'],\n 'stock' => $price['stock'],\n 'product_id' => $product->id,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ];\n }\n ProductVariantPrice::insert($product_variant_prices);\n }\n\n DB::commit();\n return response()->json(['message' => 'Successfully updated.'], 200);\n } catch (\\Exception $e) {\n DB::rollback();\n return response()->json(['error' => true, 'message' => $e->getMessage()], 500);\n }\n }", "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, 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 updated(Product $product)\n {\n if ($product->forceReindex) {\n return;\n }\n\n $product->load('property_values', 'variants.product_property_values', 'variants.property_values');\n\n $productEntry = new ProductEntry($product);\n if ($product->inventory_management_method === 'single' || $product->variants->count() > 0) {\n $this->index->update(ProductEntry::INDEX, $product->id, $productEntry);\n } else {\n $this->index->delete(ProductEntry::INDEX, $product->id, $productEntry);\n }\n\n if ($product->inventory_management_method === 'single') {\n $this->handleInventoryManagementMethodChange($product);\n $this->index->update(\n VariantEntry::INDEX,\n $this->ghostId($product),\n $this->ghostVariant($product, $productEntry)\n );\n } else {\n $this->index->delete(VariantEntry::INDEX, $this->ghostId($product));\n\n foreach ($product->variants as $variant) {\n $this->index->update(VariantEntry::INDEX, $variant->id, new VariantEntry($variant));\n }\n }\n }", "public function update(Request $request, $id) {\n $product = Product::with('media')->find($id);\n $product->name = $request->name;\n $product->product_code = $request->product_code;\n $product->description = $request->description;\n $product->short_description = $request->short_description;\n $product->price = $request->price;\n $product->origin = $request->origin;\n $product->discount_amount = $request->discount_amount;\n $product->discount_percentage = $request->discount_percentage;\n $product->min_quantity = $request->min_quantity;\n $product->is_available = $request->is_available;\n $product->producttype = $request->producttype;\n \n $product->save();\n\n $new_media = Media::findMany($request->get('files'));\n\n //remove old media\n $remove_media_ids = $product->media->diff($new_media)->pluck('id');\n if ($remove_media_ids->toArray()) {\n Media::destroy($remove_media_ids);\n }\n\n //attach new media\n $product->media()->saveMany($new_media);\n\n\n //attach Category\n if ($request->has('category')) {\n $categories = Category::findMany(array_values($request->get('category')));\n// $categories = $request->get('category');\n $product->categories()->sync($categories);\n }\n\n\n //attach attribute\n //attach attribute\n ProductAttr::where('product_id', $product->id)\n /* ->whereIn('option_id', $request->get('attributes')) */\n ->delete();\n\n $attributes = AttributeOption::findMany($request->get('attributes'));\n\n $products_eav = [];\n foreach ($attributes as $attribute) {\n $item = [];\n $item['attribute_id'] = $attribute->attribute_id;\n $item['option_id'] = $attribute->id;\n $item['product_id'] = $product->id;\n $item['value'] = null;\n $products_eav[] = $item;\n }\n ProductAttr::insert($products_eav);\n\n return $product;\n }", "public function update(Request $request, Product $product)\n {\n // validate input\n $this->validate($request, [\n 'name' => 'required|min:5|max:255',\n 'productType' => 'required|exists:product_types,id',\n 'stock' => 'required|integer|min:1',\n 'price' => 'required|integer|min:1',\n 'imgupload' => 'file|mimes:jpeg,png,gif',\n 'description' => 'required|min:15',\n ]);\n \n $productType = ProductType::find($request->productType);\n\n // if request has image\n if($request->hasFile('imgupload')){\n // generate file name\n $extension = $request->file('imgupload')->extension();\n $imgname = date('dmYHis') . '_' . $request->name . '.' . $extension;\n\n // delete product image from storage, if image exists\n if($product->image != null) {\n Storage::delete('public/images/' . $product->productType->name. '/' .$product->image);\n }\n \n // store new image\n Storage::putFileAs('public/images/'.strtolower($productType->name), $request->file('imgupload'), $imgname);\n } else {\n // if delete current image\n if($product->image != null && $request->deleteImage) {\n Storage::delete('public/images/' . $product->productType->name. '/' .$product->image);\n $imgname = null;\n }\n\n // no changes otherwise\n $imgname = $product->image;\n }\n\n // update model\n $product->name = $request->name;\n $product->image = $imgname;\n $product->stock = $request->stock;\n $product->price = $request->price;\n $product->description = $request->description;\n $product->save();\n\n // return success message\n return redirect()->back()->withSuccess(\"Product \" . $request->name . \" has been successfully updated!\");\n }", "public function update(ProductRequest $request, Product $product)\n {\n// $data = $request->all();\n// foreach ($checkboxes as $checkbox) {\n// if(!isset($data[$checkbox]) {\n// $data[$checkbox] = 0;\n// }\n// }\n\n\n $data = $request->all();\n if(!isset($data['featured'])) {\n $data['featured'] = 0;\n }\n if(!isset($data['recommended'])) {\n $data['recommended'] = 0;\n }\n\n $tagsIDs = $this->getTagsIDs($data['tags']);\n unset($data['tags']);\n $product->tags()->sync($tagsIDs);\n $product->update($data);\n\n return redirect()->route('products');\n\n }", "public function update(Request $request, Product $product)\n {\n $request->validate([\n 'name' => 'required|string|max:255',\n 'file' => 'image',\n 'ingredients' => 'max:255',\n 'description' => 'max:255',\n 'category_id' => 'required|exists:categories,id',\n 'available' => 'required',\n 'favorite' => 'required',\n 'customizable' => 'required',\n 'price' => 'required|regex:/^\\d+(\\.\\d{1,2})?$/'\n ]);\n\n $only = collect(['name', 'ingredients', 'description', 'category_id', 'available', 'favorite', 'price', 'customizable']);\n\n// dd($request->toArray());\n if($request->hasFile('file')) {\n// dd($request->file);\n $image = $request->file('file')->store('public/products');\n $available = ($request->available === 'true') ? true : false;\n $favorite = ($request->favorite === 'true') ? true : false;\n $customizable = ($request->customizable === 'true') ? true : false;\n $request->merge(['image' => $image, 'available' => $available, 'favorite' => $favorite, 'customizable' => $customizable]);\n $only->push('image');\n }\n// dd($request->toArray(), $only->toArray());\n $product->update($request->only($only->toArray()));\n// dd($product);\n// $products = Product::where('favorite', true)->where('available', true)->paginate();\n// return Inertia::render('Admin/Users', compact('users'))->with('success_message', 'Usuario actualizado correctamente!');\n // return redirect()->back()->with('success_message', 'Producto actualizado correctamente!');\n return redirect()->back()->with('success_message', 'Producto actualizado correctamente!');\n }", "public function update(Request $request, Product $product)\n {\n $request['slug'] = Str::slug($request['title']);\n $product->update($request->all());\n if ($request->file('files')) {\n foreach ($request->file('files') as $file) {\n $path = $file->store('products');\n StoreFiles::create([\n 'path' => $path,\n 'type' => $file->extension(),\n 'size' => $file->getSize(),\n 'product_id' => $product->id\n ]);\n }\n }\n return response()->json([\n 'status' => 201,\n 'message' => 'product updated successfully',\n 'data' => new ProductResource($product)\n ]);\n }", "public function update(Request $request, Product $product)\n {\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_product() {\n\t\t$values=array(\"product_name\"=>$_POST['product_name'],\"description\"=>$_POST['description']);\t\t\t\t\n\t\t$where =array(\"id\"=>$_POST['product_id']);\n\t\tif($this->update(\"products\",$values,$where)) {\t\t\t\n\t\t\techo true;\n\t\t}\n\t\telse\n\t\t\techo 'Error while updating';\n\t}", "public function product_update_post()\n\t\t\t\t{\n\t\t\t\t}", "public function update(){\n $this->product->id = $_POST['id'];\n $this->product->name = $_POST['name'];\n $this->product->price = $_POST['price'];\n $this->product->description = $_POST['description'];\n $this->product->category_id = $_POST['category_id'];\n\n\n\n // update the product\n if($this->product->update()){\n header(\"Refresh:2\");\n echo \"<div class=\\\"alert alert-success alert-dismissable\\\">\";\n echo \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-hidden=\\\"true\\\">&times;</button>\";\n echo \"Product was updated.\";\n echo \"</div>\";\n }\n\n // if unable to update the product, tell the user\n else{\n echo \"<div class=\\\"alert alert-danger alert-dismissable\\\">\";\n echo \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-hidden=\\\"true\\\">&times;</button>\";\n echo \"Unable to update product.\";\n echo \"</div>\";\n }\n }", "public function update(ProductRequest $request, $id)\n {\n //\n try {\n $data = $request->except('product_price', 'product_pictures');\n $product = Product::findOrFail($id);\n $product->update($data);\n\n // update product prices\n $product->productPrice()->delete();\n foreach ($request->product_prices as $price) {\n $prices[] = new ProductPrice([\n 'productid' => $product->productid,\n 'min_qty' => $price['min_qty'],\n 'max_qty' => $price['max_qty'],\n 'price' => $price['price'],\n ]);\n }\n $prices = $product->productPrice()->saveMany($prices);\n $product['product_prices'] = $prices;\n\n\n // // update product picture\n // $pictures = ProductPicture::where('productid', $product->productid)->get('filepath');\n // $this->_removePictureStorage($pictures);\n // $product->productPicture()->delete();\n\n // // Save product images\n // foreach ($request->product_pictures as $picture) {\n // $picture = new ProductPicture([\n // 'productid' => $id,\n // 'filepath' => $picture->store('assets/product', 'public'),\n // ]);\n // $pictures[] = $product->productPicture()->save($picture);\n // }\n // $product['product_pictures'] = $pictures;\n\n return ResponseFormatter::success($product, 'Success update data');\n } catch (ModelNotFoundException $e) {\n echo $e;\n return ResponseFormatter::error(null, 'Failed update data');\n }\n }", "public function update(Request $request, $id)\n {\n \\Validator::make($request->all(), [\n 'nama_product' => 'required', 'string', 'max:255', 'min:2',\n 'deskripsi' => 'required', 'string', 'max:255', 'min:8',\n 'stok' => 'required', 'max:1000',\n 'images' => 'file|image|mimes:jpeg,png,jpg',\n 'price' => 'required', 'max:20',\n ])->validate();\n \n $edit_product = Product::findOrFail($id);\n $edit_product->nama_product = $request->get('nama_product');\n $edit_product->deskripsi = $request->get('deskripsi');\n $edit_product->stok = $request->get('stok');\n if($request->file('images')){\n if($edit_product->images && file_exists(storage_path('app/public/' . $edit_product->images))){\n Storage::delete('public/'.$edit_product->images);\n $file = $request->file('images')->store('product_images', 'public');\n $edit_product->images = $file;\n }else{\n if($request->file('images')){\n $file = $request->file('images')->store('product_images', 'public');\n $edit_product->images = $file;\n }\n }\n }\n $edit_product->price = $request->get('price');\n \n if($request->get('status')){\n $edit_product->status = $request->get('status');\n }else{\n $edit_product->status = \"publish\";\n }\n\n \\Auth::user()->productId()->save($edit_product);\n\n return redirect()->route('manage-product.index')->with('status', 'Update Product Success!!');\n }", "public function update(UpdateProduct $request, Product $product)\n {\n $data = $request->only('pp_title', 'pp_basic_price', 'pp_selling_price', 'pp_qty', 'pp_weight', 'pp_description', 'pp_status', 'pp_email', 'pp_phone');\n $product->update($data);\n if (isset($request->pp_link)) {\n $gambar = new ImgProduct;\n $gambar['pip_token'] = $product['pp_token'];\n $gambar['pip_token_backup'] = $product['pp_token_backup'];\n $desc = $product['pp_token'] . '-' . $product['pp_token_backup'];\n $file = $request->file('pp_link');\n $nama_file = time() . \"_\" . $file->getClientOriginalName();\n\n // isi dengan nama folder tempat kemana file diupload\n $path = 'customAuth/img/product/' . $desc . '/';\n if (!is_dir('customAuth/img/product/' . $desc)) {\n mkdir('./customAuth/img/product/' . $desc, 0777, TRUE);\n }\n $file->move($path, $nama_file);\n $gambar['pip_img_path'] = 'img/product/' . $desc . '/' . $nama_file;\n $gambar->save();\n }\n return redirect()->route('product.product.index')->with(['message' => 'Success Edit Product']);\n }", "public function update(Request $request, Product $product)\n {\n\n }", "public function update(Product $product, ProductStoreOrUpdateRequest $request)\n {\n $this->products->update($product, $request->all());\n return redirect()->route(env('APP_BACKEND_PREFIX').'.products.index')->withFlashSuccess('更新成功');\n }", "public function testUpdate()\n\t{\n\t\t// Update just updates the given fields, let's the rest unchanged.\n\t\t// Use Replace to replace all fields.\n\t\t$updateProduct = [\n\t\t\t'description' => 'This is a product description.',\n\t\t\t'price' => 1150.00\n\t\t];\n\n\t\t$service = $this->getService();\n\n\t\t// Update product\n\t\t$this->mockResponseFromFile('products.update.success');\n\t\t$response = $service->update()->pin('AD8CCDD5F9')->area('work')->spn('MBA11')->product($updateProduct)->execute();\n\t\t$this->assertIsArray($response);\n\t\t$this->assertArrayHasKey('kind', $response);\n\t\t$this->assertArrayHasKey('link', $response);\n\t}", "public function update(Request $request, $product)\n {\n $product = Crypt::decrypt($product);\n $a = Product::findorFail($product);\n $a->name = $request->name;\n $a->category = $request->category;\n $a->reorderThreshold = $request->reorderThreshold;\n $a->save();\n session()->flash('alert-warning', 'Product Updated');\n return redirect('/product');\n }", "public function update(Request $request, $id)\n\t{\n\t\t// validate request\n\t\t$validateProduct = Validator::make($request->get('Product'), Product::$rules);\n\t\t$validationMessages = [];\n\n\t\tif ($validateProduct->fails() OR count($validationMessages) > 0) {\n\t\t\t$validationMessages = array_merge_recursive($validateProduct->messages()->toArray(), $validationMessages);\n\t\t\treturn redirect()->back()->withErrors($validationMessages)->withInput();\n\t\t}\n\n\t\t// sure execute success, if not success rollback\n\t\tDB::transaction(function () use ($request, $id) {\n\t\t\t$user = $request->user();\n\n\t\t\t// insert Product\n\t\t\t$product = Product::findOrFail($id);\n\t\t\t$product->key = $request->input('Product.key');//Common::createKeyURL($request->input('Product.title'));\n\t\t\t\n\t\t\t$product->title = $request->input('Product.title');\n\t\t\t$product->product_type_id = $request->input('Product.product_type_id');\n\t\t\t$product->province_id = $request->input('Product.province_id');\n\t\t\t$product->district_id = $request->input('Product.district_id');\n\t\t\t$product->ward_id = $request->input('Product.ward_id');\n\t\t\t$product->street_id = $request->input('Product.street_id');\n\t\t\t$product->project_id = $request->input('Product.project_id');\n\n\t\t\t$product->price_range_id = $request->input('Product.price_range_id');\n\t\t\t$product->area_range_id = $request->input('Product.area_range_id');\n\t\t\t$product->incense_type_id = $request->input('Product.incense_type_id');\n\t\t\t\n\t\t\t$product->area = $request->input('Product.area');\n\n\t\t\t$price = floatval(str_replace(',', '.', $request->input('Product.price')));\n\t\t\t$product->price = $price;\t\t\n\t\t\t\t\n\t\t\t$product->price_type_id = $request->input('Product.price_type_id');\n\t\t\t$product->total_price = $request->input('Product.total_price');\n\t\t\t$product->address = $request->input('Product.address');\n\t\t\tif($request->input('Product.expire_at') != null && $request->input('Product.expire_at') !='')\n\t\t\t{\n\t\t\t\t$expire_at = Carbon::createFromFormat('d/m/Y', $request->input('Product.expire_at'))->toDateString();\n\t\t\t\t$product->expire_at = $expire_at;\n\t\t\t}\n\t\t\t$product->summary = $request->input('Product.summary');\n\n\t\t\t$product->description = $request->input('Product.description');\n\t\t\t$product->home_direction = $request->input('Product.home_direction');\n\t\t\t$product->rooms = $request->input('Product.rooms');\n\t\t\t$product->toilets = $request->input('Product.toilets');\n\t\t\t$product->interior = $request->input('Product.interior');\n\t\t\t$product->main_image = $request->input('Product.main_image');\n\n\t\t\t$product->br_name = $request->input('Product.br_name');\n\t\t\t$product->br_address = $request->input('Product.br_address');\n\t\t\t$product->br_phone = $request->input('Product.br_phone');\n\t\t\t$product->br_email = $request->input('Product.br_email');\n\t\t\t\n\t\t\t$product->map_latitude = $request->input('Product.map_latitude');\n\t\t\t$product->map_longitude = $request->input('Product.map_longitude');\n\t\t\t$product->meta_description = $request->input('Product.meta_description');\n\t\t\t$product->meta_keywords = $request->input('Product.meta_keywords');\n\n\t\t\t$product->priority = $request->input('Product.priority');\n\t\t\t$product->active = $request->input('Product.active');\n\t\t\t$product->user_id = $user->id;\n\t\t\t$product->created_by = $user->name;\n\t\t\t$product->updated_by = $user->name;\n\t\t\t$product->save();\n\n\t\t\t// save attachments\n\t\t\t// only insert or delete, not update\n\t\t\tif ($request->input('Product.attachments') != \"\") {\n\t\t\t\t$currentAttachments = $product->attachments->lists('id');\n\t\t\t\t$requestAttachments = explode(',', $request->input('Product.attachments'));\n\t\t\t\t$attachments = [];\n\t\t\t\t$keepAttachments = [];\n\t\t\t\tforeach ($requestAttachments as $key => $value) {\n\t\t\t\t\tif (strpos($value, '|') === false) {\n\t\t\t\t\t\tarray_push($attachments, new Attachment([\n\t\t\t\t\t\t\t'entry_id' => $product->id,\n\t\t\t\t\t\t\t'table_name' => 'products',\n\t\t\t\t\t\t\t'path' => $value,\n\t\t\t\t\t\t\t'priority' => 0,\n\t\t\t\t\t\t\t'is_publish' => 1\n\t\t\t\t\t\t]));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$attachmentId = explode('|', $value)[0];\n\t\t\t\t\t\tarray_push($keepAttachments, $attachmentId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count($attachments) > 0) {\n\t\t\t\t\t$product->attachments()->saveMany($attachments);\n\t\t\t\t}\n\t\t\t\t// delete attachments\n\t\t\t\tforeach ($currentAttachments as $key => $value) {\n\t\t\t\t\tif (!in_array($value, $keepAttachments)) {\n\t\t\t\t\t\tAttachment::findOrFail($value)->delete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$product->save();\n\n\t\t});\n\n\t\treturn redirect()->route('admin.products.index');\n\t}", "public function update(SaveProductRequest $request, Product $product)\n {\n\n $product = Product::find($product->id);\n \n //$product->fill($request->all());\n\n if ($request->get('name') == null) {\n $product->name = $product->name;\n } else {\n $product->name = $request->get('name');\n }\n\n \n if ($request->get('description') == null) {\n $product->description = $product->description;\n } else {\n $product->description = $request->get('description');\n }\n\n \n if ($request->get('size') == null) {\n $product->size = $product->size;\n } else {\n $product->size = $request->get('size');\n }\n\n \n if ($request->get('price') == null) {\n $product->price = $product->price;\n } else {\n $product->price = $request->get('price');\n }\n\n if ($request->file('image') == null) {\n \n } else {\n $product->image = \\Request::file('image');\n }\n\n if ($request->file('description_file') == null) {\n \n } else {\n $product->description_file = \\Request::file('description_file');\n }\n\n if ($request->get('visible') == null) {\n $product->visible = 1;\n } else {\n $product->visible = $request->get('visible');\n }\n\n if ($request->get('category_id') == null) {\n $product->category_id = $product->category_id;\n } else {\n $product->category_id = $request->get('category_id');\n }\n\n if ($request->get('varietal_id') == null) {\n $product->varietal_id = $product->varietal_id;\n } else {\n $product->varietal_id = $request->get('varietal_id');\n }\n\n \n if ($request->get('winery_id') == null) {\n $product->winery_id = $product->winery_id;\n } else {\n $product->winery_id = $request->get('winery_id');\n }\n\n/*\n $request->get('name') == null ? $product->name = $product->name : $product->name =$request->get('name');\n $description = $request->get('description') == null ? $product->description = $product->description : $product->description = $request->get('description');\n $request->get('size') == null ? $product->size = $product->size : $product->size = $request->get('size');\n $request->get('price') == null ? $product->price = $product->price : $product->price = $request->get('price');\n $request->file('image') == null ? $product->image = $product->image : $product->image = \\Request::file('image');\n $request->file('description_file') == null ? $product->description_file = $product->description_file : $product->description_file = \\Request::file('description_file');\n $request->get('visible') == null ? $product->visible = 1 : $product->visible = $request->get('visible');\n $request->get('category_id') == null ? $product->category_id = $product->category_id : $product->category_id = $request->get('category_id');\n $request->get('varietal_id') == null ? $product->varietal_id = $product->varietal_id : $product->varietal_id = $request->get('varietal_id');\n $request->get('winery_id') == null ? $product->winery_id = $product->winery_id : $product->winery_id = $request->get('winery_id');\n\n \n $product->name = $name;\n $product->description = $description;\n $product->size = $size;\n $product->price = $price;\n $product->image = $image;\n $product->description_file = $description_file;\n $product->visible = $visible;\n $product->category_id = $category_id;\n $product->varietal_id = $varietal_id;\n $product->winery_id = $varietal_id;\n*/\n \n\n $updated = $product->save();\n\n $message = $updated ? 'Producto actualizado correctamente' : 'El Producto NO pudo ser actualizado';\n \n return redirect()->route('admin.product.index')->with('message', $message);\n }", "public function update(Products $product)\n {\n $this->validateRequest();\n\n $product->name = request('name');\n $product->price = request('price');\n if(request()->file('img'))\n {\n $img = request()->file('img');\n $imgName = $img->getClientOriginalName();\n Image::make($img)->save(public_path('/images/uploads/products/'.$imgName));\n $product->img = $imgName;\n }\n\n $product->save();\n\n return redirect('/l2admin/products');\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\n }", "public function update(Request $request, Product $product)\n {\n //\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 function update(Request $request, Product $product)\n {\n // Recupero i dati dal form\n $dati = $request->all();\n\n //Creazione nome immagini e copia nella cartella images\n $file_image_front = time().'.'.$request->image_front->getClientOriginalName();\n $file_image_lateral = time().'.'.$request->image_lateral->getClientOriginalName();\n\n // Cancello i vecchi file dalla cartella images\n if(\\File::exists(public_path('images/'.$product->image_front))){\n \\File::delete(public_path('images/'.$product->image_front));\n }\n\n if(\\File::exists(public_path('images/'.$product->image_lateral))){\n \\File::delete(public_path('images/'.$product->image_lateral));\n }\n\n // Sposto i file nella cartella public/images\n $request->image_front->move(public_path('images'), $file_image_front);\n $request->image_lateral->move(public_path('images'), $file_image_lateral);\n\n\n $dati['image_front'] = $file_image_front;\n $dati['image_lateral'] = $file_image_lateral;\n\n // Aggiorno nel database il prodotto appena modificato\n $product->update($dati);\n\n // Redirect all' Homepage\n return redirect()->route('products.index');\n }", "public function getUpdateProductData();", "public function updateProduct(Request $request, $id)\n {\n\n //FETCHING DATA\n \t$data=array();\n $data['product_name']=$request->product_name;\n $data['product_code']=$request->product_code;\n $data['cat_id']=$request->cat_id;\n $data['sup_id']=$request->sup_id;\n $data['product_garage']=$request->product_garage;\n $data['product_route']=$request->product_route;\n $data['buy_date']=$request->buy_date;\n $data['expire_date']=$request->expire_date;\n $data['buying_price']=$request->buying_price;\n $data['selling_price']=$request->selling_price;\n\n $image=$request->product_image;\n //UPDATING EXISTING IMAGE\n if ($image) {\n $image_name = Str::random(5);\n $ext = strtolower($image->getClientOriginalExtension());\n $image_full_name = $image_name.'.'.$ext;\n $upload_path = 'public/products/';\n $image_url = $upload_path.$image_full_name;\n $success = $image->move($upload_path, $image_full_name);\n if ($success) {\n $data['product_image']=$image_url;\n $img=DB::table('products')->where('id',$id)->first();\n $image_path = $img->product_image;\n $done=unlink($image_path);\n $prod=DB::table('products')->where('id',$id)->update($data);\n if ($prod) {\n $notification=array(\n 'message' => 'PRODUCT INFORMATION UPDATED!!',\n 'alert-type' => 'info'\n );\n return Redirect()->route('all.product')->with($notification);\n }else{\n return Redirect()->back();\n }\n }\n }else{\n $oldphoto=$request->old_image;\n if ($oldphoto) {\n $data['product_image']=$oldphoto;\n $prod=DB::table('products')->where('id',$id)->update($data);\n if ($prod) {\n $notification=array(\n 'message' => 'PRODUCT INFORMATION UPDATED!!',\n 'alert-type' => 'info'\n );\n return Redirect()->route('all.product')->with($notification);\n }else{\n return Redirect()->back();\n }\n }\n }\n\n }", "public function update(Request $request, product $product)\n {\n //\n }", "public function update(Request $request, product $product)\n {\n //\n }", "public function update(Request $request, product $product)\n {\n //\n }", "public function update(UpdateProductsRequest $request, Products $product)\n {\n //return $request;\n //dd(request()->all());\n $data = request()->all();\n\n $product->name = $data['name'];\n\n $product->price = $data['price'];\n\n $product->discription = $data['discription'];\n\n //check if new image\n if($request->hasFile('image'))\n {\n //upload it\n $image = $request->image->store('products');\n\n //delete old one\n //$product->deleteimage();\n\n $data['image'] = $image;\n \n }\n //$product->save();\n //update attributes\n $product -> update($data);\n\n session()->flash('success','Product Is Updated');\n return redirect(route('products.index'));\n }", "public function update(Request $request, Product $product) //Actualizar\n {\n //\n }", "public function update(Request $request, Seller $seller, Product $product)\n {\n $rules = [\n 'name' => 'required',\n 'status' => 'in:' . Product::AVAILABLE_PRODUCT . ',' . Product::UNAVAILABLE_PRODUCT, // 'in:available,unavailable'\n 'image' => 'image',\n ];\n\n $this->validate($request,$rules);\n\n $this->checkSeller($seller, $product);\n\n $product->fill($request->intersect([ // Because we are not sure of these values, we need to use the intersect method to ignore the null or empty values.\n 'name',\n 'description',\n 'quantity'\n ]));\n\n if ($request->has('status')) {\n $product->status = $request->status;\n\n if ($product->isAvailable() && $product->categories()->count() == 0) { // By default when a product is created (as per above store method) the status is set to unavailable. So if here when updating the status is available but this product doesn't have a category, than the product will not be allowed to be updated with an error message outputted.\n return $this->errorResponse('An active product must have at least one category', 409); // The code 409 specifies a conflict.\n }\n }\n\n if ($request->hasFile('image')) { // Note that usually when we Update an instance using postman we have to use as body ' x-www-form-urlencoded ' format as well as the PUT/PATCH method. But for ' x-www-form-urlencoded ' format we cannot send a FILE (the image in this case) , so we need to use a the body format ' form-data ' with the method POST along with an extra input field ( Note that name, description, quantity, image is an input field) called ' _method ' . This field should have the value ' put ' or ' patch ' . In this way we will be using something called ' METHOD SPOOFING ' in which Laravel and other frameworks understand, to update an instance that includes a FILE.\n Storage::delete($product->image); // Delete old image\n\n $product->image = $request->image->store('');\n }\n\n // Once this is done we can update the image, but we will do this in a future section. We have done it now as per the above ' if ($request->hasFile('image')) { ' CODE.\n\n if ($product->isClean()) {\n return $this->errorResponse('You need to specify a different value to update', 422);\n }\n\n $product->save();\n\n return $this->showOne($product);\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 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, Product $product)\n {\n // TODO update function\n }", "public function update(Request $request, $id)\n {\n $editProduct = Product::find($id);\n\n $request->validate([\n 'product_code' => 'required|string',\n 'product_name' => 'required|string',\n 'product_price' => 'required|string',\n 'product_count' => 'required|numeric',\n 'category_id' => 'nullable|numeric',\n 'file' => 'nullable', //name of image field in form\n 'file.*' => 'max:2048|image' //name of image field in form\n ]);\n\n $editProduct->product_code = $request->post('product_code');\n $editProduct->product_name = $request->post('product_name');\n $editProduct->product_price = $request->post('product_price');\n $editProduct->product_count = $request->post('product_count');\n $editProduct->category_id = $request->post('category_id');\n\n $editProduct->save();\n\n if($request->hasFile('file')){\n foreach($request->file('file') as $image)\n {\n\n $fileNamewithExtension = $image->getClientOriginalName(); //get file name with extension\n $filename = pathinfo($fileNamewithExtension, PATHINFO_FILENAME); //get file name\n $fileExtension = $image->getClientOriginalExtension(); //get file extension\n $fileNameToStore = $filename.'_'.time().'.'.$fileExtension; // file name to store\n $image->storeAs('public/products', $fileNameToStore);\n\n\n //store product's image in Images table\n $editProductImage = new Image();\n $editProductImage->imageable_id = $editProduct->id;\n $editProductImage->imageable_type = \"App\\Product\";\n $editProductImage->image_name = $fileNameToStore;\n $editProductImage->image_path = \"storage/products/\";\n\n $editProductImage->save();\n }\n }\n\n //store tags for this product, if any tag exist\n if($request->has('tags'))\n {\n $editProduct->tags()->sync($request->input('tags'));\n }\n\n return redirect()->route('admin.products.index')->with('status', 'محصول با موفقیت ویرایش شد.');\n }", "public function update(Request $request, Product $product)\n {\n if (!Auth::user()->role->role_permission('edit_shows')) {\n abort(403, 'Unauthorized');\n }\n\n $this->validate($request, [\n 'name' => 'required|unique:products,name,' . $product->id,\n 'acronym' => 'required|unique:products,acronym,' . $product->id,\n ]);\n\n $dataInput = Helper::saveFiles($request->all());\n $dataInput = Helper::saveUncheckedCheckbox($dataInput, ['has_quota', 'has_passes']);\n\n $product->update($dataInput);\n $product->seatTypes()->sync($request->seats);\n $product->ticketTypes()->sync($request->tickets);\n\n Helper::saveTranslatedFields($product, ['description'], $request);\n\n Toastr::success('Product updated successfully');\n\n return redirect()->route('products.index');\n }", "public function update(Request $request, Product $product)\n {\n //$product= product::find($request->id);\n //return $product;\n $product->product_name = $request->get('product_name');\n $product->product_desc = $request->get('product_desc');\n $product->price = $request->get('price');\n $product->category_id = $request->get('category_id');\n if ($request->hasFile('image_upload')) {\n $name = $request->file('image_upload')->getClientOriginalName();\n $request->file('image_upload')->storeAs('public/images', $name);\n\n $product->img = $name;\n }\n if ($product->save()) {\n return redirect()->route('products_list');\n } else {\n return redirect()->back();\n }\n }", "public function update(Request $request, Product $product) {\n\n\t\t// dd($request->all());\n\n\t\t// $product->name = $request->input('name');\n\t\t// $product->price = $request->input('price');\n\t\t// $product->stock = $request->input('stock');\n\n\t\tforeach ($request->all() as $key => $value) {\n\n\t\t\tswitch ($key) {\n\t\t\tcase 'name':\n\t\t\tcase 'description':\n\t\t\tcase 'promo':\n\t\t\tcase 'price':\n\t\t\tcase 'stock':\n\t\t\t\t// case 'value':\n\t\t\t\t$product->$key = $value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($request->hasFile('file') && $request->file('file')->isValid()) {\n\n\t\t\t$location = Storage::putFile('public/products', $request->file('file'));\n\t\t\t$product->file = $location;\n\t\t\t$product->save();\n\n\t\t\treturn redirect('/products');\n\t\t} else {\n\n\t\t\tif ($request->input('fileOption') == '1') {\n\t\t\t\t$location = $request->input('file');\n\t\t\t\t$product->file = $location;\n\t\t\t\t$product->save();\n\n\t\t\t\treturn redirect('/products');\n\t\t\t} else {\n\t\t\t\treturn redirect('/products/' . $product->id . '/edit')->with(['message' => 'There was a problem with your file upload. Please try to submit again.', 'message_header' => 'Submission Unsuccessful']);\n\t\t\t}\n\n\t\t}\n\n\t}", "public function update(Request $request, Product $product)\n {\n // can't get the $product->fill() function to work properly\n // https://ryanchenkie.com/laravel-put-requests \n $product->update([\n 'quantity' => $request->quantity ? $request->quantity : $product->quantity,\n 'price' => $request->price ? $request->price : $product->price,\n 'active' => isset($request->active) ? $request->active : $product->active,\n ]);\n\n return response([''], 200 );\n }", "public function updateProduct($data) {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n if (isset($data->id)) {\r\n $product = Product::find_by_id($data->id);\r\n } else {\r\n throw new RestException(400, \"product id not supplied\");\r\n }\r\n if (!$product) {\r\n throw new RestException(400, \"product does not exist\");\r\n }\r\n if (isset($data->productkey)) {\r\n $product->productkey = $data->productkey;\r\n }\r\n if (isset($data->description)) {\r\n $product->description = $data->description;\r\n }\r\n if (isset($data->price)) {\r\n $product->price = $data->price;\r\n }\r\n if (isset($data->misc)) {\r\n $product->misc = $data->misc;\r\n }\r\n $product->save();\r\n return $product;\r\n }", "public function update(ProductRequest $request, Product $product)\n {\n $product->update($request->all());\n return redirect()->route('products.show',$product->id)->with('info', 'Product success update');\n }", "public function update(ProductRequest $request, $id)\n {\n $detail = $this->ormProductRepository->find($id);\n $template_id = $request->template_id;\n $template = $this->ormTemplateRepository->find_by_template_id($template_id);\n $uniqueSlug = $this->createSlug('products', $request->slug, $request->id);\n $path = base_path() . '/' . 'storage/app/products';\n if($request->slug != $detail->slug){\n rename($path . '/' . $detail->slug, $path . '/' . $uniqueSlug);\n }\n\n $data = [\n 'type_id' => $request->type_id,\n 'title' => $request->title,\n 'slug' => $request->slug,\n 'price' => str_replace(',','',$request->price),\n 'discount' => ($request->discount != '')? str_replace(',','',$request->discount) : 0,\n 'description' => $request->description,\n 'content' => $request->content,\n 'template_title' => $template['content'],\n 'template_content' => json_encode($request->template_content),\n 'template_id' => $request->template_id,\n 'created_at' => new DateTime()\n ];\n\n $fileName = [];\n $fileName = json_decode($detail->image);\n\n // Upload image\n if($request->file('image')){\n foreach ($request->file('image') as $key => $file) {\n $fileName[] = $file->hashName();\n $file->store('products/' . $uniqueSlug);\n }\n // print_r($upload);die;\n $image_json = json_encode($fileName);\n $data['image'] = $image_json;\n }\n\n $update = $this->ormProductRepository->update($id, $data);\n if($update){\n Session::flash('success', 'Cập nhật sản phẩm thành công!');\n return redirect()->intended('admin/product');\n }else{\n Session::flash('error', 'Cập nhật sản phẩm thất bại!');\n return back();\n }\n }", "public function update(Request $request, $id)\n {\n $name = $request->get('name');\n $slug = \\Illuminate\\Support\\Str::slug($name);\n $content = $request->get('content');\n $origin_price = $request->get('origin_price');\n $sale_price = $request->get('sale_price');\n $status = $request->get('status');\n $category_id = $request->get('parent_id');\n\n $product = Product::find($id);\n $product->name = $name;\n $product->slug = $slug;\n $product->content = $content;\n $product->origin_price = $origin_price;\n $product->sale_price = $sale_price;\n $product->status = $status;\n $product->user_id = Auth::user()->id;//$user_id;\n $product->category_id = $category_id;\n// dd($product);\n\n $product->save();\n// dd($product);\n\n return redirect()->route('backend.product.index');\n }", "public function update(Request $request)\n {\n $product = Product::findOrFail($request->id);\n $product->category_name = $request->category_name;\n $product->product_name = $request->product_name;\n $product->product_price = $request->product_price;\n $product->product_description = $request->product_description;\n //saving the image\n if($request->product_img != null){\n //delete old image\n unlink($product->product_img);\n $product->product_img = $this->image($request->file('product_img'));\n }\n $product->product_description = $request->product_description;\n $product->product_expiry_date = $request->product_expiry_date;\n $product->save(); \n return redirect()->route('product.index')->withSuccess(\"$product->product_name has been updated successfully\");\n }", "public function update(Request $request, $id)\n {\n //validate product data\n $this->validate($request,[ \n 'name'=>'required',\n 'price'=>'required',\n 'category'=>'required',\n 'stocklevel'=>'required',\n 'product_image'=>'image|nullable|max:1999'\n ]);\n\n //handle file uploads\n if($request->hasFile('product_image'))\n {\n //get file name with extension\n $filenamewithExt=$request->file('product_image')->getClientOriginalName();\n //get filename only\n $filename=pathinfo($filenamewithExt,PATHINFO_FILENAME);\n //get extension only\n $extension=$request->file('product_image')->getClientOriginalExtension();\n $filenameToDB=$filename.'_'.time().'_'.$extension;\n $path=$request->file('product_image')->storeAs('public/product_photos',$filenameToDB);\n\n }\n \n\n \n //get product data\n $productData= Product::find($id);\n $productData->name=$request->input('name'); \n $productData->price=$request->input('price');\n $productData->category=$request->input('category'); \n $productData->stocklevel=$request->input('stocklevel');\n if($request->hasFile('product_image'))\n {\n $productData->product_image=$filenameToDB;\n }\n \n\n //update product dta\n $productData->save();\n\n //store status message\n Session::flash('success_msg','product updated successfully');\n\n return redirect()->route('admin');\n }", "public function can_update_a_product()\n {\n $product = $this->create('Product');\n\n $response = $this->actingAs($this->create('User', [], false), 'api')->json('PUT', \"api/products/$product->id\", [\n 'name' => $product->name.'_updated',\n 'slug' => str_slug($product->slug.'_updated'),\n 'price' => $product->price+10\n ]);\n\n $response->assertStatus(200)\n ->assertExactJson([\n 'id' => $product->id,\n 'name' => $product->name.'_updated',\n 'slug' => str_slug($product->slug.'_updated'),\n 'price' => $product->price+10,\n 'created_at' => (string)$product->created_at\n ]);\n\n $this->assertDatabaseHas('products', [\n 'id' => $product->id,\n 'name' => $product->name.'_updated',\n 'slug' => str_slug($product->slug.'_updated'),\n 'price' => $product->price+10,\n 'created_at' => (string)$product->created_at,\n 'updated_at' => (string)$product->updated_at,\n ]);\n }", "public function update(StoreProductRequest $request, $id)\n {\n // Create Product\n $product = Product::findOrFail($id);\n \n // Handle File Upload\n if($request->hasFile('image')){\n if(\\File::exists(public_path('product_images/'.$product->image))){\n \\File::delete(public_path('product_images/'.$product->image));\n }\n $filenameWithExt = $request->file('image')->getClientOriginalName();\n $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n $extension = $request->file('image')->getClientOriginalExtension();\n $filenameToStore = $filename.'_'.time().'.'.$extension;\n $request->file('image')->move(public_path('product_images'), $filenameToStore);\n }\n \n //$product->update($request->all());\n $product->categoryId = $request->input('categoryId');\n $product->title = $request->input('title');\n $product->description = $request->input('description');\n if($request->hasFile('image')){\n $product->image = $filenameToStore;\n }\n $product->save();\n\n return redirect()->route('products.index')->with(['message' => 'Product updated successfully']);\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 update(Request $request, $id)\n {\n $data = $request->all();\n $user = Auth::user();\n \n $this->validate($request, [\n 'name' => 'required',\n 'category_id' => 'required',\n 'subcategory_id' => 'required',\n ]);\n $data_store = Product::find($id);\n $data_store-> name = $data['name'];\n $data_store-> price = $data['price'];\n $data_store-> brand = $data['brand'];\n $data_store-> condition = $data['condition'];\n $data_store-> color = $data['color'];\n $data_store-> description = $data['description'];\n $data_store-> category_id = $data['category_id'];\n $data_store-> subcategory_id = $data['subcategory_id'];\n $data_store-> user_id = $user->id;\n $data_store-> created_at = Carbon::now();\n $data_store-> updated_at = Carbon::now();\n\n $data_store->update();\n if ($data_store) {\n \n $product_id=$id;\n $file = $request->file('image');\n if ($file) {\n foreach ($file as $key => $value) {\n // if (array_key_exists($key,$data['image']))\n // {\n // return $key;\n // }\n $prefix = 'product';\n $path = 'uploads/images/product';\n $file_upload = new FileUpload;\n if (isset($data_store->product_image[$key])) {\n $file_rev=$data_store->product_image[$key]->image;\n $remove = $file_upload->remove($file_rev, $path);\n\n $upload = $file_upload->upload($file[$key], $prefix, $path);\n\n // $image=new ProductImage;\n $data_store->product_image[$key]->image=$upload['file_name'];\n // $image->product_id=$product_id;\n\n $data_store->product_image[$key]->update();\n }\n else{\n\n $upload = $file_upload->upload($file[$key], $prefix, $path);\n\n $image_store=new ProductImage;\n $image_store->image=$upload['file_name'];\n $image_store->product_id=$product_id;\n\n $image_store->save();\n }\n \n\n }\n }\n \n }\n\n if($data_store)\n {\n return redirect('admin/product')\n ->with('flash_notification.message', 'Data updated Successfully')\n ->with('flash_notification.level', 'success');\n }else{\n return redirect(route('admin/product'))\n ->with('flash_notification.message', 'Data updated Unsuccessfully')\n ->with('flash_notification.level', 'danger');\n }\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $this->validate($request,[\n 'title' => 'required|max:200',\n 'description' => 'required|min:120',\n 'price' => 'required',\n 'img_one' => 'image|max:10240',\n 'img_two' => 'image|max:10240',\n 'img_three' => 'image|max:10240',\n 'category_id' => 'required',\n 'brand_id' => 'required',\n ]);\n\n\n\n if ($request->hasFile('img_one')) {\n $file_name = 'storage/'.$product->img_one;\n unlink($file_name);\n $img_one = $request->file('img_one');\n $img_one = $img_one->store('image_path');\n } else {\n $img_one = $product->img_one;\n }\n \n\n if ($request->hasFile('img_two')) {\n if ($product->img_two != '') {\n $file_name = 'storage/'.$product->img_two;\n unlink($file_name);\n }\n $img_two = $request->file('img_two');\n $img_two = $img_two->store('image_path');\n } else {\n $img_two = $product->img_two;\n }\n\n if ($request->hasFile('img_three')) {\n if ($product->img_three != '') {\n $file_name = 'storage/'.$product->img_three;\n unlink($file_name);\n }\n $img_three = $request->file('img_three');\n $img_three = $img_three->store('image_path');\n } else {\n $img_three = $product->img_three;\n }\n\n $product_info = [\n 'title' => $request->title,\n 'description' => $request->description,\n 'price' => $request->price,\n 'img_one' => $img_one,\n 'img_two' => $img_two,\n 'img_three' => $img_three,\n 'category_id' => $request->category_id,\n 'brand_id' => $request->brand_id,\n 'discounted_price' => $request->discounted_price,\n ];\n\n $db = $product->update($product_info);\n if ($db) {\n session()->flash('message','Product edited!');\n return redirect()->route('manage-product');\n }\n }", "public function update_post()\n {\n\t\t$product_id = $this->post('product_id');\n\t\t$name = $this->post('name');\n $sku = $this->post('sku');\n $category = $this->post('category');\n $price = $this->post('price');\n\n\n\t\t$productData = array(\n 'name' => $name,\n 'sku' => $sku,\n 'category' => $category,\n 'price' => $price, \n );\n\t\n\t\t$this->db->where('id', $product_id);\n\t\t$this->db->update('products', $productData);\n\t\t$this->response([\n\t\t\t'status' => true,\n\t\t\t'message' => \"Update product details successfully\",\n\t\t], Restserver\\Libraries\\REST_Controller_Definitions::HTTP_CREATED); // CREATED (201) being the HTTP response code\n\t\texit;\n\t}", "public function update(Request $request,$id){\n\n $product = product::find($id)->update($request->all());\n return redirect(route('dashboard.product.show'));\n }", "public function update(Request $request, Product $product)\n {\n $product->update($request->all());\n }", "public function setProduct()\n {\n // get the existing products array\n $products = $this->getProducts();\n // push the new product to the array\n array_push($products, $this);\n $file = fopen($_SERVER['DOCUMENT_ROOT'] . \"/mpm_challenge/problem4/db/db.json\", \"w+\") or die(\"not opened\");\n fwrite($file, json_encode($products));\n fclose($file);\n }", "public function update(Request $request, Product $product)\n {\n $product->update($request->only('prd_name','image','price'));\n return redirect()->route('product.index')->with('success','Cập nhật thành công');\n }", "public function update(Request $request, $id)\n {\n $validateData = $request->validate([\n 'category_id' => 'required',\n 'supplier_id' => 'required',\n 'product_name' => 'required',\n 'product_code' => 'required',\n 'root' => 'required',\n 'buying_price' => 'required',\n 'selling_price' => 'required',\n 'buying_date' => 'required',\n 'product_quantity' => 'required',\n ]);\n\n $product = Product::find($id);\n\n if ($request->new_image) {\n\n $position = strpos($request->new_image, ';');\n $sub = substr($request->new_image, 0, $position);\n $ext = explode('/', $sub)[1];\n $name = str_slug($request->name).\"-\".time().\".\".$ext;\n\n $image = Image::make($request->new_image)->resize(240,200);\n $upload_path = 'backend/product/';\n $image_url = $upload_path.$name;\n $success = $image->save($image_url);\n if ($success) {\n $product->image = $image_url;\n $pro = DB::table('products')->where('id',$id)->first();\n $img_path = $pro->image;\n if ($img_path) {\n unlink($img_path);\n }\n }\n }else{\n $old_photo = $request->image;\n $product->image = $old_photo;\n }\n\n $product->category_id = $request->category_id;\n $product->supplier_id = $request->supplier_id;\n $product->product_name = $request->product_name;\n $product->product_code = $request->product_code;\n $product->root = $request->root;\n $product->buying_price = $request->buying_price;\n $product->selling_price = $request->selling_price;\n $product->buying_date = $request->buying_date;\n $product->product_quantity = $request->product_quantity;\n $product->save();\n }", "public function update(Request $request, Product $product)\n {\n\n $fileName = null;\n $currentImage = $product->image;\n\n if (request()->hasFile('image')) {\n $image = request()->file('image');\n $fileName = md5($image->getClientOriginalName() . time()) . \".\" . $image->getClientOriginalExtension();\n $image->move('./img/', $fileName);\n }\n else\n $fileName = $currentImage;\n\n if($fileName && $currentImage)\n {\n Storage::delete('./img/' . $fileName);\n }\n\n $product->title = $request->input('title');\n $product->category_id = $request->input('category_id');\n $product->subtitle = $request->input('subtitle');\n $product->slugy = $request->input('slugy');\n $product->slug = Str::slug($product->slugy, '-');\n $product->description = $request->input('description');\n $product->price = $request->input('price');\n $product->balise_alt = $request->input('balise_alt');\n $product->meta_title = $request->input('meta_title');\n $product->meta_description = $request->input('meta_description');\n $product->image = $fileName;\n\n $product->save();\n\n return redirect()->route('admin.product.index')->with(\n 'success', \"L'article à été modifier\"\n );\n }", "public function update(Request $request, Product $product)\n {\n\n if($request->hasFile('productImage1')){\n if($request->hasFile('productImage1')){\n if($product->productImage1 != 'product.png'){\n unlink(public_path('/image/products/' . $product->productImage1));}}\n $filename = $request->input('productName').'1'.'_'.time().'-'.'.'.$request->file('productImage1')->getClientOriginalExtension();\n $location = public_path('/image/products/' . $filename);\n Image::make($request->file('productImage1'))->save($location);\n $product->productImage1 = $filename;\n }\n if($request->hasFile('productImage2')){\n if($request->hasFile('productImage2')){\n if($product->productImage2 != 'product.png'){\n unlink(public_path('/image/products/' . $product->productImage2));}}\n $filename = $request->input('productName').'2'.'_'.time().'-'.'.'.$request->file('productImage2')->getClientOriginalExtension();\n $location = public_path('/image/products/' . $filename);\n Image::make($request->file('productImage2'))->save($location);\n $product->productImage2 = $filename;\n }\n if($request->hasFile('productImage3')){\n if($request->hasFile('productImage3')){\n if($product->productImage3 != 'product.png'){\n unlink(public_path('/image/products/' . $product->productImage3));}}\n $filename = $request->input('productName').'3'.'_'.time().'-'.'.'.$request->file('productImage3')->getClientOriginalExtension();\n $location = public_path('/image/products/' . $filename);\n Image::make($request->file('productImage3'))->save($location);\n $product->productImage3 = $filename;\n }\n\n\n $product->update($request->all());\n\n $user = User::find($request->input('userid'));\n\n //Redirect\n return redirect('private_profiles/'.$user->username)->with('productUpdated','Product Updated');\n }", "public function update(Product $product, Request $request)\n {\n $request->validate([\n 'name' => 'required|unique:products,id,'.$product->id,\n 'price' => 'required',\n ]);\n\n try {\n $product->name = request()->name;\n $product->price = request()->price;\n $product->description = request()->description;\n if(request()->has('image')) {\n Storage::delete('/public/product/'.$product->image);\n $product->image = basename(request()->file('image')->store('public/product'));\n }\n $product->save();\n return redirect()->route('products.index')->withSuccess('Product updated successfully');\n } catch(\\Exception $e) {\n return redirect()->back()->withError($e->getMessage());\n }\n }", "public function update(Request $request, $id)\n {\n // Product::update($request->all());\n $data = $request->all();\n unset($data['_token']);\n unset($data['_method']);\n // Product::where('id', $request->input('id'))->update($data);\n // $products = \\App\\Product::find($id);\n // $products->product_name=$request->get('product_name');\n // $products->product_description=$request->get('product_description');\n // $products->prices=$request->get('prices'); \n // $products->save();\n //$product = Product::where('id', $request->input('id'))->update($data);\n\n\n //$data['file'] = \n //dd($data);\n\n \n\n $categories = $request->input('categories');\n $product = Product::find($id);\n $old_file = $product->file;\n $product->update($data);\n $upload_req = $request->file('file');\n $extension = $upload_req->extension();\n $basefilename = 'files/'.str_random(32);\n $filename = $basefilename.'.'.$extension;\n $request->file('file')->storeAs('public', $filename);\n Storage::disk('public')->delete($old_file); \n $product->file = $filename; \n $product->save(); \n \n \n $product->categories()->sync($categories);\n return redirect('product'); \n }", "public function update(Request $request, $id)\n {\n try{\n $product=Product::findorfail($id);\n $product->title=$request->title;\n $product->sku=$this->generateSKU();\n $product->slug=$request->slug;\n $product->status=$request->status;\n $product->price=$request->price;\n $product->discount_price=$request->discount_price;\n $product->short_description=$request->short_description;\n $product->long_description=$request->long_description;\n $product->user_id=1;\n $product->save();\n $attributes=explode(',',$request->input('attributes')[0]);\n $photos=explode(',',$request->input('photo_id')[0]);\n $product->photos()->sync($photos);\n $product->categories()->sync($request->categories);\n $product->attributeValues()->sync($attributes);\n Session()->put('product_success','محصول با موفقیت ویرایش شد');\n return redirect('/products');\n }\n catch (\\Exception $m){\n Session()->put('product_error','خطایی در ویرایش به وجود آمده لطفا مجددا تلاش کنید');\n return redirect('/products');\n }\n }", "public function update(Request $request, $id)\n {\n if(auth()->user()->can('edit product')){\n $request->validate([\n 'title' => 'required|string|max:50',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'salePrice' => 'nullable|numeric',\n 'sku' => 'nullable|string|max:60',\n 'images.*' => 'nullable|image|dimensions:ratio=12/13,min_width=600,min_height=650,max_width=1200,max_height=1300'\n ]);\n if(is_numeric($id)){\n $product =Product::find($id);\n if($product == null){\n return redirect()->back()->with('error','product does not exists!');\n }\n $product->title = $request->input('title');\n $product->short_description = $request->input('short_description');\n $product->description = $request->input('description');\n $product->price = $request->input('price');\n $product->discounted_price = $request->input('sale_price');\n\n\n\n if($request->has('sku')){\n $product->sku = $request->input('sku');\n }\n if($request->input('in_stock') === 'instock'){\n $product->in_stock = true;\n }else{\n $product->in_stock = false;\n }\n if($request->has('quantity')){\n $product->quantity = $request->input('quantity');\n }\n if($request->has('purchase_note')){\n $product->purchase_note = $request->input('purchase_note');\n }\n if($request->has('sub_category_id')){\n $product->sub_category_id = $request->input('sub_category_id');;\n }\n $product->is_active = $request->has('is_active');\n $product->is_featured = $request->has('is_featured');\n try{\n //\n $product->save();\n if($request->has('category_id')){\n $product->categories()->sync($request->input('category_id'));\n }\n if($request->has('images')){\n foreach ($request->file('images') as $img){\n\n $product->images()->create([\n 'url' => Storage::url($img->store('public/images/products'))\n ]);\n }\n }\n if($request->has('variants')){\n if($request->has('variants')){\n $product->variants()->detach();\n foreach ($request->input('variants') as $key => $variant){\n $v = Variant::where('id',$variant)->first();\n $product->variants()->attach($v, ['price' => $request->input('variant_price')[$key],'discounted_price' => $request->input('variant_discounted_price')[$key]]);\n }\n }\n }else{\n $product->variants()->detach();\n }\n return redirect()->route('product.index')->with('success','updated successfully');\n }catch (\\Exception $e){\n return redirect()->back()->with('error',$e->getCode().':'.$e->getMessage());\n }\n }\n }else{\n return redirect()->route('home')->with('error','Unauthorized access!');\n }\n }", "public function update(Request $request, Product $product)\n {\n $data = $request->validate([\n 'name' => 'required',\n 'p_desc' => 'nullable',\n 'sku' => ['required', 'integer'],\n 'category_id' => ['required', 'exists:categories,id'],\n 'price'=> ['required', 'integer'],\n 'isStock' => ['required', 'boolean'],\n 'gender' => ['required'],\n 'sizes' => ['required'],\n 'colors' => 'required',\n 'first_image' => ['nullable', 'image', 'mimes:jpeg,png'],\n 'second_image' => ['nullable', 'image', 'mimes:jpeg,png'],\n 'third_image' => ['nullable', 'image', 'mimes:jpeg,png'],\n ]);\n\n $data['isStock'] == \"1\" ? true : false;\n\n if($request->hasFile('first_image')){\n $fname = Str::random(20);\n $fexe = $request->file('first_image')->extension();\n $fpath = \"$fname.$fexe\";\n\n $request->file('first_image')->storeAs('public/products', $fpath);\n\n $data['first_image'] = 'products/'.$fpath;\n\n if($product->first_image){\n Storage::delete('public/', $product->first_image);\n }\n }\n\n if($request->hasFile('second_imgae')){\n $sname = Str::random(20);\n $sexe = $request->file('second_imgae')->extension();\n $spath = \"$sname.$sexe\";\n\n $request->file('second_imgae')->storeAs('public/products', $spath);\n\n $data['second_imgae'] = 'products/'.$spath;\n\n if($product->second_image){\n Storage::delete('public/', $product->second_image);\n }\n }\n\n if($request->hasFile('third_image')){\n $tname = Str::random(20);\n $texe = $request->file('third_image')->extension();\n $tpath = \"$tname.$texe\";\n\n $request->file('third_image')->storeAs('public/products', $tpath);\n\n $data['third_image'] = 'products/'.$tpath;\n\n if($product->third_image){\n Storage::delete('public/', $product->third_image);\n }\n }\n \n\n $product->update($data);\n\n return redirect(route('admin.products.index'))->with('sucess', 'Product Updated Sucessfully');\n }" ]
[ "0.7693959", "0.7109897", "0.7038027", "0.6987092", "0.6936687", "0.692956", "0.691723", "0.68994087", "0.6893607", "0.68926966", "0.6887604", "0.6885928", "0.6875296", "0.6864771", "0.6857832", "0.6853497", "0.6844251", "0.68364376", "0.68275845", "0.6819749", "0.6819256", "0.68161684", "0.6775823", "0.67709064", "0.67677", "0.6763401", "0.6762399", "0.6755155", "0.67503756", "0.6744907", "0.67401415", "0.67376965", "0.6730736", "0.67285126", "0.67262286", "0.6724259", "0.6722658", "0.6718267", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703634", "0.6703416", "0.6700528", "0.6697184", "0.66858906", "0.66842425", "0.66842425", "0.66842425", "0.66781473", "0.66768783", "0.6674116", "0.66739565", "0.666272", "0.66626537", "0.66620755", "0.66548216", "0.6652529", "0.6639456", "0.66353804", "0.66325295", "0.66302705", "0.66285443", "0.6628355", "0.6623005", "0.66215396", "0.6621258", "0.66178894", "0.66156876", "0.660475", "0.66047007", "0.6598499", "0.659596", "0.65938425", "0.65834045", "0.65830994", "0.65809053", "0.65802443", "0.65797967", "0.6577969", "0.65751284", "0.657188", "0.6571179", "0.6569395" ]
0.0
-1
Get count of the collection
public function ProductCount() { return Products::count(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function count() {\r\n\t\treturn count($this->collection);\r\n\t}", "public function count()\n {\n return count($this->collection);\n }", "public function count()\n {\n return $this->collection->count();\n }", "public function count()\n {\n return $this->collection->count();\n }", "public function count(): int\n {\n return count($this->collection);\n }", "public function count(): int\n {\n return $this->collection->count();\n }", "public function countCollection()\n {\n return count($this->collections);\n }", "public function getCount()\n\t{\n\t\treturn $this->getFilteredCollection()->count();\n\t}", "public function size()\n {\n return count($this->getCollection());\n }", "public static function getCount()\n\t{\n\t\treturn self::find()->count();\n\t}", "static function count($collection, $query = array()) {\r\n\t\t$col = self::getCollection($collection, true);\r\n\t\tif ($query) {\r\n\t\t\t$res = $col->find($query);\r\n\t\t\treturn $res->count();\r\n\t\t} else {\r\n\t\t\treturn $col->count();\r\n\t\t}\r\n\t}", "public function count()\n\t{\n\t\treturn $this->all()->count();\n\t}", "public function count()\n {\n return $this->client->count($this->compile())['count'];\n }", "public function count()\n\t{\n\t\t$content = $this->resource->get($this->name)->getContent();\n\t\t\n\t\treturn $content['doc_count'];\n\t}", "public function getCount() {\n \treturn $this->count();\n }", "public function count(): int\n {\n return count( $this->toArray() );\n }", "public function getTotalCollectionCount() {\n return $this->totalCollectionCount;\n }", "public function _count();", "static function count($collection, $query = array()) {\n global $mongo;\n $col = $mongo->selectCollection(MONGODB_NAME, $collection);\n if ($query) {\n $res = $col->find($query);\n return $res->count();\n } else {\n return $col->count();\n }\n }", "public function count(): int\n\t{\n\t\treturn count($this->all());\n\t}", "public function count(): int {\n return count($this->toArray());\n }", "public function count(string $collection = '', array $options = []): int\n\t{\n\t\treturn $this->_get($collection, $options, TRUE, __METHOD__);\n\t}", "public function count()\n {\n return count($this->countable);\n }", "public function count()\n {\n return $this->iterator->count();\n }", "public function count()\n\t{\n\t\treturn $this->getCount();\n\t}", "public function count()\n {\n return $this->getCount();\n }", "public function count()\n {\n return $this->model->paginate(1, $this->select)->total();\n }", "final public function count(): int\n {\n return count($this->all());\n }", "public function getCount() {\n return $this->get(self::COUNT);\n }", "public function count($collection, array $query = array()) {\n $col = $this->db->selectCollection($collection);\n if ($query) {\n $res = $col->find($query);\n return $res->count();\n } else {\n return $col->count();\n }\n }", "public function getCount()\n\t{\n\t\treturn $this->_count;\n\t}", "public function getCount()\n {\n return $this->_count;\n }", "public function getCount()\n {\n return $this->_count;\n }", "public function getCount()\n\t{\n\t\treturn $this->count;\n\t}", "public function count() {\n\t\t// return $this->_count;\n\t\treturn count($this->_data);\n\t}", "public function count() {\r\n return count($this->objects);\r\n }", "public function count()\n {\n return $this->size();\n }", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count()\n {\n return $this->items()->count();\n }", "public static function getCount()\n {\n return static::find()->count();\n }", "public function count() {\n\t\treturn count($this->getData());\n\t}", "public function count() {\n $repo = $this->getRepository();\n\n return $repo->aggregate($this->limit(0), __FUNCTION__, $repo->getPrimaryKey());\n }", "public function count(): int\n {\n return $this->getIterator()->count();\n }", "public function getCount()\n {\n return $this->doQuery(null, false, false)->count();\n }", "public function getCount() {\r\n return $this->count;\r\n }", "public function count() { return $this->_m_count; }", "public function count(): int\n {\n // TODO: Implement count() method.\n return count($this->toArray());\n }", "public function getCount()\r\n {\r\n return $this->count;\r\n }", "public function count()\r\n {\r\n return count($this->data);\r\n }", "public function count() {\n\t\treturn $this->_count;\n\t}", "public function count() {\r\n if (is_null($this->objectcount)) {\r\n $this->fetchData();\r\n }\r\n return $this->objectcount;\r\n }", "public function getCount()\n {\n return $this->count;\n }", "public function getCount()\n {\n return $this->count;\n }", "public function getCount()\n {\n return $this->count;\n }", "public function getCount()\n {\n return $this->count;\n }", "public function getCount()\n {\n return $this->count;\n }", "public function getCount()\n {\n return $this->count;\n }", "public function getCount()\n {\n return $this->count;\n }", "public function getCount()\n {\n return $this->count;\n }", "public function getCount()\n {\n return $this->count;\n }", "public function count()\n {\n return $this->_count;\n }", "public function count()\n {\n return $this->_count;\n }", "public function count()\n {\n return $this->_count;\n }", "public function count() {\r\n return count($this->data);\r\n }", "public function count()\n {\n return count($this->data);\n }", "public function count()\n {\n return count($this->data);\n }", "public function count()\n {\n return count($this->data);\n }", "public function count()\n {\n return count($this->data);\n }", "public function count()\n {\n return count($this->data);\n }", "public function count () {\n\n return $this->_count;\n }", "public function getCount()\n\t{\n\t\treturn $this->Count;\n\t}", "public function count() {\n\t\treturn count($this->getIterator());\n\t}", "public function getCount()\n\t{\n\t\treturn count($this->_d);\n\t}", "public function count() {\n\t\treturn $this->count;\n\t}", "public function count()\r\n\t{\r\n\t\treturn $this->count;\r\n\t}", "public function count()\n {\n return count($this->getResults());\n }", "function count() {\n return count($this->data);\n }", "public function count()\n {\n return count( $this->data );\n }", "public function count()\n {\n $this->setIteratorFilter(self::FLIST_NOCONTAINER | self::FLIST_UNSUB);\n return count(iterator_to_array($this));\n }", "public function count()\n {\n return count($this->_data);\n }" ]
[ "0.87680876", "0.8767217", "0.87304306", "0.87304306", "0.87140644", "0.8625013", "0.84952974", "0.82679015", "0.82478017", "0.7915573", "0.79050386", "0.79010373", "0.7877169", "0.7845941", "0.7839773", "0.7835773", "0.78174543", "0.7817121", "0.7813893", "0.7803956", "0.78010845", "0.7797179", "0.77969", "0.7789295", "0.7785713", "0.7777256", "0.7755413", "0.7744509", "0.7725797", "0.77235", "0.7710591", "0.7708136", "0.7708136", "0.77016", "0.7700791", "0.7700043", "0.7698049", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.76924103", "0.7690414", "0.7690406", "0.7689356", "0.7686494", "0.7686353", "0.76811117", "0.7678665", "0.7672354", "0.7672029", "0.7667821", "0.7667307", "0.7657095", "0.7653989", "0.76531196", "0.76531196", "0.76531196", "0.76531196", "0.76531196", "0.76531196", "0.76531196", "0.76531196", "0.76531196", "0.76527786", "0.76527786", "0.76527786", "0.76313055", "0.76297283", "0.76297283", "0.76297283", "0.76297283", "0.76297283", "0.7629658", "0.7628421", "0.7625288", "0.76204914", "0.76202077", "0.7614945", "0.7614144", "0.7611672", "0.7608383", "0.7605432", "0.76000285" ]
0.0
-1
End: getList Faz uma busca de Usuario
public static function search($login){ $sql = new Sql(); return $sql->select("SELECT * FROM tb_usuarios_dois WHERE deslogin LIKE :SEARCH ORDER BY idusuario", array( ':SEARCH'=>"%".$login."%" )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getList(){\n\t\t$sql = new sql();\n\n\t\treturn $sql->select(\"SELECT * FROM usuarios ORDER BY email;\");\n\n\t}", "function getList() {\n $this->db->getCursorParameters(self::TABLA);\n $respuesta = array();\n while ($fila = $this->db->getRow()) {\n $objeto = new Usuario();\n $objeto->set($fila);\n $respuesta[] = $objeto;\n }\n return $respuesta;\n }", "public function Listar()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$result = array();\n\n\t\t\t$stm = $this->pdo->prepare(\"SELECT usuario.`correo`, `usuario`.`clave`, `rol`.`nomRol`, `datospersonales`.`Documento`\nFROM `usuario`\nLEFT JOIN `rol` ON `rol`.`nomRol` = `usuario`.`nomRol` \nLEFT JOIN `datospersonales` ON `datospersonales`.`Documento` = `usuario`.`Documento`\n WHERE correo is not null \");\n\t\t\t$stm->execute();\n\n\t\t\tforeach($stm->fetchAll(PDO::FETCH_OBJ) as $r)\n\t\t\t{\n\t\t\t\t$usu = new Usuario();\n\n\t\t\t\t$usu->__SET('correo', $r->correo);\n\t\t\t\t$usu->__SET('clave', $r->clave);\n\t\t\t\t$usu->__SET('nomRol', $r->nomRol);\n\t\t\t\t$usu->__SET('Documento', $r->Documento);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t$result[] = $usu;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}", "public function get_usuarios()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$sql = \"SELECT * FROM usuarios\";\n\n\t\t\t$resultado = $this->db->prepare($sql);\n\n\t\t\tif(!$resultado->execute())\n\t\t\t{\n\t\t\t\techo \"<h1 class='text-danger bg-danger'>Falla en la consulta</h1>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twhile($reg = $resultado->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->usuarios[] = $reg;\n\t\t\t\t}\n\n\t\t\t\treturn $this->usuarios;\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie(\"Error: {$e->getMessage()}\");\n\t\t}\n\t}", "public static function getlist(){\n $sql = new Sql();\n \n return $sql->select(\"SELECT * FROM tb_usuarios ORDER BY deslogin\");\n }", "public static function getList(){\n\t\t\t$sql = new sql();\n\n\t\t\treturn $sql->select(\"SELECT * FROM tb_usuarios ORDER BY deslogim\");\n\t\t}", "public function listarUsuarios()\r\n\t{\r\n\t\t$administradores=array();\r\n\t\ttry{\r\n\t\t\t//realizamos la consulta de todos los items\r\n\t\t\t$consulta = $this->db->prepare(\"select * from administrador\");\r\n\t\t\t$consulta->execute();\r\n\t\t\tfor($i=0; $row = $consulta->fetch(); $i++)\r\n\t\t\t{\r\n\t\t $fila['admin_cedula']=$row['ADMIN_CEDULA'];\r\n\t\t\t$fila['admin_login']=$row['ADMIN_LOGIN'];\r\n\t\t\t$fila['admin_nombre']=$row['ADMIN_NOMBRE'];\r\n\t\t\t$fila['admin_apellido']=$row['ADMIN_APELLIDO'];\r\n\t\t\t$fila['admin_status']=$row['ADMIN_STATUS'];\r\n\t\t\t$administradores[]=$fila;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tcatch(PDOException $e)\r\n\t\t{\r\n\t\t\techo $e;\r\n\t\t}\r\n\t\treturn $administradores;\t\t\r\n\t}", "public function getUsers(){\n $query = \"SELECT * FROM usuario \";\n return self::getInstance()->consulta($query);\n }", "public static function getUsuarios()\n {\n $query = \"SELECT id,nombre,email,usuario,privilegio,fecha_registro FROM users\";\n\n self::getConexion();\n\n $resultado = self::$cnx->prepare($query);\n\n $resultado->execute();\n\n $filas = $resultado->fetchAll();\n\n return $filas;\n }", "public static function get_usuarios(){\n\t\t\n\t\t$query = \"SELECT * FROM usuarios\";\n\n\t\t/**\n\t\t * Call getConexion()\n\t\t */\n\t\tself::getConexion();\n\n\n\n\t\t$resultado = self::$cn->prepare($query);\n\t\t$resultado->execute();\n\n\t\t$filas=$resultado->fetchAll();\n\n\t\t\n\t\treturn $filas;\n\n\t}", "public static function getAllUsuario(){\n $v = array();\n\t\t$conexion = new Database();\n $sql = sprintf('SELECT * FROM agenda_usuarios' );\n $rows = $conexion->query( $sql );\n\n foreach( $rows as $row ){\n\t\t\t$u = new Usuario();\n\t\t\t$u->usuario = $row['USUARIO'];\n $u->password = $row['PASSWORD'];\n $u->codigo = $row['USUARIO_ID'];\n\t\t\t$v[] = $u;\n\t\t}\n return $v;\n }", "function ListaUsuario() {\n\t\n\t\t\t$sql = \"SELECT usu.*, CONCAT_WS(' ', per.primer_nombre, per.primer_apellido) as nombre_completo, usu.nombre_usuario, rol.descripcion FROM usuario usu\n\t\t\t\t\tINNER JOIN rol rol ON rol.id = usu.rol_id\n\t\t\t\t\tINNER JOIN persona per ON per.id = usu.persona_id\";\n\t\t\t$db = new conexion();\n\t\t\t$result = $db->consulta($sql);\n\t\t\t$num = $db->encontradas($result);\n\t\t\t$respuesta->datos = [];\n\t\t\t$respuesta->mensaje = \"\";\n\t\t\t$respuesta->codigo = \"\";\n\t\t\tif ($num != 0) {\n\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t\t\t}\n\t\t\t\t$respuesta->mensaje = \"Ok\";\n\t\t\t\t$respuesta->codigo = 1;\n\t\t\t} else {\n\t\t\t\t$respuesta->mensaje = \"No existen registros de roles.\";\n\t\t\t\t$respuesta->codigo = 0;\n\t\t\t}\n\t\t\treturn json_encode($respuesta);\n\t\t}", "public function ListarUsuarios()\n{\n\tself::SetNames();\n\t$sql = \" select * from usuarios \";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "function getUsuarios(){\n\t\n\t\treturn conectar()->query( \"SELECT * FROM usuarios\");\n\t}", "public function listarUsuarios()\n {\n $usuarios = Usuarios::all();\n\n return $usuarios;\n }", "public static function ListarUsuarios(){\n return (new Usuario)->FindBy([],[\"nombre asc\"]);\n }", "static public function ctrListarUsuario( ){\n\n\t\treturn ModeloUsuarios::mdlListarUsuario( );\n\n\t}", "public function listAll(){\n $sql = \"SELECT id,name,email FROM users\";\n $stmt = $this->cnx->prepare($sql);\n $result = $stmt->execute();\n \n $resultados = array();\n\n while($rs = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $resultados[] = $rs;\n }\n \n if(empty($resultados)){\n throw new Exception(\"Nenhum usuario encontrado!\");\n }\n \n return $resultados;\n }", "public function getList(){\n\t\t$resultsUsers = [];\n\t\t$q = $this->pdo->query('SELECT * FROM utilisateur');\n\t\twhile ($donnee = $q->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$resultsUsers[] = new Utilisateur($donnee);\n\t\t}\n\t\treturn $resultsUsers;\n\t}", "function getUsuarios()\n{\n\t$con = getDBConnection();\n\t$sql = \"SELECT * FROM usuarios\";\n\t$stmt = $con->prepare($sql);\n\t$stmt->execute();\n\t$usuarios = null;\n\twhile ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t$usuario = new Usuario();\n\t\t$usuario->setID($row['id']);\n\t\t$usuario->set($row['nombre'],$row['apellidos'],$row['user_name'],$row['password'],$row['email']);\n\t\t$usuarios[] = $usuario;\n\t}\n\treturn $usuarios;\n}", "public function listarUser() {\n if(IDUSER) {\n $eval = \"SELECT id,nombre,apellidos,email FROM users\";\n $peticion = $this->db->prepare($eval);\n $peticion->execute();\n $resultado = $peticion->fetchAll(PDO::FETCH_OBJ);\n exit(json_encode($resultado));\n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Fallo de autorizacion\"])); \n }\n }", "function ListaUsuarios() {\n\t//obtiene el id del usuario\n $sql = \"SELECT usuario.id, usuario.nombre_usuario, persona.primer_nombre, persona.primer_apellido, usuario.estado, rol.descripcion FROM usuario INNER JOIN persona ON usuario.persona_id = persona.id INNER JOIN rol ON usuario.rol_id = rol.id WHERE usuario.estado = 'ACTIVO'\";\n\n\t$db = new conexion();\n\t$result = $db->consulta($sql);\n\t$num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($num != 0) {\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\t\t$respuesta->mensaje = \"Usuarios listados\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"No existen registros de usuarios !\";\n\t\t$respuesta->codigo = 0;\n\t}\n\treturn json_encode($respuesta);\n}", "public function listarUsua(){\n\t\t$sql=\"SELECT USUARI_ID, USUARI_NOMBRES, USUARI_USUARIO\n\t\t FROM usuario ORDER BY USUARI_NOMBRES\";\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function getUsuarios()\n {\n\n $sql = \"SELECT * FROM usuario\";\n\n foreach ($this->bd->query($sql) as $res) {\n $this->usuarios[] = $res;\n }\n return $this->usuarios;\n\n }", "public function utilisateurListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Utilisateur\");//type array\n\t}", "function listarUsuarios(){\n \n $conex=Conexion::getInstance();\n $stmt = $conex->dbh->prepare(\"SELECT * FROM usuarios\"); \n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $stmt->execute();\n $listaUsuarios=[];\n while ($row = $stmt->fetch()){\n $listaUsuarios[]=array('id'=>$row['id'],'usuario'=>$row['usuario'],'nombre'=>$row['nombre'],'admin'=>$row['admin'],'password'=>$row['password']) ; \n }\n return $listaUsuarios;\n}", "public function getList(){\n\t\t$model=new Model();\n\t\treturn $model->select(\"SELECT * FROM tb_usuarios ORDER BY idusuario\");\n\t}", "private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }", "function getAllUsuarios(){\n\t\t\tDB_DataObject::debugLevel(0);\n\t\t\t$obj = DB_DataObject::Factory('VenUsuario');\n\t\t\t$obj->find();\n\t\t\t$i = 0;\n\t\t\t$data='';\n\t\t\twhile($obj->fetch()){\n\t\t\t\t$data[$i]['idUsuario']=$obj->idUsuario;\n\t\t\t\t$data[$i]['idCargo']=$obj->idCargo;\n\t\t\t\t$nombreCargo=$this->getCargoById($obj->idCargo);\n\t\t\t\t$nombreCargo=utf8_encode($nombreCargo['nombre']);\n\t\t\t\t$data[$i]['cargo']= $nombreCargo;\n\t\t\t\t$data[$i]['nombre']=utf8_encode($obj->nombre);\n\t\t\t\t$data[$i]['apellido']=utf8_encode($obj->apellido);\n\t\t\t\t$data[$i]['email']=$obj->email;\n\t\t\t\t$data[$i]['usuario']=utf8_encode($obj->usuario);\n\t\t\t\t$data[$i]['contrasena']=utf8_encode($obj->contrasena);\n\t\t\t\t$data[$i]['puntos']=$obj->puntos;\n\t\t\t\t$data[$i]['estado']=$obj->estado;\n\t\t\t\t$data[$i]['fechaMod']=$obj->fechaMod;\n\t\t\t\t$data[$i]['fecha']=$obj->fecha;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$obj->free();\n\t\t\t//printVar($data,'getAllUsuarios');\n\t\t\treturn $data;\n\t\t}", "function obtenerUsuarios(){\n //Variable que almacena la consulta sql\n $sql = \"select login,Alias\n \t\t\tfrom ENTREGA\";\n\t\t//se ejecuta la query\n $resultado = $this->mysqli->query( $sql );\n if ( $resultado->num_rows == 0 ) { return null; }//miramos si el número de filas es 0.\n //Caragamos las tuplas resultado de la consulta en un array\n while($datos = mysqli_fetch_row ($resultado)){\n //Variable que almacena el array de las tuplas resultado de la query\n $miarray[] = $datos;\n }\n return $miarray;\n }", "public function get_all() {\n\t\t\n\t\treturn $this->db->get('usuarios');\n\t}", "public function readUsuarios()\n\t{\n\t\t$sql = 'SELECT IdRol, Nombre, Apellido, Telefono, Email, u.IdEstado, IdUsuario \n FROM usuarios u ORDER BY Apellido';\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}", "public function getAll()\n {\n $usuario = new Usuario();\n return $usuario->getAll();\n }", "public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }", "public function getUsuarios(){\n\t\t$filasPagina = 7;//registros mostrados por página\n\n\t\tif(isset($_GET['pagina'])){//si le pasamos el valor \"pagina\" de la url (si el usuario da click en la paginación)\n\t\t\t\tif($_GET['pagina']==1){\n\t\t\t\t$pagina=1; \n\t\t\t\theader(\"Location: principal.php?c=controlador&a=muestraUsuarios\");\n\t\t\t\t}else{\n\t\t\t\t\t$pagina=$_GET['pagina'];//índice que indica página actual\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$pagina=1;//índice que indica página actual\n\t\t\t}\n\n\t\t\t$empezarDesde = ($pagina-1) * $filasPagina;\n\n\t\t\t$sql = \" SELECT * FROM usuarios \";\n\n\t\t\t$resultado = $this->db->query($sql);\n\n\t\t\t$resultado->execute(array());\n\n\t\t\t$numFilas = $resultado->rowCount();//número de registos totales de la consulta\n\n\t\t\t//ceil — Redondear fracciones hacia arriba\n\t\t\t$totalPaginas = ceil($numFilas / $filasPagina);//calcula cuántas páginas serán en total para mostrar todos los registros\n\n\t\t\t$resultado->closeCursor();\n\n\t\t//------------------------- Consulta para mostrar los resultados ---------------------------\n\n\t\t\t$sql_limite = \" SELECT * FROM usuarios LIMIT $empezarDesde , $filasPagina \";\n\n\t\t\t$resultado = $this->db->query($sql_limite);//ejecutando la consulta con la conexión establecida\n\n\t\t\twhile($row = $resultado->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$this->objeto[] = $row;//llenando array con valores de la consulta\n\t\t\t}\n\n\t\treturn $this->objeto;\n\t}", "function listar()\n {\n $query = $this->db->get(\"usuarios\");\n return $query->result_array();\n }", "public function buscarUsuarios(){\n\t\t}", "private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "public function getUsersList()\n {\n }", "function all_usuarios(){\n\t\t$Query = 'SELECT * FROM tb_usuarios';\n\t\t$respuesta = ObtenerRegistros($Query);\t\n\t\treturn ConvertirUTF8($respuesta);\n\t}", "function findAll() \n {\n $usuarios = array();\n $n=0;\n $sql=\"select u.id,u.nombre,u.paterno,u.materno,u.username,u.fechaAlta,\".\n \" u.estatus,u.idTipoUsuario,tu.descripcion from Usuarios u\".\n \" inner join TipoUsuarios tu on tu.id=u.idTipoUsuario\".\n \" order by u.id\";\n \n $usuariosRs = mysqli_query($this->_connDb, $sql); \n while ($row = mysqli_fetch_array($usuariosRs)) {\n $oUsuario = new Usuario(0);\n $oUsuario->setId($row['id']);\n $oUsuario->setNombre($row['nombre']);\n $oUsuario->setPaterno($row['paterno']);\n $oUsuario->setMaterno($row['materno']);\n $oUsuario->setUsername($row['username']);\n $oUsuario->setFechaAlta($row['fechaAlta']);\n $oUsuario->setEstatus($row['estatus']);\n\n // Creamos el objeto de tipo TipoUsuario\n $oTipoUsuario = new TipoUsuario($row['idTipoUsuario']);\n $oTipoUsuario->setDescripcion($row['descripcion']);\n\n // Inyectamos la dependencia de TipoUsuario\n $oUsuario->setTipoUsuario($oTipoUsuario);\n $usuarios[$n]=$oUsuario;\n $n++; \n }\n return $usuarios;\n }", "function getUsersAdmin() {\n $usuarios = [];\n\n $con = crearConexion();\n\n $query = \"SELECT `username` FROM `usuario` WHERE `tipo`='0'\";\n\n $result = mysqli_query($con, $query);\n\n while ($row = mysqli_fetch_array($result)) {\n $usuarios[] = $row['username'];\n }\n\n cerrarConexion($con);\n return $usuarios;\n}", "public function getList() {\n //Retourne la liste de tous les users\n $users = [];\n $requsers = $this->db->query('SELECT * FROM user');\n\n while ($data = $requsers->fetch(PDO::FETCH_ASSOC)) {\n $users[] = new user($data);\n }\n\n return $users;\n }", "function showUsuarios()\r\n\t{\r\n\t\t$valuesUsuarios = $this->User->find('all', array('conditions' => array('User.active' => 1),'order' => 'User.first_lastname ASC'));\r\n\t\t\r\n\t\tforeach ($valuesUsuarios as $value)\r\n\t\t{\r\n\t\t\t$resultadosUsuarios[$value['User']['id']]= $value['User']['first_lastname'].' '.$value['User']['second_lastname'].', '.$value['User']['name'];\r\n\t\t}\r\n\t\t\r\n\t\treturn $resultadosUsuarios;\r\n\t}", "function fetchUsuario() {\n\n $usuarios = array();\n\n $con = new DB();\n $sql = $con->prepare(\"SELECT * FROM usuario\");\n $result = $con->executeQuery($sql);\n\n foreach ($result as $row) {\n $id = $row['id'];\n $username = $row['username'];\n $password = $row['password'];\n $email = $row['email'];\n $poblacion = $row['poblacion'];\n $idioma = $row['idioma'];\n $telefono = $row['telefono'];\n $url = $row['url'];\n $foto = $row['foto'];\n $textoPresentacion = $row['textoPresentacion'];\n $administrador = $row['esAdministrador'];\n $registrado = $row['esUsuarioRegistrado'];\n $professional = $row['esUsuarioProfesional'];\n $usuario = new Usuario($id, $username, $password, $email, $poblacion, $idioma, $telefono, $url, $foto, $textoPresentacion, $administrador, $registrado, $professional);\n array_push($usuarios, $usuario);\n }\n\n return $usuarios;\n }", "public function getAllUsers(){\n\t\n\t\t$db = new Database();\n\t\t$conn= $db->getConn();\n\t\t$rs = $conn->query(\"select * from login\");\n\t\t$num_of_row = $rs->num_rows;\n\t\tif($num_of_row >0){\n\t\t\twhile($row = $rs->fetch_assoc()){\n\t\t\t\t$users[]=array('username'=>$row['username'],'password'=>sha1($row['password']),'email'=>$row['email'],'user_type'=>$row['user_type']);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $users;\n\t}", "function listar_usuarios() {\n\t\t$query = \"SELECT colaboradores.*, colaboradores_permisos.*\n\t\tFROM colaboradores, colaboradores_permisos\n\t\tWHERE colaboradores.id_colaborador=colaboradores_permisos.id_colaborador\n\t\tAND colaboradores.estado=1\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function get_user_list(){\n\t\treturn array();\n\t}", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function index()\n {\n $usuarios = dev_Usuario::get();\n return $usuarios;\n }", "public function getUsuaris()\n {\n $usuarios = $this->_db->query(\"select * from usuarios\");\n return $usuarios->fetchall();\n }", "public function getUserList(): array {\n\t\t$sql = 'SELECT u.id, u.login, u.mail, r.name role FROM users u\n\t\t\t\tINNER JOIN roles r ON u.role = r.id\n\t\t\t\tWHERE u.login != :mylogin';\n\n\t\treturn $this->queryRows($sql, ['mylogin' => $_SESSION['user']['login']]);\n\t}", "public function listar(){\n\n $sql = \"SELECT * FROM buro_credito\";\n\n return $this->mysql->getRows($sql);\n\n }", "public function getUsers()\n {\n return Security::getUserList();\n }", "protected function getUserList() {\n\t$controller = new ChatMySQLDAO();\n\tif(!isset($_SESSION['username'])) {\n\t return;\n\t}\n\t$users = $controller->getUserList($_SESSION['username']);\n\t$data = array();\n\t$i = 0;\n\tforeach ($users as $user) {\n\t $data[$i++] = $user['user_name'];\n\t}\n\treturn $data;\n }", "public function retrieve_all_users()\n {\n $table_pengajar = $this->db->dbprefix('pengajar');\n $table_siswa = $this->db->dbprefix('siswa');\n $table_login = $this->db->dbprefix('login');\n\n $sql = \"SELECT {$table_login}.username, {$table_pengajar}.nama FROM {$table_pengajar} INNER JOIN {$table_login} ON {$table_pengajar}.id = {$table_login}.pengajar_id\n UNION\n SELECT {$table_login}.username, {$table_siswa}.nama FROM {$table_siswa} INNER JOIN {$table_login} ON {$table_siswa}.id = {$table_login}.siswa_id\";\n\n $result = $this->db->query($sql);\n\n $data = array();\n foreach ($result->result_array() as $r) {\n # selain yang login\n if (is_login() && $r['username'] == get_sess_data('login', 'username')) {\n continue;\n }\n $data[] = addslashes($r['nama']) . ' [' . $r['username'] . ']';\n }\n\n return $data;\n }", "function listerUtilisateur()\n\t{\n\t\t$req=\"select idUti, nomUti, prenomUti, photoUti, telPorUti, mailUti, statutUti from utilisateur\";\n\t\t$exereq = mysql_query($req) or die(mysql_error());\n\t\n\t\twhile($ligne=mysql_fetch_array($exereq))\n\t\t{\n\t\t\t$tab[]=$ligne;\n\t\t}\n\n\t\treturn $tab;\n\t}", "public function consultarUsuario(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT c.*, a.permissao FROM tbusuarios c, tbpermissao a where c.idpermissao = a.idpermissao and permissao <> 'SUPER-ADMIN'order by c.nome\";\n $sql = $this->conexao->query($sql);\n\n $dados = array();\n\n while ($row = $sql->fetch_assoc()) {\n $idusuario = $row[\"idusuario\"];\n $nome = $row[\"nome\"];\n $email = $row[\"email\"];\n $dtnascimento = $row[\"dt_nascimento\"];\n $telefone = $row[\"telefone\"];\n $dtnascimento = $row[\"dt_nascimento\"];\n $habilitado = $row[\"habilitado\"];\n $permissao = $row[\"permissao\"]; \n $idpermissao = $row[\"idpermissao\"]; \n\n $dado = array();\n $dado['idusuario'] = $idusuario;\n $dado['nome'] = $nome;\n $dado['email'] = $email;\n $dado['senha'] = $row['senha'];\n $dado['senha_confirma'] = $row['senha_confirma'];\n $dado['idpermissao'] = $idpermissao;\n $dado['permissao'] = $permissao;\n $dado['telefone'] = $telefone;\n $dado['dtnascimento'] = $dtnascimento;\n $dado['habilitado'] = $habilitado; \n $dados[] = $dado;\n }\n\n return $dados;\n\n }", "public function getUsuarios()\n {\n return $this->usuarios;\n }", "public function getList(){\r\n \r\n $sql = \"SELECT * FROM ESTADO_USUARIO\";\r\n $ests = array();\r\n if(!$resultado = pg_Exec($this->conexion, $sql));\r\n\r\n while($row = pg_fetch_array($resultado))\r\n { \r\n $est = New Status_User();\r\n $est->setCod_estado($row[0]);\r\n $est->setNom_estado($row[1]);\r\n $ests[] = $est;\r\n }\r\n return $ests;\r\n }", "public function getUsers()\n {\n $usuarios = $this->Etapas->getUsers()->usuarios->usuario; //usuarios seg.users\n echo json_encode($usuarios);\n }", "public function UsuariosPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from usuarios where codigo = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codigo\"])) );\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 obtenerUsuarios()\n {\n $consulta = \"SELECT * FROM usuarios, usuarios_roles WHERE (usuarios.rol=usuarios_roles.id_rol) ORDER BY usuarios.nombres ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "private function usuarios(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"GET\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t}//es una petición GET\n\t\t//se realiza la consulta a la bd\n\t\t$query = $this->_conn->query(\n\t\t\t\"SELECT id, nombre, email \n\t\t\t FROM usuario\");\n\t\t//cantidad de usuarios\n\t\t$filas = $query->fetchAll(PDO::FETCH_ASSOC); \n \t$num = count($filas);\n \t//si devolvio un resultado, se envia al cliente\n \tif ($num > 0) { \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['usuarios'] = $filas; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } //se envia un error \n\t $this->mostrarRespuesta($this->devolverError(2), 204);\n\t}", "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "public static function getUsersLists(){\n \t$data = Doctrine_Query::create()\n \t// ->distinct('u.DeviceToken')\n \t->select(\"u.firstName, u.DeviceToken\")\n \t->from(\"User u\")\n \t->where('u.deleted=0')\n \t->andWhere(\"u.roleId=2\")\n \t->andWhere('u.DeviceToken!= \"NULL\"')\n\t->andWhere(\"u.DeviceToken!= '(null)'\")\n \t->andWhere('u.DeviceToken!=\"\"')\n \t->groupBy('u.DeviceToken')\n \t//->getSqlQuery();\n\t->fetchArray();\n \t\n return $data;\n }", "function modele_get_liste_user() {\n\n\t\t$req = 'SELECT * FROM p_user ';\n\n\t\t$reqPrep = self::$connexion->prepare($req);\n\n\t\t$reqPrep->execute();\n\n\t\t$enregistrement = $reqPrep->fetchall(PDO::FETCH_ASSOC);\n\n\t\treturn $enregistrement;\n\t}", "public function getAllUsers() {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new SecurityDAO($dbObj);\n return $this->DAO->getAllUsers();\n }", "function get_user_list()\n {\n $query = $this->db->get('user_login');\n return $query->result();\n }", "public function getUsuariosJuridico() {\r\n $usuarios = null;\r\n $sql = \"SELECT usu_id, usu_apellido, usu_nombre \"\r\n . \"FROM usuario \"\r\n . \"WHERE per_id = 8 \"\r\n . \"ORDER BY usu_apellido\";\r\n $r = $this->db->ejecutarConsulta($sql);\r\n if ($r) {\r\n $cont = 0;\r\n while ($w = mysql_fetch_array($r)) {\r\n $usuario = new CUsuario($w['usu_id'], null);\r\n $usuario->setNombre($w['usu_nombre']);\r\n $usuario->setApellido($w['usu_apellido']);\r\n $usuarios[$cont] = $usuario;\r\n $cont++;\r\n }\r\n }\r\n return $usuarios;\r\n }", "public function infoUsuariosPorProyectoList(){\n\n $usuarios = UsersModel::infoUsuariosPorProyecto(\"usuario\", $_SESSION[\"id_project\"]);\n \n foreach ($usuarios as $row => $item) {\n echo '<option value=\"'.$item[\"Email\"].'\">'.$item[\"Email\"].'</option>'; \n }\n\n }", "public static function getUserList() {\n $db = DB::getInstance();\n $resp = \"\";\n try {\n $query = $db->query(\"SELECT id, first_name, last_name, username, lump, admin FROM `users` ORDER BY last_name ASC\", PDO::FETCH_ASSOC);\n $rows = $query->fetchAll();\n $resp = json_encode($rows);\n }\n catch (Exception $e) {\n $db->rollBack();\n $resp = $e->getMessage();\n }\n return $resp;\n }", "public function listUsers() {\n\t\t$users = Common::loadJSON(\"users\");\n\t\t$temp = array();\n\n\t\t//Remove the user in session.\n\t\tforeach ($users as $username => $data) {\n\t\t\tif ($username == $this->activeUser) continue;\n\t\t\t$temp[] = $username;\n\t\t}\n\n\t\treturn $temp;\n\t}", "function getUsers(){\n\t$O = [];//initialiser a une List vide\n\t\n\t$db = connect();\n\t$stmt = mysqli_prepare($db, \"SELECT * FROM user WHERE login=? AND mdp=?\");\n\tmysqli_stmt_bind_param($stmt, \"ss\", $login, $mdp);\n\tmysqli_stmt_bind_result($stmt, $id, $nom, $login, $mdp, $type);\n\tmysqli_stmt_execute($stmt);\n\t\n\twhile(mysqli_stmt_fetch($stmt)){\n\t\tarray_push( $O , new User($id, $nom, $login, $mdp, $type) );\n\t}\n\t\n\treturn $O;\n}", "public function getUsers(){\n if($this->get_request_method() != \"GET\"){\n $this->response('',406);\n }\n $role = $_REQUEST[\"role\"];\n\n $query=\"SELECT * FROM `usuario` WHERE `rol` = \" . $role;\n\n $this->db->get($query);\n }", "public function listausuarios(){\n $user = Usuario::with('rol')->paginate(15);\n $lista_usuarios = compact('user'); \n\n return $this->sendResponse($lista_usuarios, 'Listado de usuarios devueltos con éxito');\n\n }", "function getUserNameList()\r\n\t{\r\n\t\treturn $this->UserNameList;\r\n\t}", "function get_users()\n\t{\n\n\t\trequire_once('modules/Users/User.php');\n\t\t\n\t\t$query = \"SELECT user_id as id FROM roles_users WHERE role_id='$this->id' AND deleted=0\";\n\t\t\n\t\treturn $this->build_related_list($query, new User());\n\t}", "function list_users(){\r\n\t\t$query = $this->db->query(\"SELECT userid, concat(fname, ' ', lname, ' (', username, ')') as name FROM nf_users\");\r\n\t\t$return = array();\r\n\t\tforeach($query->result() as $row){\r\n\t\t\t$return[$row->userid] = $row->name;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "private function listUsers()\n {\n $users = get_users();\n $user_ids = array();\n\n foreach ($users as $u) {\n $user_ids[] = $u['id'];\n }\n\n if (count($this->ids) != 0) {\n return array_intersect($this->ids, $user_ids);\n } else {\n return $user_ids;\n }\n }", "function listuser(){\n\t\t\tif(!empty($_GET['paginado'])){\n\t\t\t\t$pag = $_GET['paginado'];\n\t\t\t\t$list = $this -> model -> selectuser($pag);\n\t\t\t}else{\n\t\t\t\t$list = $this -> model -> selectuser();\n\t\t\t}\n\t\t\t$this -> ajax_set($list);\n\t\t}", "public function get_user_list() {\n\n $sql = \" SELECT userId, concat(firstName, ' ', surname) AS `name`\n FROM time_user\"; \n return $this->db->query( $sql );\n }", "public function ls_user_get()\n {\n $this->db->select('id, idrol,rol, nombre, correo, activo');\n $this->db->from('vusuarios');\n $query = $this->db->get();\n if ($query && $query->num_rows() >= 1) {\n $usuarios = $query->result();\n\n foreach ($usuarios as $row) {\n $row->id = (int) $row->id;\n $row->idrol = (int) $row->idrol;\n $row->rol = (int) $row->rol;\n $row->nombre = $row->nombre;\n $row->correo = (int) $row->correo;\n $row->activo = $row->activo;\n }\n $respuesta = array(\n 'usuarios' => $usuarios,\n );\n $status = 200;\n } else {\n $respuesta = array(\n 'message' => 'Valide sus datos de acceso',\n );\n $status = 401;\n }\n $this->response($respuesta, $status);\n }", "function getUsers(){\n\t\t$query = $this->db->get('usuarios');\n\t\tif($query->num_rows() > 0) return $query;\n\t\telse return NULL;\n\t}", "public function buscarUsuarios(){\n $usuarios = file_get_contents('usuarios.json');\n $arrUsuariosJSON = explode(PHP_EOL,$usuarios);\n $arrUsuarioPHP = [];\n array_pop($arrUsuariosJSON);\n foreach ($arrUsuariosJSON as $key => $usuario) {\n $arrUsuarioPHP[] = json_decode($usuario,true);\n }\n return $arrUsuarioPHP;\n }", "public function findTodosLosUsuarios()\n {\n $em = $this->getEntityManager();\n \n $consulta = $em->createQuery('SELECT u FROM UsuarioBundle:Usuario u');\n \n return $consulta->getResult();\n }", "public function Listar($filtros=null,$start=null,$limit = null,$sort = null) \n\t\t{\t\t\n\t\t\t$consulta = \"SELECT usuario_id,usuario_nombre,usuario_login,usuario_rol_id, usuario_email, usuario_apellido1, usuario_apellido2,usuario_detalles,rol_nombre \n\t\t\t FROM usuario INNER JOIN rol ON usuario_rol_id=rol_id WHERE 1\";\n\n\t\t\treturn parent::Listar($consulta, false, $filtros, $start, $limit, $sort);\n\t\t}", "public function citas_usuariosCitas(){\n \t\n\t\t\t$resultado = array();\n\t\t\n\t\t\t$query = \" SELECT idUsuario, identificacion, nombre, apellido\n\t\t\t\t\t\tFROM tb_usuarios\";\n\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\t\t\n }", "public function getUserList()\n {\n $responseMap = $this->_postCommand(static::$COMMAND_GET_USER_LIST);\n \n // From the response, filter out only the users that matched this environment Prefix\n $userIdList = [];\n foreach ($responseMap['ids'] as $userId) {\n $unprefixedUserId = PrefixHelper::unprefix($userId);\n \n if ($unprefixedUserId !== false) {\n $userIdList[] = $unprefixedUserId;\n }\n }\n \n return $userIdList;\n }", "function getUsers(){\n }", "function getUsers(){\n }", "function getUser(){\n $db=new connect();\n $select=\"select * from users\";\n return $db->getList($select);\n }", "public function getUsuarios($order){\r\n\t$pdo = Database::connect();\r\n\t//verificamos el ordenamiento asc o desc:\r\nif($orden==true)//asc\r\n$sql = \"select * from usuario order by nombre\";\r\nelse //desc\r\n\t$sql = \"select * from usuario order by nombre desc\";\r\n\t$resultado = $pdo->query($sql);\r\n//transformamos los registros en objetos de tipo usuario:\r\n\t$listado = array();\r\n\tforeach ($resultado as $res){\r\n\t\t$usuario = new usuario();\r\n\t\t$usuario->setCodigo($res['codigo']);\r\n\t\t$usuario->setNombre($res['nombre']);\r\n\t\t$usuario->setPrecio($res['precio']);\r\n\t\t$usuario->setCantidad($res['cantidad']);\r\n\t\tarray_push($listado, $usuario);\r\n\t}\r\n\tDatabase::disconnect();\r\n//retornamos el listado resultante:\r\n\treturn $listado;\r\n}", "public static function getUserComboList() { \n return Doctrine_Query::create()->select('u.id, SUBSTRING(u.username, 1, 25) as username')->from('sfGuardUser u')->orderBy('u.username');\n }", "function listUsers() {\n return $this->users;\n }", "public function getdatosUsuarios(){\n\t\t$bd = new bd();\n\t\t$result = $bd->doSingleSelect($this->u_table,\"id = {$this->id}\");\n\t\tif($result){\n\t\t\t$this->datosUsuario($result[\"direccion\"], $result[\"telefono\"], $result[\"descripcion\"], $result[\"estados_id\"], $result[\"facebook\"], $result[\"twitter\"],$result[\"website\"],$result[\"certificado\"],$result[\"id_sede\"]);\n\t\t\t$this->id = $result[\"id\"];\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function allUser() {\n $listado = DB::table('users')->join('role_user', 'role_user.user_id', '=', 'users.id')\n ->join('roles', 'roles.id', '=', 'role_user.role_id')\n ->select('users.*', 'roles.description')\n ->get();\n\n return $listado;\n }", "function getUsers()\n {\n $sql = \"SELECT * FROM \" . DB_NAME . \".`customers`\";\n\n try {\n $result = $this->connexion->prepare($sql);\n $var = $result->execute();\n $users = [];\n\n while ($data = $result->fetch(PDO::FETCH_OBJ)) {\n $user = new UserEntity();\n $user->setIdUser($data->idUser);\n $user->setNom_societe($data->Nom_societe);\n $user->setAbreviations($data->Abreviations);\n $user->setAdresse($data->Adresse);\n $user->setTel($data->Tel);\n $user->setEmail($data->Email);\n $user->setSecteur($data->Secteur);\n $user->setCreatedAt($data->createdat);\n\n $users[] = $user;\n }\n\n if ($users) {\n return $users;\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }", "public function getAllUsers() {\n $sql = 'SELECT id, firstname, mail, role, isAdmin FROM user';\n $sth = $this->db->prepare($sql);\n $sth-> execute(array());\n if ($row = $sth->fetchAll()) {\n return $row;\n }\n }" ]
[ "0.8054851", "0.7972419", "0.7850569", "0.7838256", "0.7833152", "0.77272445", "0.7544357", "0.7543706", "0.753477", "0.7534705", "0.75337124", "0.7515391", "0.7506416", "0.7493066", "0.7409029", "0.7407475", "0.74017054", "0.7401281", "0.74005026", "0.7396528", "0.7384753", "0.73840725", "0.7383796", "0.73730314", "0.7350511", "0.7343153", "0.73427933", "0.73288226", "0.73133177", "0.730408", "0.728019", "0.72681195", "0.7267139", "0.7265053", "0.72545105", "0.722773", "0.7221024", "0.7214843", "0.7195367", "0.7193266", "0.71556854", "0.71532863", "0.71367013", "0.71090364", "0.7104645", "0.7093768", "0.7091903", "0.7090261", "0.7063644", "0.7063644", "0.7063644", "0.7048088", "0.70398194", "0.70345783", "0.70314366", "0.7031405", "0.7028235", "0.702693", "0.70100754", "0.70003605", "0.69754785", "0.69366395", "0.6933657", "0.69166565", "0.68898314", "0.68865246", "0.6884571", "0.6877157", "0.6874912", "0.6868165", "0.6857051", "0.68565625", "0.68437916", "0.6836569", "0.6833535", "0.68235195", "0.6815589", "0.68130195", "0.68058187", "0.67980367", "0.6790551", "0.67787105", "0.6772094", "0.6767469", "0.67671835", "0.6761076", "0.6760037", "0.6753734", "0.67506224", "0.6749602", "0.674677", "0.67412937", "0.67412937", "0.6740578", "0.67292136", "0.6726854", "0.67267597", "0.67238516", "0.67204386", "0.6720218", "0.6719582" ]
0.0
-1
Determine whether the user can update the flow.
public function update(User $user) { return $user->admin; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }", "public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }", "protected function canUpdate()\n {\n return $this->hasStrategy(self::STRATEGY_UPDATE);\n }", "public function authorize()\n {\n return $this->user()->canUpdateSecurity();\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }", "public function authorize()\n {\n return $this->user()->can('update_users');\n }", "static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }", "function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}", "public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }", "function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}", "protected function canUpdateStatus() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $this->getEmptyComment());\n }", "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 }", "protected function _isAllowed()\r\n {\r\n return $this->_authorization->isAllowed('AAllen_PriceUpdate::update');\r\n }", "public function isUpdateSecurityRelevant() {}", "public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }", "public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}", "public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }", "public function authorize()\n {\n return auth()->user()->can('update online assessment');\n }", "public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }", "public function update(User $user)\n {\n if ($user->can('update_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }", "public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return Auth::check();\n }", "public function update(User $user)\n {\n\t\treturn in_array('update', $user->permissibles('vip'));\n }", "public function isUpdateRequired();", "public function update(User $user)\n {\n if ($user->can('update plans')) {\n return true;\n }\n }", "public function canBeUpdated()\n {\n return $this->isNotYetSubmitted();\n }", "public function authorize()\n {\n return $this->user()->hasPermission('update-title');\n }", "public function authorize(): bool\n {\n return $this->user()->can('update_contact');\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 }", "public function canEdit()\n {\n return $this->is_locked == 0;\n }", "function canUpdateItem() {\n\n $ticket = new Ticket();\n if (!$ticket->getFromDB($this->fields['tickets_id'])) {\n return false;\n }\n\n // you can't change if your answer > 12h\n if (!is_null($this->fields['date_answered'])\n && ((strtotime(\"now\") - strtotime($this->fields['date_answered'])) > (12*HOUR_TIMESTAMP))) {\n return false;\n }\n\n if ($ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || ($ticket->fields[\"users_id_recipient\"] === Session::getLoginUserID() && Session::haveRight('ticket', Ticket::SURVEY))\n || (isset($_SESSION[\"glpigroups\"])\n && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"]))) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }", "public function update(User $user)\n {\n return $user->hasPermissionTo('update campaign');\n }", "function canUpdateUser($userid){\r\n\t\t$permissions = new dkpUserPermissions();\r\n\t\t$permissions->loadUserPermissions($userid);\r\n\r\n\t\t//make sure we are trying to edit a user who really belongs to our guild\r\n\t\tif($permissions->guildid != $this->guild->id || !$this->HasPermission(\"AccountSecondaryUsers\"))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "public function isUpdateResource();", "public function updatePolicy(User $user)\n {\n return $user->may(static::PERMISSION_UPDATE);\n }", "function can_do_updatemultiple() {\n $id = $this->required_param('id');\n return cmclasspage::_has_capability('block/curr_admin:track:enrol', $id);\n }", "public function is_allowed_to_update_feedback($feedback);", "public function authorize()\n {\n return auth()->user()->can('update', [Category::class, request('category')]);\n }", "public function update(User $user, ApplicationForm $applicationForm)\n {\n return $user->can('update-application-forms');\n }", "public function authorize()\n {\n $authorized = auth()->check();\n if ($authorized) {\n $this->rules = $this->getRulesForAction(CrudAction::update());\n }\n return $authorized;\n }", "public function authorize(): bool\n {\n return Auth::check() && Auth::user()->can('web.user.transcripts.update');\n }", "public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }", "public function canModifyVisibilityOfUsers();", "function allowUpdate($allow){\n\t\t$this->canUpdate=$allow;\n\t}", "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// $comment = Comment::find($this->route('comment')); // Get 'comment' route's params.\n// return $comment && $this->user()->can('update', $comment);\n\n return false;\n }", "public function update(User $user)\n {\n return $user->hasAccess('update-conference-permission');\n }", "public function update(User $user)\n {\n return $user->can('update_customer');\n }", "public function get_update_availability()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $payload = $this->request('CheckForUpdate');\n\n if (preg_match('/' . self::CONSTANT_DO_UPDATE . 'true/i', $payload))\n return TRUE;\n else\n return FALSE;\n }", "public function update(User $user)\n {\n return $user->hasPermissionTo('experience_edit');\n }", "public function authorize()\n {\n if ($this->route()->getName() === 'home.update') {\n $post = Post::findOrFail($this->id);\n return Auth::check() && Auth::user()->isAdminOrOwner($post->user_id);\n }\n return Auth::check();\n }", "public function update(User $user)\n {\n if ($this->role($user)){\n return $user->hasDirectPermission($this->permission_list['update']);\n }\n }", "public function update(User $user)\n {\n if($user->can('carts-update') || $user->can('cart-update')) {\n return true;\n }\n return false;\n }", "public function executeUpdate(): bool\n {\n $this->updateDaysallowedField();\n return true;\n }", "public function authorize()\n {\n if (Auth::user()->can('update-assignment')) return true;\n if (Auth::user()->hasRole('student'))\n if ($this->owns('assignment')) return true;\n return false;\n }", "public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }", "private function _update(){\n\t\tif($this->dao->update($this->user->getID(), $this->ident, $this->datahandler)){\n\t\t\t$this->read();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "abstract public function isUpdatableByUser(User $user);", "public function update(User $user): bool\n {\n return $user->can('Update Role');\n }", "public function authorize()\n {\n $user = Auth::user();\n $lecture = Lecture::findOrFail($this->route('lecture'));\n return $user->can('lecture-update') || $user->id == $lecture->user_id;\n }", "public function update(User $user)\n {\n //\n if(!$user->isAdmin()){\n return true;\n }\n\t return app(Gate::class)->authorize('financial.exchangeRate.setting');\n }", "public function update(User $user, Property $property)\n {\n return in_array('properties-update', $user->role->permissions->pluck('title')->toArray())\n ? Response::allow()\n : Response::deny('You lack sufficient permissions to updated property');\n\n }", "public function hasUpdate();", "public function isAlwaysGranted(): bool;", "function check_permission()\r\n {\r\n // Ensure the user logs in\r\n require_login($this->course->id);\r\n if (isguestuser()) error(get_string('noguestaccess', 'sloodle'));\r\n add_to_log($this->course->id, 'course', 'view sloodle data', '', \"{$this->course->id}\");\r\n\r\n // Ensure the user is allowed to update information on this course\r\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\r\n require_capability('moodle/course:update', $this->course_context);\r\n }", "public function update(User $user, Event $event)\n {\n return ($user->hasPermission('update-event') && $user->id == $event->user_id) || $user->role_id == 1;\n }", "public function authorize() {\n\t\t$this->sport = $this->route('sport');\n\t\tif ($this->competitionDay = $this->route('competitionDay')) {\n\t\t\treturn $this->user()->can('update', $this->competitionDay);\n\t\t}\n\n\t\t$this->competitionDay = new CompetitionDay();\n\t\treturn $this->user()->can('create', CompetitionDay::class);\n\t}", "public function can_edit() {\n\t\t$can_edit = false;\n\t\t\n\t\t// is the user the owner of the package and the package is in edit mode?\n\t\tif ( ($this->get_user_id() == get_current_user_id()) && ($this->status == 1) ) {\n\t\t\t$can_edit = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_edit_other_packages' ) ) {\n\t\t\t\t$can_edit = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_edit;\n\t}", "public function update(): bool;", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\treturn $this->user()->can('create', WorkFunction::class) && $this->user()->can('update', $this->workplace);\n\t}", "private function allowModify()\n { \n if($this->viewVar['loggedUserRole'] <= 40 )\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }", "public function canEdit() {\n\t\treturn $this->_perms->checkModuleItem ( $this->_tbl_module, 'edit' );\n\t}", "public function authorize()\n {\n $hackedRoute = 'admin.media.update';\n if ( ! is_null($this->segment(4))) {\n $hackedRoute = 'admin.media_category.media.update#####' .$this->segment(3);\n }\n return hasPermission($hackedRoute);\n }", "function can_do_edit() {\n global $USER;\n\n if (has_capability('block/php_report:manageschedules', get_context_instance(CONTEXT_SYSTEM))) {\n //user can manage schedules globally, so allow access\n return true;\n }\n\n $report_shortname = '';\n\n //try to obtain the report shortname from the report schedule id\n //(applies only during first step of wizard interface)\n $id = $this->optional_param('id', 0, PARAM_INT);\n if ($id !== 0) {\n if ($record = get_record('php_report_schedule', 'id', $id)) {\n if ($record->userid != $USER->id) {\n //disallow access to another user's schedule\n return false;\n }\n $config = unserialize($record->config);\n if (isset($config['report'])) {\n $report_shortname = $config['report'];\n }\n } else {\n //wrong id, so disallow\n return false;\n }\n }\n\n //try to obtain the report shortname from the workflow information\n //(applies only after the first step of the wizard interface)\n if ($report_shortname == '' && isset($this->workflow)) {\n $data = $this->workflow->unserialize_data();\n if ($data !== NULL && isset($data['report'])) {\n $report_shortname = $data['report'];\n }\n }\n\n if ($report_shortname === '') {\n //report info not found, so disallow\n return false;\n }\n\n //check permissions via the report\n $report_instance = php_report::get_default_instance($report_shortname, NULL, php_report::EXECUTION_MODE_SCHEDULED);\n return $report_instance !== false;\n }", "public function update(User $user, Show $show): bool\n {\n return $user->isAdmin();\n }", "public function update(User $user, Task $task): bool\n {\n // Any authenticated user can modify a task\n return true;\n }", "public function authorize()\n {\n\n $this->note = Note::find($this->route('note'));\n\n return Gate::allows('update', $this->note);\n }", "public function canUserAssignUsage()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::usage', $user->alexf, true);\n }", "public function getUserCanEditAttribute()\n {\n return AccessControl::check($this, 'edit_post', false);\n }" ]
[ "0.7821232", "0.7358515", "0.7355931", "0.7321696", "0.7300643", "0.72989434", "0.72538024", "0.72354335", "0.7213674", "0.7137995", "0.712668", "0.70730466", "0.70385355", "0.70106757", "0.69969743", "0.6993346", "0.6989734", "0.6930484", "0.6916799", "0.68949", "0.6883863", "0.6883863", "0.68623537", "0.6839619", "0.68235743", "0.68151164", "0.67996323", "0.6798349", "0.6798349", "0.6798349", "0.6798349", "0.6798349", "0.6798349", "0.6798349", "0.6798349", "0.6798349", "0.67775106", "0.67757726", "0.6734836", "0.67132014", "0.66751456", "0.6638925", "0.662571", "0.66060054", "0.6589937", "0.65495175", "0.65338016", "0.6525638", "0.65181196", "0.6480635", "0.6440282", "0.6440282", "0.64193684", "0.63867664", "0.6377725", "0.6362547", "0.6323004", "0.6321748", "0.6315738", "0.62853014", "0.6284557", "0.62763834", "0.62734944", "0.6271067", "0.6266929", "0.6266832", "0.62601197", "0.6257596", "0.6254969", "0.6248993", "0.6247734", "0.623791", "0.62305176", "0.6221514", "0.6219468", "0.6208279", "0.62064147", "0.62058526", "0.6202664", "0.6200414", "0.6181849", "0.6181161", "0.61695236", "0.6147082", "0.61383915", "0.61264086", "0.61257243", "0.6117872", "0.6108847", "0.6106175", "0.61035717", "0.6092773", "0.60920423", "0.60894394", "0.60826325", "0.6081729", "0.60808897", "0.60796666", "0.6077852", "0.6074966", "0.60748225" ]
0.0
-1
Determine whether the user can delete the flow.
public function delete(User $user) { return $user->admin; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }", "public function canDelete()\n {\n return Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() );\n }", "public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }", "public function canDelete()\n {\n return in_array('delete', $this->actions);\n }", "function canDelete() {\n return true;\n }", "public function canDelete()\n {\n return 1;\n }", "function canDelete($user) {\n if($this->getId() == $user->getId()) {\n return false; // user cannot delete himself\n } // if\n\n if($this->isAdministrator() && !$user->isAdministrator()) {\n return false; // only administrators can delete administrators\n } // if\n\n return $user->isPeopleManager();\n }", "public function authorize()\n {\n return $this->can('delete');\n }", "public function canDelete()\n {\n $exist = $this->getModelObj('permission')->where(['resource_code' => $this->code, 'app' => $this->app])->first();\n if ($exist) {\n return false;\n }\n return true;\n }", "public function canDelete()\n {\n $user = $this->getUser();\n\n if ($user->getData('role') == 'Admin' && $this->getData('status') != Service\\BalanceWithdrawals::STATUS_PENDING) {\n return true;\n }\n\n return false;\n }", "function canDelete(User $user) {\n return $user->canManageTrash();\n }", "function canDelete(User $user) {\n return $user->isFinancialManager();\n }", "public function canDelete()\n {\n return $this->canGet();\n }", "public function authorize()\n {\n $represent = $this->getRepresent();\n\n return $represent->can('delete')\n && $represent->exists($this->route('id'));\n }", "public function authorize(): bool\n {\n return Gate::allows('admin.genero.delete', $this->genero);\n }", "public function isDeleteGranted($entity): bool;", "function CanDelete()\n\t{\treturn !count($this->subpages) && $this->CanAdminUserDelete();\n\t}", "private function canDelete()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "protected function hasActiveUserDeletePermissionForThisUser()\n {\n if (true === $this->bAllowEditByAll) {\n return true;\n }\n if (true === $this->IsOwner()) {\n return false;\n }\n /** @var SecurityHelperAccess $securityHelper */\n $securityHelper = ServiceLocator::get(SecurityHelperAccess::class);\n\n if (false === $securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_DELETE, $this->oTableConf->fieldName)) {\n return false;\n }\n\n if (true === $securityHelper->isGranted(CmsUserRoleConstants::CMS_ADMIN)) {\n return true;\n }\n\n if ($this->sId === $securityHelper->getUser()?->getId()) {\n // you cannot delete yourself.\n return false;\n }\n\n $oTargetUser = TdbCmsUser::GetNewInstance($this->sId);\n\n // Also, the user may only delete users that have at least one portal in common.\n $userPortals = $securityHelper->getUser()?->getPortals();\n if (null === $userPortals) {\n $userPortals = [];\n }\n $allowedPortals = array_keys($userPortals);\n $portalsOfTargetUser = $oTargetUser->GetFieldCmsPortalIdList();\n\n return 0 === \\count($portalsOfTargetUser) ||\n \\count(array_intersect($allowedPortals, $portalsOfTargetUser)) > 0;\n }", "function canDelete($user) {\n if($this->isOwner() || $user->getCompanyId() == $this->getId()) {\n return false; // Owner company cannot be deleted. Also, user cannot delete company he belongs to\n } // if\n return $user->isPeopleManager();\n }", "abstract function allowDeleteAction();", "public function delete(User $user)\n {\n if ($user->can('delete_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->reusablePayment = FetchReusablePayment::run([\n 'encoded_id' => $this->encoded_id,\n ]);\n\n return $this->user()->can('delete', $this->reusablePayment);\n }", "public function canDelete()\n {\n if ( !SimpleForumTools::checkAccess($this->forumNode(), 'topic', 'remove') )\n {\n \treturn false;\n }\n \t\n return true;\n }", "protected function canDelete() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS_DELETE, $this->getEmptyComment());\n }", "public function authorize(): bool\n {\n if (Auth::user()->hasPermissionTo('delete thread')) {\n return true;\n }\n\n $thread = $this->run(GetThreadJob::class, [\n 'thread_id' => $this->request->all()['thread_id']\n ]);\n\n if ($thread != null && $thread->user_id === Auth::user()->id && Auth::user()->hasPermissionTo('delete own thread')) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->translation = Translation::findByUuidOrFail($this->route('id'));\n\n return $this->user()->can('delete', [Translation::class, $this->translation->node->project]);\n }", "public function testAllowDelete()\n {\n $this->logOut();\n $deleteFalse = LogEntry::create()->canDelete(null);\n $this->assertFalse($deleteFalse);\n\n $this->logInWithPermission('ADMIN');\n $deleteTrue = LogEntry::create()->canDelete();\n $this->assertTrue($deleteTrue);\n }", "public function isDelete();", "public function allowDeletion()\n {\n return $this->allowDeletion;\n }", "function permissions_delete()\n{\n // Deletion not allowed\n return false;\n}", "public function authorize()\n {\n if (env('APP_ENV') == 'testing') {\n return true;\n }\n\n return tenant(auth()->user()->id)->hasPermissionTo('delete fixed asset');\n }", "public function delete(): bool\n {\n return $this->actionHandler->delete();\n }", "public function delete(User $user)\n {\n return $user->role->can_delete_post == 1;\n }", "public function delete()\n {\n // Check P_DELETE\n if (!wcmSession::getInstance()->isAllowed($this, wcmPermission::P_DELETE))\n {\n $this->lastErrorMsg = _INSUFFICIENT_PRIVILEGES;\n return false;\n }\n\n if (!parent::delete())\n return false;\n \n // Erase permissions\n $project = wcmProject::getInstance();\n $sql = 'DELETE FROM #__permission WHERE target=?';\n $params = array($this->getPermissionTarget());\n $project->database->executeStatement($sql, $params);\n \n return true;\n\n }", "public function canDelete()\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( 'delete' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $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\t\t\n\t\tif( static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\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 isDelete(): bool {}", "public function canDELETE($collection = null) {\r\n $rights = $this->getRights($collection, 'delete');\r\n return is_bool($rights) ? $rights : true;\r\n }", "public function sure_delete_block(){\r\n\t\tif($this->has_admin_panel()) return $this->module_sure_delete_block();\r\n return $this->module_no_permission();\r\n\t}", "public function authorizedToDelete(Request $request)\n {\n return false;\n }", "public function getCanDeleteProperty()\n {\n return $this->deleteConfirm === $this->staff->email;\n }", "protected function canDelete($record) { return false; }", "public function is_allowed_to_delete_feedback($feedback);", "public function canDelete($member = null) {\n\t\treturn Permission::check('CMS_ACCESS_CMSMain');\n\t}", "function userCanDeleteUser( $sessionID, $username ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "function userCanDeleteInterim( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 8;\r\n\t}", "public function delete(User $user)\n {\n if ($user->can('delete plans')) {\n return true;\n }\n }", "public function canDelete(ConclusionInterface $conclusion);", "public function isDeleteResource();", "public function delete(User $user): bool\n {\n return $user->can('Delete Role');\n }", "public function canDelete($userId = \"\")\n {\n\n if ($userId == \"\")\n $userId = Yii::$app->user->id;\n\n if ($this->user_id == $userId)\n return true;\n\n if (Yii::$app->user->isAdmin()) {\n return true;\n }\n\n if ($this->container instanceof Space && $this->container->isAdmin($userId)) {\n return true;\n }\n\n return false;\n }", "function CanDelete()\n\t{\t\n\t\t\n\t\tif ($this->id && !$this->GetLocations() && $this->CanAdminUserDelete())\n\t\t{\n\t\t\t// courses\n\t\t\t$sql = \"SELECT cid FROM courses WHERE city=\" . (int)$this->id;\n\t\t\tif ($result = $this->db->Query($sql))\n\t\t\t{\tif ($this->db->NumRows($result))\n\t\t\t\t{\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public function getCanDeleteAttribute()\n {\n // Are you the owner if the note?\n return Auth::id() == $this->user_id;\n }", "public function canDelete($item)\n {\n return false;\n }", "public function canDelete($item)\n {\n return false;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webiators_DeleteOrdersFromAdmin::delete_order');\n }", "public function delete(User $user, Event $event)\n {\n return $user->hasPermission('delete-event');\n }", "public function delete(User $user)\n {\n return $user->can('delete_customer');\n }", "public function delete(User $user)\n {\n if ($this->role($user)){\n return $user->hasDirectPermission($this->permission_list['delete']);\n }\n }", "function user_can_delete_post($user_id, $post_id, $blog_id = 1)\n {\n }", "public function delete(User $user)\n {\n $test = DB::table('permissions')->get()->first();\n if ($test->delete_commande and $test->id_user == $user->id){\n return true;\n }else{\n return false;\n }\n }", "public function authorize()\n {\n // パラメータのIDからで削除対象のリプライを取得\n $post = Post::find($this->route(\"id\"));\n // if ($reply == null) return false;\n\n return $post && $this->user()->id == $post->user_id ? true : false;\n }", "public function delete(User $user)\n {\n return $user->hasPermissionTo('delete campaign');\n }", "public function delete(User $user)\n {\n return $user->hasPermission('user-delete');\n }", "function canDelete($member = NULL)\n\t{\n\t\treturn true;\n\t}", "protected function check_delete_permission($post)\n {\n }", "abstract public function shouldIDelete();", "public function delete(User $user, EduDocument $document)\n {\n\t\treturn $user->id == $document->user_id || $user->can('Edu-document');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Training_Vendor::main_index_delete');\n }", "public function delete(User $user)\n {\n if($user->can('carts-delete') || $user->can('cart-delete')) {\n return true;\n }\n return false;\n }", "public function action_delete_delete(){\r\n\t\t\t//permission check\r\n\t\t\tif(!$this->user->can('Assumeownership', array('owner' => $this->user->id))){\r\n\t\t\t\t$this->throw_permission_error(Constant::NOT_OWNER);\r\n\t\t\t}\r\n\r\n\t\t\tif(!isset($this->myID) || !isset($this->myID2))\r\n\t\t\t{\r\n\t\t\t\t$error_array = array(\r\n\t\t\t\t\t\"error\" => \"Required Parameters Missing\",\r\n\t\t\t\t\t\"desc\" => \"Required Parameters Missing.\"\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$this->modelNotSetError($error_array);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$subject = Ent::eFact($this->myID, $this->myID2);\r\n\t\t\t$subject->delete_with_deps();\r\n\t\t\treturn $subject->getBasics();\r\n\t\t}", "public function delete(User $user, $entity)\n {\n return Auth::check() && !$this->shadow() && (!empty($entity->campaign_id) ? $user->campaign->id == $entity->campaign_id : true)\n && $this->checkPermission('delete', $user, $entity);\n }", "public function authorize()\n {\n abort_if(Gate::denies('comment_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n return false;\n }", "function userCanDeleteContact( $sessionID, $contactID ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "public function delete() {\n $stmt = $this->pro->prepare('delete from user where id = :id');\n $stmt->bindValue(':id', $this->id);\n return $stmt->execute() == 1;\n }", "public function canDelete($identifier = null);", "public function authorize()\n {\n return $this->user()->can('manage-drafts');\n }", "public function deletePolicy(User $user)\n {\n return $user->may(static::PERMISSION_DELETE);\n }", "public function deletePolicy(User $user)\n {\n return $user->may(static::PERMISSION_DELETE);\n }", "public function delete(User $user, File $file)\n {\n return Permission::anyoneCanAccess($file->id)\n || Permission::userCanAccess($user->id, $file->id, \"write\");\n }", "protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t return Factory::getUser()->authorise(\n\t\t\t\t\"core.delete\",\n\t\t\t\t\"com_dinning_philosophers.dinning_philosophers.\".$record->id\n\t\t\t);\n\t\t}\n\t}", "public function interceptDelete()\n\t{\n\t\t$user = $this->getService('com://admin/ninjaboard.model.people')->getMe();\n\t\t$rows = $this->getModel()->getList();\n\t\tforeach($rows as $row)\n\t\t{\n\t\t\t$topic = $this->getService('com://site/ninjaboard.model.topics')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($row->ninjaboard_topic_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\t\t\t$forum = $this->getService('com://site/ninjaboard.model.forums')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($topic->forum_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\n\t\t\t// @TODO we migth want to add an option later, wether or not to allow users to delete their own post.\n\t\t\tif($forum->post_permissions < 3 && $row->created_by != $user->id) {\n\t\t\t\tJError::raiseError(403, JText::_('COM_NINJABOARD_YOU_DONT_HAVE_THE_PERMISSIONS_TO_DELETE_OTHERS_TOPICS'));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "function delete() {\n\t\t$query = '\n\t\t\tDELETE FROM '.system::getConfig()->getDatabase('mofilm_content').'.userSourcePermissions\n\t\t\tWHERE\n\t\t\t\tID = :ID\n\t\t\tLIMIT 1';\n\n\t\t$oStmt = dbManager::getInstance()->prepare($query);\n\t\t$oStmt->bindValue(':ID', $this->getID());\n\n\t\tif ( $oStmt->execute() ) {\n\t\t\t$oStmt->closeCursor();\n\t\t\t$this->reset();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function beforeDelete() {\n // Console doesn't have Yii::$app->user, so we skip it for console\n if (php_sapi_name() != 'cli') {\n // Don't let delete yourself\n if (Yii::$app->user->id == $this->id) {\n return false;\n }\n\n // Don't let non-superadmin delete superadmin\n if (!Yii::$app->user->isSuperadmin AND $this->superadmin == 1) {\n return false;\n }\n }\n\n return parent::beforeDelete();\n }", "protected function canDelete($record)\n\t{\n\t\tif (!empty($record->id))\n\t\t{\n\t\t\tif ($record->state != -2)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$user = JFactory::getUser();\n\t\t\t\n\t\t\treturn $user->authorise('core.delete', 'com_cooltouraman.course.' . (int) $record->id);\n\t\t}\n\n\t\treturn false;\n\t}", "function canDelete(&$msg, $oid = NULL) {\n\t\t//$tables[] = array( 'label' => 'Users', 'name' => 'users', 'idfield' => 'user_id', 'joinfield' => 'user_company' );\n\t\t//return CDpObject::canDelete( $msg, $oid, $tables );\n\t\treturn true;\n\t}", "protected function _can_delete($delete_id) {\n\t\treturn TRUE;\n\t}", "protected function _can_delete($delete_id) {\n\t\treturn TRUE;\n\t}", "public function isPermDeleted($userid) {\n $recipient = $this->mailboxRecipient($userid);\n if ($this->sender_id == $userid) {\n $flag = $this->sender_del;\n } elseif ($recipient != null) {\n $flag = $recipient->recipient_del;\n }\n\n return is_null($flag) ? true : false;\n }", "private function canDelete(User $user, ?Place $place): bool\n {\n return $this->canEdit($user, $place);\n }", "public function authorize()\n {\n $name = $this->relatedResource()->name();\n $model = $this->resource()->getModel();\n $relatedModel = $this->relationship()->getRelated();\n\n return parent::authorize()\n && $this->authorizeIfPolicyExists(\"detach$name\", $model, $relatedModel);\n }", "public function isDelete() {\n if($this->method === 'DELETE') {\n return true;\n } else {\n return false;\n }\n }", "public function canDelete($member = null) {\n\t\treturn ($this->Code == 'DEFAULT') ? false : Permission::check('Product_CANCRUD');\n\t}", "public function delete(): bool\n {\n\n return false;\n }", "public function delete(User $user)\n {\n return $user->hasPermissionTo('experience_delete');\n }", "protected function _can_delete($delete_id) {\r\n return true;\r\n }", "public function authorize()\n {\n return $this->user()->can('Crear Departamentos');\n\n }", "public function isDelete() {\n return $this->method == 'DELETE';\n }", "public function delete(User $user)\n {\n return (int)Route::current()->parameters('user')['user'] === $user->id && Auth::guard('admin-api')->user()->token()->client->personal_access_client;\n }", "protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t\treturn Factory::getUser()->authorise(\"core.delete\", \"com_bookingmanager.customer.\" . $record->id);\n\t\t}\n\t}", "protected function CanDelete(Container $container)\n {\n return self::Guard()->Allow(BackendAction::Delete(), $container);\n }" ]
[ "0.7494141", "0.7403055", "0.73354065", "0.73117226", "0.7306132", "0.7175039", "0.71588385", "0.71575725", "0.715621", "0.7146644", "0.70949966", "0.7081669", "0.70721906", "0.7034842", "0.7013619", "0.69893277", "0.6985067", "0.6962062", "0.6839201", "0.6789569", "0.67787766", "0.67655724", "0.6762386", "0.67523456", "0.67508346", "0.67486316", "0.67476255", "0.67267334", "0.6665836", "0.66404706", "0.6611965", "0.6603812", "0.6573762", "0.6555048", "0.6546557", "0.65393806", "0.6538234", "0.6535564", "0.65047884", "0.6494038", "0.647122", "0.64496404", "0.64369255", "0.64335406", "0.6431145", "0.64067876", "0.64029974", "0.639796", "0.6396853", "0.6390109", "0.63897294", "0.6384411", "0.63805294", "0.636432", "0.636432", "0.6355162", "0.63403684", "0.6332901", "0.6326227", "0.6320867", "0.6309915", "0.6308304", "0.6305431", "0.62986594", "0.6287448", "0.62780756", "0.62768", "0.62755245", "0.62651414", "0.62639314", "0.6259035", "0.6257603", "0.6247515", "0.624535", "0.6238268", "0.62369406", "0.62255055", "0.62180597", "0.62180597", "0.6217169", "0.62170374", "0.6207864", "0.619871", "0.6193611", "0.61895293", "0.6182039", "0.6176086", "0.6176086", "0.6175415", "0.6164679", "0.6158708", "0.615162", "0.6145962", "0.61441183", "0.6136697", "0.61334914", "0.61253387", "0.61230576", "0.6119809", "0.61177933", "0.61092633" ]
0.0
-1
Retrieve the database table column => post_meta mapping.
public function get_postmeta_mapping() { return $this->postmeta_mapping; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPostColumns()\n {\n return array(\n 'post' => 'post', \n 'prefecture' => 'prefecture', \n 'address1' => 'address1', \n 'address2' => 'address2', \n 'tel' => 'tel', \n 'fax' => 'fax',\n 'category' => 'category',\n 'healthCheck' => 'healthCheck'\n );\n }", "public static function get_meta_table();", "public function meta(){\n $table_meta = new \\stdClass();\n\n // get fields in the database table\n if(count($this->_model_meta)==0){\n $this->_meta();\n }\n\n\n foreach ($this->_model_meta as $meta) {\n $table_meta->{$meta->name} = $meta;\n }\n\n return $table_meta;\n }", "private static function postmeta_table( $query ) {\n\t\t\t/** @var \\wpdb $wpdb */\n\t\t\tglobal $wpdb;\n\t\t\t$postmeta_table = $wpdb->postmeta;\n\n\t\t\tif ( ! $query->tribe_is_multi_posttype ) {\n\t\t\t\treturn $postmeta_table;\n\t\t\t}\n\n\t\t\t$qv = $query->query_vars;\n\n\t\t\t// check if are any meta queries\n\t\t\tif ( ! empty( $qv['meta_key'] ) ) {\n\t\t\t\t$postmeta_table = 'tribe_event_postmeta';\n\t\t\t} else {\n\t\t\t\tif ( isset( $qv['meta_query'] ) ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t( is_array( $qv['meta_query'] ) && ! empty( $qv['meta_query'] ) ) ||\n\t\t\t\t\t\t( $qv['meta_query'] instanceof WP_Meta_Query && ! empty( $qv['meta_query']->queries ) )\n\t\t\t\t\t) {\n\t\t\t\t\t\t$postmeta_table = 'tribe_event_postmeta';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$postmeta_table = $wpdb->postmeta;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $postmeta_table;\n\t\t}", "public function getMetaData()\n {\n if (is_null($this->_metaData)) {\n list($app, $name) = explode('/', $this->_config['name']);\n $args = array($name, $this->_config['params']);\n $this->_metaData = $GLOBALS['registry']->callByPackage(\n $app, 'getTableMetaData', $args);\n\n // We need to make vars for the columns.\n foreach ($this->_metaData['sections'] as $secname => $section) {\n foreach ($section['columns'] as $col) {\n $title = isset($col['title']) ? $col['title'] : '';\n $typename = isset($col['type']) ? $col['type'] : 'text';\n $params = isset($col['params']) ? $col['params'] : array();\n // Column types which begin with % are pseudo-types handled\n // directly.\n if (substr($typename, 0, 1) != '%') {\n $type = Horde_Form::getType($typename, $params);\n $var = new Horde_Form_Variable(\n $title, $col['name'], $type, false, true, '');\n $this->_formVars[$secname][$col['name']] = $var;\n }\n }\n }\n }\n\n return $this->_metaData;\n }", "public function columnMap()\n {\n //the values their names in the application\n return array(\n 'id' => 'code' ,\n 'the_name' => 'theName' ,\n 'the_type' => 'theType' ,\n 'the_year' => 'theYear'\n );\n }", "function _map_post_data_for_model()\n\t{\n\t\t// create map the abbreviate post data to database\n\t\t$post_data_map = array(\n 'id'\t=> 'device_id',\n 'h'\t\t=> 'heading',\n 'la'\t=> 'latitude',\n 'lo' \t=> 'longitude',\n 's' \t=> 'speed',\n 't' \t=> 'timestamp',\n \t);\n \t\n\t\t// create new array with full column names as keys to to be passed in\n\t\t// to model\n \t$event = array();\n \tforeach ($post_data_map as $key => $value) {\n \t\t$post_value = $this->input->post($key);\n\t\t\t\n\t\t\t// break and return NULL if any value is blank\n\t\t\tif (!isset($post_value) or $post_value == '') {\n\t\t\t\treturn NULL;\n\t\t\t} else {\n\t \t\t$event[$value] = $post_value;\n\t\t\t}\n\t\t}\n\t\treturn $event;\n\t}", "public function _meta(){\n if(!$this->db->table_exists($this->table_name())):\n throw new OrmExceptions(sprintf(\"The table %s does not exist\", $this->table_name()));\n endif;\n\n if(empty($this->_model_meta )){\n $this->_model_meta = $this->db->field_data($this->table_name());\n $this->_fields_loaded = TRUE;\n }\n return $this->_model_meta ;\n }", "public function fields_names(){\n $table_meta = array();\n // get fields in the database table\n\n foreach ($this->_meta() as $meta) {\n array_push($table_meta, $meta->name);\n }\n\n return $table_meta;\n }", "public static function get_post_meta($post,$key){\n\t\t$post_id = false;\n\n\t\tif(!is_numeric($post)){\n\t\t\tif(isset($post->id)){\n\t\t\t\t$post_id = $post->id;\n\t\t\t}else{\n\t\t\t\t$post_id = $post->ID;\n\t\t\t}\n\t\t}else{\n\t\t\t$post_id = $post;\n\t\t}\n\n\t\tif(!$post_id) return [];\n\n\t\tstatic $cache = [];\n\n\t\tif(isset($cache[$post_id][$key])) return $cache[$post_id][$key];\n\n\t\t$meta = get_post_meta($post_id,$key,true);\n\n\t\tif($meta){\n\t\t\t$cache[$post_id][$key] = $meta;\n\t\t}\n\n\t\treturn $meta;\n\t}", "public function getColumnMeta($column)\r\n\t{\r\n\t\t$field = $this->pdo->driver->fetchField($this->resource, $column);\r\n\t\t$field = (array)$field;\r\n\t\t\r\n\t\treturn $field;\r\n\t}", "public function getMeta($column)\n\t{\n\t\treturn isset($this->meta[$column]) ? $this->meta[$column] : null;\n\t}", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'level' => 'level',\n 'name' => 'name',\n 'sort' => 'sort',\n 'type' => 'type',\n 'value' => 'value',\n 'token' => 'token',\n 'pid' => 'pid'\n ];\n }", "function meta($key) {\n return get_post_meta($post->ID, $key, true);\n}", "public function columnMap()\n {\n //the values their names in the application\n return array(\n 'id' => 'ID',\n 'item_id' => 'Item_ID',\n 'des' => 'Des',\n 'depts_id' => 'Depts_ID',\n 'application_id' => 'Application_ID',\n 'module_id' => 'Module_ID',\n );\n\n\n }", "public function columnMap()\n {\n return [\n 'id_categoria' => 'id_categoria',\n 'titulo' => 'titulo',\n 'descripcion' => 'descripcion'\n ];\n }", "function mappingColumns()\n {\n $mapped_columns = array(\n \"id\" => 0,\n \"url\" => 2,\n \"iframe\" => false,\n \"preview\" => false,\n \"thumbs\" => 1,\n \"title\" => 3,\n \"tags\" => 5,\n \"categories\" => 4,\n \"pornstars\" => 6,\n \"duration\" => 7,\n \"views\" => false,\n \"likes\" => false,\n \"unlikes\" => false,\n );\n\n return $mapped_columns;\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'notice_id' => 'notice_id',\n 'worker_id' => 'worker_id'\n ];\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'id_user' => 'id_user',\n 'ip' => 'ip',\n 'user_agent' => 'user_agent'\n ];\n }", "function wtr_events_locations_custom_columns($column){\r\n\r\n\tglobal $post;\r\n\r\n\tswitch ($column) {\r\n\t\tcase \"event_locatio_address\":\r\n\t\t\techo get_post_meta( $post->ID, '_wtr_events_locations_address', true );\r\n\t\tbreak;\r\n\t}\r\n}", "public function columnMap(){\n\t\treturn array(\n\t\t\t'id'=> 'id',\n\t\t\t'name'=> 'name',\n\t\t\t'content'=> 'content' \n\t\t);\n\t}", "public static function getAccessiblePostMeta($postId)\n {\n $meta = get_post_meta($postId);\n $newMeta = array();\n foreach ($meta as $key => $list) {\n if (count($list) == 1) {\n $newMeta[$key] = $list[0];\n } else {\n $newMeta[$key] = $list;\n }\n }\n\n return $newMeta;\n }", "public function field_metacolumn($table, $col_name){\r\n $arr = array(); \r\n $arr = $this->db->MetaColumns($table);\r\n\r\n $obj_field = new ADOFieldObject();\r\n if(isset($arr[strtoupper($col_name)])){\r\n $obj_field = $arr[strtoupper($col_name)];\r\n // print('<pre>');\r\n // print_r($obj_field);\r\n // print('</pre>');\r\n return $obj_field; \r\n }else{\r\n return false;\r\n }\r\n \r\n\r\n\r\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'pole_id' => 'pole_id',\n 'worker_id' => 'worker_id',\n 'notice' => 'notice'\n ];\n }", "public function getPostsTable(): string\n {\n return $this->wpDatabase->posts;\n }", "public function get_meta() {\n\t\treturn $this->meta;\n\t}", "public function get_meta() {\n\t\treturn $this->meta;\n\t}", "function jeg_post_columns($columns)\n{\n\t$columns['posttype'] = 'Blog Post Type';\n\treturn $columns;\n}", "public function get_metadata() {\n\t\t$metadata = [];\n\n\t\tforeach ( $this->get_mapping() as $attribute => $meta_key ) {\n\t\t\t$metadata[ $attribute ] = $this->get_meta( $meta_key );\n\t\t}\n\n\t\treturn $metadata;\n\t}", "private function _sql_meta() {\n\t\tglobal $wpdb;\n\n\t\tif ( $this->meta_key && $this->meta_value) {\n\t\t\treturn sprintf(\"%s (%s.meta_key=%s AND %s.meta_value=%s)\"\n\t\t\t\t, $this->join_rule\n\t\t\t\t, $wpdb->postmeta\n\t\t\t\t, $wpdb->prepare('%s', $this->meta_key)\n\t\t\t\t, $wpdb->postmeta\n\t\t\t\t, $wpdb->prepare('%s', $this->meta_value)\n\t\t\t);\n\t\t}\n\t\telseif ($this->meta_key) {\n\t\t\treturn $this->_sql_filter($wpdb->postmeta, 'meta_key', '=', $this->meta_key);\n\t\t}\n\t\telse {\n\t\t\treturn $this->_sql_filter($wpdb->postmeta, 'meta_value', '=', $this->meta_value);\n\t\t}\n\t}", "public function columnMap()\n {\n return array(\n 'sess_id' => 'sess_id',\n 'created' => 'created',\n 'changed' => 'changed',\n 'ip' => 'ip',\n 'vars' => 'vars'\n );\n }", "public function metas()\n {\n return $this->hasMany(PostMeta::class);\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id',\n 'users_id' => 'users_id',\n 'secret_key' => 'secret_key',\n 'hmac' => 'hmac',\n 'created' => 'created'\n );\n }", "public static function getMetaData()\n {\n // _deprecated_function( __FUNCTION__, '1.4.1');\n\n global $post;\n\n $meta = new stdClass();\n\n $active = get_post_meta($post->ID, Pronamic_Google_Maps_Post::META_KEY_ACTIVE, true);\n $meta->active = filter_var($active, FILTER_VALIDATE_BOOLEAN);\n\n $meta->latitude = null;\n $value = get_post_meta($post->ID, Pronamic_Google_Maps_Post::META_KEY_LATITUDE, true);\n if ($value != '') {\n $meta->latitude = (float)$value;\n }\n $meta->longitude = null;\n $value = get_post_meta($post->ID, Pronamic_Google_Maps_Post::META_KEY_LONGITUDE, true);\n if ($value != '') {\n $meta->longitude = (float)$value;\n }\n\n $meta->mapType = self::MAP_TYPE_DEFAULT;\n $value = get_post_meta($post->ID, Pronamic_Google_Maps_Post::META_KEY_MAP_TYPE, true);\n if ($value != '') {\n $meta->mapType = $value;\n }\n\n $meta->zoom = self::MAP_ZOOM_DEFAULT;\n $value = get_post_meta($post->ID, Pronamic_Google_Maps_Post::META_KEY_ZOOM, true);\n if ($value != '') {\n $meta->zoom = (int)$value;\n }\n\n $meta->title = get_post_meta($post->ID, Pronamic_Google_Maps_Post::META_KEY_TITLE, true);\n\n $description = get_post_meta($post->ID, Pronamic_Google_Maps_Post::META_KEY_DESCRIPTION, true);\n if (!is_admin()) {\n $description = apply_filters('pronamic_google_maps_item_description', $description);\n }\n $meta->description = $description;\n\n $meta->address = get_post_meta($post->ID, Pronamic_Google_Maps_Post::META_KEY_ADDRESS, true);\n\n $meta = apply_filters('pronamic_google_maps_post_meta', $meta);\n\n return $meta;\n }", "protected function getKeyField() {\n return \"PostID\"; \n }", "public function getColumnMeta($column)\n {\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id',\n 'title' => 'title',\n 'source_id' => 'source_id',\n 'abstract' => 'abstract',\n 'Personal_Author' => 'Personal_Author',\n 'Corporate_Author' => 'Corporate_Author',\n 'parent_literature' => 'parent_literature',\n 'conference_title' => 'conference_title',\n 'conference_date' => 'conference_date',\n 'conference_place' => 'conference_place',\n 'host_unit' => 'host_unit',\n 'keywords' => 'keywords',\n 'publishDate' => 'publishDate',\n 'file_id' => 'file_id'\n );\n }", "function MetaColumns($table,$normalize=true)\n\t{\n\t\tglobal $ADODB_FETCH_MODE;\n\n\t\t$schema = false;\n\t\t$false = false;\n\t\t$this->_findschema($table,$schema);\n\n\t\tif ($normalize) $table = strtolower($table);\n\n\t\t$save = $ADODB_FETCH_MODE;\n\t\t$ADODB_FETCH_MODE = ADODB_FETCH_NUM;\n\t\tif ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);\n\n\t\t$rs = $this->Execute($this->_generateMetaColumnsSQL($table, $schema));\n\t\tif (isset($savem)) $this->SetFetchMode($savem);\n\t\t$ADODB_FETCH_MODE = $save;\n\n\t\tif ($rs === false) {\n\t\t\treturn $false;\n\t\t}\n\t\tif (!empty($this->metaKeySQL)) {\n\t\t\t// If we want the primary keys, we have to issue a separate query\n\t\t\t// Of course, a modified version of the metaColumnsSQL query using a\n\t\t\t// LEFT JOIN would have been much more elegant, but postgres does\n\t\t\t// not support OUTER JOINS. So here is the clumsy way.\n\n\t\t\t$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;\n\n\t\t\t$rskey = $this->Execute(sprintf($this->metaKeySQL,($table)));\n\t\t\t// fetch all result in once for performance.\n\t\t\t$keys = $rskey->GetArray();\n\t\t\tif (isset($savem)) $this->SetFetchMode($savem);\n\t\t\t$ADODB_FETCH_MODE = $save;\n\n\t\t\t$rskey->Close();\n\t\t\tunset($rskey);\n\t\t}\n\n\t\t$rsdefa = array();\n\t\tif (!empty($this->metaDefaultsSQL)) {\n\t\t\t$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;\n\t\t\t$sql = sprintf($this->metaDefaultsSQL, ($table));\n\t\t\t$rsdef = $this->Execute($sql);\n\t\t\tif (isset($savem)) $this->SetFetchMode($savem);\n\t\t\t$ADODB_FETCH_MODE = $save;\n\n\t\t\tif ($rsdef) {\n\t\t\t\twhile (!$rsdef->EOF) {\n\t\t\t\t\t$num = $rsdef->fields['num'];\n\t\t\t\t\t$s = $rsdef->fields['def'];\n\t\t\t\t\tif (strpos($s,'::')===false && substr($s, 0, 1) == \"'\") { /* quoted strings hack... for now... fixme */\n\t\t\t\t\t\t$s = substr($s, 1);\n\t\t\t\t\t\t$s = substr($s, 0, strlen($s) - 1);\n\t\t\t\t\t}\n\n\t\t\t\t\t$rsdefa[$num] = $s;\n\t\t\t\t\t$rsdef->MoveNext();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tADOConnection::outp( \"==> SQL => \" . $sql);\n\t\t\t}\n\t\t\tunset($rsdef);\n\t\t}\n\n\t\t$retarr = array();\n\t\twhile (!$rs->EOF) {\n\t\t\t$fld = new ADOFieldObject();\n\t\t\t$fld->name = $rs->fields[0];\n\t\t\t$fld->type = $rs->fields[1];\n\t\t\t$fld->max_length = $rs->fields[2];\n\t\t\t$fld->attnum = $rs->fields[6];\n\n\t\t\tif ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4;\n\t\t\tif ($fld->max_length <= 0) $fld->max_length = -1;\n\t\t\tif ($fld->type == 'numeric') {\n\t\t\t\t$fld->scale = $fld->max_length & 0xFFFF;\n\t\t\t\t$fld->max_length >>= 16;\n\t\t\t}\n\t\t\t// dannym\n\t\t\t// 5 hasdefault; 6 num-of-column\n\t\t\t$fld->has_default = ($rs->fields[5] == 't');\n\t\t\tif ($fld->has_default) {\n\t\t\t\t$fld->default_value = $rsdefa[$rs->fields[6]];\n\t\t\t}\n\n\t\t\t//Freek\n\t\t\t$fld->not_null = $rs->fields[4] == 't';\n\n\n\t\t\t// Freek\n\t\t\tif (is_array($keys)) {\n\t\t\t\tforeach($keys as $key) {\n\t\t\t\t\tif ($fld->name == $key['column_name'] AND $key['primary_key'] == 't')\n\t\t\t\t\t\t$fld->primary_key = true;\n\t\t\t\t\tif ($fld->name == $key['column_name'] AND $key['unique_key'] == 't')\n\t\t\t\t\t\t$fld->unique = true; // What name is more compatible?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;\n\t\t\telse $retarr[($normalize) ? strtoupper($fld->name) : $fld->name] = $fld;\n\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\t$rs->Close();\n\t\tif (empty($retarr))\n\t\t\treturn $false;\n\t\telse\n\t\t\treturn $retarr;\n\n\t}", "public function columnMap()\n {\n return array(\n 'name' => 'name', \n 'description' => 'description', \n );\n }", "public function metaField()\n {\n return $this->belongsTo(\n MetaField::class,\n self::COLUMN_META_FIELD_ID\n );\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'area_name' => 'area_name',\n 'area_short_name' => 'area_short_name',\n 'area_parent_id' => 'area_parent_id',\n 'area_sort' => 'area_sort',\n 'area_deep' => 'area_deep',\n 'area_region' => 'area_region'\n ];\n }", "public function get_field_map( $name ) {\n\t\tif ( in_array( $name, [ 'post_title', 'post_content', 'post_excerpt' ], true ) ) {\n\t\t\tif ( isset( $this->field_map['post'][ $name ] ) ) {\n\t\t\t\treturn $this->field_map['post'][ $name ];\n\t\t\t}\n\t\t} else {\n\t\t\tif ( isset( $this->field_map['postmeta'][ $name ] ) ) {\n\t\t\t\treturn $this->field_map['postmeta'][ $name ];\n\t\t\t}\n\t\t}\n\t}", "function posts_custom_columns( $column_name, $id ){\n if( $column_name === 'thumb_img'){\n echo the_post_thumbnail('thumb_img');\n }\n\n //global $post;\n //$custom = get_post_custom($post->ID);\n //$email = $custom[\"email\"][0];\n\n //if($column_name === 'email'){\n //echo $email;\n //}\n\n}", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'user_id' => 'user_id',\n 'create_time' => 'create_time',\n 'money' => 'money',\n 'bank_name' => 'bank_name',\n 'account_bank' => 'account_bank',\n 'account_name' => 'account_name',\n 'remark' => 'remark',\n 'status' => 'status'\n ];\n }", "function map_columns($columns)\n {\n $columns[$this->taxonomies_id] = __($this->taxonomies_name, $this->tax_domain);\n return $columns;\n }", "private function getProperties(){\n\n\n\t\t$props = get_post_meta(\n\t\t\t$this->post_id,\n\t\t\t'_column_props_'.$this->fullId,\n\t\t\ttrue\n\t\t);\n\n\n\n\t\t$defaults = $this->getDefaultColumnArgs();\n\t\t$props = wp_parse_args( $props, $defaults );\n\n\t\t$this->properties = $props;\n\n\t}", "public function getMetaData($post_id) {\n $query = \"SELECT * FROM wp_pwgb_postmeta\n WHERE post_id = :post_id;\";\n $stm = $this->db->prepare($query);\n $stm->bindValue(\":post_id\", $post_id, PDO::PARAM_INT);\n $stm->execute();\n\n $response = $stm->fetchAll(PDO::FETCH_ASSOC);\n return $response;\n }", "static function get_post_metas($post){\n\t\t$post_id = false;\n\n\t\tif(!is_numeric($post)){\n\t\t\tif(isset($post->id)){\n\t\t\t\t$post_id = $post->id;\n\t\t\t}else{\n\t\t\t\t$post_id = $post->ID;\n\t\t\t}\n\t\t}else{\n\t\t\t$post_id = $post;\n\t\t}\n\n\t\tif(!$post_id) return [];\n\n\t\tstatic $cache;\n\t\tif(isset($cache[$post_id])) return $cache[$post_id];\n\n\t\t/**\n\t\t * Get and unserialize post meta\n\t\t *\n\t\t * @param $post_id\n\t\t *\n\t\t * @return array\n\t\t */\n\t\t$get_metas = function($post_id){\n\t\t\t$metas = array_map(function($value){\n\t\t\t\tif(is_array($value) && isset($value[0])){\n\t\t\t\t\treturn maybe_unserialize($value[0]);\n\t\t\t\t}else{\n\t\t\t\t\treturn $value;\n\t\t\t\t}\n\t\t\t},get_post_meta($post_id));\n\t\t\treturn $metas;\n\t\t};\n\n\t\t$metas = $get_metas($post_id);\n\n\t\t$cache[$post_id] = $metas;\n\n\t\treturn $metas;\n\t}", "public function getPostMeta(int $postId, string $name)\n {\n return $this->app->getPostMeta($postId, $name);\n }", "public function columnMap()\n {\n return [\n 'imageid' => 'imageid',\n 'galleryid' => 'galleryid',\n 'visible' => 'visible'\n ];\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id',\n 'username' => 'username',\n 'hash' => 'hash',\n 'email' => 'email',\n 'created' => 'created'\n );\n }", "public function post_metas()\n {\n return $this->hasMany('App\\PostMeta');\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id', \n 'name' => 'name', \n 'class_name' => 'class_name', \n 'description' => 'description', \n 'logo' => 'logo',\n 'delsign' => 'delsign'\n );\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'nickname' => 'nickname',\n 'realname' => 'realname',\n 'username' => 'username',\n 'openid' => 'openid',\n 'phone' => 'phone',\n 'passwd' => 'passwd',\n 'avatar' => 'avatar',\n 'sex' => 'sex',\n 'province' => 'province',\n 'city' => 'city',\n 'area' => 'area',\n 'address' => 'address',\n 'cardsn' => 'cardsn',\n 'recommend' => 'recommend',\n 'level' => 'level',\n 'groupid' => 'groupid',\n 'vip' => 'vip',\n 'add_at' => 'add_at',\n 'active' => 'active',\n 'integral' => 'integral',\n 'money' => 'money',\n 'update_at' => 'update_at'\n ];\n }", "protected function meta() {\n if (!$this->_meta) {\n // Initialize at first call\n $this->_meta = new \\stdClass();\n if (!$this->isNewRecord && $this->{static::meta_id_field()}) {\n foreach ($this->meta as $meta_row) {\n $this->_meta->{static::meta_prefix() . $meta_row->meta_key} = $meta_row->meta_value;\n }\n }\n }\n return $this->_meta;\n }", "public function columnMap()\n {\n return array(\n 'id' => 'sfafba_id',\n\t\t\t'partner_id' => 'sfafba_partner_id',\n\t\t\t'name' => 'sfafba_name',\n\t\t\t'size' => 'sfafba_size',\n\t\t\t'lang' => 'sfafba_lang',\n\t\t\t'html_code' => 'sfafba_html_code',\n\t\t\t'keywords' => 'sfafba_keywords',\n\t\t\t'is_active' => 'sfafba_is_active',\n\t\t\t'created_at' => 'sfafba_created_at',\n\t\t\t'updated_at' => 'sfafba_updated_at'\n );\n }", "public function meta()\n {\n return $this->meta;\n }", "public function columnMaps();", "public function columnMap()\n {\n return [\n 'id_comentario' => 'id_comentario',\n 'comentario' => 'comentario',\n 'fecha_comentario' => 'fecha_comentario',\n 'id_reporte' => 'id_reporte',\n 'id_usuario' => 'id_usuario'\n ];\n }", "public function getMeta() {\n return $this->hasMany(Meta::class,\n ['owner_id' => static::meta_id_field()])->andWhere([Meta::tableName() . '.owner' => static::tableName()]);\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'user_id' => 'user_id',\n 'session_id' => 'session_id',\n 'goods_id' => 'goods_id',\n 'goods_sn' => 'goods_sn',\n 'goods_name' => 'goods_name',\n 'market_price' => 'market_price',\n 'goods_price' => 'goods_price',\n 'member_goods_price' => 'member_goods_price',\n 'goods_num' => 'goods_num',\n 'spec_key' => 'spec_key',\n 'spec_key_name' => 'spec_key_name',\n 'bar_code' => 'bar_code',\n 'selected' => 'selected',\n 'add_time' => 'add_time',\n 'prom_type' => 'prom_type',\n 'prom_id' => 'prom_id',\n 'sku' => 'sku'\n ];\n }", "public static function manage_post_columns( $column, $post_id ) {\n\t\t\tglobal $post;\n\t\t\n\t\t\tswitch( $column ) {\n\t\t\n\t\t\t\tcase 'category' :\n\t\t\n\t\t\t\t\t$menucat = get_post_meta( $post->ID, 'meta_menucat', true );\n\t\t\n\t\t\t\t\tif ( empty( $menucat ) )\n\t\t\t\t\t\techo __( 'No classification yet' );\n\t\t\n\t\t\t\t\telse\n\t\t\t\t\t\t$name = self::get_metaname($menucat);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( empty( $name ) ) {\n\t\t\t\t\t\t\techo __( 'No classification yet' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo __($name);\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\tbreak;\n\t\t\n\t\t\t\tdefault :\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'name' => 'name',\n 'type' => 'type',\n 'expression' => 'expression',\n 'description' => 'description',\n 'start_time' => 'start_time',\n 'end_time' => 'end_time',\n 'is_close' => 'is_close',\n 'group' => 'group',\n 'prom_img' => 'prom_img',\n 'goods_ids' => 'goods_ids'\n ];\n }", "public function getFieldValues()\n {\n if($this->isNewRecord){\n return []; //TODO: LOAD DEFAULT FIELDS OF TYPE\n }\n\n //pull meta values from DB\n $table = self::tablePrefix().'cms_post_field';\n $strSql = \"SELECT id, field_id, value \n\t\t\t\t\tFROM {$table}\n\t\t\t\t\tWHERE post_id = :pid\n\t\t\t\t \";\n $cmd = self::getDb()->createCommand($strSql);\n $cmd->bindValue(\":pid\",$this->id,\\PDO::PARAM_STR);\n $arrResults = $cmd->queryAll();\n\n return ArrayHelper::index($arrResults, 'id', 'field_id');\n }", "public function seePostMetaInDatabase(array $criteria)\n {\n $tableName = $this->grabPrefixedTableNameFor('postmeta');\n $this->seeInDatabase($tableName, $criteria);\n }", "function sb_slideshow_custom_columns( $column, $post_id ) {\n\tswitch( $column ) {\n\t\tcase 'id':\n\t\t\techo $post_id;\n\t\tbreak;\n\t\tcase 'shortcode':\n\t\t\techo sb_slideshow_embed_input( $post_id );\n\t\tbreak;\n\t}\n}", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'purchase_invoices_id' => 'purchase_invoices_id',\n 'product_id' => 'product_id',\n 'quantity' => 'quantity',\n 'price' => 'price',\n 'total' => 'total',\n 'created_at' => 'created_at'\n ];\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'producer_id' => 'producer_id',\n 'description_id' => 'description_id',\n 'product_detail_id' => 'product_detail_id',\n 'quantity' => 'quantity',\n 'import_price' => 'import_price',\n 'sale_price' => 'sale_price',\n 'discount' => 'discount',\n 'view' => 'view',\n 'hot' => 'hot',\n 'created_at' => 'created_at'\n ];\n }", "public function columnMap()\n {\n return array(\n 'bank_id' => 'bank_id',\n 'title' => 'title',\n 'name' => 'name',\n 'shorten' => 'shorten',\n 'logo' => 'logo',\n 'home' => 'home',\n 'epay' => 'epay',\n 'bankcode' => 'bankcode',\n 'status' => 'status'\n );\n }", "public function columnMap()\n {\n return array(\n 'mandatary_id' => 'mandatary_id',\n 'phone' => 'phone',\n 'real_name' => 'real_name',\n 'id_card' => 'id_card',\n 'id_card_image' => 'id_card_image',\n 'business_id' => 'business_id',\n 'status' => 'status',\n 'user_id' => 'user_id',\n 'update_time' => 'update_time'\n );\n }", "public function tableColumnsContent($column, $postId)\n {\n \tif ($column == 'post_type') {\n \t\t$comment = get_comment($postId, OBJECT);\n \t\t$post_type_slug = get_post_type($comment->comment_post_ID);\n \t\t$post_type_obj = get_post_type_object($post_type_slug);\n \t\techo $post_type_obj->label;\n \t}\n }", "function ae_get_db_fields( ) {\n\n global $wpdb;\n\n return $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT `DATA_TYPE`, `CHARACTER_MAXIMUM_LENGTH`, `COLUMN_NAME`\n FROM `information_schema`.`COLUMNS`\n WHERE `TABLE_SCHEMA` = '%s'\n AND `TABLE_NAME` = '{$wpdb->products}'\",\n DB_NAME\n )\n );\n}", "function get_column() {\n global $post;\n $list = array();\n $num = 0;\n $termsObjects = get_the_terms('', 'column_info', '');\n if (!empty($termsObjects)){\n foreach ($termsObjects as $v) {\n $list[$num] = $v->slug;\n $num++;\n }\n }\n return($list);\n}", "function DNUI_getRowPostMeta($id) {\r\n global $wpdb;\r\n $sql = 'SELECT * FROM ' . $wpdb->prefix . 'postmeta where post_id=' . $id . ';';\r\n return $wpdb->get_results($sql, \"ARRAY_A\");\r\n}", "public function getName() {\n\t\treturn 'postmeta';\n\t}", "function pms_get_post_meta( $post_id, $key = '', $single = false ) {\r\n\r\n if( empty( $key ) ) {\r\n $post_meta = get_post_meta( $post_id );\r\n\r\n foreach( $post_meta as $key => $value ) {\r\n $post_meta[$key] = $value[0];\r\n }\r\n\r\n return $post_meta;\r\n }\r\n\r\n return get_post_meta( $post_id, $key, $single );\r\n\r\n }", "private static function get_meta_keys_alt() {\n\n\t global $wpdb;\n\t \n\t return $wpdb->get_col( \"SELECT meta_key FROM $wpdb->postmeta GROUP BY meta_key ORDER BY meta_key\" );\n\t \n\t}", "function lookup_columns()\n {\n // Avoid doing multiple SHOW COLUMNS if we can help it\n $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns');\n $this->_table_columns = C_Photocrati_Transient_Manager::fetch($key, FALSE);\n if (!$this->_table_columns) {\n $this->object->update_columns_cache();\n }\n return $this->_table_columns;\n }", "function populate_custom_column ( $column, $post_id ) {\n switch ( $column ) {\n case 'prezzo':\n echo get_post_meta ( $post_id, 'prezzo', true ) . ' €';\n break;\n case 'ingredienti':\n echo get_post_meta ( $post_id, 'ingredienti', true );\n break;\n }\n }", "public function getMeta(): LaramoreMeta\n {\n return Meta::getForTableName($this->getTableName());\n }", "function TS_VCSC_Testimonials_Get_CustomColumn_Data($columns, $post_id) {\r\n\t\tif ($columns === 'previews') {\r\n\t\t\techo the_post_thumbnail('thumbnail');\r\n\t\t} else if ($columns === 'ids') {\r\n echo $post_id;\r\n }\r\n\t}", "public function columnMap()\n {\n return array(\n 'diaMesAno' => 'diaMesAno'\n );\n }", "public function getMeta($key)\n {\n return $this->meta[$key] = get_post_meta($this->id, $key, true);\n }", "public function columnMap()\n {\n return [\n 'id_rol' => 'id_rol',\n 'rol' => 'rol'\n ];\n }", "function dbTableField($tableName) {\n $data = array();\n $sql = \"SHOW COLUMNS FROM \" . $tableName;\n $result = mysql_query($sql);\n $i = 0;\n while ($row = mysql_fetch_assoc($result)) {\n $data[$i]['Field'] = $row['Field'];\n $data[$i]['Type'] = $row['Type'];\n $data[$i]['Null'] = $row['Null'];\n $data[$i]['Key'] = $row['Key'];\n $data[$i]['Default'] = $row['Default'];\n $data[$i]['Extra'] = $row['Extra'];\n $i++;\n }\n\n return $data;\n }", "public function meta($key)\n {\n return $this->meta[$key] ?? null;\n }", "public function columnMap()\n {\n // the values their names in the application\n return array(\n 'id' => 'id',\n 'enabled' => 'enabled',\n 'suspended' => 'suspended',\n 'gender' => 'gender',\n 'info' => 'info',\n 'password' => 'password',\n 'roles' => 'roles',\n 'first_name' => 'firstName',\n 'last_name' => 'lastName',\n 'email' => 'email',\n 'created_at' => 'created_at',\n 'expires_at' => 'expires_at',\n );\n }", "function _get_fields_map_simple() {\n\t\t$cache_name = \"fields_map_simple\";\n\t\t// Get from local cache\n\t\tif ($this->CACHE_IN_MEMORY && isset($this->$cache_name)) {\n\t\t\treturn $this->$cache_name;\n\t\t}\n\t\t// Create array of fields in tables\n\t\tif (main()->USE_SYSTEM_CACHE) {\n\t\t\t$db_cols = cache_get($cache_name);\n\t\t}\n\t\tif (empty($db_cols)) {\n\t\t\t$Q = db()->query(\"SHOW COLUMNS FROM \".db('user').\"\");\n\t\t\twhile ($A = db()->fetch_assoc($Q)) {\n\t\t\t\tif ($A[\"Field\"] == \"id\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\t\n\t\t\t\t$db_cols[$A[\"Field\"]] = $A[\"Field\"];\n\t\t\t}\n\t\t\tif (main()->USE_SYSTEM_CACHE) {\n\t\t\t\tcache_set($cache_name, $db_cols);\n\t\t\t}\n\t\t}\n\t\t// Put to local cache\n\t\tif ($this->CACHE_IN_MEMORY && !isset($this->$cache_name)) {\n\t\t\t$this->$cache_name\t= $db_cols;\n\t\t}\n\n\t\treturn $db_cols;\n\t}", "function get_maps () {\r\n\t\t$table = $this->get_table_name();\r\n\t\treturn $this->wpdb->get_results(\"SELECT id, title FROM {$table}\", ARRAY_A);\r\n\t}", "public function importPostMeta() {\n\t\t$postsPerAction = 100;\n\t\t$publicPostTypes = implode( \"', '\", aioseo()->helpers->getPublicPostTypes( true ) );\n\t\t$timeStarted = gmdate( 'Y-m-d H:i:s', aioseo()->transients->get( 'import_post_meta_yoast_seo' ) );\n\n\t\t$posts = aioseo()->db\n\t\t\t->start( 'posts' . ' as p' )\n\t\t\t->select( 'p.ID, p.post_type' )\n\t\t\t->join( 'postmeta as pm', '`p`.`ID` = `pm`.`post_id`' )\n\t\t\t->leftJoin( 'aioseo_posts as ap', '`p`.`ID` = `ap`.`post_id`' )\n\t\t\t->whereRaw( \"pm.meta_key LIKE '_yoast_wpseo_%'\" )\n\t\t\t->whereRaw( \"( p.post_type IN ( '$publicPostTypes' ) )\" )\n\t\t\t->whereRaw( \"( ap.post_id IS NULL OR ap.updated < '$timeStarted' )\" )\n\t\t\t->orderBy( 'p.ID DESC' )\n\t\t\t->limit( $postsPerAction )\n\t\t\t->run()\n\t\t\t->result();\n\n\t\tif ( ! $posts || ! count( $posts ) ) {\n\t\t\taioseo()->transients->delete( 'import_post_meta_yoast_seo' );\n\t\t\treturn;\n\t\t}\n\n\t\t$mappedMeta = [\n\t\t\t'_yoast_wpseo_title' => 'title',\n\t\t\t'_yoast_wpseo_metadesc' => 'description',\n\t\t\t'_yoast_wpseo_canonical' => 'canonical_url',\n\t\t\t'_yoast_wpseo_meta-robots-noindex' => 'robots_noindex',\n\t\t\t'_yoast_wpseo_meta-robots-nofollow' => 'robots_nofollow',\n\t\t\t'_yoast_wpseo_meta-robots-adv' => '',\n\t\t\t'_yoast_wpseo_focuskw' => '',\n\t\t\t'_yoast_wpseo_focuskeywords' => '',\n\t\t\t'_yoast_wpseo_opengraph-title' => 'og_title',\n\t\t\t'_yoast_wpseo_opengraph-description' => 'og_description',\n\t\t\t'_yoast_wpseo_opengraph-image' => 'og_image_custom_url',\n\t\t\t'_yoast_wpseo_twitter-title' => 'twitter_title',\n\t\t\t'_yoast_wpseo_twitter-description' => 'twitter_description',\n\t\t\t'_yoast_wpseo_twitter-image' => 'twitter_image_custom_url',\n\t\t\t'_yoast_wpseo_schema_page_type' => '',\n\t\t\t'_yoast_wpseo_schema_article_type' => ''\n\t\t];\n\n\t\tforeach ( $posts as $post ) {\n\t\t\t$postMeta = aioseo()->db\n\t\t\t\t->start( 'postmeta' . ' as pm' )\n\t\t\t\t->select( 'pm.meta_key, pm.meta_value' )\n\t\t\t\t->where( 'pm.post_id', $post->ID )\n\t\t\t\t->whereRaw( \"`pm`.`meta_key` LIKE '_yoast_wpseo_%'\" )\n\t\t\t\t->run()\n\t\t\t\t->result();\n\n\t\t\tif ( ! $postMeta || ! count( $postMeta ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$meta = [\n\t\t\t\t'post_id' => (int) $post->ID,\n\t\t\t];\n\n\t\t\tforeach ( $postMeta as $record ) {\n\t\t\t\t$name = $record->meta_key;\n\t\t\t\t$value = $record->meta_value;\n\n\t\t\t\tif ( ! in_array( $name, array_keys( $mappedMeta ), true ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tswitch ( $name ) {\n\t\t\t\t\tcase '_yoast_wpseo_meta-robots-noindex':\n\t\t\t\t\tcase '_yoast_wpseo_meta-robots-nofollow':\n\t\t\t\t\t\tif ( (bool) $value ) {\n\t\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = ! empty( $value );\n\t\t\t\t\t\t\t$meta['robots_default'] = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_meta-robots-adv':\n\t\t\t\t\t\t$values = explode( ',', $value );\n\t\t\t\t\t\tif ( $values ) {\n\t\t\t\t\t\t\tforeach ( $values as $value ) {\n\t\t\t\t\t\t\t\t$meta[ \"robots_$value\" ] = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_canonical':\n\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_opengraph-image':\n\t\t\t\t\t\t$meta['og_image_type'] = 'custom_image';\n\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_twitter-image':\n\t\t\t\t\t\t$meta['twitter_use_og'] = false;\n\t\t\t\t\t\t$meta['twitter_image_type'] = 'custom_image';\n\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_schema_page_type':\n\t\t\t\t\t\t$value = aioseo()->helpers->pregReplace( '#\\s#', '', $value );\n\t\t\t\t\t\tif ( in_array( $post->post_type, [ 'post', 'page', 'attachment' ], true ) ) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( in_array( $value, ImportExport\\SearchAppearance::$supportedWebPageGraphs, true ) ) {\n\t\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = 'WebPage';\n\t\t\t\t\t\t\t$options = new \\stdClass();\n\t\t\t\t\t\t\t$options->webPage = [ 'webPageType' => $value ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$meta['schema_type_options'] = wp_json_encode( $options );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_schema_article_type':\n\t\t\t\t\t\t$value = aioseo()->helpers->pregReplace( '#\\s#', '', $value );\n\t\t\t\t\t\tif ( 'none' === lcfirst( $value ) ) {\n\t\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = 'None';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( in_array( $post->post_type, [ 'page', 'attachment' ], true ) ) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$options = new \\stdClass();\n\t\t\t\t\t\tif ( isset( $meta['schema_type_options'] ) ) {\n\t\t\t\t\t\t\t$options = json_decode( $meta['schema_type_options'] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$options->article = [ 'articleType' => 'Article' ];\n\t\t\t\t\t\tif ( in_array( $value, ImportExport\\SearchAppearance::$supportedArticleGraphs, true ) ) {\n\t\t\t\t\t\t\t$options->article = [ 'articleType' => $value ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$options->article = [ 'articleType' => 'BlogPosting' ];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$meta['schema_type'] = 'Article';\n\t\t\t\t\t\t$meta['schema_type_options'] = wp_json_encode( $options );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_focuskw':\n\t\t\t\t\t\t$keyphrase = [\n\t\t\t\t\t\t\t'focus' => [ 'keyphrase' => aioseo()->helpers->sanitizeOption( $value ) ],\n\t\t\t\t\t\t\t'additional' => []\n\t\t\t\t\t\t];\n\t\t\t\t\t\t$meta['keyphrases'] = wp_json_encode( $keyphrase );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_focuskeywords':\n\t\t\t\t\t\t$keyphrases = [];\n\t\t\t\t\t\tif ( ! empty( $meta[ $mappedMeta[ $name ] ] ) ) {\n\t\t\t\t\t\t\t$keyphrases = (array) json_decode( $meta[ $mappedMeta[ $name ] ] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$yoastKeyphrases = json_decode( $value );\n\t\t\t\t\t\tfor ( $i = 0; $i < count( $yoastKeyphrases ); $i++ ) {\n\t\t\t\t\t\t\t$keyphrase = [ 'keyphrase' => aioseo()->helpers->sanitizeOption( $yoastKeyphrases[ $i ]->keyword ) ];\n\t\t\t\t\t\t\t$keyphrases['additional'][ $i ] = $keyphrase;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! empty( $keyphrases ) ) {\n\t\t\t\t\t\t\t$meta['keyphrases'] = wp_json_encode( $keyphrases );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_title':\n\t\t\t\t\tcase '_yoast_wpseo_metadesc':\n\t\t\t\t\tcase '_yoast_wpseo_opengraph-title':\n\t\t\t\t\tcase '_yoast_wpseo_opengraph-description':\n\t\t\t\t\t\tif ( 'page' === $post->post_type ) {\n\t\t\t\t\t\t\t$value = aioseo()->helpers->pregReplace( '#%%primary_category%%#', '', $value );\n\t\t\t\t\t\t\t$value = aioseo()->helpers->pregReplace( '#%%excerpt%%#', '', $value );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$value = aioseo()->importExport->yoastSeo->helpers->macrosToSmartTags( $value, 'post', $post->post_type );\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = esc_html( wp_strip_all_tags( strval( $value ) ) );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$aioseoPost = Models\\Post::getPost( (int) $post->ID );\n\t\t\t$aioseoPost->set( $meta );\n\t\t\t$aioseoPost->save();\n\t\t}\n\n\t\tif ( count( $posts ) === $postsPerAction ) {\n\t\t\ttry {\n\t\t\t\tas_schedule_single_action( time() + 5, aioseo()->importExport->yoastSeo->postActionName, [], 'aioseo' );\n\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\t// Do nothing.\n\t\t\t}\n\t\t} else {\n\t\t\taioseo()->transients->delete( 'import_post_meta_yoast_seo' );\n\t\t}\n\t}", "public function getMeta()\n {\n return $this->getValue('meta');\n }", "public function getMeta()\n {\n return $this->getValue('meta');\n }", "function sc_get_post_meta( $id, $key ){\n\treturn (object)get_post_meta( $id, $key, true );\n}", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'parent_id' => 'parentId',\n 'name' => 'name',\n 'order' => 'order',\n 'store_id' => 'storeId',\n 'user_id' => 'userId',\n 'url' => 'url',\n 'depth' => 'depth',\n 'created_at' => 'createdAt',\n 'updated_at' => 'updatedAt',\n 'deleted_at' => 'deletedAt',\n 'is_deleted' => 'isDeleted'\n ];\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id',\n 'classification_name' => 'classification_name'\n );\n }", "function add_custom_columns($column) \n {\n global $post;\n \n //var_dump($post);\n switch($column) {\n case 'shortcode':\n printf(\"[bbquote id='%s']\", $post->ID);\n break;\n case 'quote':\n echo $post->post_content;\n break;\n }\n }", "public function get($key) {\n if (!array_key_exists($key, $this->mapping))\n return null;\n\n return $this->mapping[$key]['column_name'];\n }", "function get_post_meta($post_id, $key = '', $single = \\false)\n {\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'jobId' => 'jobId',\n 'workerPid' => 'workerPid',\n 'queueId' => 'queueId',\n 'userId' => 'userId',\n 'messageId' => 'messageId',\n 'categoryId' => 'categoryId',\n 'groupId' => 'groupId',\n 'emailId' => 'emailId',\n 'createAt' => 'createAt',\n 'modifyAt' => 'modifyAt',\n 'attempts' => 'attempts',\n 'errors' => 'errors',\n 'lock' => 'lock',\n 'status' => 'status'\n ];\n }", "public function getMetadataForTable($table)\n {\n $tabletmp = trim(strtoupper($table));\n\n if (isset($this->columnmeta[$tabletmp])) {\n return $this->columnmeta[$tabletmp];\n }\n\n $cache = MQF_Registry::instance()->getCacheById('metadatatable', 86400);\n\n $id = md5($this->dsn.$tabletmp);\n\n if (!$this->columnmeta[$tabletmp] = $cache->get($id)) {\n $this->loadTables();\n\n if (!is_array($this->tables) or !in_array($table, $this->tables)) {\n require_once 'MQF/Database/Exception/NoSuchTable.php';\n throw new MQF_Database_Exception_NoSuchTable(\"Table '{$table}' does not exist in database\");\n }\n\n $this->connect();\n $this->columnmeta[$tabletmp] = $this->db->MetaColumns($table, true);\n\n MQF_Log::log(\"Fields in table $table: \".implode(',', array_keys($this->columnmeta[$tabletmp])));\n\n $pks = $this->db->MetaPrimaryKeys($table);\n\n if (is_array($pks) and count($pks)) {\n foreach ($pks as $pk) {\n foreach ($this->columnmeta[$tabletmp] as $offset => $m) {\n if ($m->name == $pk) {\n $this->columnmeta[$tabletmp][$offset]->primarykey = 1;\n }\n }\n }\n MQF_Log::log(\"Primary keys for $table:\".implode(',', $pks));\n } else {\n MQF_Log::log(\"No primary key(s) for $table defined\");\n }\n\n $cache->save($id, $this->columnmeta[$tabletmp]);\n }\n\n MQF_Registry::instance()->setMarker(\"DB {$this->id} metadata '{$table}'\");\n\n return $this->columnmeta[$tabletmp];\n }" ]
[ "0.6630238", "0.63588476", "0.624645", "0.59931535", "0.59918094", "0.59838206", "0.59522116", "0.59407735", "0.59362483", "0.5935924", "0.5913532", "0.5907472", "0.5904582", "0.58867764", "0.5882605", "0.58741844", "0.5874088", "0.5861811", "0.5849968", "0.5849872", "0.584461", "0.58444804", "0.5831251", "0.5810108", "0.5808443", "0.5806926", "0.5806926", "0.5800856", "0.578782", "0.5787613", "0.57814014", "0.5771854", "0.57509565", "0.573402", "0.5705169", "0.5705025", "0.5701659", "0.5695039", "0.56942", "0.56940097", "0.5691732", "0.56896806", "0.567687", "0.5667655", "0.56657314", "0.5654447", "0.56461835", "0.56432945", "0.5642843", "0.56278825", "0.56275105", "0.56248885", "0.5623173", "0.561499", "0.56103075", "0.56072736", "0.56011933", "0.5594723", "0.559068", "0.5577214", "0.5553881", "0.5548404", "0.554388", "0.55334604", "0.55216897", "0.55141693", "0.55128103", "0.5503604", "0.55006856", "0.54965204", "0.5494504", "0.54932016", "0.54911566", "0.54899377", "0.54894507", "0.54881275", "0.54817206", "0.54780185", "0.5476711", "0.54609007", "0.54518396", "0.5446949", "0.5445265", "0.54367197", "0.54334354", "0.5431354", "0.54184234", "0.5417607", "0.5417336", "0.540621", "0.54029447", "0.54029447", "0.539393", "0.53917694", "0.53861684", "0.5382711", "0.5375608", "0.53721523", "0.53676766", "0.53672403" ]
0.70662725
0
Create a new order in the database.
public function create( &$order ) { /** * Filter the generated order ID. * * @param string $order_key The uniquely-generated ID for this order. */ $order_key = apply_filters( 'woocommerce_generate_order_key', uniqid( 'order_' ) ); $order->set_order_key( 'wc_' . $order_key ); $this->creating = true; parent::create( $order ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create(Order $order)\n {\n //\n }", "public function creating(Order $Order)\n {\n //code...\n }", "public function create()\n\t{\n\t\t$this->auth->restrict('Purchase_Order.Orders.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_purchase_order())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\tlog_activity($this->current_user->id, lang('purchase_order_act_create_record') .': '. $insert_id .' : '. $this->input->ip_address(), 'purchase_order');\n\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/orders/purchase_order');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_failure') . $this->purchase_order_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('purchase_order', 'purchase_order.js');\n\n\t\tTemplate::set('toolbar_title', lang('purchase_order_create') . ' Purchase Order');\n\t\tTemplate::render();\n\t}", "public function create() : Orders;", "public static function createOrder ()\n\t{\n $user=Auth::user();// here to get the user info and store it in the $user variable\n $order=$user->orders()->create([\n 'total'=>Cart::total(),\n 'delivered' =>0\n\n ]);\n // the delivered column will get by default the value zero which means that this order\n // is not delivered yet \n\n $cartItems=cart::content();\n //seek for intels about attach function \n\n foreach($cartItems as $cartItem)\n $order->orderItems()->attach($cartItem->id,[\n 'qty'=>$cartItem->qty ,\n 'total' => $cartItem->qty*$cartItem->price \n ]);\n\n\t}", "protected function createOrder(){\n $order = Auth::user()->orders()->create(['status' => 'aguardando']);\n\n return $order;\n }", "public function testCreateOrder() {\n $order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'default',\n 'unit_price' => [\n 'number' => '999',\n 'currency_code' => 'USD',\n ],\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'order_items' => [$order_item],\n 'uid' => $this->loggedInUser,\n 'store_id' => $this->store,\n ]);\n\n $order_exists = (bool) Order::load($order->id());\n $this->assertNotEmpty($order_exists, 'The new order has been created in the database.');\n }", "public function actionCreate()\n {\n /** @var Order $model */\n $model = new Order;\n // Load saved draft\n $draftModel = $model->getDraftOrderByUser($this->acl->getUser());\n if ($draftModel) {\n $model = $draftModel;\n }\n\n $event = new OrderCreatedEvent($model, $this);\n $model->onOrderCreated = [$event, 'sendNotification'];\n\n // Get current model scenario\n $scenario = $model->getScenario();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Order'])) {\n $model->setAttributes($_POST['Order']);\n $model->setAttribute('creator_id', Yii::app()->user->getId());\n $model->orderItems = $_POST['OrderItems'];\n\n if ($model->isDraft()) {\n $redirect = ['index'];\n $scenario = 'saveDraft';\n $model->setScenario($scenario);\n // Order is not created until it is actually posted\n // It is posted when status changed from \"Draft\"\n $model->setAttribute('created', null);\n } else {\n $model->setAttribute('created', date('Y-m-d'));\n $redirect = ['view', 'id' => $model->id];\n }\n\n // Same scenario should apply to related models\n if ($model->saveWithRelated(['orderItems' => ['scenario' => $scenario]])) {\n $this->redirect($redirect);\n }\n }\n\n $this->render('create', [\n 'model' => $model,\n ]);\n }", "static function createOrder(Order $newOrder) : int {\r\n $sqlInsert = \"INSERT INTO Orders (CustomerID, Amt, Dates) \r\n VALUES (:CustomerID, :Amount, :Date) \";\r\n\r\n self::$db->query($sqlInsert);\r\n\r\n self::$db->bind(':CustomerID', $newOrder->getCustomerID());\r\n self::$db->bind(':Amount', $newOrder->getAmount());\r\n self::$db->bind(':Date', $newOrder->getDate());\r\n \r\n\r\n self::$db->execute();\r\n\r\n return self::$db->lastInsertId();\r\n\r\n }", "public function createorderAction()\n {\n\t\ttry{\n\t\t\t// Write your code here\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\tif($request->isPost()){\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t$objOrderTable = $sm->get('Order\\Model\\OrderTable');\n\t\t\t\t\n\t\t\t\t$posts['order_attachment'] = $posts['multipleimagesHidden'];\n\t\t\t\tunset($posts['multipleimagesHidden']);\n\t\t\t\t\n\t\t\t\t/*foreach($posts as $key => $value){\n\t\t\t\t\tif(empty($value))\n\t\t\t\t\t\tunset($posts[$key]);\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\tlist($d, $m, $y) = explode('/', $posts['exp_delivery_date']);\n\t\t\t\t$posts['exp_delivery_date'] = \"$y-$m-$d\";\n\t\t\t\t\n\t\t\t\tif(empty($posts['id'])){\n\t\t\t\t\t$posts['created_date'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$posts['created_by'] = $identity['user_id'];\n\t\t\t\t}else{\n\t\t\t\t\t$posts['updated_date'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$posts['updated_by'] = $identity['user_id'];\n\t\t\t\t}\n\t\t\t\tunset($posts['opp_name']);\n\t\t\t\t\n\t\t\t\techo $objOrderTable->createOrder($posts);\n\t\t\t}\n\t\t\texit;\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n }", "public function creating(Order $order)\n\t{\n\t\t$user = auth()->user();\n\n\t\t// auto set status = pending\n\t\tif (is_null($order->status)) {\n\t\t\t$order->status = Order::STATUS_PENDING;\n\t\t}\n\n\t\t// auto set user_id\n\t\tif (!empty($user)) {\n\n\t\t\t// set user_id as author\n\t\t\tif (empty($order->user_id)) {\n\t\t\t\t$order->user_id = $user->id;\n\t\t\t}\n\n\t\t\t// set company_id\n\t\t\tif (\n\t\t\t\tempty($order->company_id) &&\n\t\t\t\t!is_null($user->getCurrentCompanyId())\n\t\t\t) {\n\t\t\t\t$order->company_id = $user->getCurrentCompanyId();\n\t\t\t}\n\t\t}\n\t}", "public function order_create()\n {\n $this->_checkPartner();\n \n $mod_c = $this->_getConfig();\n if(isset($mod_c['orders_limit']) && $mod_c['orders_limit']) {\n $sql = \"SELECT COUNT(id) FROM client_order WHERE client_id = :cid AND DATE_FORMAT(created_at, '%Y-%m-%d') = :date GROUP BY client_id\";\n $count = R::getCell($sql, array('cid'=>$this->client->id, ':date'=>date('Y-m-d')));\n if($count >= $mod_c['orders_limit']) {\n throw new Box_Exception('Daily orders limit reached. Order today :today out of :limit', array(':today'=>$count, ':limit'=>$mod_c['orders_limit']), 8804);\n }\n }\n \n $partner = $this->service->getPartner($this->client);\n $price = $this->service->getPartnerPrice($this->client);\n \n if(isset($mod_c['check_balance']) && $mod_c['check_balance']) {\n $client = $this->getApiAdmin()->client_get(array('id'=>$this->client->id));\n if($client['balance'] < $price) {\n throw new Box_Exception('Not enough money in balance to create order. You must have at least $:price in your balance', array(':price'=>$price), 8808);\n }\n }\n \n if(!isset($mod_c['lid'])) {\n throw new Box_Exception('Partners program is temporary disabled.',null, 8806);\n }\n \n if($partner->product_id) {\n $product_id = $partner->product_id;\n } else {\n $product_id = $mod_c['lid'];\n }\n \n $odata = array(\n 'client_id' => $this->client->id,\n 'product_id' => $product_id,\n 'price' => $price,\n 'quantity' => 1,\n 'period' => '1M',\n 'activate' => true,\n 'invoice_option' => 'no-invoice',\n 'config' => array(\n 'partner_id' => $this->client->id,\n ),\n );\n \n $order_id = $this->getApiAdmin()->order_create($odata);\n \n $odata = array(\n 'id' => $order_id,\n 'invoice_option'=> 'issue-invoice',\n 'expires_at' => date('Y-m-d', strtotime('+14 days')),\n );\n $this->getApiAdmin()->order_update($odata);\n \n $this->service->addOrderForPartner($this->client, $order_id);\n \n $this->getApiAdmin()->hook_call(array('event'=>'onAfterPartnerOrderCreate', 'params'=>array('client_id'=>$this->client->id, 'order_id'=>$order_id)));\n \n $this->_log('Partner created new order #%s', $order_id);\n return $order_id;\n }", "public function createOrderAction()\n {\n $data = $this->Request()->getParams();\n $data = $data['data'];\n\n $orderNumber = $this->getOrderNumber();\n\n /** @var \\Shopware_Components_CreateBackendOrder $createBackendOrder */\n $createBackendOrder = Shopware()->CreateBackendOrder();\n $hasMailError = false;\n\n try {\n /** @var Shopware\\Models\\Order\\Order $orderModel */\n $orderModel = $createBackendOrder->createOrder($data, $orderNumber);\n\n if (!$orderModel instanceof \\Shopware\\Models\\Order\\Order) {\n $this->view->assign($orderModel);\n\n return false;\n }\n } catch (\\Exception $e) {\n $this->view->assign(\n [\n 'success' => false,\n 'message' => $e->getMessage()\n ]\n );\n\n return;\n }\n\n try {\n //sends and prepares the order confirmation mail\n $this->sendOrderConfirmationMail($orderModel);\n } catch (\\Exception $e) {\n $hasMailError = $e->getMessage();\n }\n\n if ($hasMailError) {\n $this->view->assign(\n [\n 'success' => true,\n 'orderId' => $orderModel->getId(),\n 'mail' => $hasMailError,\n 'ordernumber' => $orderModel->getNumber()\n ]\n );\n\n return;\n }\n\n $this->view->assign(\n [\n 'success' => true,\n 'orderId' => $orderModel->getId(),\n 'ordernumber' => $orderModel->getNumber()\n ]\n );\n }", "public function create_order( $args = array() )\n {\n return $this->_request('createorder', $args);\n }", "public function create()\n\t{\n\t\t$order = new Order;\n\n\t\t// Set the 'default' order status\n\t\t//$orderStatus = OrderStatus::find(Config::get('Orders::defaultStatus'));\n\n\t\t//$orderStatus->order()->associate($order);\n\n\n\n\t\t// Save the order\n\t\t$order->save();\n\n\t\t// Return the response, with the order, as JSON\n\t\treturn Response::json($order);\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Order;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Order']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Order'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function testCreateOrder()\n {\n $result = OrdersService::create([\n 'title' => 'Test Order',\n 'state' => 'INITIAL',\n 'res_id' => 1,\n 'foods' => [1, 2],\n ]);\n\n $this->assertInstanceOf(Model::class, $result);\n }", "public function store(OrderCreateRequest $request)\n {\n return $this->repository->storeOrder($request);\n }", "public function createOrder($order)\n {\n $this->notificationRepository->create(['type' => 'order', 'order_id' => $order->id]);\n \n event(new CreateOrderNotification);\n }", "public function create(array $data): Order\n {\n return Order::create($data);\n }", "public function create()\n {\n $order = new Order();\n $order->setAccountId($this->accountId);\n $order->setLanguage($this->language);\n\n return $order;\n }", "public function created(Order $Order)\n {\n //code...\n }", "function createOrder($order,$requester,$numberId){\n $sql='';\n //status==0 mean have to cook and else will finish now status will be send\n $finish_time=$order->status==0 ? '\\'0000-00-00 00:00:00\\'' :'now()';\n $sql = 'INSERT INTO `order` (waiter_id,chef_id, number_id, table_id, product_id,bill_detail_id, count, comments, order_time, finish_time, status, price) VALUES ';\n $sql.= '(\\''.$requester.'\\',\\'\\','.$numberId.', '.$order->table_id.', '.$order->product_id.',-1,'.$order->count.',\\''.$order->comments.'\\', now(), '.$finish_time.', \\''.$order->status.'\\', '.$order->price.');';\n //echo $sql;\n if(isset($this->connection)){\n return $this->queryNotAutoClose($sql);\n }else{\n return $this->query($sql);\n }\n }", "public function created(Order $order)\n {\n //\n }", "public function neworder() {\n\t\tparent::__construct();\n\t\tsession_start();\n\t\tif(isset($_SESSION['uid'])){\n\t\t\t$this->write('orders', array(NULL, $_SESSION['uid'], 1, \"PAID\"));\n\t\t} else {\n\t\t\t$this->write('orders', array(NULL, NULL, 1, \"PAID\"));\n\t\t}\n\t\t$this->orderid = $this->id;\n\t\t\n\t\t//Create new order table and insert cart data\n\t\t$create = $this->conn->prepare(\n\t\t\t'DROP TABLE IF EXISTS order'.$this->orderid.'; '\n\t\t\t.'CREATE TABLE order'.$this->orderid\n\t\t\t.'(itemid INT(7) ZEROFILL NOT NULL, itemname VARCHAR(256) NOT NULL, qnt INT(3) NOT NULL, itemprice DECIMAL(6,2) NOT NULL); '\n\t\t);\n\t\t$create->execute();\n\n\t\t$count = 0;\n\t\tforeach($_SESSION['cart'] as $item){\n\t\t\t//This is redundant but otherwise db insert skips first row - PDO or db class issue?\n\t\t\tif($count == 0){$this->write('order'.$this->orderid, array($item[\"item\"],$item[\"name\"],$item[\"qnt\"],$item[\"price\"]));};\n\t\t\t$count++;\n\t\t\t$this->write('order'.$this->orderid, array($item[\"item\"],$item[\"name\"],$item[\"qnt\"],$item[\"price\"]));\n\t\t}\n\t}", "public function actionCreate()\n {\n $model = new Orders();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(CreateOrderRequest $request)\n {\n $input = $request->all();\n\n // dd($input);\n\n $order = $this->orderRepository->create($input);\n\n Flash::success('Order saved successfully.');\n\n return redirect(route('admin.products.orders.index'));\n }", "public function creating(Order $order): void\n\t{\n\t\tif (auth()->check()) {\n\t\t\t$order->client_id = auth()->id();\n\t\t}\n\t\t// If a booster has been selected for the order, set its status to progress, otherwise pending\n\t\t(bool) $order->booster_id ? $order->status = 'progress' : 'pending';\n\t}", "public function actionCreate()\n {\n $model = new YxOrder();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n\t{\n $this->load->model('ordersmodel');\n $data['json']=$this->ordersmodel->insertorders();\n\t\t$this->load->view('json',$data);\n\t}", "public function created(Order $order)\n\t{\n\t\t//\n\t}", "public function created(Order $order)\n\t{\n\t\t//\n\t}", "private function create_order_record($id_order) {\n $aux['details'] = $this->m_orders_overview->get_details($id_order);\n\n $record['id_order'] = null; // auto-increment\n $record['id_menu_order'] = $id_order;\n $record['id_table'] = $aux['details'][0]->id_table;\n $record['id_count_ks'] = $aux['details'][0]->id_count_ks;\n $record['date_pay'] = date(\"Y-m-d\");\n\n $record['id_employee'] = $aux['details'][0]->id_employee;\n $record['pay_method'] = 'hotovost';\n $record['sum_price'] = $aux['details'][0]->price;\n $record['is_closed'] = 0;\n\n $this->m_orders_overview->insert_new_order_record($record);\n }", "public function run()\n {\n order::create([\n 'customers_id' => '1',\n 'pict_payment' => 'Banner.jpg',\n 'date' => '2022-02-10',\n 'total' => 2300000,\n 'status' => 'Pending',\n 'keterangan' => '-',\n 'shipping' => 'JNE',\n 'ongkir' => 6000\n ]);\n }", "public function store(CreateOrderRequest $request)\n {\n $input = $request->all();\n\n $order = $this->orderRepository->create($input);\n\n Flash::success('Order saved successfully.');\n\n return redirect(route('admin.orders.index'));\n }", "public function insert_order()\n\t{\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_admin_auth();\n\t\t$CI->load->model('Orders');\n\t\t$order_id = $CI->Orders->order_entry();\n\t\t$this->session->set_userdata(array('message'=>display('successfully_added')));\n\t\t$this->order_inserted_data($order_id);\n\n\t\tif(isset($_POST['add-order'])){\n\t\t\tredirect(base_url('Corder/manage_order'));\n\t\t}elseif(isset($_POST['add-order-another'])){\n\t\t\tredirect(base_url('Corder'));\n\t\t}\n\t}", "function create(Request $request) {\n // create order\n $data = [\n 'client_name' => $request->client_name,\n 'date' => $request->order_date,\n ];\n $order = $this->orders->create($data);\n\n // add products to order\n $num_products = $this->products->numProducts();\n for($i = 1; $i < $num_products + 1; $i++) {\n $key = 'product-' . $i;\n if($request[$key] != null) {\n $this->orders->addProduct($order->id, $i, $request[$key]);\n } \n }\n Redirect::to('encomendas');\n }", "public static function createOrder(array $data)\n {\n $orderOpen = new Order($data);\n $orderOpen->save();\n return $orderOpen;\n }", "function addOrder () {\n\t//\terror_log ( 'addOrder\\n', 3, '/var/tmp/php.log' );\n\t$request = Slim::getInstance ()->request ();\n\t$order = json_decode ( $request->getBody () );\n\t//\t$sql = \"INSERT INTO wine (name, grapes, country, region, year, description) VALUES (:name, :grapes, :country, :region, :year, :description)\";\n\ttry {\n\t\t$db = new DbOperation();\n\t\t$orderId = $db->addOrder ( $order );\n\t\t//\t\t$stmt = $db->prepare ( $sql );\n\t\t//\t\t$stmt->bindParam ( \"name\", $order->name );\n\t\t//\t\t$stmt->bindParam ( \"grapes\", $order->grapes );\n\t\t//\t\t$stmt->bindParam ( \"country\", $order->country );\n\t\t//\t\t$stmt->bindParam ( \"region\", $order->region );\n\t\t//\t\t$stmt->bindParam ( \"year\", $order->year );\n\t\t//\t\t$stmt->bindParam ( \"description\", $order->description );\n\t\t//\t\t$stmt->execute ();\n\t\t//\t\t$order->id = $db->lastInsertId ();\n\t\t//\t\t$db = null;\n\t\t// print_f($order);\n\t\t// $order.push(\"orderId\", $orderId);\n\t\t// print_f($order);\n\t\t$order->orderId = $orderId;\n\t\techo '{\"addedOrder\":' . json_encode ( $order ) . '}';\n\t\t// echo $orderId;\n\t} catch ( Exception $e ) {\n\t\t//\t\terror_log ( $e->getMessage (), 3, '/var/tmp/php.log' );\n\t\t//\t\techo '{\"error\":{\"text\":' . $e->getMessage () . $e.'}}';\n\t\techo '{\"errorText\":\"Add order fail with text as\", \"text\":}' . $e->getMessage () . $e . '}';\n\t}\n}", "private function createOrderTable()\n {\n $this->db->query(\n \"CREATE TABLE IF NOT EXISTS `\". DB_PREFIX .\"mundipagg_order` (\n `opencart_id` INT(11) NOT NULL,\n `mundipagg_id` VARCHAR(30) NOT NULL,\n UNIQUE INDEX `opencart_id` (`opencart_id`),\n UNIQUE INDEX `mundipagg_id` (`mundipagg_id`)\n );\"\n );\n }", "public static function orderCreate(Request $request,$data){\n //Log::info($data);\n $query =self::orderExit($request,$data['order']['num']);\n Log::info($query);\n if(!$query){\n\n DB::beginTransaction();\n $rsOrder = Order::insert($data['order']);\n Log::info($rsOrder);\n $rsOrderInfo = OrderInfo::insert($data['orderInfo']);\n if($rsOrder&&$rsOrderInfo){// 成功\n DB::commit();\n return true;\n\n }else{\n DB::rollback();\n return false;\n }\n\n }else{\n return false;\n }\n\n\n\n }", "public function createAction() {\n $customer = Mage::getSingleton('customer/customer')->load(Mage::getStoreConfig('testorders/general/customerid'));\n /*empty object for sourceOrder is fine*/\n $sourceOrder = new Varien_Object();\n $sku = $this->getRequest()->getParam('sku');\n\n $messages = array();\n $model = Mage::getModel(\"testorders/simulator\");\n $model->setOrderInfo($sourceOrder, $customer, $sku);\n $order = $model->create();\n\n if ($order && $order->getIncrementId()) {\n echo \"Order #{$order->getIncrementId()} has been created from SKU : {$sku}\";\n }\n else {\n echo \"Test Order creation failed. Please check the module config and make sure selected shipping method and payment method are configured properly\";\n }\n\n exit;\n }", "function createOrder() {\n\t$postData = new Order;\n\n\treturn $postData->getOrderJson();\n}", "public function store(CreateOrderRequest $request)\n {\n $input = $request->all();\n $order = $this->orderRepository->create($input);\n\n Flash::success(__('messages.saved', ['model' => __('models/orders.singular')]));\n\n return redirect(route('orders.index'));\n }", "public function testCreate()\n {\n VCR::insertCassette('orders/create.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $this->assertInstanceOf('\\EasyPost\\Order', $order);\n $this->assertStringMatchesFormat('order_%s', $order->id);\n $this->assertNotNull($order->rates);\n }", "public function creating(Order $model)\n {\n//\n// $model->created_user_id = $this->user->id;\n// $model->created_user_name = $this->user->name;\n $model->status = 1;\n $model->user_name = optional($model->user)->name??'';\n $model->amount = ($model->amount==0)?0.01:$model->amount;\n if (empty($model->father_id))\n $model->leader_id = $model->user_id;\n $model->number = date('Ymd') . time();\n if ($model->use_times != 0)\n User::find($model->user_id)->decrement('tour_times',$model->use_times);\n// \\Log::info('orders::'.json_encode($model));\n //判断是否为香榧果订单 统计斤数\n $can = $this->checkOrderCreate($model);\n if ($can == 1)\n $model->fruit_order = 1;\n //$model->address_str = $model->address ? $model->address->location : '';\n // $model->amount = bcmul(constants('PRODUCT_PRICE'), $model->qty, 2);\n }", "public function createOrder(Request $request)\n {\n\n $order = Order::create([\n 'room_id' => $request['roomId'],\n 'user_id' => $request['userId'],\n 'guests' => $request['guests'],\n 'check_in' => $request['checkIn'],\n 'check_out' => $request['checkOut'],\n 'total_days' => $request['totalDays'],\n 'message' => $request['message'],\n 'status' => $request['status'],\n ]);\n\n return response()->json([\n \"message\" => \"pesananmu masuk kedalam proses\",\n \"data\" => $order\n ]);\n }", "public function create()\n {\n $invoice = new InvoiceEntity();\n $invoice->setNumber('019101910191091')\n ->setValue(100.90)\n ->setUrl('http://domain.com')\n ->setIssuanceDate('2017-09-15')\n ->setKey('POL9898AS');\n\n $tracking = new TrackingEntity();\n $tracking->setOrderId('00001010101AA')\n ->setStatus('in_route')\n ->setCode('BR800OPR5')\n ->setInvoice($invoice);\n\n $this->dm->persist($tracking);\n $this->dm->flush();\n }", "public function actionCreate()\n\n {\n\n $model = new Orders();\n\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n\t\t\t\n\n\t\t\tYii::$app->session->setFlash('orders', 'Orders has been added successfully');\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n return $this->render('create', [\n\n 'model' => $model,\n\n ]);\n\n }\n\n }", "private function create()\n {\n if ($this->isRequired()) {\n $db = Database::getDatabaseConnection();\n $db->exec($this->getDropQuery());\n $db->exec($this->getCreateQuery());\n $this->populate($db);\n }\n }", "public function create()\n {\n \n return view('order.create');\n }", "public function create(array $values) {\n\n global $user;\n\n // We support only the basic order type 'commerce_order' for now\n\n // We ignore the order status, if any, because 'cart' orders only can be created\n // in our design\n\n // So, to create a new order we need just the user id or zero for anonymous carts.\n // Hostname and creation and last change timestamps are set automatically\n\n $order = commerce_order_new($user->uid, 'cart');\n\n commerce_order_save($order);\n\n // watchdog('musth_restws', 'W7D001 7VQPkiu8 order create values (!v) (!o) (!u) ',\n // array('!v' => print_r($values, true),\n // '!u' => print_r($user->uid, true),\n // '!o' => print_r($order, true)),\n // WATCHDOG_DEBUG);\n\n // A create api returns the order id only\n // If you want the full object, you have to call the get method\n\n return $order->order_id;\n }", "public function addNewOrder($newOrderVendorId, $newOrderUserId, $newOrderProductId, $newOrderProductQuantity, $newOrderTotal, $newOrderDeliveryAddress, $newOrderEmail, $newOrderPhoneNumber) {\n\n $newOrderTime = time(); // We generate the date and time the order has been created\n\n $query = $this->db->prepare(\"INSERT INTO `orders` (`order_partner_id`, `order_customer_id`, `order_product_id`, `order_product_quantity`, `order_total`, `order_delivery_address`, `order_email`, `order_phone_number`, `order_timestamp`, `order_processed`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\");\n\n $query->bindValue(1, $newOrderVendorId);\n $query->bindValue(2, $newOrderUserId);\n $query->bindValue(3, $newOrderProductId);\n $query->bindValue(4, $newOrderProductQuantity);\n $query->bindValue(5, $newOrderTotal);\n $query->bindValue(6, $newOrderDeliveryAddress);\n $query->bindValue(7, $newOrderEmail);\n $query->bindValue(8, $newOrderPhoneNumber);\n $query->bindValue(9, $newOrderTime);\n $query->bindValue(10, 0);\n\n try {\n\n $query->execute();\n\n } catch(PDOException $e) {\n die($e->getMessage());\n }\n }", "public function insertOrder(Request $request){\n\n $invoice = new tblInvoices;\n\n $invoice->cust_id = $request->input('cust_id');\n $invoice->amount = $request->input('amount');\n $invoice->discount = $request->input('discount');\n $invoice->final_amount = $request->input('final_amount');\n $invoice->branch_id = $request->input('branch_id');\n $invoice->offer_id - $request->input('offer_id');\n\n\n $invoice->save();\n $invoice->id;\n\n $insertedId = $invoice->id;\n\n $order = new tblOrder;\n $order->all->branch_id = $request->input('branch_id');\n $order->all->cust_id = $request->input('cust_id');\n $order->all->invoice_id = $insertedId;\n $order->item_name = $request->\n $order -> save();\n }", "public function createOrder($order, $comment, $deliveryType, $datetime)\n {\n $data = $this->_prepareCreateOrder($order, $comment, $deliveryType, $datetime);\n\n return $this->apiClient->doCall(\"POST\", \"order/create\", $data);\n }", "public function insert(FoodOrder $foodOrder) {\n //needs changing\n //$now = new DateTime();\n $foodOrder->setOrderId(null);\n //$flightBooking->setCreatedOn($now);\n //$flightBooking->setLastModifiedOn($now);\n $foodOrder->setStatus(FoodOrder::PENDING);\n // $sql = 'INSERT INTO food_order (order_id, user_id, full_name, email, phone_number, product_id, status)\n // VALUES (:order_id, :user_id, :full_name, :email, :phone_number, :product_id, :status)';\n $sql = '\n INSERT INTO food_orders (order_id, user_id, full_name, phone_number, email, product_id, status)\n VALUES (:order_id, :user_id, :full_name, :phone_number, :email, :product_id, :status)';\n return $this->execute($sql, $foodOrder);\n }", "public function actionCreate()\n {\n $model = new ModelOrders();\n $model->reg_date = date('d.m.Y');\n $lastId = $model::find()->select('id')->orderBy(['id'=>SORT_DESC])->asArray()->one();\n $lastId = $lastId ? $lastId['id'] + 1 : 1;\n $model->doc_number = \"MO\".$lastId . \"/\" . date('m-Y');\n\n $model->status = ModelOrders::STATUS_INACTIVE;\n\n if($model->save(false)){\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n if(Yii::$app->request->referrer){\n return $this->redirect(Yii::$app->request->referrer);\n }else{\n return $this->redirect(['index']);\n }\n }", "public static function createOrder($data)\r\n\t{\r\n\t\treturn new Order($id);\r\n\t}", "public function create()\n {\n return view('crud.order.create');\n }", "public function create()\n\t{\n\t\treturn view('admin.sale-order.create');\n\t}", "public function create()\n {\n return view('admin.create_order');\n }", "public function placeOrder(Request $request)\n {\n // validate the input\n $validator = $this->validator($request->all());\n // If validation fails then return with status failed and validation error message\n if ($validator->fails()) {\n return response()->json(['status' => 'failed', 'validationErrors' => $validator->errors()]);\n }\n\n // initializing new order object\n $order = new Order();\n $order->user_id = Auth::user()->id;\n $order->amount = $request->order_amount;\n $order->description = $request->description;\n $order->order_date = Carbon::now();\n $data = array();\n\n // preparing data to insert in order_product table\n if (!empty($request->products)) {\n foreach ($request->products as $key => $productId) {\n $data[$productId] = ['product_quantity' => $request->product_quantity[$key]];\n }\n }\n\n // start data insertion\n DB::beginTransaction();\n // insert order data\n $orderQuery = $order->save();\n $productQuery = false;\n if (!empty($data)) {\n // insert order_product data\n $productQuery = $order->products()->attach($data);\n }\n\n // if data is not inserted in both of the tables then no insertion will be executed\n if ($orderQuery != true || $productQuery != null) {\n DB::rollBack();\n }\n DB::commit();\n // end of data insertion process\n\n return response()->json([\n 'status' => 'success',\n 'message' => 'Successfully placed order!'\n ], 201);\n }", "private function addPaymentToDatabase()\n {\n $this->setReceiptKey();\n \n $this->createDonorEntry();\n $this->createDonationEntry();\n $this->createDonationContentEntry();\n $this->createDonorAddressEntry();\n $this->addDonationToFundraisersTotalRaise();\n \n $this->redirect('donations');\n }", "public function createAction(){\n if(!$this->request->isPost()){\n return $this->forward(\"orders/index\");\n }\n\n $form = new OrdersForm();\n $order = new Orders();\n $product = Products::findFirst($form->get('product_id'));\n\n $order->currency = $product->currency;\n $order->price = $product->price;\n\n $data = $this->request->getPost();\n if(!$form->isValid($data, $order)){\n echo '<pre>';\n print_r($form->getMessages());\n echo '</pre>';\n foreach($form->getMessages() as $message){\n $this->flash->error($message);\n }\n\n return $this->forward('orders/new');\n }\n\n $date = new DateTime();\n $order->date = $date->format('Y-m-d H:i:s');\n $order->paid = 0;\n $order->hash = Phalcon\\Text::random(Phalcon\\Text::RANDOM_ALNUM, 32);\n\n if($order->save() == false){\n foreach($order->getMessages() as $message){\n $this->flash->error($message);\n }\n\n return $this->forward('orders/new');\n }\n\n $form->clear();\n\n $this->flash->success(\"Zamówienie zostało przyjęte, teraz możesz je opłacić w PayPal.\");\n\n return $this->response->redirect(\"orders/payment/\" . $order->hash);\n }", "public function create($debug = false) {\n\t\t\t$this->set('date', date('Ymd'));\n\t\t\t$this->set('time', date('His'));\n\t\t\treturn insert_orderhead($this->sessionid, $this->orderno, $this, $debug);\n\t\t}", "protected function addToOrdersTable($request, $error)\n {\n $order = Order::create([\n 'user_id' => auth()->user() ? auth()->user()->id : null,\n 'billing_email' => $request->billing_email,\n 'billing_name' => $request->first_name . $request->last_name,\n 'billing_address' => $request->billing_address,\n 'billing_phone' => $request->billing_phone,\n 'billing_name_on_card' => $request->billing_name_on_card,\n 'billing_discount_code' => 'ABCD',\n 'billing_discount' => Cart::discount(),\n 'billing_subtotal' => Cart::subtotal(),\n 'billing_tax' => Cart::tax(),\n 'billing_total' => Cart::total(),\n 'payment_method' => 'Stripe',\n 'shipped' => false,\n 'error' => $error,\n ]);\n\n // Save order items\n $cartItems = Cart::content();\n\n foreach ($cartItems as $item) {\n $order->products()->attach($item->id, [\n 'price' => $item->price,\n 'quantity' => $item->qty,\n ]);\n }\n\n return $order;\n }", "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "public function createAction(Request $request)\n {\n $entity = new Order();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('admin_order_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "function create(){\n $query = \"INSERT INTO\n \" . $this->table_name . \"\n SET\n date_order=:date_order, name=:name, phone=:phone, count=:count\";\n \n // prepare query\n $stmt = $this->conn->prepare($query);\n \n // sanitize\n $this->date_order=htmlspecialchars(strip_tags($this->date_order));\n $this->name=htmlspecialchars(strip_tags($this->name));\n $this->phone=htmlspecialchars(strip_tags($this->phone));\n $this->count=htmlspecialchars(strip_tags($this->count));\n \n // bind values\n $stmt->bindParam(\":date_order\", $this->date_order);\n $stmt->bindParam(\":name\", $this->name);\n $stmt->bindParam(\":phone\", $this->phone);\n $stmt->bindParam(\":count\", $this->count);\n // execute query\n if($stmt->execute()){\n return true;\n }\n return false;\n \n }", "public function store(CreateOrderAPIRequest $request)\n {\n $input = $request->all();\n\n $order = $this->orderRepository->create($input);\n\n return $this->sendResponse(new OrderResource($order), 'Order saved successfully');\n }", "public function addOrder(Order $order);", "public function create()\n {\n $supplyorder = new Supplyorder;\n $supplyorder->supplier_id =1;\n $supplyorder->status_id =1;\n $supplyorder->save();\n Activity::log('Created supply order #' . $supplyorder->id . '.');\n return Redirect::action('SupplyOrderController@show', $supplyorder->id);\n }", "public function create()\n {\n return view('admin.order.create');\n }", "public function create()\n {\n if(Auth::check()){\n if (session_status() == PHP_SESSION_NONE) {\n session_start();\n }\n\n if (isset($_SESSION['carrinho'])){\n if (!empty($_SESSION['carrinho'])){\n $user_id = $_SESSION['user']['id'];\n //dd($_SESSION['endereco']);\n $address_id = $_SESSION['endereco'][0]['id'];\n $carrinho = $_SESSION['carrinho'];\n\n //dd($address_id, $user_id,$carrinho);\n\n $order = new Order();\n //Vai receber o id do ultimo PEDIDO.\n\n //Usando uma transação para cadastrar o usuário.\n DB::transaction(function () use ($order, $user_id, $address_id, $carrinho){\n $order->user_id = $user_id;\n $order->address_id = $address_id;\n $order->save();\n //Retornando ID\n $order_id = $order->id;\n\n foreach ($carrinho as $aux){\n //Registrar valor com desconto\n $n = $aux['discount'].'0.0';\n $pctm = floatval($n);\n $valorQuantity = $aux['valueProduct'] * $aux['quantityPurchased'];\n $valorProduto = $valorQuantity - ( $valorQuantity / 100 * $pctm);\n\n DB::table('orders_products')->insert([[\n 'valueUnit' => $valorProduto,\n 'quantityProduct' =>$aux['quantityPurchased'],\n 'order_id' => $order_id,\n 'product_id' => $aux['id']\n ]]);\n }\n\n $this->id_lastWish = $order_id;\n //dd($id_lastWish);\n //Limpando o carrinho\n unset($_SESSION['carrinho']);\n });\n\n $orderProductsRequest = DB::table('products')\n ->join('orders_products', function ($join) {\n $join->on('products.id', '=', 'orders_products.product_id')\n ->where('orders_products.order_id', '=', $this->id_lastWish);\n })\n ->get()->toArray();\n\n //$valueCompra = DB::table('orders_products')->where('order_id','=',$this->id_lastWish)->first();\n\n //dd($orderProductsRequest, $this->id_lastWish);\n //Enviar dados para a View\n return view('makePurchase', [\n 'pedido'=> $orderProductsRequest,\n ]);\n }\n }\n return redirect()->back()->withInput()->withErrors(['Erro ! Compara NÃO REALIZADA.']);\n }\n return redirect()->route('/list-products');\n }", "public function submitOrder(){\n try {\n $query = \"INSERT INTO `order`\n (`CustomerID`, `Date`, `Status`,`Total`) \n VALUES (?,?,'Pending',?)\"; // Create the query\n $query = $this->stmt->prepare($query);\n $date = date('Y-m-d H:i:s');\n $query->bind_param(\"ssd\",$this->customerId, $date, $this->total);\n $query->execute();\n $orderId = $query->insert_id;\n if($orderId){\n $this->orderId = $orderId; // Set the orderId property\n $this->insertItems();\n }\n $query->close();\n return $this->orderId;\n } catch (Exception $th) {\n exit($th->getMessage());\n }\n }", "public function createorder()\n\n {\n $data = request()->validate([\n 'user_id' => ['required'],\n \"restaurant_id\" => ['required'],\n 'restaurant_service_id' => [],\n 'menu_id' => [],\n 'quantity' => [],\n 'table_id' => [],\n 'notes' => [],\n\n\n ]);\n\n\n\n $restaurant = RestaurantProfile::where('id', '=', $data['restaurant_id'])->get();\n\n $order = Order::create([\n 'restaurant_service_id' => $data['restaurant_service_id'],\n 'user_id' => $data['user_id'],\n 'restaurant_profile_id' => $data['restaurant_id'],\n 'menu_id' => $data['menu_id'],\n 'quantity' => $data['quantity'],\n 'table_id' => $data['table_id'] ?? null,\n 'notes' => $data['notes'] ?? null,\n 'status' => 1\n\n ]);\n if ($data['restaurant_service_id'] == 2) {\n\n $order_details = OrderDetail::create([\n 'note' => $data['note'],\n 'estate' => $data['estate'] ?? 'estate',\n 'full_name' => $data['full_name'] ?? 'full_name',\n 'email' => $data['email'] ?? 'email',\n 'note' => $data['note'] ?? 'note',\n 'phone' => $data['phone'] ?? 'phone',\n 'house' => $data['house'] ?? 'house',\n 'house_no' => $data['house_no'] ?? 'house_no',\n 'city' => $data['city'] ?? 'city',\n 'delivery_day' => $data['delivery_schedule_time'] ?? 'delivery_day',\n 'delivery_time' => $data['delivery_schedule_day'] ?? 'delivery_time',\n 'order_id' => $order->id\n ]);\n }\n\n return $this->jsonResponse(false, 'order created successfully', 'order', $order);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'service' => 'required',\n 'issue' => 'required'\n\n ]);\n\n //create Post\n $orders = new Order;\n $orders->user_id = auth()->user()->id;\n $account = Account::find($request->id);\n $orders->account()->associate($account);\n $orders->issue = $request->input('issue');\n $orders->save();\n\n return redirect ('/orders')->with('success', 'Order Created');\n\n\n }", "public function created(Order $order): void\n\t{\n\t\t$order->chat()->create();\n\t}", "public function store(Request $request)\n {\n return Order::create([\"client_id\" => $request->client_id]);\n }", "public function create_order($data) {\n\n\t\t// this creates a blank order inserting session id into the database for the cart,\n\t\t// so we can tie to this in the future.\n\t\t$session_id = $this->session->userdata('session_id');\n\t\t\n\t\tif($session_id) {\n\t\t\t$myDate = date('Y-m-d H:m'); // make a valid date for create and update\n\n\t\t\t// create the order, passing back the ID of the newly inserted item, then store in session for\n\t\t\t// shopping.\n\t\t\t$query = 'INSERT INTO orders (sessid,status,created_on,modified_on) VALUES (?,?,now(),now())';\n\t\t\t// # values must match field count above.\n\t\t\t$values = array($session_id,0,$myDate,$myDate);\n\n\t\t\t$tmp = $this->db->query($query, $values);\n\t\t\n\t\t} else {\n\t\t\tdie('no session!!! cannot create cart.');\n\t\t}\n\n\t\treturn $this->db->insert_id; // return id of record inserted. more useful.\n\n\t}", "public function createOrder($orderID) { global $db;\n \n // Insert Order\n $insert = $db->query(\"INSERT INTO `orders` (order_id, email_address, order_date, dispatch_date, delivery_address_id, delivery_id) \n VALUES(:order_id, :email_address, :order_date, :dispatch_date, :delivery_address_id, :delivery_id)\",\n array(\n 'order_id' => $orderID,\n 'email_address' => $_SESSION['user']['email_address'],\n 'order_date' => date(\"YmdHis\"),\n 'dispatch_date' => \"\",\n 'delivery_address_id' => $_SESSION['address']['id'],\n 'delivery_id' => $_SESSION['checkout']['delivery']['id']\n ));\n // Insert Order Totals\n $insert = $db->query(\"INSERT INTO `order_totals` (order_id, order_discount, order_delivery, order_vat, order_gross) \n VALUES(:order_id, :order_discount, :order_delivery, :order_vat, :order_gross)\",\n array(\n 'order_id' => $orderID,\n 'order_discount' => $_SESSION['checkout']['totals']['savings_total'],\n 'order_delivery' => $_SESSION['checkout']['totals']['delivery'],\n 'order_vat' => $_SESSION['checkout']['totals']['order_vat'],\n 'order_gross' => $_SESSION['checkout']['totals']['gross_total'],\n ));\n \n // Insert Order Items\n foreach($_SESSION['checkout']['items'] as $key => $item) {\n $insert = $db->query(\"INSERT INTO `order_items` (order_id, prod_code, price, qty) \n VALUES(:order_id, :prod_code, :price, :qty)\",\n array(\n 'order_id' => $orderID,\n 'prod_code' => $item['prod_code'],\n 'price' => $item['sale_total'] != 0.00 ? $item['sale_total'] : $item['price_total'],\n 'qty' => $item['qty']\n ));\n }\n \n return $orderID;\n }", "private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }", "public function create()\n {\n return view('order.create');\n }", "public function create()\n {\n return view('order.create');\n }", "public function create()\n {\n return view('order.create');\n }", "public function store(OrderRequest $request)\n {\n DB::transaction(function () use ($request) {\n $result = $this->orderService->create($request->input());\n $this->orderService->addItem($result->id);\n $this->cartService->deleteCart();\n return $result;\n });\n }", "public function store(Request $request)\n {\n $request->validate([\n 'total' => 'required|min:0',\n 'id_discount' => 'numeric'\n ]);\n $id_order = 'Orders-00001';\n $cek_order = Order::find($id_order);\n if($cek_order){\n $cek_order = Order::select('id')->orderBy('created_at','desc')->first();\n $id_order = $cek_order->id;\n $id_order++;\n }\n\n $order = new Order([\n 'id' => $id_order,\n 'total' => $request->get('total'),\n 'id_discount' => $request->get('id_discount'),\n ]);\n $order->save();\n return new OrderInsertResource($order);\n\n\n }", "public function createOrder()\n {\n if(!request()->ajax())\n {\n throw new BadRequestHttpException();\n }\n\n $data = request()->all();\n\n $model = new OrderViewModel(request('language'));\n\n $this->orderService->fill($model);\n\n DB::beginTransaction();\n\n if (auth()->check())\n {\n $userId = auth()->id();\n }\n else\n {\n $userId = null;\n }\n \n $this->orderService->createOrder($data, $userId, $model);\n\n $this->orderService->createOrderProducts($model);\n \n try \n {\n \\Mail::to(request('email'))->send(new OrderReport($model, request('name')));\n\n \\Mail::to(config('mail.from.address'))->send(new OrderReportManager($model, request('name')));\n }\n catch (\\Exception $e)\n {\n\n DB::rollBack();\n \n return response()->json([\n 'status' => 'error'\n ]);\n }\n \n $this->cartService->clearCart();\n \n DB::commit();\n \n Session::put('isOrderCreated', true);\n \n return response()->json([\n 'status' => 'success'\n ]);\n }", "public function makeorder (Request $request) {\n\n $order = new Order;\n $order->pizza_id = $request->pizzaId;\n $order->user_id = Auth::user()->id;\n\n $order->save();\n \n return redirect ('/pizzas');\n }", "public function create() //添加\n {\n\t\t//\n }", "protected function newOrderAction()\n {\n $entity = $this->createNewEntity();\n\n $easyadmin = $this->request->attributes->get('easyadmin');\n $easyadmin['item'] = $entity;\n $this->request->attributes->set('easyadmin', $easyadmin);\n\n $fields = $this->entity['new']['fields'];\n\n $newForm = $this->createNewForm($entity, $fields);;\n\n $newForm->handleRequest($this->request);\n if ($newForm->isValid()) {\n\n foreach ($entity->getProducts() as $product)\n {\n $product->setOrder($entity);\n }\n\n $this->em->persist($entity);\n $this->em->flush();\n\n $refererUrl = $this->request->query->get('referer', '');\n\n return !empty($refererUrl)\n ? $this->redirect(urldecode($refererUrl))\n : $this->redirect($this->generateUrl('easyadmin', array('action' => 'list', 'entity' => $this->entity['name'])));\n }\n\n return $this->render($this->entity['templates']['new'], array(\n 'form' => $newForm->createView(),\n 'entity_fields' => $fields,\n 'entity' => $entity,\n ));\n }", "public function store(Request $request)\n {\n \n $order = new Order;\n $order->id_Uzsakymas = $request->input('id_Uzsakymas');\n $order->uzsakytos_prekes_pavadinimas = $request->input('uzsakytos_prekes_pavadinimas');\n $order->uzsakymo_kiekis = $request->input('uzsakymo_kiekis');\n $order->uzsakymo_kaina = $request->input('uzsakymo_kaina');\n $order->uzsakymo_suma = $request->input('uzsakymo_suma');\n $order->pristatymo_data = $request->input('pristatymo_data');\n $order->fk_Pirkejasid_Pirkejas = $request->input('fk_Pirkejasid_Pirkejas');\n $order->fk_Sutartisid_Sutartis = $request->input('fk_Sutartisid_Sutartis');\n $order->save();\n\n return redirect('/orders');\n\n }", "public function placeOrder(){\n $sql = \"INSERT INTO `tbl_order`(`o_id`, `u_id`, `p_id`, `date`) VALUES (NULL,'$this->userId','$this->productId','$this->orderDate')\";\n // echo $sql; exit;\n return $this->connect->qry($sql);\n }", "public function store(CreateOrderRequest $request)\n {\n $input = $request->all();\n // if ($request->hasFile('image')) {\n // $path = $request->file('image')->store('public/orders');\n // $publicPath = \\Storage::url( $path );\n // $input['image'] = $publicPath;\n // }\n\n $order = $this->orderRepository->create($input);\n\n Flash::success('Order успешно сохранен.');\n // $order['id']\n// event( new \\App\\Events\\ServerCreated(\"Новый заказ!\", $id) );\n\n return redirect(route('orders.index'));\n }", "public function create(array $data)\n {\n $this->db->beginTransacton();\n \n //Create the order\n $orderSql = \"INSERT INTO orders(user_id) VALUES (:user_id)\";\n \n $this->db->prepare($orderSql);\n \n $this->db->bind('user_id', $data['userId'], \\PDO::PARAM_INT);\n\n $this->db->execute();\n\n $orderId = $this->db->lastInsertId();\n\n $orderItemsSql = \"INSERT INTO order_items(order_id, product_id, quantity) VALUES (:order_id, :product_id, :quantity)\";\n\n $this->db->prepare($orderItemsSql);\n\n foreach ($data['cartItems'] as $key => $value) {\n\n $this->db->bind('order_id', $orderId, \\PDO::PARAM_INT);\n $this->db->bind('product_id', $key, \\PDO::PARAM_INT);\n $this->db->bind('quantity', $value, \\PDO::PARAM_INT);\n\n $this->db->execute();\n }\n\n $this->db->commit();\n\n return $orderId;\n\n }", "public function newOrder($values)\n\t{\n\t\treturn $this->getRequest('NewOrder', $values);\n\t}", "public function create()\n {\n return view('backend.orders.create');\n }", "public function storeOrder($request);", "public function create()\n {\n return view('order-create');\n }", "public function createOrder($id_user, $id_service) { \n $stmt = $this->conn->prepare(\"INSERT INTO `order`(\n `id_user`,\n `id_service`,\n `code`,\n `payment_code`,\n `code_valided`,\n `code_notified`,\n `created_at`\n )\n VALUES(?, ?, UPPER(SUBSTR( MD5(UUID_SHORT()), -8)), UPPER(SUBSTR( MD5(UUID()), -10)), 0, 0, NOW() )\");\n $stmt->bind_param(\"ii\", $id_user, $id_service);\n $result = $stmt->execute();\n $stmt->close();\n \n if ($result) {\n // order row created\n // now assign the order to user\n $new_order_id = $this->conn->insert_id;\n return $new_order_id;\n \n } else {\n print_r($stmt->error); die;\n // order failed to create\n return NULL;\n }\n }" ]
[ "0.7726986", "0.76280785", "0.7603774", "0.72889686", "0.72638935", "0.71876585", "0.711252", "0.702796", "0.70068866", "0.69737464", "0.69582343", "0.6922678", "0.68804663", "0.6835975", "0.680529", "0.67847925", "0.6768965", "0.6752184", "0.67420954", "0.67005557", "0.66975737", "0.66820097", "0.668015", "0.66411966", "0.66300577", "0.6612525", "0.6605666", "0.6592263", "0.6570478", "0.65650445", "0.6550673", "0.6550673", "0.65333444", "0.65134203", "0.65110385", "0.648667", "0.6484408", "0.6483685", "0.6469532", "0.6446138", "0.6433364", "0.64296573", "0.6404894", "0.6392931", "0.6355195", "0.6343921", "0.6329373", "0.6328702", "0.632084", "0.63173527", "0.6296871", "0.6292815", "0.62798816", "0.62714183", "0.62608963", "0.6259946", "0.62580967", "0.62566584", "0.62491494", "0.62466085", "0.6244344", "0.6242824", "0.62329054", "0.62275636", "0.6219403", "0.6217583", "0.6205483", "0.62000483", "0.61973214", "0.6190109", "0.6188703", "0.6172413", "0.61683255", "0.61560345", "0.6148403", "0.6144029", "0.6140549", "0.6139071", "0.6138306", "0.6134948", "0.6127472", "0.61220914", "0.6115861", "0.6115861", "0.6115861", "0.6115753", "0.6092469", "0.60905296", "0.6079419", "0.60785687", "0.6077638", "0.60719013", "0.606387", "0.6059908", "0.60593736", "0.6053304", "0.6051696", "0.60468537", "0.60465133", "0.60452694" ]
0.6522131
33
Delete an order from the database.
public function delete( &$order, $args = array() ) { global $wpdb; $order_id = $order->get_id(); parent::delete( $order, $args ); if ( $args['force_delete'] || 0 == $order->get_id() ) { $wpdb->delete( "{$wpdb->prefix}woocommerce_orders", array( 'order_id' => $order_id, ) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteOrder($order_id);", "public function deleting(Order $Order)\n {\n //code...\n }", "function deleteOrder($orderId);", "public function deleted(Order $order)\n {\n //\n }", "public function deleted(Order $order)\n {\n //\n }", "function deleteOrder () {\n\t//\terror_log ( 'addOrder\\n', 3, '/var/tmp/php.log' );\n\t$request = Slim::getInstance ()->request ();\n\t$orderId = json_decode ( $request->getBody () );\n\ttry {\n\t\t$db = new DbOperation();\n\t\t$db->deleteOrder ( $orderId->orderId );\n\t\techo '{\"deleteStatus\":\"YES\"}';\n\t} catch ( Exception $e ) {\n\t\t//\t\terror_log ( $e->getMessage (), 3, '/var/tmp/php.log' );\n\t\techo '{\"errorText\":\"Delete order fail with text as\", \"text\":}' . $e->getMessage () . $e . '}';\n\t}\n}", "public function testDeleteOrder() {\n $order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'default',\n 'unit_price' => [\n 'number' => '999',\n 'currency_code' => 'USD',\n ],\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'order_items' => [$order_item],\n 'uid' => $this->loggedInUser,\n 'store_id' => $this->store,\n ]);\n $order->delete();\n\n $order_exists = (bool) Order::load($order->id());\n $order_item_exists = (bool) OrderItem::load($order_item->id());\n $this->assertEmpty($order_exists, 'The new order has been deleted from the database.');\n $this->assertEmpty($order_item_exists, 'The matching order item has been deleted from the database.');\n }", "public function delete_order()\n\t{\n\t\tif ($this->checkLogin('A') == '') {\n\t\t\tredirect('admin');\n\t\t} else {\n\t\t\t$order_id = $this->uri->segment(4, 0);\n\t\t\t$condition = array('id' => $order_id);\n\t\t\t$old_order_details = $this->order_model->get_all_details(PRODUCT, array('id' => $order_id));\n\t\t\t$this->update_old_list_values($order_id, array(), $old_order_details);\n\t\t\t$this->update_user_order_count($old_order_details);\n\t\t\t$this->order_model->commonDelete(PRODUCT, $condition);\n\t\t\t$this->setErrorMessage('success', 'Order deleted successfully');\n\t\t\tredirect('admin/order/display_order_list');\n\t\t}\n\t}", "public function deleted(Order $order)\n\t{\n\t\t//\n\t}", "public function deleted(Order $order)\n\t{\n\t\t//\n\t}", "public function deleted(Order $Order)\n {\n //code...\n }", "public function destroy(Order $order)\n {\n $order->delete();\n }", "public function destroy(order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n\n }", "public function destroy(Order $order)\n {\n //\n }", "public function delete($id)\n {\n Order::findOrFail($id)->delete();\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function destroy(Order $order)\n {\n //\n }", "public function delete($orderId)\n {\n $query = \"DELETE FROM orders\n WHERE id = :id\";\n\n $this->db->prepare($query);\n\n $this->db->bind('id', $orderId);\n\n return $this->db->execute();\n \n }", "public function destroy(Order $order)\n {\n \n }", "public function deleteById($orderlineId);", "public function deleteOrder($id_order)\n\t\t{\n\t\t\t$this->mgrOrder->deleteOrder($id_order);\n\t\t}", "public function destroy($order_id)\n {\n $order=Orders::findOrFail($order_id);\n $order->delete();\n }", "public function delete_OrderPage(){\n $id_product = $_REQUEST[\"id_product\"];\n $id_order = $_REQUEST[\"id_order\"];\n $query = \"DELETE FROM order_u\n WHERE order_u.id = $id_order;\";\n $data = $this->connection->query($query);\n\n $query = \"DELETE FROM order_product\n WHERE order_product.order_id = $id_order;\";\n $data = $this->connection->query($query);\n \n }", "public function destroy(Order $order)\n {\n \n $order->order_lines()->delete();\n $order->delete(); \n return redirect()->route('orders.index');\n }", "public function deleteorders($id, $order)\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n OrderModel::manage_order($id, $order);\n }", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "public function delete($order_id)\n {\n $this->db->where('id', $order_id);\n return $this->db->delete('orders') == TRUE;\n }", "public function destroy(Order $Order)\n {\n //\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function delete()\n\t{\n\t\t$res = $this->getDB()->delete('quotes',['quote_id'=>$this->getId()]);\n\n\t\t// Check to see if the query ran properly.\n\t\tif(!$res)\n\t\t{\n\t\t\tthrow new Exception('The product was not deleted from the quote/order.');\n\t\t}\n\t}", "public function delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }", "public function deleteOrder(){\r\n $cookies = new CookieModel();\r\n $cookie_id = $cookies -> read();\r\n $Form = M('userinfo');\r\n $condition_in['stuid'] = $cookie_id;\r\n $data = $Form->where($condition_in)->find();\r\n if (! $data['manager']) $this->redirect('/');\r\n\r\n $key = $_REQUEST['id'];\r\n //$key = 2;\r\n $condition['id'] = $key;\r\n $form = M(\"orderinfo\");\r\n $data = $form->where($condition)->delete();\r\n $this->redirect('/index.php/Admin/index');\r\n //$this->display();\r\n }", "public function destroy(TxShopDomainModelOrderItem $order)\n {\n //\n }", "public function forceDeleted(Order $order)\n {\n //\n }", "public function forceDeleted(Order $order)\n {\n //\n }", "public function forceDeleted(Order $order)\n {\n //\n }", "public function sDeleteBasketOrder()\r\n {\r\n $sessionId = Shopware()->Session()->get('sessionId');\r\n\r\n if (empty($sessionId)) return;\r\n\r\n $deleteWholeOrder = Shopware()->Db()->fetchAll(\"\r\n SELECT * FROM s_order_basket WHERE sessionID = ?\r\n \",array($sessionId));\r\n\r\n foreach ($deleteWholeOrder as $orderDelete) {\r\n Shopware()->Db()->executeUpdate(\"\r\n DELETE FROM s_order_basket WHERE id = ?\r\n \",array($orderDelete[\"id\"]));\r\n }\r\n }", "public function delete(Order $order)\n {\n $order->delete();\n\n return response()->json([], 200);\n }", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "public function order_delete($id)\n { \n echo 'yes';\n Order::where('id',$id)->delete();\n Session::flash('flash_message_success', 'Order deleted successfully');\n return redirect()->back();\n }", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "public function orders_delete($app, $collection_id = null, $order_id = null) {\n\t\t//Delete order\n\t\t$success = Elementorder::delete($order_id);\n\n\t\treturn $app->toJSON(['status' => $success]);\n\t}", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function destroy(Order $order)\n {\n $order->delete();\n return $this->index();\n }", "public function delete_order($where) {\n return $this->db->delete($this->order, $where);\n }", "public function destroy(Order $order)\n {\n /** order dengan status 1 forceDelete */\n if ($order->status == 1) {\n foreach ($order->details()->get() as $detail) {\n $qty = $detail->product->stock->qty + $detail->qty;\n ProductStock::whereProductId($detail->product_id)\n ->update(['qty' => $qty]);\n }\n\n if ($order->payment_count > 0) {\n Storage::delete($order->payment->proof);\n $order->payment()->forceDelete();\n }\n\n $order->details()->forceDelete();\n $order->forceDelete();\n return redirect(route('orders.index'))->withToastSuccess('Succesfully Deleted');\n }\n\n $order->delete();\n\n return redirect(route('orders.index'))->withToastSuccess('Succesfully Deleted');\n }", "public function destroy(Order $order)\n {\n $order->delete();\n return redirect()->route('order.index');\n }", "public function delete() {\n\n\t\t// Database\n\t\t$db = $this->db;\n\n\t\t// SQL code for deletion\n\t\t$sql = $this->sql_for_delete();\n\n\t\t// Deletion execution\n\t\treturn $db::execute($sql);\n\t}", "public function forceDeleted(Order $order)\n\t{\n\t\t//\n\t}", "public function forceDeleted(Order $order)\n\t{\n\t\t//\n\t}", "function MyShop_OrderDelete($args) {\n global $_TABLES;\n\n $sql = \"DELETE FROM {$_TABLES['myshop_order']} WHERE orderid = '{$args['orderid']}'\";\n DB_query($sql);\n}", "public function deleteOrderDetails($product_code,$order_id=NULL,$quantity,$token=NULL);", "public function destroy(Order $order)\n {\n $order->delete();\n\n return redirect(route('orders.index'));\n }", "public function destroy(Order $order)\n {\n $order->delete();\n return redirect()->route('orders.index');\n }", "static function cancelOrder($order_id) {\n\t\t\t$query = \"delete from orders where OID = ?\";\n\t\t\t$dataArr = array($order_id);\n\t\t\tOrder::manDb($query, $dataArr);\n\t\t}", "public function destroy(Order $order)\n {\n /*if (Gate::allows('delete-order', $order)) {*/\n $order->delete();\n return redirect()->route('order.my');\n /*} else {\n abort(403);\n }*/\n }", "public function delete_sales_order() {\n\t\t$values=array(\"rstatus\"=>\"C\");\n\t\t$rowIndex = $_POST['row_index'];\n\t\t$where =array(\"id\"=>$_POST['so_id']);\n\t\tif($this->update(\"sales_order\",$values,$where)) {\t\t\t\n\t\t\techo '{\"salesOrderList\":{\"updateFlag\":\"void\",\"rowIndex\":'.$rowIndex.'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while inserting sales tbl';\n\t}", "public function destroy(Order $orders)\n {\n //\n }", "public function deleteById($orderscheduleId);", "public function destroy(Order $order)\n {\n //\n $order->delete();\n\n return redirect()->route('orders.index')\n\n ->with('success','Pedido Eliminado Exitosamente');\n }", "public function deleteEntidad(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_entidades WHERE entidad_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }", "public function destroy(Order $order)\n {\n Order::destroy($order->id_order);\n return redirect('/admin');\n }", "public function delete(){\r\n\t\t$this->db->delete();\r\n\t}", "public function delete()\r\n {\r\n $db = Database::getDatabase();\r\n $db->consulta(\"DELETE FROM puesto WHERE idPue = {$this->idPue};\");\r\n }", "public function delete()\n\t{\n\t\tDatabase::query(\"\n\t\t\tDELETE FROM\n\t\t\t\t\". $this->tableName .\"\n\t\t\tWHERE\n\t\t\t\tid = '\". $this->id .\"'\n\t\t\");\n\t}", "public function destroy(Orders $orders)\r\n {\r\n //\r\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n }", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "function deleteItem($orderId)\n {\n $dataService = new OrderDataService();\n\n return $dataService->deleteItem($orderId);\n }", "public function destroy(Order $order)\n {\n $order->delete();\n\n Session::flash('success', 'Successfully delete order!');\n return redirect()->back();\n }", "public function destroy(Order $order)\n {\n $order->delete();\n return $this->respond();\n }", "public function delete($id) {\n\n //$input['tags'] = $this->processTags($input['tags']);\n return $this->order->destroy($id);\n }", "public function destroy(RequestOrder $requestOrder)\n\n {\n\n //\n\n }", "function deleteItem($orderId)\n {\n }", "public function destroy(Order $order){\n foreach ($order->products as $product){\n $product->update([\n 'stock'=>$product->stock +$product->pivot->quantity\n ]);\n }//end of foreach\n $order->products()->detach();\n $order->delete();\n session()->flash('success',__('site.deleted_successfully'));\n return redirect()->route('dashboard.orders.index');\n }", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "public function actionDelete($id)\n\t{\n\t\t// $this->loadModel($id)->delete();\n\t\t$order = $this->loadModel($id);\n\t\t\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->condition = 'KODE_ORDER = :order';\n\t\t$criteria->params = array(':order' => $id);\n $orderdetail = OrderDetail::model()->deleteAll($criteria);\n //$orderdetail->delete();\n\t\t$order->delete();\n\t\t// var_dump(); die();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax'])) {\n\t\t\tYii::app()->user->setFlash('info', MyFormatter::alertError('<strong>Selamat!</strong> Data telah berhasil dihapus.'));\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('index'));\n\t\t}\n\t}", "public function deleteOrder($order_id) {\n\t\t$this->load->model('order/order_history');\n\n\t\t$this->model_order_order_history->addOrderHistory($order_id, 0);\n\n\t\t$this->db->query(\"DELETE FROM `\" . DB_PREFIX . \"order` WHERE order_id = '\" . (int)$order_id . \"'\");\n\t\t$this->db->query(\"DELETE FROM `\" . DB_PREFIX . \"order_custom_field` WHERE order_id = '\" . (int)$order_id . \"'\");\n\t\t$this->db->query(\"DELETE FROM `\" . DB_PREFIX . \"order_product` WHERE order_id = '\" . (int)$order_id . \"'\");\n\t\t$this->db->query(\"DELETE FROM `\" . DB_PREFIX . \"order_option` WHERE order_id = '\" . (int)$order_id . \"'\");\n\t\t$this->db->query(\"DELETE FROM `\" . DB_PREFIX . \"order_additionally` WHERE order_id = '\" . (int)$order_id . \"'\");\n\t\t$this->db->query(\"DELETE FROM `\" . DB_PREFIX . \"order_total` WHERE order_id = '\" . (int)$order_id . \"'\");\n\t\t$this->db->query(\"DELETE FROM `\" . DB_PREFIX . \"order_history` WHERE order_id = '\" . (int)$order_id . \"'\");\n\t}", "public function delete()\n {\n $this->execute(\n $this->syntax->deleteSyntax(get_object_vars($this))\n );\n }", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }" ]
[ "0.80839837", "0.7640994", "0.7444085", "0.7374824", "0.7374824", "0.73580664", "0.7342271", "0.73054206", "0.72994447", "0.72994447", "0.71366346", "0.7110824", "0.70548797", "0.70511264", "0.7041883", "0.69984317", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.698561", "0.6975465", "0.6943964", "0.6934961", "0.69275373", "0.6908325", "0.6885705", "0.6879299", "0.6865279", "0.6860944", "0.67842996", "0.67760736", "0.67567027", "0.6745437", "0.6718737", "0.6699538", "0.66771346", "0.66738856", "0.66738856", "0.66738856", "0.66420263", "0.66411036", "0.6640161", "0.66318256", "0.66308564", "0.66176385", "0.6580226", "0.6573798", "0.6556243", "0.6535926", "0.6534308", "0.6494911", "0.64878607", "0.64878607", "0.64592534", "0.64416033", "0.64316386", "0.64102674", "0.6408465", "0.6403417", "0.6401751", "0.6379225", "0.6376442", "0.63728803", "0.63711905", "0.63642246", "0.6357644", "0.6356215", "0.63482773", "0.6343654", "0.6336959", "0.63277036", "0.6324924", "0.6312254", "0.63099116", "0.6292252", "0.6289127", "0.62884736", "0.6281167", "0.6279569", "0.62790346", "0.6276143", "0.62678295", "0.6267262" ]
0.7150532
10
Retrieve a single order from the database.
public function get_order_data_from_table( $order ) { global $wpdb; return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}woocommerce_orders WHERE order_id = %d;", $order->get_id() ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOrderById($id){\n $this->db->query(\"SELECT * FROM orders WHERE id = :id\");\n\n $this->db->bind(':id', $id);\n \n $row = $this->db->single();\n\n return $row;\n }", "static function getOrder(int $OrderID) {\r\n $sqlSelect = \"SELECT * FROM Orders WHERE OrderID = :OrderID\";\r\n //Query\r\n self::$db->query($sqlSelect);\r\n //Bind\r\n self::$db->bind(':OrderID', $OrderID);\r\n //Execute\r\n self::$db->execute();\r\n //Return\r\n return self::$db->singleResult();\r\n }", "public function getOrder()\n {\n $orderId = $this->getData(self::ORDER_ID);\n\n return $this->order->load($orderId);\n }", "static public function getOrderById($order_id) {\n $order = DB::table('orders')->where('id', $order_id)->get();\n return $order;\n }", "function getOrderbyId($order_id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT *\n\t\t\t\t\t\t\t\t\t\tFROM `order`\n\t\t\t\t\t\t\t\t\t\tWHERE `id` = ? ');\n\t\t$sth \t-> execute(array($order_id));\n\t\treturn \t$sth;\n\t}", "function getSelectedOrder($orderId) {\n try {\n // get DB connection\n $db = new DbOperation();\n $orders = $db->getSelectedOrder ($orderId);\n if ( $orders != null ) {\n echo '{\"gotOrder\":' . json_encode ( $orders ) . '}';\n } else {\n echo '{\"error\":{\"text\":' . \"Failed to get orders data\" . '}}';\n }\n } catch ( Exception $e ) {\n echo '{\"error\":{\"text\":' . $e->getMessage () . '}}';\n }\n}", "public function getOneOrder($orderId) {\n\n $this->load->model('account/order');\n return $this->model_account_order->getOrder($orderId);\n }", "private function getOrder()\n {\n // get the last real order id\n $lastOrderId = $this->_checkoutSession->getLastRealOrderId();\n if ($lastOrderId) {\n // load and return the order instance\n return $this->_orderFactory->create()->loadByIncrementId($lastOrderId);\n }\n return false;\n }", "public function getOne(){\n\n $pedido = $this->db->query(\"SELECT * FROM pedidos WHERE id = {$this->getId()}\");\n\n \n return $pedido->fetch_object();\n }", "public function get_order( $order_id ) {\n\t\treturn $this->request( \"orders/{$order_id}\" );\n\t}", "public function getOrder()\n {\n return $this->hasOne(Orders::className(), ['id' => 'order_id']);\n }", "public function getOrder()\n {\n return $this->hasOne(Order::className(), ['id' => 'order_id']);\n }", "public function getOrder()\n {\n return $this->hasOne(Order::className(), ['id' => 'order_id']);\n }", "public function getOrder(string $order_id): \\GDAX\\Types\\Response\\Authenticated\\Order;", "static public function getOrderById($id) {\n $rq = \"SELECT * FROM \" . PREFIX . \"sales.`order` \n WHERE `id` =\" . $id . \" LIMIT 1;\";\n\n $aItem = Sql::Get($rq, 1);\n \n return $aItem[0];\n }", "public function get($id)\n {\n header('Access-Control-Allow-Origin: *'); \n $order = Order::find($id);\n \n return $order;\n }", "public function getOrder($id) {\n return Order::fetch($id);\n }", "public function getOrderById($order_id)\n {\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.\"orders/$order_id/detail/\");\n $client->setMethod(\\Zend_Http_Client::GET);\n $client->setHeaders([\n 'Content-Type: application/json', \n 'Accept: application/json',\n \"Authorization: Token $this->token\"\n ]);\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $order_data=json_decode($string);\n \n return $order_data;\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos order save helper', [\"Get order error\"=>$e->getMessage()]);\n return false;\n }\n }", "public function getOne(){\n //hacemos la consulta y lo guardamos en una variable\n $producto=$this->db->query(\"SELECT * FROM pedidos where id={$this->getId()};\");\n //devolvemos un valor en especifico y lo comvertimos a un objeto completamente usable.\n return $producto->fetch_object();\n }", "private function fetchOrder()\n {\n $this->oOrder = Mage::getSingleton('sales/order');\n try {\n $this->oOrder->load($this->getParameter('orderid',self::REGEX_INTEGER));\n } catch (Exception $e) {\n $this->returnMessage = self::MESSAGE_INVALID_ORDER_ID;\n $this->returnStatus = self::STATUS_ERROR;\n $this->sendStatus();\n }\n\n if(!$this->oOrder->getPayment() || substr($this->oOrder->getPayment()->getMethod(),0,3) != 'mcp') {\n $this->returnMessage = self::MESSAGE_NOT_MICROPAYMENT_ORDER;\n $this->returnStatus = self::STATUS_ERROR;\n $this->sendStatus();\n }\n }", "public function getOrder()\n {\n return $this->orderFactory->create()->load($this->getReservedOrderId(), 'increment_id');\n }", "public function getById($orderlineId);", "private function getOrder($orderoid){\n $rs = selectQuery('select * from WTSORDER where KOID=\"'.$orderoid.'\"');\n if ($rs->rowcount() == 1){\n $ors = $rs->fetch();\n foreach($ors as $k=>$v){\n\t$order->{$k} = $v;\n }\n } else {\n $order = null;\n XLogs::critical(get_class($this), 'Impossible de trouver la commande ayant pour KOID : '.$orderoid);\n }\n return $order;\n }", "protected function getOrderItem()\n\t{\n\t\t$search = $this->object->createSearch();\n\n\t\t$expr = [];\n\t\t$expr[] = $search->compare( '==', 'order.base.rebate', 14.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.sitecode', 'unittest' );\n\t\t$expr[] = $search->compare( '==', 'order.base.price', 53.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.editor', $this->editor );\n\t\t$search->setConditions( $search->combine( '&&', $expr ) );\n\t\t$results = $this->object->searchItems( $search );\n\n\t\tif( ( $item = reset( $results ) ) === false ) {\n\t\t\tthrow new \\RuntimeException( 'No order found' );\n\t\t}\n\n\t\treturn $item;\n\t}", "public function getQuote()\n {\n return $this->quoteFactory->create()->load($this->getReservedOrderId(), 'reserved_order_id');\n }", "public function testRetrieve()\n {\n VCR::insertCassette('orders/retrieve.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $retrievedOrder = Order::retrieve($order->id);\n\n $this->assertInstanceOf('\\EasyPost\\Order', $retrievedOrder);\n $this->assertEquals($order->id, $retrievedOrder->id);\n }", "public function retrieve($id) {\n SCA::$logger->log(\"retrieve resource $id\");\n return $this->orders_service->retrieve($id);\n }", "public function item($order)\n {\n return SiteMaintenanceItem::where('main_id', $this->id)->where('order', $order)->first();\n }", "public function readOne()\n {\n $sql = 'SELECT id_producto, nombre_producto, descripcion_producto, precio_producto, imagen_producto, stock, id_marca, estado_producto\n FROM productos\n WHERE id_producto = ?';\n $params = array($this->id);\n return Database::getRow($sql, $params);\n }", "public function order(){\n\t\treturn $this->hasOne(Order::class);\n\t}", "public function getOrderFromSession(): Order\n {\n $id = Session::pull('mall.payment.order');\n\n return Order::findOrFail($id);\n }", "public function getOrderById($orderId)\n {\n }", "public function getExistingOrder($orderid = '') {\n $orderid = isset($orderid) ? $orderid : '';\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($orderid);\n\n // if no order found\n if (!$order->getId())\n return FALSE;\n else\n return $order;\n}", "public function getOrderById($id_order)\n {\n return $this->orderRepository->getOrderById($id_order);\n }", "public function find(int $id): Order\n {\n return Order::find($id);\n }", "private function fetchOrderModel(string $orderNumber): Order\n {\n /** @var Order $order */\n $order = Bootstrap::getObjectManager()->get(Order::class);\n $order->loadByIncrementId($orderNumber);\n return $order;\n }", "public function show(Order $order)\n {\n return $order;\n }", "public static function order($orderId) {\n //Return an object with the information about $orderId\n\t\t\treturn self::get(self::order_index() . '/' . $orderId);\n\t\t}", "public function single()\n {\n $this->executeQuery($this->statement);\n return $this->fetch($this->statement);\n }", "public function single() {\n $this->execute();\n return $this->stmt->fetch(PDO::FETCH_OBJ);\n }", "public function show(Order $order)\n {\n $this->authorize('view',$order);\n return $this->helper->get($order->id);\n }", "public function show($id)\n {\n return Order::find($id);\n }", "public function show($id)\n {\n return Order::find($id);\n }", "public function show($id)\n {\n return Order::findOrFail($id);\n }", "protected function getOne()\n {\n $statement = $this->connection->query($this->sqlToString());\n return $this->fetch($statement);\n }", "public function getOrder($id)\n {\n $db = new Mysqli();\n $db->connect('localhost', 'root', 111111, 'nn_pay');\n $data = $db->query(\"select * from nns_pay_order where nns_id = '{$id}' limit 1\");\n Register::set('nn_pay_db', $db);\n\n return $data[0];\n }", "public function getOrder() { \n if ($this->hasOrder()) {\n return $this->getData('order');\n }\n if (Mage::registry('current_order')) {\n return Mage::registry('current_order');\n }\n if (Mage::registry('order')) {\n return Mage::registry('order');\n }\n Mage::throwException(Mage::helper('sales')->__('Can\\'t get order instance'));\n }", "public function single()\n\t{\n\t\t$this->execute();\n\t\treturn $this->stm->fetch(PDO::FETCH_OBJ);\n\t}", "public function order()\n {\n return $this->hasOne('App\\Models\\Order');\n }", "public function get($order_id)\n {\n $query = $this->db->where('id', $order_id)\n ->get('orders');\n\n if ($query->num_rows() > 0) {\n $row = $this->build_array($query->result_array());\n return $row[0];\n }\n return FALSE;\n }", "public function fetchSingle() {\n $this->execute();\n return $this->stmt->fetch(PDO::FETCH_OBJ);\n }", "public function show(int $id)\n {\n $order = Order::find($id);\n\n if (null === $order) {\n return response()\n ->noContent();\n }\n\n return $order;\n }", "public function getOrderId();", "public function orderQueryAction()\n {\n // https://api.weixin.qq.com/pay/orderquery?access_token=xxxxxx\n $orderId = $this->params()->fromRoute('id', '0');\n\n $order = $this->getOrderTable()->getOrder($orderId);\n if ($orderId == '0' || !$order) {\n return $this->errorViewModel(array('code' => 1, 'msg' => 'order '.$orderId.' not exist.'));\n }\n\n $postResult = $this->orderQuery($orderId);\n // echo $postResult;\n echo '<br>errcode:';\n echo $postResult->errcode;\n echo '<br>errmsg:';\n echo $postResult->errmsg;\n if ($postResult->errcode == 0) {\n echo '<br>orderinfo:';\n var_dump($postResult->order_info);\n }\n\n return $this->viewModel();\n }", "function findById($orderId);", "public function getOneByUser(){\n //hacemos la consulta y lo guardamos en una variable\n $sql=\"SELECT id,coste FROM pedidos\"\n .\" where usuario_id={$this->getUsuario_id()} order by id desc limit 1\";\n $pedido=$this->db->query($sql);\n //devolvemos un valor en especifico y lo comvertimos a un objeto completamente usable.\n return $pedido->fetch_object();\n }", "public function getOneByUser(){\n $sql = \"SELECT p.id, p.coste FROM pedidos p \"\n //. \"INNER JOIN lineas_pedidos lp ON p.id = lp.pedido_id \"\n . \"WHERE p.usuario_id = {$this->getUsuario_id()} ORDER BY id DESC LIMIT 1\";\n\n $pedido = $this->db->query($sql);\n\n \n //echo $this->db->error;\n \n return $pedido->fetch_object();\n \n }", "function findById($id)\n {\n $dataService = new OrderDataService();\n\n return $dataService->findById($id);\n }", "public function read($order_id) {\n\n global $user;\n\n //watchdog('musth_restws', 'W7D001 5DXS OrderResourceController start read (!i) (!p) ',\n // array('!i' => print_r($order_id, true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n $order_as_array = entity_load('commerce_order', array($order_id));\n $order = $order_as_array[$order_id];\n\n // The order total, which is in the field commerce_order_total, is calculated\n // automatically when the order is refreshed, which happens at least when we\n // call the line item api to get all the line items of an order\n\n // Refreshing the order in case any product changed its price or there are other\n // changes to take care of\n\n // Since we refresh the order here, there is no need to do it when we load\n // line items. Just call the order query api first and then the line item query api\n\n if ($order->status == 'cart')\n commerce_cart_order_refresh($order);\n\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n\n //watchdog('musth_restws', 'W7D001 71788 kkk OrderResourceController read (!i) (!p) ',\n // array('!i' => print_r('', true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n if (isset($order->commerce_customer_billing[LANGUAGE_NONE]))\n $customer_profile_id = $order->commerce_customer_billing[LANGUAGE_NONE][0]['profile_id'];\n else\n $customer_profile_id = 0;\n\n if ($user->uid) {\n // For logged-in users we can send back the email address\n\n $user_email = $order->mail;\n\n } else {\n // For anonymous users we can't\n\n $user_email = 'Cant send you the email address for privacy';\n }\n\n $order_to_return = new Order($order->order_id,\n $order->order_number,\n $order->uid,\n $user_email,\n $customer_profile_id,\n $order->status,\n $order_wrapper->commerce_order_total->amount->value(),\n $order_wrapper->commerce_order_total->currency_code->value(),\n $order->created,\n $order->changed\n );\n\n //watchdog('musth_restws', 'W7D001 7171 OrderResourceController read (!i) (!p) ',\n // array('!i' => print_r('', true),\n // '!p' => print_r('', true)),\n // WATCHDOG_DEBUG);\n\n // Sending back the Order object\n\n return $order_to_return;\n }", "public function getOrder($orderId) {\n\t\t$action = new EventerraActionMyOrders($this);\n\t\ttry {\n\t\t\t$array = $action->request($orderId);\n\t\t} catch (\\Eventerra\\Exceptions\\EventerraSDKException $exception) {\n\t\t\tif ($exception->getCode() == 5) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\tthrow $exception;\n\t\t\t}\n\t\t}\n\t\treturn array_shift($array);\n\t}", "function wisataone_X1_get_single_order($id) {\n global $wpdb, $wisataone_X1_tblname;\n $wp_track_table = $wpdb->prefix . $wisataone_X1_tblname;\n\n $res = $wpdb->get_results( \n \"\n SELECT *\n FROM {$wp_track_table}\n WHERE {$wp_track_table}.id = {$id}\n LIMIT 1\n \"\n );\n\n if ($res) {\n return $res[0];\n }\n\n return null;\n}", "function getOrder($orderId) {\n\techo \"Getting Order: \" . $orderId . \"</br>\";\n\t$response = getRequest('/api/order/' . $orderId);\n\tprintInfo($response);\n}", "public function show($id)\n {\n return OrderService::getOrderById($id);\n }", "public function single(){\n\t\t$this->execute();\n\t\treturn $this->stmt->fetch(PDO::FETCH_OBJ);\n\t}", "public function get_order_by_id($id) {\n if(!$id) {\n throw new Exception('id should not be empty');\n }\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/orders/$id.json\");\n }", "public function single(){\r\n $this->execute();\r\n return $this->stmt->fetch(PDO::FETCH_OBJ);\r\n }", "protected function getOrder($orderId) {\n $order = Order::with('items.catalog.product')->where('id', '=', $orderId)->where('status', '=', Order::PENDING)->first();\n return $order;\n }", "protected function _getOrder()\n {\n if (empty($this->_order)) {\n // get proper order\n $id = $this->_request['track_id'];\n $this->_order = Mage::getModel('sales/order')->loadByIncrementId($id);\n if (!$this->_order->getId()) {\n $this->_debugData['exception'] = sprintf('Wrong order ID: \"%s\".', $id);\n $this->_debug();\n Mage::app()->getResponse()\n ->setHeader('HTTP/1.1','503 Service Unavailable')\n ->sendResponse();\n exit;\n }\n }\n return $this->_order;\n }", "public function getOrder()\n {\n $order = Mage::registry('current_order');\n if ($order == null) {\n $lastOrderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();\n $order = Mage::getModel('sales/order')->loadByIncrementId($lastOrderId);\n }\n return $order;\n }", "public function fetchOne($where=\"2>1\",$order=\"idUser asc\")\n\t{\n\t\t\n\t\t$sql = \"SELECT * FROM {$this->table} WHERE {$where} order by {$order}\";\n\t\t//return une ligne de donnees\n\t\treturn $this->pdo->fetchOne($sql);\n\t}", "public function getOne($id)\n {\n $sql = \"SELECT * FROM \".$this->table.\" WHERE id =\" . $id;\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetch(PDO::FETCH_OBJ);\n }", "public function getOrderByID($order_id)\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.order_id = :order_id\nORDER BY orders.order_date;\nSQL\n );\n $order->execute(array(':order_id' => $order_id));\n return $order->fetch(\\PDO::FETCH_OBJ);\n }", "public function single()\n {\n $this->execute();\n return $this->stmt->fetch(PDO::FETCH_ASSOC);\n }", "public function getOrder($user_id, $order_id)\n {\n $where = [\n 'user_id' => $user_id,\n 'order_id' =>$order_id,\n ];\n $result = $this->where($where)->find(); \n\n return $result;\n }", "public function actionOrderDetail($id)\n {\n $order = Order::find()\n ->where(['id' => $id, 'customer_id' => $this->customer_id])\n ->andWhere(['<>', 'status_id', Order::STATUS_DRAFT])\n ->one();\n \n if ($order !== null) {\n return $order;\n }\n \n throw new NotFoundHttpException(\"Order transaction ({$id}) is not available.\");\n }", "public function show(Order $order)\n {\n return $order->getData();\n }", "public function query() {\n\t\tif (get_current_login_user() == 'admin') {\n\t\t\treturn Order::get();\n\t\t} else if (get_current_login_user() == 'store') {\n\t\t\t$store_id = auth()->guard('store')->user()->id;\n\t\t\treturn Order::where('store_id', $store_id)->get();\n\t\t}\n\t}", "private function getOrder($order_id){\r\n\r\n if($this->flow_woocommerce_version_check()){\r\n return new WC_Order($order_id);\r\n }\r\n else{\r\n return wc_get_order($order_id);\r\n }\r\n }", "public function getByOrder($orderId) {\n\n return $this->fetchAll(\n $this->select()\n ->where(\"`orderId` = ?\", $orderId)\n );\n }", "public function get_order($order_id)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->where('orders.order_status = order_status.order_status_id AND users.user_id = orders.user_id AND orders.order_id = '.$order_id);\n\t\t$query = $this->db->get('orders, order_status, users');\n\t\t\n\t\treturn $query;\n\t}", "public function show(Order $order)\n {\n return api_response(200, 'success', new OrderResource($order));\n }", "private function _getOrder()\n {\n if (!is_null($this->_order)) {\n return $this->_order;\n }\n \n $orderId = $this->getRequest()->getParam('orderId');\n if (!empty($orderId)) {\n $this->_order = Mage::getSingleton('sales/order')->loadByIncrementId($orderId);\n return $this->_order;\n }\n \n Mage::throwException('Forbidden');\n }", "public function get_order() {\n return wc_get_order( $this->get_order_id() );\n }", "protected function _retrieveQuote()\n {\n $sessionQuote = $this->_getCheckoutSession()->getQuote();\n $zipMoneyCheckoutId = $this->getRequest()->getParam('checkoutId');\n $use_checkout_api_quote = false;\n $addtionalPaymentInfo = $sessionQuote->getPayment()->getAdditionalInformation();\n $checkout_id = $addtionalPaymentInfo['zip_checkout_id'];\n // Return Session Quote\n if (!$sessionQuote) {\n $this->_logger->error(__(\"Session Quote does not exist.\"));\n $use_checkout_api_quote = true;\n } elseif ($checkout_id != $zipMoneyCheckoutId && $checkout_id != 'au-'.$zipMoneyCheckoutId) {\n $this->_logger->error(__(\"Checkout Id does not match with the session quote.\"));\n $use_checkout_api_quote = true;\n } else {\n return $sessionQuote;\n }\n\n //Retrurn DB Quote\n if ($use_checkout_api_quote) {\n $checkoutApiQuote = $this->_getQuoteByUsingCheckoutApi($zipMoneyCheckoutId);\n if (!$checkoutApiQuote) {\n $this->_logger->warn(__(\"Quote doesnot exist for the given checkout_id.\"));\n return false;\n } else {\n $this->_logger->info(__(\"Loading Quote by using zip checkout get api\"));\n }\n return $checkoutApiQuote;\n }\n }", "protected function OrderRecord() {\n\treturn $this->OrderTable($this->GetOrderID());\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function fetchCustomer($order_id) {\n $cust_id = $this->field('user_customer_id', array('id' => $order_id));\n return $this->Customer->fetchCustomer($cust_id);\n }", "private function getOrder($orderId)\n {\n try {\n $order = $this->orderRepository->get($orderId);\n } catch (InputException $e) {\n return null;\n } catch (NoSuchEntityException $e) {\n return null;\n }\n\n return $order;\n }", "public function testRetrive()\n {\n $json = <<<JSON\n{\n \"order_id\": \"f3392f8b-6116-4073-ab96-e330819e2c07\",\n \"order_amount\": 50000,\n \"order_tax_amount\": 5000\n}\nJSON;\n\n $this->mock->append(\n new Response(\n 200,\n ['Content-Type' => 'application/json'],\n $json\n )\n );\n\n $order = new Orders($this->connector, 'auth-token-123456');\n $this->assertEquals('auth-token-123456', $order->getId());\n\n $order->retrieve();\n\n $this->assertEquals('f3392f8b-6116-4073-ab96-e330819e2c07', $order['order_id']);\n $this->assertEquals(50000, $order['order_amount']);\n\n $request = $this->mock->getLastRequest();\n $this->assertEquals(Method::GET, $request->getMethod());\n $this->assertEquals(\n '/instantshopping/v1/authorizations/auth-token-123456',\n $request->getUri()->getPath()\n );\n\n $this->assertAuthorization($request);\n }", "protected function _getOrder()\n {\n if ($this->getOrder()) {\n $order = $this->getOrder();\n } else if ($this->getCheckout()->getLastRealOrderId()) {\n $order = Mage::getModel('sales/order')->loadByIncrementId($this->getCheckout()->getLastRealOrderId());\n } else {\n return null;\n }\n return $order;\n }", "public function getDetails($id){\n return $this->slc(\"*\", \"orders\", array(\"order_id\" => $id), TRUE)[0];\n }", "public function getQuote()\n {\n $quoteId = $this->getRequest()->getParam('quote_id');\n if ($quoteId) {\n return $this->_quoteCreate->load($quoteId);\n } else {\n return $this->_coreRegistry->registry('current_quote');\n }\n }", "public function order() {\n\t\treturn $this->belongsTo('App\\Order', 'order_id');\n\t}", "protected function _getOrder()\n {\n $sOrderId = $this->_getContainer()->getConfig()->getRequestParameter('oxid');\n\n if ($sOrderId !== null) {\n /** @var oxOrder $oOrder */\n $oOrder = $this->_getContainer()->getObjectFactory()->createOxidObject('oxOrder');\n\n if ($oOrder->load($sOrderId) === true) {\n return $oOrder;\n }\n }\n\n return null;\n }", "public function getorder()\n\t{\n\t\t$order_id = $this->input->post('order_id');\t\t\n\t\t$result = $this->order_model->getOrderById($order_id);\n\t\t$product = $this->product_model->getProductById($result[0]['product_id']);\n\t\tif($product){\n\t\t\t$result[0]['product_name'] = $product[0]['name'];\n\t\t}\t\t\n\t\techo json_encode($result[0]);\n\t}", "private function loadOrder()\n {\n $brqOrderId = $this->getOrderIncrementId();\n\n //Check if the order can receive further status updates\n $this->order->loadByIncrementId((string) $brqOrderId);\n\n if (!$this->order->getId()) {\n $this->logging->addDebug('Order could not be loaded by brq_invoicenumber or brq_ordernumber');\n // try to get order by transaction id on payment.\n $this->order = $this->getOrderByTransactionKey();\n }\n }", "public function getByReceiptId() {\n\t\t$data = Request::inputs();\n\t\t$validator = new Validator;\n\t\t$validation = $validator->make( $data, [\n\t\t\t'id' => 'required|max:20',\n\t\t] );\n\t\t// validate\n\t\t$validation->validate();\n\t\tif ( $validation->fails() ) {\n\t\t\t$errors = $validation->errors();;\n\n\t\t\treturn responseJson( [ 'data' => $errors->firstOfAll() ] );\n\t\t}\n\t\t$order = new Order();\n\n\t\treturn responseJson( $order->where( 'receipt_id', '=', $data['id'] )->get() );\n\n\t}" ]
[ "0.72100544", "0.7028325", "0.6923297", "0.6895676", "0.6850671", "0.6843163", "0.6797846", "0.6771322", "0.6763425", "0.67399037", "0.67126656", "0.6680664", "0.6680664", "0.6653037", "0.66067356", "0.65943056", "0.65906286", "0.6554422", "0.6547009", "0.6531931", "0.65091133", "0.64688957", "0.6405835", "0.6403749", "0.6402229", "0.6367975", "0.6345682", "0.6345633", "0.63433117", "0.630086", "0.6293261", "0.6250052", "0.6248963", "0.6235987", "0.62112814", "0.6190741", "0.6181168", "0.6180186", "0.6170626", "0.6169397", "0.6165937", "0.61638516", "0.61638516", "0.6152085", "0.6148961", "0.6141511", "0.6126554", "0.6125799", "0.6104472", "0.6102546", "0.60956454", "0.608187", "0.60757273", "0.6074532", "0.60648674", "0.6063354", "0.6047473", "0.6038115", "0.6030367", "0.6022047", "0.6005344", "0.60050106", "0.5999349", "0.5996803", "0.59936774", "0.5981234", "0.5975655", "0.5971443", "0.5958325", "0.59242123", "0.59222376", "0.59163666", "0.59131646", "0.58886915", "0.5888583", "0.5881486", "0.5881037", "0.587947", "0.5861186", "0.5858933", "0.5850954", "0.58412075", "0.5839615", "0.5829759", "0.5816058", "0.5802048", "0.5802048", "0.5802048", "0.5802048", "0.5797612", "0.5784615", "0.5781415", "0.57786614", "0.5768177", "0.5758124", "0.57577753", "0.5730925", "0.57269126", "0.5715151", "0.57148874" ]
0.6064748
55
Helper method that updates all the post meta for an order based on its settings in the WC_Order class.
protected function update_post_meta( &$order ) { global $wpdb; $edit_data = array( 'order_key' => $order->get_order_key( 'edit' ), 'customer_id' => $order->get_customer_id( 'edit' ), 'payment_method' => $order->get_payment_method( 'edit' ), 'payment_method_title' => $order->get_payment_method_title( 'edit' ), 'transaction_id' => $order->get_transaction_id( 'edit' ), 'customer_ip_address' => $order->get_customer_ip_address( 'edit' ), 'customer_user_agent' => $order->get_customer_user_agent( 'edit' ), 'created_via' => $order->get_created_via( 'edit' ), 'date_completed' => $order->get_date_completed( 'edit' ), 'date_paid' => $order->get_date_paid( 'edit' ), 'cart_hash' => $order->get_cart_hash( 'edit' ), 'billing_first_name' => $order->get_billing_first_name( 'edit' ), 'billing_last_name' => $order->get_billing_last_name( 'edit' ), 'billing_company' => $order->get_billing_company( 'edit' ), 'billing_address_1' => $order->get_billing_address_1( 'edit' ), 'billing_address_2' => $order->get_billing_address_2( 'edit' ), 'billing_city' => $order->get_billing_city( 'edit' ), 'billing_state' => $order->get_billing_state( 'edit' ), 'billing_postcode' => $order->get_billing_postcode( 'edit' ), 'billing_country' => $order->get_billing_country( 'edit' ), 'billing_email' => $order->get_billing_email( 'edit' ), 'billing_phone' => $order->get_billing_phone( 'edit' ), 'shipping_first_name' => $order->get_shipping_first_name( 'edit' ), 'shipping_last_name' => $order->get_shipping_last_name( 'edit' ), 'shipping_company' => $order->get_shipping_company( 'edit' ), 'shipping_address_1' => $order->get_shipping_address_1( 'edit' ), 'shipping_address_2' => $order->get_shipping_address_2( 'edit' ), 'shipping_city' => $order->get_shipping_city( 'edit' ), 'shipping_state' => $order->get_shipping_state( 'edit' ), 'shipping_postcode' => $order->get_shipping_postcode( 'edit' ), 'shipping_country' => $order->get_shipping_country( 'edit' ), 'discount_total' => $order->get_discount_total( 'edit' ), 'discount_tax' => $order->get_discount_tax( 'edit' ), 'shipping_total' => $order->get_shipping_total( 'edit' ), 'shipping_tax' => $order->get_shipping_tax( 'edit' ), 'cart_tax' => $order->get_total_tax( 'edit' ), 'total' => $order->get_total( 'edit' ), 'version' => $order->get_version( 'edit' ), 'currency' => $order->get_currency( 'edit' ), 'prices_include_tax' => $order->get_prices_include_tax( 'edit' ), ); $changes = array(); if ( $this->creating ) { $wpdb->insert( "{$wpdb->prefix}woocommerce_orders", array_merge( array( 'order_id' => $order->get_id(), ), $edit_data ) ); // We are no longer creating the order, it is created. $this->creating = false; } else { $changes = array_intersect_key( $edit_data, $order->get_changes() ); if ( ! empty( $changes ) ) { $wpdb->update( "{$wpdb->prefix}woocommerce_orders", $changes, array( 'order_id' => $order->get_id(), ) ); } } $updated_props = array_keys( (array) $changes ); // If customer changed, update any downloadable permissions. if ( in_array( 'customer_user', $updated_props ) || in_array( 'billing_email', $updated_props ) ) { $data_store = WC_Data_Store::load( 'customer-download' ); $data_store->update_user_by_order_id( $order->get_id(), $order->get_customer_id(), $order->get_billing_email() ); } do_action( 'woocommerce_order_object_updated_props', $order, $updated_props ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function backfill_postmeta( &$order ) {\n\t\t$data = $this->get_order_data_from_table( $order );\n\n\t\tif ( is_null( $data ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $this->get_postmeta_mapping() as $column => $meta_key ) {\n\t\t\tif ( isset( $data->$column ) ) {\n\t\t\t\tupdate_post_meta( $order->get_id(), $meta_key, $data->$column );\n\t\t\t}\n\t\t}\n\t}", "function update_post_meta_on_post_save(){\n\n\tif( isset( $_POST[ 'post_ID' ] ) ){\n\n\t\t$id = $_POST[ 'post_ID' ];\n\n\t\tif( ! get_post_meta( $id, 'post_order' ) ){\n\t\t\tadd_post_meta( $id, 'post_order', 0 );\n\t\t}\n\t}\n}", "function jtl_save_testimonial_order_meta($post_id, $post) {\n\tif ($post->post_type == 'testimonial') {\n\t\t// Check to see if order value exists\n\t\t$meta_value = get_post_meta($post_id, 'jlt_testimonial_order', true);\n\t\tif (!$meta_value || empty($meta_value)) {\n\t\t\tadd_post_meta($post_id, 'jlt_testimonial_order', 0, true);\n\t\t}\n\t}\n\t\n}", "public static function update_order_meta( $order_id ) {\n\t\tupdate_post_meta( $order_id, '_billing_vat_number', self::$data['vat_number'] );\n\t\tupdate_post_meta( $order_id, '_vat_number_is_validated', ! is_null( self::$data['validation']['valid'] ) ? 'true' : 'false' );\n\t\tupdate_post_meta( $order_id, '_vat_number_is_valid', true === self::$data['validation']['valid'] ? 'true' : 'false' );\n\n\t\tif ( false !== self::get_ip_country() ) {\n\t\t\tupdate_post_meta( $order_id, '_customer_ip_country', self::get_ip_country() );\n\t\t\tupdate_post_meta( $order_id, '_customer_self_declared_country', ! empty( $_POST['location_confirmation'] ) ? 'true' : 'false' );\n\t\t}\n\t}", "protected function save_order_meta_fields( $order, $request ) {\n\t\tupdate_post_meta( $order->get_id(), '_ebanx_tef_bank', sanitize_text_field( WC_EBANX_Request::read( 'tef' ) ) );\n\n\t\tparent::save_order_meta_fields( $order, $request );\n\t}", "function jigoshop_upgrade_120() {\n\n // update orders\n\t$args = array(\n\t\t'post_type'\t => 'shop_order',\n\t\t'numberposts' => -1,\n\t\t'post_status' => 'publish'\n\t);\n\n\t$posts = get_posts( $args );\n\n\tforeach( $posts as $post ) :\n $order_data = get_post_meta($post->ID, 'order_data', true);\n\n if (!empty($order_data['order_tax'])) :\n\n // means someone has posted a manual order. Need to update to new tax string\n if (strpos($order_data['order_tax'], ':') === false) :\n $order_data['order_tax_total'] = $order_data['order_tax'];\n $order_data['order_tax'] = jigoshop_tax::create_custom_tax($order_data['order_total'] - $order_data['order_tax_total'], $order_data['order_tax_total'], $order_data['order_shipping_tax'], $order_data['order_tax_divisor']);\n else :\n $tax_array = get_old_taxes_as_array($order_data['order_tax']);\n $order_data['order_tax'] = jigoshop_tax::array_implode($tax_array);\n endif;\n\n update_post_meta($post->ID, 'order_data', $order_data);\n\n endif;\n\n endforeach;\n \n}", "function wordimpress_custom_checkout_field_update_order_meta( $order_id ) {\n if ( $_POST['inscription_checkbox'] ) {\n //It does: update post meta for this order\n update_post_meta( $order_id, 'NOLA Terms', esc_attr( $_POST['inscription_checkbox'] ) );\n }\n if ( $_POST['inscription_textbox'] ) {\n update_post_meta( $order_id, 'Allergy Information', esc_attr( $_POST['inscription_textbox'] ) );\n }\n}", "function sv_wc_admin_custom_order_fields_add_to_notes( $order_id, $post) {\n\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes1 $order_id:' . print_r( $order_id, true ) );\n\n\t//error_log( 'method_name1 $var:' . print_r( $var, true ) );\n\n\t$updated_custom_fields = isset( $_POST['wc-admin-custom-order-fields'] ) ? $_POST['wc-admin-custom-order-fields'] : null;\n\n\tif ( empty( $updated_custom_fields ) ) {\n\t\treturn;\n\t}\n\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes2 $order_id:' . print_r( $order_id, true ) );\n\n\t$order = wc_get_order( $post );\n\t$order_fields = wc_admin_custom_order_fields()->get_order_fields();\n\n\tforeach ( $order_fields as $custom_field ) {\n\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes3 $order_id:' . print_r( $order_id, true ) );\n\n\t\t$field_id = $custom_field->get_id();\n\t\t$field_meta_key = $custom_field->get_meta_key();\n\t\t$updated_value = isset( $updated_custom_fields[ $field_id ] ) ? $updated_custom_fields[ $field_id ] : '';\n\n\t\t// Update a custom field value unless it's empty...\n\t\t// A value of 0 is valid, so check for that first.\n\t\t// Empty string is also allowed to clear out custom fields completely.\n\t\tif ( '0' === $updated_value || '' === $updated_value || ! empty( $updated_value ) ) {\n\t\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes4 $order_id:' . print_r( $order_id, true ) );\n\n\t\t\t// Special handling for date fields.\n\t\t\tif ( 'date' === $order_fields[ $field_id ]->get_type() ) {\n\t\t\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes5 $order_id:' . print_r( $order_id, true ) );\n\n\t\t\t\t$updated_value = strtotime( $updated_value );\n\t\t\t\t// Add Order Note\n\t\t\t\t$order->add_order_note( $order, 'updated value: ' . $updated_value);\n\n\t\t\t\t$order_fields[ $field_id ]->set_value( $updated_value );\n\n\t\t\t\t$order->update_meta_data( $field_meta_key, $order_fields[ $field_id ]->get_value() );\n\n\t\t\t\t// This column is used so that date fields can be searchable.\n\t\t\t\t$order->update_meta_data( $field_meta_key . '_formatted', $order_fields[ $field_id ]->get_value_formatted() );\n\n\t\t\t} else {\n\t\t\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes6 $order_id:' . print_r( $order_id, true ) );\n\n\t\t\t\t$order->update_meta_data( $field_meta_key, $updated_value );\n\t\t\t}\n\n\t\t// ...Or if it's empty, delete the custom field meta altogether.\n\t\t} else {\n\n\t\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes7 $order_id:' . print_r( $order_id, true ) );\n\n\t\t\t\t// Remove order note\n\t\t\t$order->add_order_note( $order, 'removed value/set blank: ' . $updated_value);\n\t\t\t\n\t\t\t$order->delete_meta_data( $field_meta_key );\n\t\t\t$order->delete_meta_data( $field_meta_key . '_formatted' );\n\t\t}\n\n\t\t$order->save_meta_data();\n\t}\n\t\n}", "protected function save_order_meta_fields( $order, $request ) {\n\t\tparent::save_order_meta_fields( $order, $request );\n\n\t\tupdate_post_meta( $order->get_id(), '_cards_brand_name', $request->payment->payment_type_code );\n\t\tupdate_post_meta( $order->get_id(), '_masked_card_number', WC_EBANX_Request::read( 'ebanx_masked_card_number' ) );\n\t}", "function update_post_meta_on_activation(){\n\n\tglobal $wpdb;\n\n\t$sql = \"SELECT ID FROM wp_posts\";\n\n\t$posts = $wpdb->get_results( $sql );\n\n\tforeach( $posts as $post ){\n\t\tif( ! get_post_meta( $post->ID, 'post_order' ) ){\n\t\t\tadd_post_meta( $post->ID, 'post_order', 0 );\n\t\t}\n\t}\n\tif( function_exists( 'register_uninstall_hook' ) ){\n\t\tregister_uninstall_hook( __FILE__, 'custom_post_order_uninstall' );\n\t}\n}", "private function save_paypal_meta_data()\n {\n $postMeta = [\n 'payer_email' => 'Payer PayPal address',\n 'first_name' => 'Payer first name',\n 'last_name' => 'Payer last name',\n 'payment_type' => 'Payment type',\n ];\n\n foreach ($postMeta as $key => $name) {\n $value = wc_clean($this->request->get($key, FILTER_DEFAULT));\n $value and update_post_meta($this->order->get_id(), $name, $value);\n }\n }", "protected function save_paypal_meta_data( $order, $posted ) {\n }", "function CustomPostOrder_updateOptions(){\n $settings = CustomPostOrder_settings();\n $settings_keys = array_keys ( $settings );\n if ( !get_option ( 'CustomPostOrder-settings' ) ) {\n //add the settings to options\n add_option ( 'CustomPostOrder-settings', $settings );\n }\n else\n $settings = get_option ( 'CustomPostOrder-settings' );\n \n $input = $settings;\n \n \n foreach ( $_POST as $key => $value ) {\n $input[$key] = $settings[$key];\n }\n if ( $_POST['orderElement'] || $_POST['orderType'] || $_POST['applyTo'] || $_POST['applyArray']) {\n $input['orderElement'] = $_POST['orderElement'];\n $input['orderType'] = $_POST['orderType'];\n $input['applyTo'] = $_POST['applyTo'];\n $input['applyArray'] = $_POST['applyArray'];\n update_option ( 'CustomPostOrder-settings', $input );\n }\n return $input;\n}", "public function populate_from_meta( &$order, $save = true, $delete = false ) {\n\t\t$table_data = $this->get_order_data_from_table( $order );\n\n\t\tif ( is_null( $table_data ) ) {\n\t\t\t$original_creating = $this->creating;\n\t\t\t$this->creating = true;\n\t\t}\n\n\t\tforeach ( $this->get_postmeta_mapping() as $column => $meta_key ) {\n\t\t\t$meta = get_post_meta( $order->get_id(), $meta_key, true );\n\n\t\t\tif ( empty( $table_data->$column ) && ! empty( $meta ) ) {\n\t\t\t\tswitch ( $column ) {\n\t\t\t\t\tcase 'prices_include_tax':\n\t\t\t\t\t\t$order->set_prices_include_tax( 'yes' === $meta );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$order->{\"set_{$column}\"}( $meta );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( true === $save ) {\n\t\t\t$this->update_post_meta( $order );\n\t\t}\n\n\t\tif ( true === $delete ) {\n\t\t\tforeach ( $this->get_postmeta_mapping() as $column => $meta_key ) {\n\t\t\t\tdelete_post_meta( $order->get_id(), $meta_key );\n\t\t\t}\n\t\t}\n\n\t\t$this->creating = $original_creating;\n\n\t\treturn $order;\n\t}", "public function setCustomFields ($order) {\n \n }", "function _flush_and_update_postmeta($post_id, $entity, $omit = array())\n {\n // We need to insert post meta data for each property\n // Unfortunately, that means flushing all existing postmeta\n // and then inserting new values. Depending on the number of\n // properties, this could be slow. So, we directly access the database\n /* @var $wpdb wpdb */\n global $wpdb;\n if (!is_array($omit)) {\n $omit = array($omit);\n }\n // By default, we omit creating meta values for columns in the posts table\n $omit = array_merge($omit, $this->object->_table_columns);\n // Delete the existing meta values\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->postmeta} WHERE post_id = %s\", $post_id));\n // Create query for new meta values\n $sql_parts = array();\n foreach ($entity as $key => $value) {\n if (in_array($key, $omit)) {\n continue;\n }\n if (is_array($value) or is_object($value)) {\n $value = $this->object->serialize($value);\n }\n $sql_parts[] = $wpdb->prepare(\"(%s, %s, %s)\", $post_id, $key, $value);\n }\n $wpdb->query(\"INSERT INTO {$wpdb->postmeta} (post_id, meta_key, meta_value) VALUES \" . implode(',', $sql_parts));\n }", "public function set_checkout_order_meta( $order_id ) {\n\n\t\t$order = wc_get_order( $order_id );\n\n\t\tif ( $order && isset( WC()->cart->taxes['avatax'] ) ) {\n\n\t\t\tupdate_post_meta( $order_id, '_wc_avatax_tax_calculated', 'yes' );\n\n\t\t\tif ( $date_created = SV_WC_Order_Compatibility::get_date_created( $order ) ) {\n\t\t\t\tupdate_post_meta( $order_id, '_wc_avatax_tax_date', $date_created->date( 'Y-m-d' ) );\n\t\t\t}\n\t\t}\n\t}", "function update_custom_post_order_option_value(){\n\n\tif( ! current_user_can( 'order_posts' ) ){\n\t\twp_send_json_error( 'Oooops, you haven\\'t got the permission to do that' );\n\n\t\treturn;\n\t}\n\n\tif( isset( $_POST[ 'custom_order_on_of' ] ) && $_POST[ 'custom_order_on_of' ] == 'off' ){\n\n\t\tupdate_option( 'dd_custom_post_order_on_off', 'off' );\n\n\t} else if( isset( $_POST[ 'custom_order_on_of' ] ) && $_POST[ 'custom_order_on_of' ] == 'on' ){\n\n\t\tupdate_option( 'dd_custom_post_order_on_off', 'on' );\n\n\t}\n}", "public function maybe_update_meta_keys() {\n global $wpdb;\n\n // check, if the current version is greater than or equal 0.9.7\n if ( version_compare( $this->config->get( 'version' ), '0.9.7', '>=' ) ) {\n // map old values to new ones\n $meta_key_mapping = array(\n 'Teaser content' => 'laterpay_post_teaser',\n 'Pricing Post' => 'laterpay_post_pricing',\n 'Pricing Post Type' => 'laterpay_post_pricing_type',\n );\n\n $sql = 'UPDATE ' . $wpdb->postmeta . \" SET meta_key = '%s' WHERE meta_key = '%s'\";\n\n foreach ( $meta_key_mapping as $before => $after ) {\n $prepared_sql = $wpdb->prepare( $sql, array( $after, $before ) );\n $wpdb->query( $prepared_sql );\n }\n }\n }", "public static function set_order_data( $order ) {\n\t\t$order->update_meta_data( '_billing_vat_number', self::$data['vat_number'] );\n\t\t$order->update_meta_data( '_vat_number_is_validated', ! is_null( self::$data['validation']['valid'] ) ? 'true' : 'false' );\n\t\t$order->update_meta_data( '_vat_number_is_valid', true === self::$data['validation']['valid'] ? 'true' : 'false' );\n\n\t\tif ( false !== self::get_ip_country() ) {\n\t\t\t$order->update_meta_data( '_customer_ip_country', self::get_ip_country() );\n\t\t\t$order->update_meta_data( '_customer_self_declared_country', ! empty( $_POST['location_confirmation'] ) ? 'true' : 'false' );\n\t\t}\n\t}", "public function testUpdateOrderCustomFields()\n {\n }", "public function save_order_payment_type_meta_data( $order, $data ) {\n if ( $data['payment_method'] === $this->id && isset($_POST['payment_duration']) )\n $order->update_meta_data('_payment_duration', esc_attr($_POST['payment_duration']) );\n }", "function mv_save_wc_order_other_fields( $post_id ) {\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return $post_id;\n }\n\n // Check the user's permissions.\n if ( 'page' == $_POST[ 'post_type' ] ) {\n\n if ( ! current_user_can( 'edit_page', $post_id ) ) {\n return $post_id;\n }\n } else {\n\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return $post_id;\n }\n }\n // --- Its safe for us to save the data ! --- //\n\n // Sanitize user input and update the meta field in the database.\n update_post_meta( $post_id, '_reference_field', $_POST[ 'dhl_reference_field' ] );\n }", "function pickup_field_update_order_meta( $order_id ) {\n\n //if(isset($_REQUEST['pickup_field_update_order_meta'])) return;\n //$_REQUEST['pickup_field_update_order_meta'] = 1;\n // dispatch_details\n\n print_r($_POST);\n\n //This prints out on order details after checkout\n if ( @$_POST['delivery_date'] ) {\n $str = \"Delivery scheduled for \".esc_attr( $_POST['delivery_date'] );\n $_POST['dispatch_details'] = $str;\n //new invoice field\n update_post_meta( $order_id, 'shippingMethod', sanitize_text_field( $str ) );\n\n // todo: remove these 2 lines, no longer used\n //for the field additional field in admin\n $updated = (update_post_meta( $order_id, '_dispatch_details', $str))?'true':'false'; //checkout field manager adds a _ to the front of the field name...\n hog(print_r(array('billycart', $order_id, \"_dispatch_details ($updated): \".$str),true));\n }\n\n if ( @$_POST['pickup_date'] && @$_POST['pickup_time'] ) {\n //pickup time = morning or arvo,\n $str = \"Pickup scheduled for: \".esc_attr( $_POST['pickup_time'] ).\" on \".esc_attr( $_POST['pickup_date'] );\n $_POST['dispatch_details'] = $str;\n //new invoice field\n update_post_meta( $order_id, 'shippingMethod', sanitize_text_field( $str ) );\n\n // todo: remove these 2 lines, no longer used\n $updated = (update_post_meta( $order_id, '_dispatch_details', $str))?'true':'false';\n hog(print_r(array('billycart', $order_id, \"_dispatch_details ($updated): \".$str),true));\n }\n\n\n\n if ( @$_POST['pickup_date'] ) {\n //It does: update post meta for this order\n update_post_meta( $order_id, 'pickup_date', esc_attr( $_POST['pickup_date'] ) );\n }\n if ( @$_POST['pickup_time'] ) {\n update_post_meta( $order_id, 'pickup_time', esc_attr( $_POST['pickup_time'] ) );\n }\n if ( @$_POST['delivery_date'] ) {\n update_post_meta( $order_id, 'delivery_date', esc_attr( $_POST['delivery_date'] ) );\n }\n if ( @$_POST['delivery_zone_id'] ) {\n update_post_meta( $order_id, 'delivery_zone_id', esc_attr( $_POST['delivery_zone_id'] ) );\n }\n if ( @$_POST['delivery_zone_title'] ) {\n update_post_meta( $order_id, 'delivery_zone_title', esc_attr( $_POST['delivery_zone_title'] ) );\n }\n\n }", "function update_booking_meta( $meta ) {\n foreach ( $meta as $key => $value ) {\n if ( $key !== 'services' ) {\n update_post_meta( $this->id, '_' . $key, $value );\n } else {\n wp_set_post_terms( $this->id, $value, YITH_WCBK_Post_Types::$service_tax );\n }\n }\n }", "function woocommerce_process_product_meta( $post_id ) {\n foreach (array('exclude_custom_tabs_ids','custom_tabs_ids') as $key) {\n if (isset($_POST[$key]))\n update_post_meta( $post_id, $key, $_POST[$key]);\n else\n delete_post_meta( $post_id, $key);\n } \n }", "function wck_reorder_meta(){\r\n\t\tif( !empty( $_POST['meta'] ) )\r\n\t\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\telse \r\n\t\t\t$meta = '';\r\n\t\tif( !empty( $_POST['id'] ) )\r\n\t\t\t$id = absint($_POST['id']);\r\n\t\telse \r\n\t\t\t$id = '';\r\n\t\tif( !empty( $_POST['values'] ) && is_array( $_POST['values'] ) )\r\n\t\t\t$elements_id = array_map( 'absint', $_POST['values'] );\r\n\t\telse \r\n\t\t\t$elements_id = array();\r\n\r\n\t\t// Security checks\r\n\t\tif( true !== ( $error = self::wck_verify_user_capabilities( $this->args['context'], $meta, $id ) ) ) {\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $error ) );\r\n\t\t}\r\n\r\n\t\t/* make sure this does not output anything so it won't break the json response below\r\n\t\twill keep it do_action for compatibility reasons\r\n\t\t */\r\n\t\tob_start();\r\n\t\t\tdo_action( 'wck_before_reorder_meta', $meta, $id, $elements_id );\r\n\t\t$wck_before_reorder_meta = ob_get_clean(); //don't output it\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\t$results = get_post_meta($id, $meta, true);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\t$results = get_option( apply_filters( 'wck_option_meta' , $meta ) );\r\n\t\t\r\n\t\t$new_results = array();\r\n\t\tif( !empty( $elements_id ) ){\r\n\t\t\tforeach($elements_id as $element_id){\r\n\t\t\t\t$new_results[] = $results[$element_id];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$results = $new_results;\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\tupdate_post_meta($id, $meta, $results);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\tupdate_option( apply_filters( 'wck_option_meta' , $meta, $results, $element_id ), wp_unslash( $results ) );\r\n\t\t\r\n\t\t\r\n\t\t/* if unserialize_fields is true reorder all the coresponding post metas */\r\n\t\tif( $this->args['unserialize_fields'] && $this->args['context'] == 'post_meta' ){\t\t\t\r\n\t\t\t\r\n\t\t\t$meta_suffix = 1;\r\n\t\t\tif( !empty( $new_results ) ){\r\n\t\t\t\tforeach( $new_results as $result ){\t\t\t\t\r\n\t\t\t\t\tforeach ( $result as $name => $value){\t\t\t\t\t\r\n\t\t\t\t\t\tupdate_post_meta($id, $meta.'_'.$name.'_'.$meta_suffix, $value);\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$meta_suffix++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t$entry_list = $this->wck_refresh_list( $meta, $id );\r\n\t\theader( 'Content-type: application/json' );\r\n\t\tdie( json_encode( array( 'entry_list' => $entry_list ) ) );\r\n\t}", "function construction_realestate_pro_bn_meta_save_properties( $post_id ) {\n\n\t// Save price\n\tif( isset( $_POST[ 'meta-price' ] ) ) {\n\t update_post_meta( $post_id, 'meta-price', $_POST[ 'meta-price' ] );\n\t}\n\tif( isset( $_POST[ 'meta-comprice' ] ) ) {\n\t update_post_meta( $post_id, 'meta-comprice', $_POST[ 'meta-comprice' ] );\n\t}\n\n\t// Save main meta_propertyid\n\tif( isset( $_POST[ 'meta-propertyid' ] ) ) {\n\t update_post_meta( $post_id, 'meta-propertyid', $_POST[ 'meta-propertyid' ] );\n\t}\n\t// Save address\n\tif( isset( $_POST[ 'meta-address' ] ) ) {\n\t update_post_meta( $post_id, 'meta-address', $_POST[ 'meta-address' ] );\n\t}\n\t// Save location\n\tif( isset( $_POST[ 'meta-location' ] ) ) {\n\t update_post_meta( $post_id, 'meta-location', $_POST[ 'meta-location' ] );\n\t}\n\t// Save property type\n\tif( isset( $_POST[ 'meta-proptype' ] ) ) {\n\t update_post_meta( $post_id, 'meta-proptype', $_POST[ 'meta-proptype' ] );\n\t}\n\t// // Save property status\n\t// if( isset( $_POST[ 'meta-status' ] ) ) {\n\t// update_post_meta( $post_id, 'meta-status', $_POST[ 'meta-status' ] );\n\t// }\n\n\tif(isset($_POST[\"meta-status\"])){\n //UPDATE: \n $meta_element_class = $_POST['meta-status'];\n //END OF UPDATE\n\n update_post_meta($post_id, 'meta-status', $meta_element_class);\n //print_r($_POST);\n }\n\n\t// Save property status\n\tif( isset( $_POST[ 'meta-size' ] ) ) {\n\t update_post_meta( $post_id, 'meta-size', $_POST[ 'meta-size' ] );\n\t}\n\n\t// Save package meta_bathrooms\n\tif( isset( $_POST[ 'meta-bathrooms' ] ) ) {\n\t update_post_meta( $post_id, 'meta-bathrooms', $_POST[ 'meta-bathrooms' ] );\n\t}\n\n\t// Save garage\n\tif( isset( $_POST[ 'meta-garage' ] ) ) {\n\t update_post_meta( $post_id, 'meta-garage', $_POST[ 'meta-garage' ] );\n\t}\n\n\t// Save bedrooms\n\tif( isset( $_POST[ 'meta-bedrooms' ] ) ) {\n\t update_post_meta( $post_id, 'meta-bedrooms', $_POST[ 'meta-bedrooms' ] );\n\t}\n\n\t// Save Year built\n\tif( isset( $_POST[ 'meta-yearbuilt' ] ) ) {\n\t update_post_meta( $post_id, 'meta-yearbuilt', $_POST[ 'meta-yearbuilt' ] );\n\t}\n\t// Save Year built\n\tif( isset( $_POST[ 'meta-childrooms' ] ) ) {\n\t update_post_meta( $post_id, 'meta-childrooms', $_POST[ 'meta-childrooms' ] );\n\t}\n\t// Save Year built\n\tif( isset( $_POST[ 'meta-furnished' ] ) ) {\n\t update_post_meta( $post_id, 'meta-furnished', $_POST[ 'meta-furnished' ] );\n\t}\n\t// Save Year built\n\tif( isset( $_POST[ 'meta-floors' ] ) ) {\n\t update_post_meta( $post_id, 'meta-floors', $_POST[ 'meta-floors' ] );\n\t}\n\t// Save Year built\n\tif( isset( $_POST[ 'meta-swimming' ] ) ) {\n\t update_post_meta( $post_id, 'meta-swimming', $_POST[ 'meta-swimming' ] );\n\t}\n\t// Save property type\n\tif( isset( $_POST[ 'meta-longitude' ] ) ) {\n\t update_post_meta( $post_id, 'meta-longitude', $_POST[ 'meta-longitude' ] );\n\t}\n\t// Save property type\n\tif( isset( $_POST[ 'meta-latitude' ] ) ) {\n\t update_post_meta( $post_id, 'meta-latitude', $_POST[ 'meta-latitude' ] );\n\t}\n\t}", "public function updated(Order $order)\n {\n //\n }", "public function updated(Order $order)\n {\n //\n }", "public function save_post_meta( $post_id ) {\n\t\t\n\t\t// Validate request\n\t\t$nonce_action = $this->nonce['action'].$post_id;\n\t\tif(\n\t\t\tget_post_type( $post_id ) !== $this->post_type\n\t\t\t|| !isset( $_POST[ $this->nonce['name'] ] )\n\t\t\t|| !wp_verify_nonce( $_POST[ $this->nonce['name'] ], $nonce_action )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Loop meta values\n\t\tforeach( $this->fields as $field_name => $field_data ) {\n\t\t\t\n\t\t\t// Get new value and sanitize it\n\t\t\t$new_value = isset( $_POST[ $field_name ] ) ? $_POST[ $field_name ] : '';\n\t\t\t$sanitize_func = is_callable( $field_data['sanitize'] ) ? $field_data['sanitize'] : 'sanitize_text_field';\n\t\t\tif( $field_name == 'opening_hours' ) {\n\t\t\t\tif( !is_array( $new_value ) ) {\n\t\t\t\t\t$new_value = false;\n\t\t\t\t} else {\n\t\t\t\t\tarray_walk_recursive( $new_value, 'sanitize_text_field' );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$new_value = call_user_func( $sanitize_func, $new_value );\n\t\t\t}\n\t\t\t\n\t\t\t// Update database\n\t\t\tif( empty( $new_value ) ) {\n\t\t\t\tdelete_post_meta( $post_id, $field_name );\n\t\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, $field_name, $new_value );\n\t\t\t}\n\t\t}\n\t}", "private function updateOrderData()\n {\n $sign = $this->connector->signRequestKid(\n null,\n $this->connector->accountURL,\n $this->orderURL\n );\n\n $post = $this->connector->post($this->orderURL, $sign);\n if (strpos($post['header'], \"200 OK\") !== false) {\n $this->status = $post['body']['status'];\n $this->expires = $post['body']['expires'];\n $this->identifiers = $post['body']['identifiers'];\n $this->authorizationURLs = $post['body']['authorizations'];\n $this->finalizeURL = $post['body']['finalize'];\n if (array_key_exists('certificate', $post['body'])) {\n $this->certificateURL = $post['body']['certificate'];\n }\n $this->updateAuthorizations();\n } else {\n //@codeCoverageIgnoreStart\n $this->log->error(\"Failed to fetch order for {$this->basename}\");\n //@codeCoverageIgnoreEnd\n }\n }", "function wpcp_save_postdata($post_id)\n{\n if (array_key_exists('wpcp_providerplans', $_POST)) {\n\n $wpcp_provider = sanitize_text_field($_POST['wpcp_provider']);\n $wpcp_providerplans = sanitize_text_field($_POST['wpcp_providerplans']);\n\n update_post_meta(\n $post_id,\n WPCP_PROVIDER,\n $wpcp_provider\n );\n update_post_meta(\n $post_id,\n WPCP_PROVIDERPLANS,\n $wpcp_providerplans\n );\n }\n\n if (array_key_exists('wpcp_server_state', $_POST)) {\n\n $state = sanitize_text_field($_POST['wpcp_server_state']);\n\n if ($state == 'Active')\n $state = WPCP_ACTIVE;\n elseif ($state == 'Suspended')\n $state = WPCP_SUSPENDED;\n elseif ($state == 'Cancelled')\n $state = WPCP_CANCELLED;\n elseif ($state == 'Terminated')\n $state = WPCP_TERMINATED;\n\n update_post_meta(\n $post_id,\n WPCP_STATE,\n $state\n );\n }\n\n if (array_key_exists(WPCP_ORDER_PRICE, $_POST)) {\n\n $price = sanitize_text_field($_POST[WPCP_ORDER_PRICE]);\n\n update_post_meta(\n $post_id,\n WPCP_ORDER_PRICE,\n $price\n );\n }\n}", "public function update_meta( $post_id , $meta )\n\t{\n\t\t// $meta is typically $_POST[ $this->id_base ], but\n\t\t// the following silly scenario must be valid through this method:\n\t\t// $this->update_meta( $post_id, $this->get_meta( $post_id ) );\n\n\t\t// $meta needs to be fully sanitized and validated in this method\n\t\t// assume people -- even employees -- will try to hack this\n\t\t// review WP's methods and best practices for this thoroughly\n\t\t// http://codex.wordpress.org/Data_Validation\n\t\t// http://codex.wordpress.org/Function_Reference/wp_filter_nohtml_kses\n\n\t\t// make sure we have a valid post_id\n\t\tif ( ! $post_id = $this->sanitize_post_id( $post_id ) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// what word are we talking about\n\t\t$sanitized_meta['word'] = wp_kses( $meta['word'], array() );\n\t\twp_set_object_terms( $post_id, $sanitized_meta['word'], $this->post_type_name . '_words', FALSE );\n\n\t\t// the pronunciation\n\t\t$sanitized_meta['pronunciation'] = wp_kses( $meta['pronunciation'], array() );\n\n\t\t// the part of speech\n\t\t$sanitized_meta['partofspeech'] = isset( $this->default_parts_of_speech[ $meta['partofspeech'] ] ) ? $meta['partofspeech'] : $meta_defaults['partofspeech'];\n\t\twp_set_object_terms( $post_id, $sanitized_meta['partofspeech'], $this->post_type_name . '_partsofspeech', FALSE );\n\n\t\t// save the meta\n\t\tupdate_post_meta( $post_id , $this->post_meta_key , $sanitized_meta );\n\n\t\t// updating the post title is a pain in the ass, just look at what happens when we try to save it\n\t\t$post = (object) array();\n\t\t$post->ID = $post_id;\n\n\t\t// update the title\n\t\t$post->post_title = $sanitized_meta['word'];\n\t\t$post->post_name = sanitize_title_with_dashes( $sanitized_meta['word'] . '-' . $sanitized_meta['partofspeech'] );\n\n\t\t// remove the save post action and revision support\n\t\tremove_post_type_support( $this->post_type_name , 'revisions' );\n\t\tremove_action( 'save_post', array( bdefinite(), 'save_post' ) ); // not using '$this' because it's ambiguous when this is called within a child class\n\n\t\t// update the post\n\t\twp_update_post( $post );\n\n\t\t// add back the save post action and revision support\n\t\tadd_action( 'save_post', array( bdefinite(), 'save_post' ) );\n\t\tadd_post_type_support( $this->post_type_name , 'revisions' );\n\n\t}", "public function applyPromotion()\n {\n $this->promotion->setOrder($this);\n }", "public function cointopay_crypto_select_checkout_update_order_meta( $order_id ) {\n\t\t\tif (isset($_POST['cointopay_crypto_alt_coin']) && $_POST['payment_method'] == 'cointopay') update_post_meta( $order_id, 'cointopay_crypto_alt_coin', sanitize_text_field($_POST['cointopay_crypto_alt_coin']));\n\t\t }", "function setOrder( $order )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n if ( get_class( $order ) == \"ezorder\" )\n {\n $this->OrderID = $order->id();\n } \n }", "public static function admin_order_add_custom_meta_data( $data, $wc_order )\n {\n $configs = OmnivaLt_Core::get_configs();\n $order = OmnivaLt_Wc_Order::get_data($wc_order->get_id(), array('omniva'));\n\n foreach ( $configs['method_params'] as $method_key => $method_values ) {\n if ( ! $method_values['is_shipping_method'] ) continue;\n if ( $order->omniva->method != $method_values['key'] ) continue;\n\n if ( $method_values['key'] == 'pt' || $method_values['key'] == 'ps' ) {\n $data['shipping_via'] = 'Omniva ' . strtolower($method_values['title']) . \": \" . OmnivaLt_Terminals::get_terminal_address($order->omniva->terminal_id);\n }\n }\n\n if ($order->omniva->method) {\n $shipping_settings = OmnivaLt_Core::get_settings();\n $omnivalt_labels = new OmnivaLt_Labels();\n\n $barcode = $order->omniva->barcodes[0];\n $country_code = $shipping_settings['shop_countrycode'];\n $data['omnivalt_tracking_link'] = $omnivalt_labels->get_tracking_link($country_code, $barcode, true);\n $data['omnivalt_barcode'] = $barcode;\n }\n\n return $data;\n }", "function add_post_meta($post_id) {\n\t\t\tglobal $wpdb;\n\t\t\tif(isset($_POST['original_publish'])||isset($_POST['save'])){\n\t\t\t\tforeach($this->english_meta_keys as $key){\n\t\t\t\t\tupdate_post_meta($post_id, $key, $_POST[$key]);\n\t\t\t\t}\n\t\t\t\tforeach($this->arabic_meta_keys as $key2){\n\t\t\t\t\tupdate_post_meta($post_id, $key2, $_POST[$key2]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach($_POST as $key => $value){\n\t\t\t\t\tif(preg_match('/_IPCDate.*/', $key) && $key != '_IPCDateCount'){\n\t\t\t\t\t\t$n = substr($key, strpos($key, \"Date\")+4);\n\t\t\t\t\t\n\t\t\t\t\t\tforeach($this->dates_meta_keys as $key3){\n\t\t\t\t\t\t\t$k = $key3.$n;\n\t\t\t\t\t\t\tupdate_post_meta($post_id, $k, $_POST[$k]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tupdate_post_meta($post_id, '_IPCDateCount', $_POST['_IPCDateCount']);\n\t\t\t}\n\t\t}", "function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '')\n {\n }", "public function updatePostMeta($post_meta_name) {\n $meta = array();\n $meta['image'] = $this->image;\n $meta['sub-images'] = $this->sub_images;\n $meta['link'] = $this->link;\n $meta['price'] = $this->price;\n $meta['product-code'] = $this->product_code;\n\n update_post_meta($this->id, $post_meta_name, $meta);\n }", "function carton_update_order_item_meta( $item_id, $meta_key, $meta_value, $prev_value = '' ) {\n\treturn update_metadata( 'order_item', $item_id, $meta_key, $meta_value, $prev_value );\n}", "function _action_brightech_page_contacts_meta_update( $post_id ) {\n\n\tif ( \n\t\tempty( $_POST['bt_office_meta'] )\n\t\t|| ! wp_verify_nonce( $_POST['bt_office_postmeta_nonce'], __FILE__ )\n\t\t|| wp_is_post_autosave( $post_id )\n\t\t|| wp_is_post_revision( $post_id )\n\t\t|| ! current_user_can( 'edit_post', $post_id )\n\t) return;\n\n\tforeach( $_POST['bt_office_meta'] as $key => $value ) {\n\n\t\tswitch ($key) {\n\t\t\t\n\t\t\tcase 'bt_test':\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t$value = sanitize_text_field($value);\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( empty($value) ) {\n\t\t\tdelete_post_meta( $post_id, $key );\n\t\t\tcontinue;\n\t\t}\n\t\tupdate_post_meta( $post_id, $key, $value );\n\t}\n\n\treturn $post_id;\n}", "public function update() {\r\n\t\tif ( $this->key === 'job_title' || $this->key === 'job_description' ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$value = $this->get_posted_value();\r\n\t\tupdate_post_meta( $this->listing->get_id(), '_'.$this->key, $value );\r\n\t}", "protected function updateOrderItems($order)\n {\n $list = new \\XLite\\View\\ItemsList\\Model\\OrderItem(\n array(\n 'order' => $order,\n )\n );\n\n $list->processQuick();\n\n $order->calculateInitialValues();\n }", "function save_meta ( $post_id )\n\t{\n\n // Check if nonce is set.\n if ( ! isset( $_POST['metabox_lh_quote'] ) ) {\n return;\n }\n\n // Verify that the nonce is valid.\n if ( ! wp_verify_nonce( $_POST['metabox_lh_quote'], 'save_metabox_lh_quote' ) ) {\n return;\n }\n\n // If this is an autosave, our form has not been submitted, so we don't want to do anything.\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return;\n }\n\n // Check the user's permissions.\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n\n // If the post key contains the quote_element add it to the array to save\n $quote_breakdown = array();\n foreach ($_POST as $KEY => $VALUE)\n {\n if(strpos($KEY, \"quote_element\") !== false){\n $quote_breakdown[$KEY] = $VALUE;\n }\n }\n\n update_post_meta( $post_id, 'quote_breakdown', $quote_breakdown );\n\n $quote_total = $_POST['quote_total'];\n update_post_meta( $post_id, 'quote_total', $quote_total );\n\n // Save the client ID\n $client_id = $_POST['client_id'];\n update_post_meta( $post_id, 'client_id', $client_id );\n\n // Update quote status\n $quote_status = $_POST['quote_status'];\n update_post_meta( $post_id, 'quote_status', $quote_status );\n\n // Update deposit status\n $deposit_status = $_POST['deposit_status'];\n // check current deposit status. If it's not paid and its being changed add to timeline\n $current_deposit_status = get_post_meta($post_id,'deposit_status',true);\n if($current_deposit_status<>\"paid\" && $deposit_status==\"paid\")\n {\n\n // Update the client timeline\n $args = array(\n \"client_id\" => $client_id,\n \"project_id\" => $post_id,\n \"activity_title\" => 'Deposit Paid',\n \"activity_content\" => '',\n );\n lh_actions::activity_item_add($args);\n }\n update_post_meta( $post_id, 'deposit_status', $deposit_status );\n\n // Update materials status\n $materials_status = $_POST['materials_status'];\n // check current status and add to timeline if required\n $current_materials_status = get_post_meta($post_id,'materials_status',true);\n if($current_materials_status<>\"ordered\" && $materials_status==\"ordered\")\n {\n\n // Update the client timeline\n $args = array(\n \"client_id\" => $client_id,\n \"project_id\" => $post_id,\n \"activity_title\" => 'Materials Ordered',\n \"activity_content\" => '',\n );\n lh_actions::activity_item_add($args);\n }\n update_post_meta( $post_id, 'materials_status', $materials_status );\n\n // Update accessories status\n $accessories_status = $_POST['accessories_status'];\n // check current status and add to timeline if required\n $current_accessories_status = get_post_meta($post_id,'accessories_status',true);\n if($current_accessories_status<>\"arrived\" && $accessories_status==\"arrived\")\n {\n // Update the client timeline\n $args = array(\n \"client_id\" => $client_id,\n \"project_id\" => $post_id,\n \"activity_title\" => 'Critical Accessories Arrived',\n \"activity_content\" => '',\n );\n lh_actions::activity_item_add($args);\n }\n update_post_meta( $post_id, 'accessories_status', $accessories_status );\n\n // Update invouce status\n $invoice_sent = $_POST['invoice_sent'];\n update_post_meta( $post_id, 'invoice_sent', $invoice_sent );\n\n // Update invouce paid\n $invoice_paid = $_POST['invoice_paid'];\n update_post_meta( $post_id, 'invoice_paid', $invoice_paid );\n\n // Add Project start Date\n $project_start_date = $_POST['project_start_date'];\n update_post_meta( $post_id, 'project_start_date', $project_start_date );\n\n // Finally see if there is a descret key - if not create one\n $secret = get_post_meta($post_id,'secret',true);\n\n if($secret==\"\")\n {\n $new_secret = lh_crm_utils::generate_secret();\n update_post_meta( $post_id, 'secret', $new_secret );\n }\n\n\t}", "function save_order(){\n\tif( ! current_user_can( 'order_posts' ) ){\n\t\twp_send_json_error( 'Oooops, you haven\\'t got the permission to do that' );\n\n\t\treturn;\n\t}\n\t$ordered_ids = $_POST[ 'id_array' ];\n\t$position = 1;\n\tforeach( $ordered_ids as $id ){\n\t\tupdate_post_meta( (int) $id, 'post_order', $position );\n\t\t$position ++;\n\t}\n}", "private function _add_post_meta( $post_id, $data ) {\n\n foreach ($data as $meta_key => $meta_value) {\n update_post_meta( $post_id, $meta_key, $meta_value );\n }\n\n }", "public function order_meta_boxes() {\r\n global $post;\r\n if ( $post->post_type != 'estate' ) {\r\n return;\r\n }\r\n global $wp_meta_boxes;\r\n if ( isset( $wp_meta_boxes['estate']['normal']['high']['mm_general'] ) ) {\r\n $wp_meta_boxes['estate']['normal']['low']['mm_general'] = $wp_meta_boxes['estate']['normal']['high']['mm_general'];\r\n unset( $wp_meta_boxes['estate']['normal']['high']['mm_general'] );\r\n }\r\n if ( isset( $wp_meta_boxes['estate']['normal']['high']['essb_metabox_optmize'] ) ) {\r\n\t $wp_meta_boxes['estate']['normal']['low']['essb_metabox_optmize'] = $wp_meta_boxes['estate']['normal']['high']['essb_metabox_optmize'];\r\n\t unset( $wp_meta_boxes['estate']['normal']['high']['essb_metabox_optmize'] );\r\n }\r\n }", "public function updating(Order $Order)\n {\n //code...\n }", "public function updated(Order $Order)\n {\n //code...\n }", "public static function processPostMeta($meta, $obj) {\n if (is_serialized($meta)) {\n $meta = unserialize($meta);\n }\n // loop through meta array and set properties\n if (is_array($meta)) {\n foreach ($meta as $key => $value) {\n $obj->{str_replace('-', '_', $key)} = is_array($value) ? $value[0] : $value;\n }\n }\n\n }", "function save_meta_info( $post_id, $post ) {\n if($post->post_type != 'events')\n return $post_id;\n\n /* Verify the nonce before proceeding. */\n if ( !isset( $_POST['mindevents_event_meta_nonce'] ) || !wp_verify_nonce( $_POST['mindevents_event_meta_nonce'], basename( __FILE__ ) ) )\n return $post_id;\n\n\n\n $field_key = 'event_meta';\n /* Get the posted data and sanitize it for use as an HTML class. */\n $new_meta_values = (isset( $_POST[$field_key]) ? $_POST[$field_key] : '' );\n if($new_meta_values) :\n foreach ($new_meta_values as $key => $value) :\n update_post_meta( $post_id, $key, $value);\n endforeach;\n endif;\n\n return $post_id;\n }", "public function setOrderData($orderData): Order\n {\n $this->id = $orderData->getIncrementId();\n $this->email = $orderData->getCustomerEmail();\n $this->quoteId = $orderData->getQuoteId();\n $this->storeName = $orderData->getStore()->getName();\n $this->purchaseDate = $orderData->getCreatedAt();\n $this->deliveryMethod = $orderData->getShippingDescription();\n $this->deliveryTotal = (float) number_format(\n (float) $orderData->getShippingAmount(),\n 2,\n '.',\n ''\n );\n $this->currency = $orderData->getOrderCurrencyCode();\n\n /** @var OrderPaymentInterface|InfoInterface $payment */\n $payment = $orderData->getPayment();\n if ($payment) {\n if ($payment->getMethod()) {\n $methodInstance = $payment->getMethodInstance();\n if ($methodInstance) {\n $this->payment = $methodInstance->getTitle();\n }\n }\n }\n\n $this->couponCode = (string) $orderData->getCouponCode();\n\n /*\n * custom order attributes\n */\n $customAttributes = $this->getConfigSelectedCustomOrderAttributes(\n $orderData->getStore()->getWebsite()->getId()\n );\n\n if ($customAttributes) {\n $fields = $this->helper->getOrderTableDescription();\n $this->custom = [];\n foreach ($customAttributes as $customAttribute) {\n if (isset($fields[$customAttribute])) {\n $field = $fields[$customAttribute];\n $value = $this->_getCustomAttributeValue(\n $field,\n $orderData\n );\n if ($value) {\n $this->_assignCustom($field, $value);\n }\n }\n }\n }\n\n /*\n * Billing address.\n */\n $this->processBillingAddress($orderData);\n\n /*\n * Shipping address.\n */\n $this->processShippingAddress($orderData);\n\n $websiteId = $orderData->getStore()->getWebsiteId();\n\n $includeCustomOptions = $this->helper->getWebsiteConfig(\n Config::XML_PATH_CONNECTOR_SYNC_ORDER_PRODUCT_CUSTOM_OPTIONS,\n $websiteId\n );\n\n $orderItemProcessor = $this->orderItemProcessorFactory\n ->create(['data' => [\n 'websiteId' => $websiteId,\n 'includeCustomOptions' => $includeCustomOptions\n ]]);\n\n /*\n * Order items.\n */\n try {\n foreach ($orderData->getAllItems() as $productItem) {\n $productData = $orderItemProcessor->process($productItem);\n $this->mergeProductData($productData);\n }\n } catch (\\InvalidArgumentException $e) {\n $this->logger->debug(\n 'Error processing items for order ID: ' . $orderData->getId(),\n [(string) $e]\n );\n $this->products = [];\n }\n\n $this->orderSubtotal = (float) number_format(\n (float) $orderData->getData('subtotal'),\n 2,\n '.',\n ''\n );\n $this->discountAmount = (float) number_format(\n (float) $orderData->getData('discount_amount'),\n 2,\n '.',\n ''\n );\n $orderTotal = abs(\n $orderData->getData('grand_total') - $orderData->getTotalRefunded()\n );\n $this->orderTotal = (float) number_format($orderTotal, 2, '.', '');\n $this->orderStatus = $orderData->getStatus();\n\n if (!$this->schemaValidator->isValid($this->toArray())) {\n throw new SchemaValidationException(\n $this->schemaValidator,\n __(\"Validation error\")\n );\n }\n\n return $this;\n }", "public function custom_meta_save( $post_id, $post = false ){\n\t\tif( $this->options->show_on && !in_array( get_the_id(), $this->options->show_on ) ){\n\t\t\treturn false;\n\t\t}\n\n\t\t//Verify the nonce before proceeding.\n\t\tif ( !isset( $_POST[$this->unique_key.'_nonce'] ) || !wp_verify_nonce( $_POST[$this->unique_key.'_nonce'], basename( __FILE__ ) ) ){\n\t\t\treturn false;\n\t\t}\n\n\t\t//Meta Keys to Save\n\t\t$keys = array( $this->unique_key, $this->unique_key.\"_title\" );\n\n\t\tforeach( $keys as $key ){\n\n\t\t\t//Get the posted data and sanitize it for use as an HTML class.\n\t\t\tif( $key == $this->unique_key ){\n\t\t\t\t$new_meta_value = ( isset( $_POST[$key] ) ? sanitize_html_class( $_POST[$key] ) : '' );\n\t\t\t} else {\n\t\t\t\t$new_meta_value = isset( $_POST[$key] ) ? $_POST[$key] : '' ;\n\t\t\t}\n\n\t\t\t//Get the meta value of the custom field key.\n\t\t\t$meta_value = get_post_meta( $post_id, $key, true );\n\n\t\t\t//If a new meta value was added and there was no previous value, add it.\n\t\t\tif ( $new_meta_value && '' == $meta_value ){\n\t\t\t\tadd_post_meta( $post_id, $key, $new_meta_value, true );\n\t\t\t}\n\n\t\t\t//If the new meta value does not match the old value, update it.\n\t\t\telseif ( $new_meta_value && $new_meta_value != $meta_value ){\n\t\t\t\tupdate_post_meta( $post_id, $key, $new_meta_value );\n\t\t\t}\n\n\t\t\t//If there is no new meta value but an old value exists, delete it.\n\t\t\telseif ( '' == $new_meta_value && $meta_value ){\n\t\t\t\tdelete_post_meta( $post_id, $key, $meta_value );\n\t\t\t}\n\n\t\t}\n\n\t}", "protected function applyMeta(): void\n {\n $this->state->mergeIntoArray('tca.meta', $this->cache->get(static::TCA_META_CACHE_KEY, []));\n }", "protected function update_meta() {\n\t\t$changed = array_diff_assoc($this->meta, $this->cached_meta);\n\t\tforeach ($changed as $key => $value) {\n\t\t\tupdate_post_meta( $this->post->ID, '_speak_' . $key, $value );\n\t\t}\n\n\t\t// Update the internal cache\n\t\t$this->cached_meta = $this->meta;\n\n\t\treturn true;\n\t}", "public function save_global_settings_meta( $post_id ) {\n\t\tif ( !isset( $_POST['otb_repeater_nonce'] ) || !wp_verify_nonce( $_POST['otb_repeater_nonce'], 'otb_repeater_nonce' ) )\n\t\t\treturn;\n\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\n\t\t\treturn;\n\n\t\tif ( !current_user_can( 'edit_post', $post_id ) )\n\t\t\treturn;\n\t\t\n\t\t$settings = $this->settings['fields'];\n\t\t\n foreach ( $settings as $name => $config ) {\n\t\t\t$post = '';\n\t\t\t\n\t\t\tif ( isset( $_POST[ $name ] ) ) {\n\t\t\t\t$post = $_POST[ $name ];\n\t\t\t}\n\n\t\t\t$value = $this->sanitize_field( wp_unslash( $post ), $config['type'] );\n\t\t\tupdate_post_meta( $post_id, $name, $value);\n }\n\t}", "private function alterOrderInformation()\n {\n if (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '<')) {\n $sql = \"UPDATE `s_core_snippets`\n SET `value` = CASE\n WHEN `value` = 'Free text 4' THEN 'Transaction ID'\n WHEN `value` = 'Freitextfeld 4' THEN 'Transaktions-ID'\n ELSE `value`\n END\n WHERE `namespace` = 'backend/order/main'\n AND `value` IN ('Freitextfeld 4', 'Free text 4')\";\n } elseif (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '>=')) {\n $sql = \"INSERT INTO `s_attribute_configuration` (table_name, column_name, \"\n . \"column_type, position, translatable, display_in_backend, custom, \"\n . \"help_text, support_text, label, entity, array_store) \"\n . \"VALUES ('s_order_attributes','attribute4','string',1,0,1,0,'','','Transaction ID','NULL',NULL)\";\n }\n Shopware()->Db()->query($sql);\n }", "public function save_meta_settings( $post_id ) {\n \n \n // Check if our nonce is set.\n if ( ! isset( $_POST['metabox_' . $this->id . '_nonce'] ) ) {\n\n return $post_id;\n }\n \n\n $nonce = $_POST['metabox_' . $this->id . '_nonce'];\n \n // Verify that the nonce is valid.\n if ( ! wp_verify_nonce( $nonce, 'metabox_' . $this->id ) ) {\n echo('passed validation');\n }\n \n /*\n * If this is an autosave, our form has not been submitted,\n * so we don't want to do anything.\n */\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return $post_id;\n }\n \n // Check the user's permissions.\n if ( 'page' == $_POST['post_type'] ) {\n if ( ! current_user_can( 'edit_page', $post_id ) ) {\n return $post_id;\n }\n } else {\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return $post_id;\n }\n }\n \n foreach ( $this->fields as $field ) {\n $field_type = $field['type'];\n $field_meta_key = $field['meta_key'];\n $field_meta_value = $_POST[$field['meta_key']];\n if( 'checkbox' === $field['type'] && !isset( $_POST[$field['meta_key']] ) ) {\n $field_meta_value = 0;\n }\n update_post_meta( $post_id, $field['meta_key'], sanitize_text_field( $field_meta_value ) );\n \n }\n\n }", "public function set_order_cost_meta( $order_id ) {\n\n\t\t// get the order object.\n\t\t$order = wc_get_order( $order_id );\n\n\t\t$total_cost = 0;\n\n\t\t// loop through the order items and set their cost meta.\n\t\tforeach ( $order->get_items() as $item_id => $item ) {\n\n\t\t\t$product_id = ( ! empty( $item['variation_id'] ) ) ? $item['variation_id'] : $item['product_id'];\n\t\t\t$item_cost = (float) WC_COG_Product::get_cost( $product_id );\n\t\t\t$quantity = (float) $item['qty'];\n\n\t\t\t/**\n\t\t\t * Order Item Cost Filer.\n\t\t\t *\n\t\t\t * Allow actors to modify the item cost before the meta is updated.\n\t\t\t *\n\t\t\t * @since 1.9.0\n\t\t\t * @param float|string $item_cost order item cost to set\n\t\t\t * @param array $item order item\n\t\t\t * @param \\WC_Order $order order object\n\t\t\t */\n\t\t\t$item_cost = (float) apply_filters( 'wc_cost_of_goods_set_order_item_cost_meta_item_cost', $item_cost, $item, $order );\n\n\t\t\t$this->set_item_cost_meta( $item_id, $item_cost, $quantity );\n\n\t\t\t// add to the item cost to the total order cost.\n\t\t\t$total_cost += ( $item_cost * $quantity );\n\t\t}\n\n\t\t/**\n\t\t * Order Total Cost Filter.\n\t\t *\n\t\t * Allow actors to modify the order total cost before the meta is updated.\n\t\t *\n\t\t * @since 1.9.0\n\t\t * @param float|string $total_cost order total cost to set\n\t\t * @param \\WC_Order $order order object\n\t\t */\n\t\t$total_cost = apply_filters( 'wc_cost_of_goods_set_order_cost_meta', $total_cost, $order );\n\n\t\t$formatted_total_cost = wc_format_decimal( $total_cost, wc_get_price_decimals() );\n\n\t\t// save the order total cost meta.\n\t\tSV_WC_Order_Compatibility::update_meta_data( $order, '_wc_cog_order_total_cost', $formatted_total_cost );\n\t}", "function CustomPostOrder_settings() {\n $settings_arr = array(\n 'orderElement' => 'post_date',\n 'orderType' => 'DESC',\n 'applyTo' => 'all',\n 'applyArray' => ''\n );\n return $settings_arr;\n}", "function portfolioism_meta_save( $post_id ) {\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'portfolioism_valid_nonce' ]) && wp_verify_nonce( $_POST['poortfolioism_valid_nonce'], basename(__FILE__) ) ) ? 'true' : 'false';\n \n if ( $is_autosave || $is_revision || !$is_valid_nonce) {\n return;\n }\n\n if ( isset( $_POST['medium'] ) ) {\n update_post_meta($post_id, 'medium', sanitize_text_field($_POST['medium'] ) );\n }\n\n if ( isset ($_POST['height'] ) ) {\n update_post_meta($post_id, 'height', sanitize_text_field($_POST['height'] ) );\n }\n}", "function save_meta_box_custompost( $post_id ) {\n if ( defined( 'DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;\n if ( $parent_id = wp_is_post_revision( $post_id ) ) {\n $post_id = $parent_id;\n }\n $fields = ['published_date'];\n foreach ( $fields as $field ) {\n if ( array_key_exists( $field, $_POST ) ) {\n update_post_meta( $post_id, $field, sanitize_text_field( $_POST[$field] ) );\n }\n }\n }", "function update_order() {\r\n\r\n\t\t\tif ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) )\r\n\t\t\t\tdie( 'Please login as administrator' );\r\n\r\n\t\t\t/**\r\n\t\t\t * @var $form_id\r\n\t\t\t */\r\n\t\t\textract( $_POST );\r\n\r\n\t\t\t$fields = UM()->query()->get_attr( 'custom_fields', $form_id );\r\n\r\n\t\t\t$this->row_data = get_option( 'um_form_rowdata_' . $form_id, array() );\r\n\t\t\t$this->exist_rows = array();\r\n\r\n\t\t\tif ( ! empty( $fields ) ) {\r\n\t\t\t\tforeach ( $fields as $key => $array ) {\r\n\t\t\t\t\tif ( $array['type'] == 'row' ) {\r\n\t\t\t\t\t\t$this->row_data[$key] = $array;\r\n\t\t\t\t\t\tunset( $fields[$key] );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$fields = array();\r\n\t\t\t}\r\n\r\n\t\t\tforeach ( $_POST as $key => $value ) {\r\n\r\n\t\t\t\t// adding rows\r\n\t\t\t\tif ( 0 === strpos( $key, '_um_row_' ) ) {\r\n\r\n\t\t\t\t\t$update_args = null;\r\n\r\n\t\t\t\t\t$row_id = str_replace( '_um_row_', '', $key );\r\n\r\n\t\t\t\t\t$row_array = array(\r\n\t\t\t\t\t\t'type' => 'row',\r\n\t\t\t\t\t\t'id' => $value,\r\n\t\t\t\t\t\t'sub_rows' => $_POST[ '_um_rowsub_'.$row_id .'_rows' ],\r\n\t\t\t\t\t\t'cols' => $_POST[ '_um_rowcols_'.$row_id .'_cols' ],\r\n\t\t\t\t\t\t'origin' => $_POST[ '_um_roworigin_'.$row_id . '_val' ],\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\t$row_args = $row_array;\r\n\r\n\t\t\t\t\tif ( isset( $this->row_data[ $row_array['origin'] ] ) ) {\r\n\t\t\t\t\t\tforeach( $this->row_data[ $row_array['origin'] ] as $k => $v ){\r\n\t\t\t\t\t\t\tif ( $k != 'position' && $k != 'metakey' ) {\r\n\t\t\t\t\t\t\t\t$update_args[$k] = $v;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ( isset( $update_args ) ) {\r\n\t\t\t\t\t\t\t$row_args = array_merge( $update_args, $row_array );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$this->exist_rows[] = $key;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$fields[$key] = $row_args;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// change field position\r\n\t\t\t\tif ( 0 === strpos( $key, 'um_position_' ) ) {\r\n\t\t\t\t\t$field_key = str_replace('um_position_','',$key);\r\n\t\t\t\t\tif ( isset( $fields[$field_key] ) ) {\r\n\t\t\t\t\t\t$fields[$field_key]['position'] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// change field master row\r\n\t\t\t\tif ( 0 === strpos( $key, 'um_row_' ) ) {\r\n\t\t\t\t\t$field_key = str_replace('um_row_','',$key);\r\n\t\t\t\t\tif ( isset( $fields[$field_key] ) ) {\r\n\t\t\t\t\t\t$fields[$field_key]['in_row'] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// change field sub row\r\n\t\t\t\tif ( 0 === strpos( $key, 'um_subrow_' ) ) {\r\n\t\t\t\t\t$field_key = str_replace('um_subrow_','',$key);\r\n\t\t\t\t\tif ( isset( $fields[$field_key] ) ) {\r\n\t\t\t\t\t\t$fields[$field_key]['in_sub_row'] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// change field column\r\n\t\t\t\tif ( 0 === strpos( $key, 'um_col_' ) ) {\r\n\t\t\t\t\t$field_key = str_replace('um_col_','',$key);\r\n\t\t\t\t\tif ( isset( $fields[$field_key] ) ) {\r\n\t\t\t\t\t\t$fields[$field_key]['in_column'] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// add field to group\r\n\t\t\t\tif ( 0 === strpos( $key, 'um_group_' ) ) {\r\n\t\t\t\t\t$field_key = str_replace('um_group_','',$key);\r\n\t\t\t\t\tif ( isset( $fields[$field_key] ) ) {\r\n\t\t\t\t\t\t$fields[$field_key]['in_group'] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tforeach ( $this->row_data as $k => $v ) {\r\n\t\t\t\tif ( ! in_array( $k, $this->exist_rows ) )\r\n\t\t\t\t\tunset( $this->row_data[$k] );\r\n\t\t\t}\r\n\r\n\t\t\tupdate_option( 'um_existing_rows_' . $form_id, $this->exist_rows );\r\n\r\n\t\t\tupdate_option( 'um_form_rowdata_' . $form_id , $this->row_data );\r\n\r\n\t\t\tUM()->query()->update_attr( 'custom_fields', $form_id, $fields );\r\n\r\n\t\t}", "public static function update_custom_data ($postId, $structure) {\n if ($postId) {\n foreach ($structure as $attributeId => $conf) {\n if (array_key_exists($attributeId, $_POST)) {\n update_post_meta($postId, $attributeId, $_POST[$attributeId]);\n }\n }\n }\n }", "function action_save_postdata( $post_id ) {\n $inputValues = [\n 'cost_recommandation',\n 'link_recommandation'\n ];\n foreach ($inputValues as $inputValue) {\n $value = Services::getValue( $inputValue );\n if (false != $value)\n update_post_meta( $post_id, $inputValue, $value );\n }\n\n}", "function archive_SaveMetaData( $post_id ) {\n\t\tglobal $archive_fields;\n\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {return;}\n\n\t\tif ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {\n\t\t\tif ( ! current_user_can( 'edit_page', $post_id ) ) {return;}\n\t\t}else {\n\t\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {return;}\n\t\t}\n\n\t\tforeach ($archive_fields as $key => $value) {\n\t\t\t$slug = $value['slug'];\n\t\t\t//print_r($value);\n\n\t\t\tif (isset( $_POST['archive_'.$value['slug'].'_nonce'] ) ) {\n\n\t\t\t\tforeach($value['fields'] as $key => $value){\n\t\t\t\t\t$name = 'archive_'.$slug.'_'.$value['name'];\n\t\t\t\t\tif($value['type'] == 'checkbox'){\n\t\t\t\t\t\tif(isset($_POST[$name])){\n\t\t\t\t\t\t\tupdate_post_meta($post_id, $name, 'true');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tupdate_post_meta($post_id, $name, 'false');\n\t\t\t\t\t\t}\n\t\t\t\t\t}elseif(isset($_POST[$name])){\n\t\t\t\t\t\t$value = esc_html($_POST[$name]);\n\t\t\t\t\t\tupdate_post_meta($post_id, $name, $value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function textbook_save_data() {\r\n global $post;\r\n update_post_meta($post->ID, 'textbook_pub',\r\n\t\t $_POST['textbook_pub']);\r\n update_post_meta($post->ID, 'textbook_author',\r\n\t\t $_POST['textbook_author']);\r\n update_post_meta($post->ID, 'textbook_date',\r\n\t\t $_POST['textbook_date']);\r\n}", "public static function on_post_save( $post_id )\n {\n \n // don't auto save custom post items\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return $post_id;\n\n \t$post = get_post( $post_id );\n \tif( 'property' != $post->post_type ) return $post_id;\n\n \tif ( !wp_verify_nonce($_POST['wp_meta_box_nonce'], NONCE_STRING ) ) return $post_id;\n\n \t// can the user do this? if not, bail...\n \tif ( !current_user_can( 'edit_posts', $post_id ) ) return $post_id;\n\n \tif( count( $_REQUEST ) > 0 ){\n \t apc_delete('get_all_properties_idx');\n \t apc_delete('property_type');\n \t \n \t apc_delete('all_property_type_Rent_ids');\n \t apc_delete('all_property_type_Sale_ids');\n \t \n \t apc_delete( 'idx_post_' . $post_id);\n \t apc_delete('small_genPropertyArray_' . $post_id );\n \t apc_delete('genPropertyArray_' . $post_id );\n \t \n \t // ThemeUtil::mpuke_ta(print_r($_REQUEST, 1)); exit;\n \t // ThemeUtil::log_something(print_r($_REQUEST, 1));\n \t \n \t ThemeAdmin::idx_and_save( $post_id, 'garage', $_REQUEST['garage'] );\n \t ThemeAdmin::idx_and_save( $post_id, 'neighborhood', $_REQUEST['neighborhood'] );\n \t ThemeAdmin::idx_and_save( $post_id, 'part_of_town', $_REQUEST['part_of_town'] );\n \n \t$address \t\t = $_REQUEST['address']; \n \tupdate_post_meta( $post_id, 'address', $address );\n \t\n \t$lat \t\t = $_REQUEST['lat']; \n \tupdate_post_meta( $post_id, 'lat', $lat );\n \t\n \t$lng \t\t = $_REQUEST['lng']; \n \tupdate_post_meta( $post_id, 'lng', $lng );\n \t\n \t// update_post_meta( $post_id, 'city', $_REQUEST['city'] );\n \tThemeAdmin::idx_and_save( $post_id, 'city', $_REQUEST['city'] );\n \t\n \tupdate_post_meta( $post_id, 'state', $_REQUEST['state'] );\n \t\n \tThemeAdmin::idx_and_save( $post_id, 'postal_code', $_REQUEST['postal_code'] );\n \t\n // $occupancy_type = $_REQUEST['occupancy_type']; \n // update_post_meta( $post_id, 'occupancy_type', $occupancy_type );\n ThemeAdmin::idx_and_save( $post_id, 'occupancy_type', $_REQUEST['occupancy_type'] );\n \n \t$featured \t\t = $_REQUEST['featured']; \n \tupdate_post_meta( $post_id, 'featured', $featured );\n \t\n // $square_footage = $_REQUEST['square_footage']; \n // update_post_meta( $post_id, 'square_footage', $square_footage );\n ThemeAdmin::idx_and_save( $post_id, 'square_footage', $_REQUEST['square_footage'] );\n \t\n // $stories = $_REQUEST['stories']; \n // update_post_meta( $post_id, 'stories', $stories );\n ThemeAdmin::idx_and_save( $post_id, 'stories', $_REQUEST['stories'] );\n \t\n \tThemeAdmin::idx_and_save( $post_id, 'hardwood_floors', $_REQUEST['hardwood_floors'] );\n \t\n \t$age \t\t = $_REQUEST['age']; \n \tupdate_post_meta( $post_id, 'age', $age );\n \t// ThemeAdmin::idx_and_save( $post_id, 'stories', $_REQUEST['stories'] );\n \t\n \t$num_beds \t\t = $_REQUEST['num_beds']; \n \tupdate_post_meta( $post_id, 'num_beds', $num_beds );\n \t\n \t$num_baths \t\t = $_REQUEST['num_baths']; \n \tupdate_post_meta( $post_id, 'num_baths', $num_baths );\n \t\n \t$price \t\t = $_REQUEST['price']; \n update_post_meta( $post_id, 'price', $price );\n \n ThemeAdmin::idx_and_save( $post_id, 'parking', $_REQUEST['parking'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'fridge', $_REQUEST['fridge'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'oven', $_REQUEST['oven'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'dwasher', $_REQUEST['dwasher'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'forced_air', $_REQUEST['forced_air'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'central_air', $_REQUEST['central_air'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'central_heat', $_REQUEST['central_heat'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'near_shopping', $_REQUEST['near_shopping'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'near_school', $_REQUEST['near_school'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'near_transit', $_REQUEST['near_transit'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'handicap_accessible', $_REQUEST['handicap_accessible'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'lease_option', $_REQUEST['lease_option'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'aware_compliant', $_REQUEST['aware_compliant'] );\n \n // ThemeAdmin::idx_and_save( $post_id, 'development', $_REQUEST['development'] );\n\t \n\t\tdelete_post_meta($post_id, 'development');\n\t\tif(is_array($_REQUEST['development'])) {\n\t\t\tforeach($_REQUEST['development'] as $d) {\n\t\t\t\tadd_post_meta( $post_id, 'development', $d );\n\t\t\t}\n\t\t}\n \n ThemeAdmin::idx_and_save( $post_id, 'status', $_REQUEST['status'] );\n \t\n \t// ThemeAdmin::idx_and_save( $post_id, 'project', $_REQUEST['project'] );\n \t\n \tThemeAdmin::idx_and_save( $post_id, 'property_type', $_REQUEST['property_type'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'project_type', $_REQUEST['project_type'] );\n \n \t \n \t ThemeAdmin::idx_and_save( $post_id, 'wd_hookup', $_REQUEST['wd_hookup'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'laundry', $_REQUEST['laundry'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'balcony', $_REQUEST['balcony'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'deck', $_REQUEST['deck'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'patio', $_REQUEST['patio'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'yard', $_REQUEST['yard'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'cable', $_REQUEST['cable'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'resident_services', $_REQUEST['resident_services'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'playground', $_REQUEST['playground'] );\n\n update_post_meta( $post_id, 'management_company', $_REQUEST['management_company'] );\n \n update_post_meta( $post_id, 'management_phone', $_REQUEST['management_phone'] );\n \n update_post_meta( $post_id, 'management_web', $_REQUEST['management_web'] );\n\n ThemeAdmin::idx_and_save( $post_id, 'pets_allowed', $_REQUEST['pets_allowed'] );\n\n ThemeAdmin::idx_and_save( $post_id, 'senior_community', $_REQUEST['senior_community'] );\n \t \n ThemeAdmin::idx_and_save( $post_id, 'paid_utilities', $_REQUEST['paid_utilities'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'short_term_lease', $_REQUEST['short_term_lease'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'on_site_maintenance', $_REQUEST['on_site_maintenance'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'alarm_system', $_REQUEST['alarm_system'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'tax_incentives', $_REQUEST['tax_incentives'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'first_floor_master', $_REQUEST['first_floor_master'] );\n\n ThemeAdmin::idx_and_save( $post_id, 'dining_room', $_REQUEST['dining_room'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'laundry_room', $_REQUEST['laundry_room'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'basement', $_REQUEST['basement'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'family_room', $_REQUEST['family_room'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'den_office', $_REQUEST['den_office'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'fireplace', $_REQUEST['fireplace'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'corner_lot', $_REQUEST['corner_lot'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'cul_de_sac', $_REQUEST['cul_de_sac'] );\n \n update_post_meta( $post_id, 'lot_size', $_REQUEST['lot_size'] );\n \n // $all_props = \n \t}\n \t\n }", "private function updateOrderDetail($order){\n $endpoint = $this->endpointBase.\"/\".$order['id'];\n $params = array('url_params' => \"\");\n\n return $this->MPAPI->callMallAPI(HTTP_Method::PUT, $endpoint, $order);\n }", "public static function update_store_data( $post_ID, $post = null, $update = null ){\r\n\r\n // Get post if not exists\r\n if ( ! $post ) {\r\n $post = get_post( $post_ID );\r\n }\r\n\r\n if ( 'coupon' != get_post_type( $post ) ) {\r\n return ;\r\n }\r\n\r\n /**\r\n * Update tracking data\r\n */\r\n $percent = get_post_meta( $post_ID, '_wpc_percent_success', true );\r\n if ( empty( $percent ) || $percent == '' ){\r\n update_post_meta( $post_ID, '_wpc_percent_success', 100 );\r\n }\r\n\r\n $meta = get_post_custom( $post_ID );\r\n\r\n if ( ! isset ( $meta[ '_wpc_used' ] ) ) {\r\n update_post_meta( $post_ID, '_wpc_used', 0 );\r\n }\r\n\r\n if ( ! isset ( $meta[ '_wpc_today' ] ) ) {\r\n update_post_meta( $post_ID, '_wpc_today', '' );\r\n }\r\n\r\n if ( ! isset ( $meta[ '_wpc_vote_up' ] ) ) {\r\n update_post_meta( $post_ID, '_wpc_vote_up', 0 );\r\n }\r\n\r\n if ( ! isset ( $meta[ '_wpc_vote_down' ] ) ) {\r\n update_post_meta( $post_ID, '_wpc_vote_down', 0 );\r\n }\r\n\r\n if ( ! isset ( $meta[ '_wpc_expires' ] ) ) {\r\n update_post_meta( $post_ID, '_wpc_expires', '' );\r\n }\r\n\r\n }", "public function auctions_meta_save( $post_id ) { \n\n\t\t$product_type = empty( $_POST['product-type'] ) ? 'simple' : sanitize_title( stripslashes( $_POST[ 'product-type' ] ) );\n\t\t\n\t\tif ( $product_type == 'auction' ) {\n\n\t\t \tupdate_post_meta( $post_id, '_manage_stock', 'yes' );\n\t\t \tupdate_post_meta( $post_id, '_stock', '1' );\n\t\t \tupdate_post_meta( $post_id, '_backorders', 'no' );\n\t\t\tupdate_post_meta( $post_id, '_sold_individually', 'yes' );\n\n\t\t\tif ( isset($_POST['_auction_item_condition'])) \n\t\t\t\tupdate_post_meta( $post_id, '_auction_item_condition', stripslashes( $_POST['_auction_item_condition'] ) );\n\t\t\tif ( isset($_POST['_auction_type'])) \n\t\t\t\tupdate_post_meta( $post_id, '_auction_type', stripslashes( $_POST['_auction_type'] ) );\n\t\t\tif ( isset($_POST['_auction_proxy'])){\n\t\t\t\tupdate_post_meta( $post_id, '_auction_proxy', stripslashes( $_POST['_auction_proxy'] ) );\n\t\t\t} else {\n\t\t\t\tdelete_post_meta( $post_id, '_auction_proxy' );\t\n\t\t\t}\n\t\t\tif (isset($_POST['_auction_start_price']))\n\t\t\tupdate_post_meta( $post_id, '_auction_start_price', stripslashes( $_POST['_auction_start_price'] ) );\n\t\t\tif (isset($_POST['_auction_bid_increment']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_bid_increment', stripslashes( $_POST['_auction_bid_increment'] ) );\n\t\t\tif (isset($_POST['_auction_reserved_price']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_reserved_price', stripslashes( $_POST['_auction_reserved_price'] ) );\n\t\t\tif ( isset( $_POST['_buy_it_now_price'] ) ) { \n\t\t\t\tupdate_post_meta( $post_id, '_buy_it_now_price', stripslashes( $_POST['_buy_it_now_price'] ) );\n\t\t\t\tupdate_post_meta( $post_id, '_regular_price', stripslashes( $_POST['_buy_it_now_price'] ) );\n\t\t\t}\n\n\t\t\tif ( isset( $_POST['_regular_price'] ) ) { \n\t\t\t\tupdate_post_meta( $post_id, '_buy_it_now_price', stripslashes( $_POST['_regular_price'] ) );\n\t\t\t}\n\n\t\t\tif (isset($_POST['_auction_dates_from']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_dates_from', stripslashes( $_POST['_auction_dates_from'] ) );\n\t\t\tif (isset($_POST['_auction_dates_to']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_dates_to', stripslashes( $_POST['_auction_dates_to'] ) );\n\t \n\t if(isset($_POST['_relist_auction_dates_from']) && isset($_POST['_relist_auction_dates_to']) && !empty($_POST['_relist_auction_dates_from']) && !empty($_POST['_relist_auction_dates_to']) ){\n\t $this->do_relist($post_id, $_POST['_relist_auction_dates_from'], $_POST['_relist_auction_dates_to']);\n\t \n\t }\n\t if (isset($_POST['_auction_automatic_relist']))\n\t \tupdate_post_meta( $post_id, '_auction_automatic_relist', stripslashes( $_POST['_auction_automatic_relist'] ) );\n\t if (isset($_POST['_auction_relist_fail_time']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_relist_fail_time', stripslashes( $_POST['_auction_relist_fail_time'] ) );\n\t\t\tif (isset($_POST['_auction_relist_not_paid_time']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_relist_not_paid_time', stripslashes( $_POST['_auction_relist_not_paid_time'] ) );\n\t\t\tif (isset($_POST['_auction_relist_duration']))\n\t\t\t\tupdate_post_meta( $post_id, '_auction_relist_duration', stripslashes( $_POST['_auction_relist_duration'] ) );\n\t \t}\n\n\t}", "function wck_update_meta(){\r\n\t\tcheck_ajax_referer( \"wck-update-entry\" );\r\n\t\tif( !empty( $_POST['meta'] ) )\r\n\t\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\telse \r\n\t\t\t$meta = '';\r\n\t\tif( !empty( $_POST['id'] ) )\r\n\t\t\t$id = absint($_POST['id']);\r\n\t\telse \r\n\t\t\t$id = '';\r\n\t\tif( isset( $_POST['element_id'] ) )\r\n\t\t\t$element_id = absint( $_POST['element_id'] );\r\n\t\telse \r\n\t\t\t$element_id = 0;\r\n\t\tif( !empty( $_POST['values'] ) && is_array( $_POST['values']) )\r\n\t\t\t$values = array_map( 'wppb_sanitize_value', $_POST['values'] );\r\n\t\telse\r\n\t\t\t$values = array();\r\n\t\t\r\n\t\t// Security checks\r\n\t\tif( true !== ( $error = self::wck_verify_user_capabilities( $this->args['context'], $meta, $id ) ) ) {\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $error ) );\r\n\t\t}\r\n\t\t\r\n\t\t$values = apply_filters( \"wck_update_meta_filter_values_{$meta}\", $values, $element_id );\r\n\t\t\r\n\t\t/* check required fields */\r\n\t\t$errors = self::wck_test_required( $this->args['meta_array'], $meta, $values, $id );\r\n\t\tif( $errors != '' ){\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $errors ) );\r\n\t\t}\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\t$results = get_post_meta($id, $meta, true);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\t$results = get_option( apply_filters( 'wck_option_meta' , $meta, $values, $element_id ) );\r\n\t\t\r\n\t\t$results[$element_id] = $values;\r\n\r\n\t\t/* make sure this does not output anything so it won't break the json response below\r\n\t\twill keep it do_action for compatibility reasons\r\n\t\t */\r\n\t\tob_start();\r\n\t\t\tdo_action( 'wck_before_update_meta', $meta, $id, $values, $element_id );\r\n\t\t$wck_before_update_meta = ob_get_clean(); //don't output it\r\n\t\t\r\n\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\tupdate_post_meta($id, $meta, $results);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\tupdate_option( apply_filters( 'wck_option_meta' , $meta, $results, $element_id ), wp_unslash( $results ) );\r\n\t\t\r\n\t\t/* if unserialize_fields is true update the coresponding post metas for every element of the form */\r\n\t\tif( $this->args['unserialize_fields'] && $this->args['context'] == 'post_meta' ){\r\n\t\t\t\r\n\t\t\t$meta_suffix = $element_id + 1;\t\r\n\t\t\tif( !empty( $values ) ){\r\n\t\t\t\tforeach( $values as $name => $value ){\r\n\t\t\t\t\tupdate_post_meta($id, $meta.'_'.$name.'_'.$meta_suffix, $value);\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$entry_content = $this->wck_refresh_entry( $meta, $id, $element_id );\t\t\r\n\r\n\t\theader( 'Content-type: application/json' );\r\n\t\tdie( json_encode( array( 'entry_content' => $entry_content ) ) );\r\n\t}", "public function postUpdateHandler (Order $order, LifecycleEventArgs $event)\n {\n $changeSet = $event->getEntityManager()->getUnitOfWork()->getEntityChangeSet($event->getEntity());\n\n // If the sku has changed search for orders and run them through the approval process\n if (isset($changeSet['status']))\n {\n if ($changeSet['status'][1]->getId() == OrderStatusUtility::PENDING_FULFILLMENT_ID)\n $this->handleOrderShipmentLogic($order);\n }\n }", "public function order_save_data() {\n\t\tglobal $wpdb;\n\n\t\t$user_id = $_POST['user_id'];\n\n\t\t// Get order info that can be manipulated and compared\n\t\t$current_info \t= WC_Api_Manager_Helpers::get_users_data( $user_id );\n\n\t\t$order_key \t\t= esc_attr( stripslashes_deep( $_POST['order_key'] ) );\n\n\t\tif ( ! empty( $_POST['_api_update_permission'] ) )\n\t\t\t$update_permission = 'yes';\n\t\telse\n\t\t\t$update_permission = 'no';\n\n\t\t$info = WC_Api_Manager_Helpers::get_users_data( $user_id );\n\n\t\t// Get order info that can be used to populate values\n\t\t$data = $info[$order_key];\n\n\t\tif ( isset( $data ) ) {\n\n\t\t\tif ( $order_key ) {\n\n\t\t\t\tunset( $current_info[$order_key] );\n\n\t\t\t\t$update =\n\t\t \t\tarray( $order_key =>\n\t\t \t\t\tarray(\n\t\t \t'user_id'\t\t\t\t\t\t=> absint( $data['user_id'] ),\n\t\t\t\t\t\t\t'order_id' \t\t\t\t\t\t=> absint( $data['order_id'] ),\n\t\t\t\t\t\t\t'order_key' \t\t\t\t\t=> sanitize_text_field( $order_key ),\n\t\t\t\t\t\t\t'license_email' \t\t\t\t=> sanitize_text_field( stripslashes_deep( $_POST['license_email'] ) ),\n\t\t\t\t\t\t\t'_api_software_title_parent' \t=> empty( $_POST['_api_software_title_parent'] ) ? '' : sanitize_text_field( stripslashes_deep( $_POST['_api_software_title_parent'] ) ),\n\t\t\t\t\t\t\t'_api_software_title_var' \t\t=> empty( $_POST['_api_software_title_var'] ) ? '' : sanitize_text_field( stripslashes_deep( $_POST['_api_software_title_var'] ) ),\n\t\t\t\t\t\t\t'software_title' \t\t\t\t=> empty( $_POST['software_title'] ) ? '' : sanitize_text_field( stripslashes_deep( $_POST['software_title'] ) ),\n\t\t\t\t\t\t\t'parent_product_id'\t\t\t\t=> sanitize_text_field( $data['parent_product_id'] ),\n\t\t\t\t\t\t\t'variable_product_id'\t\t\t=> sanitize_text_field( $data['variable_product_id'] ),\n\t\t\t\t\t\t\t'current_version'\t\t\t\t=> sanitize_text_field( stripslashes_deep( $_POST['current_version'] ) ),\n\t\t\t\t\t\t\t'_api_activations'\t\t\t\t=> empty( $_POST['_api_activations'] ) ? '' : absint( $_POST['_api_activations'] ),\n\t\t\t\t\t\t\t'_api_activations_parent'\t\t=> empty( $_POST['_api_activations_parent'] ) ? '' : absint( $_POST['_api_activations_parent'] ),\n\t\t\t\t\t\t\t'_api_update_permission'\t\t=> sanitize_text_field( $update_permission ),\n\t\t\t\t\t\t\t'is_variable_product'\t\t\t=> sanitize_text_field( $data['is_variable_product'] ),\n\t\t\t\t\t\t\t'license_type'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t'expires'\t\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t)\n\t\t \t\t\t);\n\n\t\t\t\t$new_info = array_merge_recursive( $update, $current_info );\n\n\t\t\t\tupdate_user_meta( $user_id, $wpdb->get_blog_prefix() . WC_Api_Manager_Helpers::$user_meta_key_orders, $new_info );\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function registry_post_meta_boxes_setup() {\n\n /* Add meta boxes on the 'add_meta_boxes' hook. */\n add_action( 'add_meta_boxes', 'registry_add_post_meta_boxes', 1 );\n\n /* Save post info meta on the 'save_post' hook. */\n add_action( 'save_post', 'registry_save_coz_info_meta', 10, 2 );\n \n /* Save post info meta on the 'save_post' hook. */\n add_action( 'save_post', 'registry_save_coz_num_meta', 10, 2 );\n \n}", "abstract public function setOrder(OrderModel $order);", "function pavi_post_meta_boxes_setup() {\n add_action( 'add_meta_boxes', 'pavi_textarea_meta_boxes' );\n\n /* Save post meta on the 'save_post' hook. */\n add_action( 'save_post', 'pavi_save_post_class_meta', 10, 2 );\n}", "public function set_status( $order, $reset_status = false ) {\n\n\t\t\t/**\n\t\t\t * Post meta table.\n\t\t\t */\n\t\t\t$post_status = get_post_meta( $order['post_id'], self::LANGUAGE_POST_STATUS, true );\n\n\t\t\tif ( ! is_array( $post_status ) ) {\n\t\t\t\t// Meta value is invalid. Reset to an empty array.\n\t\t\t\t$post_status = array();\n\t\t\t}\n\n\t\t\t$result_meta = true;\n\t\t\t$message = '';\n\t\t\t$status_changed = false;\n\n\t\t\tif ( 'draft' === $order['status'] ) {\n\t\t\t\tif ( empty( $post_status[ $order['language'] ] ) || $post_status[ $order['language'] ] != $order['status'] ) {\n\t\t\t\t\t$post_status[ $order['language'] ] = $order['status'];\n\t\t\t\t\t$status_changed = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tunset( $post_status[ $order['language'] ] );\n\t\t\t\t$status_changed = true;\n\t\t\t}\n\n\t\t\tif ( empty( $post_status ) ) :\n\t\t\t\t$result_meta = delete_post_meta( $order['post_id'], self::LANGUAGE_POST_STATUS );\n\t\t\telse:\n\t\t\t\tif ( $status_changed ) {\n\t\t\t\t\t$result_meta = update_post_meta( $order['post_id'], self::LANGUAGE_POST_STATUS, $post_status );\n\t\t\t\t}\n\t\t\tendif;\n\n\t\t\tif ( $status_changed ) {\n\t\t\t\tif ( $result_meta ) {\n\t\t\t\t\t$message = esc_html( sprintf( __( 'Successfully set to \"%s\"', 'wpglobus-plus' ), ucfirst( $order['status'] ) ) );\n\t\t\t\t} else {\n\t\t\t\t\t$message = esc_html( sprintf( __( 'Setting to \"%s\" FAILED!', 'wpglobus-plus' ), ucfirst( $order['status'] ) ) );\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$message = esc_html( sprintf( __( 'Already set to \"%s\". Not changing.', 'wpglobus-plus' ), ucfirst( $order['status'] ) ) );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Options table.\n\t\t\t */\n\t\t\t$result_option = true;\n\t\t\t$lang_status = get_option( self::LANGUAGE_STATUS );\n\n\t\t\tif ( empty( $post_status ) ) {\n\n\t\t\t\tif ( ! empty( $lang_status[ $order['language'] ] ) && isset( $lang_status[ $order['language'] ][ $order['post_id'] ] ) ) {\n\t\t\t\t\tunset( $lang_status[ $order['language'] ][ $order['post_id'] ] );\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( 'draft' === $order['status'] ) {\n\t\t\t\t\t$lang_status[ $order['language'] ][ $order['post_id'] ] = $order['post_id'];\n\t\t\t\t} else {\n\t\t\t\t\tif ( ! empty( $lang_status[ $order['language'] ] ) && isset( $lang_status[ $order['language'] ][ $order['post_id'] ] ) ) {\n\t\t\t\t\t\tunset( $lang_status[ $order['language'] ][ $order['post_id'] ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t\tif ( isset( $lang_status[ $order['language'] ] ) && empty( $lang_status[ $order['language'] ] ) ) {\n\t\t\t\tunset( $lang_status[ $order['language'] ] );\n\t\t\t}\n\n\t\t\tif ( empty( $lang_status ) ) {\n\t\t\t\t$result_option = delete_option( self::LANGUAGE_STATUS );\n\t\t\t} else {\n\n\t\t\t\t$result_option = update_option( self::LANGUAGE_STATUS, $lang_status, false );\n\t\t\t\tif ( $reset_status ) {\n\t\t\t\t\t$result_option = $this->reset_status();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$return = array();\n\t\t\t$return['action'] \t= $order['action'];\n\t\t\t$return['post_id'] \t= $order['post_id'];\n\t\t\t$return['language'] = $order['language'];\n\t\t\t$return['status'] \t= $order['status'];\n\t\t\t$return['message'] \t= $message;\n\n\t\t\treturn $return;\n\n\t\t}", "function set_generated_meta( $insert_id = 0, $meta_type = '' ) {\n\n\t// Handle our before.\n\tdo_action( Core\\HOOK_PREFIX . 'before_sourced_meta_generated', $insert_id, $meta_type );\n\n\t// Handle the meta type switch.\n\tswitch ( $meta_type ) {\n\n\t\t// Handle post meta.\n\t\tcase 'post' :\n\t\tcase 'posts' :\n\t\tcase 'attachment' :\n\t\tcase 'attachments' :\n\t\tcase 'product' :\n\t\tcase 'products' :\n\n\t\t\t// Update the meta with our keys.\n\t\t\tupdate_post_meta( $insert_id, Core\\META_PREFIX . 'sourced', 1 );\n\t\t\tupdate_post_meta( $insert_id, Core\\META_PREFIX . 'created', time() );\n\n \t\t\t// And break.\n \t\t\tbreak;\n\n \t\t// Handle comment and review meta.\n\t\tcase 'comment' :\n\t\tcase 'comments' :\n\t\tcase 'review' :\n\t\tcase 'reviews' :\n\n\t\t\t// Update the meta with our keys.\n\t\t\tupdate_comment_meta( $insert_id, Core\\META_PREFIX . 'sourced', 1 );\n\t\t\tupdate_comment_meta( $insert_id, Core\\META_PREFIX . 'created', time() );\n\n \t\t\t// And break.\n \t\t\tbreak;\n\n \t\t// Handle user and customer meta.\n\t\tcase 'user' :\n\t\tcase 'users' :\n\t\tcase 'customer' :\n\t\tcase 'customers' :\n\n\t\t\t// Update the meta with our keys.\n\t\t\tupdate_user_meta( $insert_id, Core\\META_PREFIX . 'sourced', 1 );\n\t\t\tupdate_user_meta( $insert_id, Core\\META_PREFIX . 'created', time() );\n\n \t\t\t// And break.\n \t\t\tbreak;\n\n\t\t// End all case breaks.\n\t}\n\n\t// No other updates needed, so do the action.\n\tdo_action( Core\\HOOK_PREFIX . 'after_sourced_meta_generated', $insert_id, $meta_type );\n}", "function update_custom_order_capability_settings(){\n\tif( ! current_user_can( 'order_posts' ) ){\n\t\twp_send_json_error( 'Oooops, you haven\\'t got the permission to do that' );\n\t}\n\n\tif( isset( $_POST[ 'custom_post_order_capabilities' ] ) ){\n\n\t\t$roles_can_order_posts = $_POST[ 'custom_post_order_capabilities' ];\n\n\n\t\t$all_roles = new WP_Roles();\n\n\n\t\tforeach( $all_roles->roles as $key => $role ){\n\t\t\tif( in_array( $key, $roles_can_order_posts ) ){\n\n\t\t\t\t$role_add = get_role( $key );\n\t\t\t\t$role_add->add_cap( 'order_posts', true );\n\n\t\t\t} else{\n\n\t\t\t\t$role_remove = get_role( $key );\n\t\t\t\t$role_remove->remove_cap( 'order_posts', true );\n\t\t\t}\n\t\t}\n\n\t}\n}", "public function testUpdateOrder()\n {\n }", "function save_custom_fields( $post_id, $post ) {\n if ( !isset($_POST['wpnext_wpnonce']) || !wp_verify_nonce($_POST['wpnext_wpnonce'], 'wpnext') )\n return;\n if ( !current_user_can( 'edit_post', $post_id ) )\n return;\n\n if ( isset($_POST['wpn_post_data']) ) {\n update_post_meta( $post_id, 'wpnext', $_POST['wpn_post_data']);\n } else {\n delete_post_meta( $post_id, 'wpnext');\n }\n }", "function add_update_or_delete_post_meta($new_meta_value, $post_id, $key) {\n global $clientele_events;\n global $post_type;\n $args['post_id'] = $post_id;\n $args['key'] = $key;\n $old_meta_value = get_post_meta($post_id, $key, true);\n if ('' == $new_meta_value) { // If empty delete it\n delete_post_meta($post_id, $key, $old_meta_value);\n if ($post_type == 'clientele-client') {\n $clientele_events->do_event('change', 'delete_meta', 'Meta field \"' . $key . '\" deleted', $args);\n }\n } elseif (isset($new_meta_value) && '' == $old_meta_value) { // If new add it.\n add_post_meta($post_id, $key, $new_meta_value, true);\n if ($post_type == 'clientele-client') {\n $clientele_events->do_event('change', 'add_meta', 'Meta field \"' . $key . '\" added', $args);\n }\n } elseif (isset($new_meta_value) && $new_meta_value != $old_meta_value) { // If changed update it\n update_post_meta($post_id, $key, $new_meta_value);\n if ($post_type == 'clientele-client') {\n $clientele_events->do_event('change', 'update_meta', 'Meta field \"' . $key . '\" updated', $args);\n }\n }\n }", "public function save(){\r\n // Need the post type name again\r\n $post_type_name = $this->post_type_name;\r\n\r\n add_action( 'save_post',\r\n function() use( $post_type_name ){\r\n // Deny the WordPress autosave function\r\n if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;\r\n\r\n if ( ! wp_verify_nonce( $_POST['custom_post_type'], plugin_basename(__FILE__) ) ) return;\r\n\r\n global $post;\r\n\r\n if( isset( $_POST ) && isset( $post->ID ) && get_post_type( $post->ID ) == $post_type_name ){\r\n global $custom_fields;\r\n\r\n // Loop through each meta box\r\n foreach( $custom_fields as $title => $fields ){\r\n // Loop through all fields\r\n foreach( $fields as $label => $type ){\r\n $field_id_name = strtolower( str_replace( ' ', '_', $title ) ) . '_' . strtolower( str_replace( ' ', '_', $label ) );\r\n if($_POST['custom_meta'][$field_id_name] != ''){//Check Entry is not empty\r\n update_post_meta( $post->ID, $field_id_name, $_POST['custom_meta'][$field_id_name] );\r\n }\r\n }\r\n\r\n }\r\n }\r\n }\r\n );\r\n }", "public function set_post_meta( $name, $meta_value, $post_id ) {\n\n $cache_key = 'laterpay_post_price_' . $post_id;\n\n if ( empty( $meta_value ) ) {\n\n wp_cache_delete( $cache_key, 'laterpay' );\n return delete_post_meta( $post_id, $name );\n\n } else {\n\n $cache_data = array(\n 'type' => $meta_value['type'],\n );\n\n if ( LaterPay_Helper_Pricing::TYPE_INDIVIDUAL_DYNAMIC_PRICE === $meta_value['type'] ) {\n // Update post meta so that dynamic pricing values are available and we get valid dynamic price.\n update_post_meta( $post_id, $name, $meta_value );\n\n // Get post dynamic price based on price range and days and store in cache.\n $cache_data['price'] = LaterPay_Helper_Pricing::get_dynamic_price( get_post( $post_id ) );\n } elseif ( LaterPay_Helper_Pricing::TYPE_CATEGORY_DEFAULT_PRICE === $meta_value['type'] ) {\n\n $LaterPay_Category_Model = LaterPay_Model_CategoryPriceWP::get_instance();\n $cache_data['price'] = $LaterPay_Category_Model->get_price_by_category_id( (int) $meta_value['category_id'] );\n\n } else {\n if ( isset( $meta_value['price'] ) ) {\n $cache_data['price'] = $meta_value['price'];\n }\n }\n\n wp_cache_set( $cache_key, $cache_data, 'laterpay' );\n return update_post_meta( $post_id, $name, $meta_value );\n }\n }", "function savePostMeta($post_id)\n\t\t{\n\t\t\t$dataMetas = self::getDataMetas();\n\n\t\t\tforeach ($dataMetas as $key => $meta) {\n\t\t\t\t$nameMeta = $meta['_name_meta_box'];\n\t\t\t\tif ( isset($_POST[$nameMeta]) ) { \n\t\t\t\t\tupdate_post_meta( $post_id, $nameMeta, $_POST[$nameMeta] );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}", "function update_custom_meta( $postID, $value, $field ) {\n if ( ! get_post_meta( $postID, $field ) ) {\n add_post_meta( $postID, $field, $value );\n } else {\n // or to update existing meta\n update_post_meta( $postID, $field, $value );\n }\n}", "function save_custom_meta_box($post_id, $post, $update)\n {\n if (!isset($_POST[\"meta-box-nonce\"]) || !wp_verify_nonce($_POST[\"meta-box-nonce\"], basename(__FILE__)))\n return $post_id;\n\n if(!current_user_can(\"edit_post\", $post_id))\n return $post_id;\n\n if(defined(\"DOING_AUTOSAVE\") && DOING_AUTOSAVE)\n return $post_id;\n\n $slug = \"post\";\n if($slug != $post->post_type)\n return $post_id;\n \n $Main_checkbox_value = \"\"; //Empty Variable To Save Main Posts Meta In It\n $Feature_checkbox_value = \"\"; //Empty Variable To Save Feature Posts Meta In It\n $Local_checkbox_value = \"\"; //Empty Variable To Save Local Posts Meta In It\n $World_checkbox_value = \"\"; //Empty Variable To Save World Posts Meta In It\n\n\n if(isset($_POST[\"Main_Posts\"]))\n {\n $Main_checkbox_value = $_POST[\"Main_Posts\"];\n } \n //Update The Value Of Main Posts Meta Box\n update_post_meta($post_id, \"Main_Posts\", $Main_checkbox_value);\n \n \n if(isset($_POST[\"Features_Posts\"]))\n {\n $Feature_checkbox_value = $_POST[\"Features_Posts\"];\n } \n //Update The Value Of Feature Posts Meta Box\n update_post_meta($post_id, \"Features_Posts\", $Feature_checkbox_value);\n \n \n if(isset($_POST[\"Local_Posts\"]))\n {\n $Local_checkbox_value = $_POST[\"Local_Posts\"];\n \n } \n //Update The Value Of Local Posts Meta Box\n update_post_meta($post_id, \"Local_Posts\", $Local_checkbox_value);\n \n \n if(isset($_POST[\"World_Posts\"]))\n {\n $World_checkbox_value = $_POST[\"World_Posts\"];\n \n } \n //Update The Value Of World Posts Meta Box\n update_post_meta($post_id, \"World_Posts\", $World_checkbox_value);\n \n }", "public function updateOrder()\n {\n if (!empty($_POST['order'])) {\n $values = [];\n\n $key = $this->businessModel->data[$this->table]['key'];\n\n $query = '\n UPDATE '.$this->db->backtick($this->table).'\n SET '.$this->db->backtick($this->businessModel->data[$this->table]['order']['column']).' = CASE '.$this->db->backtick($key)\n ;\n\n foreach ($_POST['order'] as $order => $id) {\n $values[':'.$key.$id] = $id;\n $values[':order'.$order] = $order;\n $query .= ' WHEN :'.$key.$id.' THEN :order'.$order;\n }\n\n $query .= ' END WHERE '.$this->db->backtick($key).' IN ('.implode(',', array_values($_POST['order'])).')';\n\n $statement = $this->db->handle->prepare($query);\n\n exit($statement->execute($values));\n }\n }", "function update_postmeta_cache($post_ids)\n {\n }", "public static function save_meta_data($post_id)\n {\n $standardMetaValues = array(\"label\", \"link\", \"priority\");\n parent::save_standard_meta_values($standardMetaValues, $post_id);\n }", "function metabox_save_portfolio_meta($post_id, $post)\n\n {\n\n if (!wp_verify_nonce($_POST['eventmeta_noncename'], plugin_basename(__FILE__))) {\n\n\n\n return $post->ID;\n\n }\n\n\n\n // Is the user allowed to edit the post or page?\n\n if (!current_user_can('edit_post', $post->ID))\n\n\n\n return $post->ID;\n\n\n\n $headquarters = sanitize_text_field($_POST['_headquarters']);\n\n update_post_meta($post->ID, '_headquarters', $headquarters);\n\n\n\n $website_url = sanitize_text_field($_POST['_website_url']);\n\n update_post_meta($post->ID, '_website_url', $website_url);\n\n\n\n $regions = $_POST['_regions'];\n\n update_post_meta($post->ID, '_regions', $regions);\n\n\n\n $sector = $_POST['_sector'];\n\n update_post_meta($post->ID, '_sector', $sector);\n\n\n\n }", "function foodpress_save_meta_data($post_id, $post){\n\t\t\tglobal $pagenow;\n\n\t\t\tif ( empty( $post_id ) || empty( $post ) ) return;\n\t\t\tif($post->post_type!='menu') return;\n\t\t\tif (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;\n\n\t\t\t// Prevent quick edit from clearing custom fields\n\t\t\tif (defined('DOING_AJAX') && DOING_AJAX) return;\n\t\t\tif ( is_int( wp_is_post_revision( $post ) ) ) return;\n\t\t\tif ( is_int( wp_is_post_autosave( $post ) ) ) return;\n\t\t\t\n\t\t\t// verify this came from the our screen and with proper authorization,\n\t\t\t// because save_post can be triggered at other times\n\t\t\tif( isset($_POST['fp_noncename']) ){\n\t\t\t\tif ( !wp_verify_nonce( $_POST['fp_noncename'], plugin_basename( __FILE__ ) ) ){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t$_allowed = array( 'post-new.php', 'post.php' );\n\t\t\tif(!in_array($pagenow, $_allowed)) return;\n\n\t\t\t/* Get the post type object. */\n\t\t\t$post_type = get_post_type_object( $post->post_type );\n\t\t\t\n\t\t\t\n\t\t\t// Check permissions\n\t\t\tif ( !current_user_can( $post_type->cap->edit_post, $post_id ) )\n\t\t\t\treturn;\t\n\n\t\t\t\n\t\t\t//save the post meta values\n\t\t\t//$fields_ar =apply_filters();\n\t\t\t\n\t\t\t$meta_fields = $this->foodpress_menu_metabox_array();\t\t\t\n\t\t\t\n\t\t\t// run through all the custom meta fields\n\t\t\tforeach($meta_fields as $mb=>$f_val){\n\t\t\t\t\n\t\t\t\tif(!empty($f_val)){\n\t\t\t\t\tif( $f_val['type']=='multiinput'){\n\t\t\t\t\t\tforeach($f_val['ids'] as $fvals){\n\t\t\t\t\t\t\t$this->fp_individual_post_values($fvals, $post_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->fp_individual_post_values($f_val['id'], $post_id);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//update_post_meta($post_id, 'test', $_POST['fp_menuicons']);\n\t\t\t\n\t\t\t// save user closed meta field boxes\n\t\t\t$fp_closemeta_value = (isset($_POST['fp_collapse_meta_boxes']))? $_POST['fp_collapse_meta_boxes']: '';\n\t\t\t\n\t\t\tfoodpress_save_collapse_metaboxes($post_id, $fp_closemeta_value );\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// (---) hook for addons\n\t\t\tdo_action('foodpress_save_meta', $post_id);\t\n\t\t\t\t\n\t\t}", "function DoctorAppointment_meta_save($post_id){\n $is_auto_save = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = (isset($_POST['DoctorAppointment_nonce']) && \n wp_verify_nonce( $_POST['DoctorAppointment_nonce'], basename(__FILE__)))? 'true' : 'false';\n \n // return if ina auto svae , revision of non valid nouncer\n if($is_auto_save || $is_revision || !$is_valid_nonce){\n return ;\n }\n \n // update DoctorAppointment_id\n if(isset($_POST[\"DoctorAppointment_id\"])){\n update_post_meta( $post_id, \"DoctorAppointment_id\",sanitize_text_field( $_POST[\"DoctorAppointment_id\"]) );\n\n }\n\n // update DoctorAppointment_name\n if(isset($_POST[\"DoctorAppointment_name\"])){\n update_post_meta( $post_id, \"DoctorAppointment_name\",sanitize_text_field( $_POST[\"DoctorAppointment_name\"]) );\n \n }\n\n // update DoctorAppointment_email\n if(isset($_POST[\"DoctorAppointment_email\"])){\n update_post_meta( $post_id, \"DoctorAppointment_email\",sanitize_email( $_POST[\"DoctorAppointment_email\"]) );\n \n }\n\n // update DoctorAppointment_mobile\n if(isset($_POST[\"DoctorAppointment_mobile\"])){\n update_post_meta( $post_id, \"DoctorAppointment_mobile\",sanitize_text_field( $_POST[\"DoctorAppointment_mobile\"]) );\n }\n\n\n // update DoctorAppointment_message\n if(isset($_POST[\"DoctorAppointment_message\"])){\n update_post_meta( $post_id, \"DoctorAppointment_message\", sanitize_text_field($_POST[\"DoctorAppointment_message\"]));\n }\n\n// still have to write code fo\n \n \n \n \n \n\n}", "protected function save_meta() {}", "function tf_update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '') {\r\n // make sure meta is added to the post, not a revision\r\n if ( $the_post = wp_is_post_revision($post_id) )\r\n $post_id = $the_post;\r\n\r\n $meta_type = 'post';\r\n $object_id = $post_id;\r\n\r\n if ( !$meta_type || !$meta_key )\r\n return false;\r\n\r\n if ( !$object_id = absint($object_id) )\r\n return false;\r\n\r\n if ( ! $table = _get_meta_table($meta_type) )\r\n return false;\r\n\r\n global $wpdb;\r\n\r\n $column = esc_sql($meta_type . '_id');\r\n $id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';\r\n\r\n // expected_slashed ($meta_key)\r\n // $meta_key = stripslashes($meta_key); // this was the trouble !\r\n $passed_value = $meta_value;\r\n // $meta_value = stripslashes_deep($meta_value); // this was the trouble !\r\n $meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type );\r\n\r\n $check = apply_filters( \"update_{$meta_type}_metadata\", null, $object_id, $meta_key, $meta_value, $prev_value );\r\n if ( null !== $check )\r\n return (bool) $check;\r\n\r\n // Compare existing value to new value if no prev value given and the key exists only once.\r\n if ( empty($prev_value) ) {\r\n $old_value = get_metadata($meta_type, $object_id, $meta_key);\r\n if ( count($old_value) == 1 ) {\r\n if ( $old_value[0] === $meta_value )\r\n return false;\r\n }\r\n }\r\n\r\n if ( ! $meta_id = $wpdb->get_var( $wpdb->prepare( \"SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d\", $meta_key, $object_id ) ) )\r\n return tf_add_post_meta($object_id, $meta_key, $passed_value);\r\n\r\n $_meta_value = $meta_value;\r\n $meta_value = maybe_serialize( $meta_value );\r\n\r\n $data = compact( 'meta_value' );\r\n $where = array( $column => $object_id, 'meta_key' => $meta_key );\r\n\r\n if ( !empty( $prev_value ) ) {\r\n $prev_value = maybe_serialize($prev_value);\r\n $where['meta_value'] = $prev_value;\r\n }\r\n\r\n do_action( \"update_{$meta_type}_meta\", $meta_id, $object_id, $meta_key, $_meta_value );\r\n\r\n if ( 'post' == $meta_type )\r\n do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value );\r\n\r\n $wpdb->update( $table, $data, $where );\r\n\r\n wp_cache_delete($object_id, $meta_type . '_meta');\r\n\r\n do_action( \"updated_{$meta_type}_meta\", $meta_id, $object_id, $meta_key, $_meta_value );\r\n\r\n if ( 'post' == $meta_type )\r\n do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );\r\n\r\n return true;\r\n }", "function save_unit_meta_boxes( $post_id ) {\n\t\t/*\n\t\t* If we arent doing an autosave we merge all the extra fields with their corresponding post data.\n\t\t* Next we check to make sure we are saving a unit vs a post or page so we dont make the geocoding \n\t\t* request when we dont need to. Once we geocode the address, we save the long/lat in the DB. Next we \n\t\t* check to see if we are chaging the property from rented to available and if so, we set that date time\n\t\t* so we can calculate the listing age later on.\n\t\t*/\n\t\t\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;\n\t\t\n\t\t//Check to make sure we are on a \"Units\" page so we dont geocode on every page save//\n\t\tif (isset($_POST['unitsMetaBoxUpdate']) && $_POST['unitsMetaBoxUpdate'] == 'yesPlease') {\n\n\t\t\t$post_data = array_merge($this->extra_fields, $_POST);\n\t\t\t\n\t\t\tforeach( $this->extra_fields as $key => $value ) {\n\t\t\t\tupdate_post_meta( $post_id, $key, $post_data[$key]);\n\t\t\t}\n\t\t\t\n\t\t\t$address = $post_data['address'].\" \".$post_data['city'].\", \".$post_data['state'].\" \".$post_data['zip'];\n\n\t\t\t$geoCode = $this->_geo_code( $address, $post_data );\n\n\t\t\tupdate_post_meta( $post_id, 'lat', $geoCode['lat']);\n\t\t\tupdate_post_meta( $post_id, 'lon', $geoCode['lon']);\n\n\t\t\t//Lets see if user is making the unit available for rent.//\n\t\t\t//1) Check previous status\n\t\t\t$prevStatus = $_POST['previousStatus'];\n\t\t\t//2) Check if posted value is avail && previousStatus is rented\n\n\t\t\tif ($prevStatus == 'Rented' && $_POST['status'] == 'For Rent') {\n\t\t\t\tupdate_post_meta( $post_id, 'last_avail_date', strtotime('now'));\n\t\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'last_avail_date', $_POST['last_avail_date']);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public function run() {\n\t\t$config = $this->settings_array;\n\t\tforeach (\n\t\t\tarray(\n\t\t\t\t'post_meta_setting' => array(\n\t\t\t\t\tWPML_POST_META_CONFIG_INDEX_PLURAL,\n\t\t\t\t\tWPML_POST_META_CONFIG_INDEX_SINGULAR\n\t\t\t\t),\n\t\t\t\t'term_meta_setting' => array(\n\t\t\t\t\tWPML_TERM_META_CONFIG_INDEX_PLURAL,\n\t\t\t\t\tWPML_TERM_META_CONFIG_INDEX_SINGULAR\n\t\t\t\t)\n\t\t\t) as $setting_constructor => $settings\n\t\t) {\n\t\t\tif ( ! empty( $config[ $settings[0] ] ) ) {\n\t\t\t\t$field = $config[ $settings[0] ][ $settings[1] ];\n\t\t\t\t$cf = ! is_numeric( key( current( $config[ $settings[0] ] ) ) ) ? array( $field ) : $field;\n\t\t\t\tforeach ( $cf as $c ) {\n\t\t\t\t\t$setting = call_user_func_array( array(\n\t\t\t\t\t\t$this->setting_factory,\n\t\t\t\t\t\t$setting_constructor\n\t\t\t\t\t), array( trim( $c['value'] ) ) );\n\t\t\t\t\t$this->import_action( $c, $setting );\n\t\t\t\t\t$setting->make_read_only();\n\t\t\t\t\t$this->import_editor_settings( $c, $setting );\n\t\t\t\t\tif ( isset( $c[ 'attr' ][ 'translate_link_target' ] ) || isset( $c[ 'custom-field' ] ) ) {\n\t\t\t\t\t\t$setting->set_translate_link_target( isset( $c[ 'attr' ][ 'translate_link_target' ] ) ? (bool) $c[ 'attr' ][ 'translate_link_target' ] : false, isset( $c[ 'custom-field' ] ) ? $c[ 'custom-field' ] : array() );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isset( $c[ 'attr' ][ 'convert_to_sticky' ] ) ) {\n\t\t\t\t\t\t$setting->set_convert_to_sticky( (bool) $c[ 'attr' ][ 'convert_to_sticky' ] );\n\t\t\t\t\t}\n\t\t\t\t\t$setting->set_encoding( Obj::path( [ 'attr', 'encoding' ], $c ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->import_custom_field_texts();\n\t}" ]
[ "0.7477523", "0.6846129", "0.67944044", "0.67478037", "0.6576126", "0.65583384", "0.6493488", "0.644619", "0.6434062", "0.6425109", "0.63788086", "0.6378417", "0.63032913", "0.6291431", "0.6273514", "0.6257501", "0.62316877", "0.62316763", "0.6047204", "0.6029002", "0.60001373", "0.598783", "0.59607863", "0.5933531", "0.5883013", "0.585047", "0.5808355", "0.57515836", "0.57426417", "0.57426417", "0.57371664", "0.57264835", "0.5705331", "0.565918", "0.5625432", "0.56253546", "0.56004584", "0.5586483", "0.55578804", "0.55552673", "0.55491614", "0.5542988", "0.55319446", "0.552299", "0.5517056", "0.5516896", "0.5501745", "0.5493121", "0.54919773", "0.54843736", "0.5480373", "0.5478365", "0.547647", "0.5466085", "0.5456646", "0.54421586", "0.5427837", "0.5426752", "0.54232794", "0.54026353", "0.54017127", "0.53924567", "0.53915244", "0.5384867", "0.5380525", "0.5375257", "0.5362517", "0.53616214", "0.5359328", "0.5357408", "0.53526235", "0.53477377", "0.53251475", "0.5322244", "0.5321776", "0.53178775", "0.5317061", "0.53160703", "0.530093", "0.5298524", "0.52982426", "0.5297564", "0.52867407", "0.5274772", "0.52737397", "0.52699417", "0.52599317", "0.525494", "0.5248758", "0.52477854", "0.5229559", "0.52291125", "0.5223295", "0.52121896", "0.52116466", "0.52088106", "0.5207488", "0.52024645", "0.5199219", "0.5190195" ]
0.7783935
0
Get amount already refunded.
public function get_total_refunded( $order ) { global $wpdb; $total = $wpdb->get_var( $wpdb->prepare( " SELECT SUM( postmeta.meta_value ) FROM $wpdb->postmeta AS postmeta INNER JOIN $wpdb->posts AS posts ON ( posts.post_type = 'shop_order_refund' AND posts.post_parent = %d ) WHERE postmeta.meta_key = '_refund_amount' AND postmeta.post_id = posts.ID ", $order->get_id() ) ); return $total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAmountRefunded() {\n return $this->item->getAmountRefunded();\n }", "public function getAmountRefunded()\n {\n return $this->amountRefunded instanceof TypedMoneyBuilder ? $this->amountRefunded->build() : $this->amountRefunded;\n }", "public function getBaseAmountRefunded() {\n return $this->item->getBaseAmountRefunded();\n }", "public function getTotalRefundedAmount()\n {\n return $this->total_refunded_amount;\n }", "public function getRefundedAmount()\n {\n $refunded = new Money(0, $this->amount->getCurrency());\n\n foreach ($this->refunds as $refund) {\n $refunded = $refunded->add($refund->getAmount());\n }\n\n return $refunded;\n }", "public function getTotalRefunded();", "public function getRefundableAmount()\n {\n $amount = $this->getAmount()->subtract($this->getRefundedAmount());\n\n return $amount->isNegative() ? new Money(0, $this->amount->getCurrency()) : $amount;\n }", "public function getBaseTotalRefunded();", "public function getQtyRefunded() {\n return $this->item->getQtyRefunded();\n }", "public function getDiscountRefunded() {\n return $this->item->getDiscountRefunded();\n }", "public function getSubtotalRefunded();", "public function getDiscountRefunded();", "public function getRefundAmount()\n {\n if ($this->orderRefund === null) {\n return new Money('0');\n }\n return $this->orderRefund->getRefundAmount();\n }", "public function getBaseDiscountRefunded() {\n return $this->item->getBaseDiscountRefunded();\n }", "public function getRefundFromReceivedAmount()\n {\n return $this->refund_from_received_amount;\n }", "public function getRefundAmount()\n {\n return $this->refundAmount;\n }", "public function getReimbursedAmount()\n {\n return $this->_fields['ReimbursedAmount']['FieldValue'];\n }", "public function getRefundAmount()\n {\n return $this->refund_amount;\n }", "public function getRefundFromTransactionFee()\n {\n return $this->refund_from_transaction_fee;\n }", "public function getGwTaxAmountRefunded() {\n return $this->item->getGwTaxAmountRefunded();\n }", "public function isRefunded()\n {\n return $this->getRefundedAmount()->isPositive();\n }", "public function getBaseDiscountRefunded();", "public function getGwPriceRefunded() {\n return $this->item->getGwPriceRefunded();\n }", "final public static function transactionSentForRefund()\n {\n return self::get(2057);\n }", "public function getReceivableAmount()\n {\n return $this->receivable_amount;\n }", "public function getBaseTotalOnlineRefunded();", "public function getBaseTotalOfflineRefunded();", "public function getGwBaseTaxAmountRefunded() {\n return $this->item->getGwBaseTaxAmountRefunded();\n }", "public function getShippingRefunded();", "public function getRaisedAmount() {\n $sql = sprintf(\"SELECT SUM(amount) AS total_amount FROM donation WHERE project_id = %d;\", $this->id);\n $results = self::$connection->execute($sql);\n $total_amount = $results[0][\"total_amount\"];\n return $total_amount ? $total_amount : 0;\n }", "public function getTaxRefunded() {\n return $this->item->getTaxRefunded();\n }", "public function getCashRefundsMoney(): ?Money\n {\n return $this->cashRefundsMoney;\n }", "public function getTotalOnlineRefunded();", "public function getCharge() {\n return Charge::retrieve($this->refund->__get('data')['object']['balance_transaction']);\n }", "public function countMoneyToRefund()\n {\n if( count( $this -> payments ) == 0 )\n {\n return 0.0;\n }\n\n if( $this -> hasAlreadyUsedUpMoney() )\n {\n return null;\n }\n\n $moneyToRefund = $this -> countPaidMoney() - $this -> countConsumedMoney();\n $moneyToRefund = round( $moneyToRefund, 2 );\n \n return $moneyToRefund;\n }", "public function getGwBasePriceRefunded() {\n return $this->item->getGwBasePriceRefunded();\n }", "public function getBaseSubtotalRefunded();", "protected function getRefundedAmount(\\XLite\\Model\\Payment\\Transaction $transaction, array $data)\n {\n $amount = 0;\n $types = array(\n \\XLite\\Model\\Payment\\BackendTransaction::TRAN_TYPE_REFUND,\n \\XLite\\Model\\Payment\\BackendTransaction::TRAN_TYPE_REFUND_PART,\n );\n\n if (in_array($data['status'], array(static::STATUS_REFUND, static::STATUS_REFUND_PART))) {\n\n foreach ($transaction->getBackendTransactions() as $bt) {\n if ($bt->isCompleted() && in_array($bt->getType(), $types)) {\n $amount += $bt->getValue();\n }\n }\n\n $amount = $data['refundedAmount'] - $amount;\n }\n\n return $amount;\n }", "public function getTotalRefundToBuyer()\n {\n return $this->totalRefundToBuyer;\n }", "public function getTaxRefunded();", "public function get_donated_amount() {\r\n\t\tif ( ! isset( $this->donated_amount ) || is_null( $this->donated_amount ) ) {\r\n\r\n\t\t\t/**\r\n\t\t\t * Try to fetch from cache first. \r\n\t\t\t */\r\n\t\t\t$this->donated_amount = get_transient( $this->get_donations_cache_key( $this->ID ) . '_amount' );\r\n\r\n\t\t\tif ( $this->donated_amount === false ) {\r\n\t\t\t\t$this->donated_amount = charitable()->get_db_table('campaign_donations')->get_campaign_donated_amount( $this->ID );\r\n\r\n\t\t\t\tset_transient( $this->get_donations_cache_key( $this->ID ) . '_amount', $this->donated_amount, 0 );\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $this->donated_amount;\r\n\t}", "public function get_total_shipping_refunded( $order ) {\n\t\tglobal $wpdb;\n\n\t\t$total = $wpdb->get_var( $wpdb->prepare( \"\n\t\t\tSELECT SUM( order_itemmeta.meta_value )\n\t\t\tFROM {$wpdb->prefix}woocommerce_order_itemmeta AS order_itemmeta\n\t\t\tINNER JOIN $wpdb->posts AS posts ON ( posts.post_type = 'shop_order_refund' AND posts.post_parent = %d )\n\t\t\tINNER JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON ( order_items.order_id = posts.ID AND order_items.order_item_type = 'shipping' )\n\t\t\tWHERE order_itemmeta.order_item_id = order_items.order_item_id\n\t\t\tAND order_itemmeta.meta_key IN ('cost')\n\t\t\", $order->get_id() ) );\n\n\t\treturn abs( $total );\n\t}", "public function getDiscountTaxCompensationRefunded();", "public function getDiscountTaxCompensationRefunded() {\n return $this->item->getDiscountTaxCompensationRefunded();\n }", "public function getTotalOfflineRefunded();", "public function setTotalRefunded($totalRefunded);", "public function payment_status_refunded()\n {\n if ($this->validator->is_valid_refund()) {\n $this->order->update_status(\n OrderStatuses::ORDER_STATUS_REFUNDED,\n sprintf(\n esc_html__('Payment %s via IPN.', 'woo-paypalplus'),\n $this->request->get(Request::KEY_PAYMENT_STATUS, FILTER_SANITIZE_STRING)\n )\n );\n do_action(\n 'wc_paypal_plus__ipn_payment_update',\n OrderStatuses::ORDER_STATUS_REFUNDED,\n $this->settingRepository\n );\n }\n }", "public function getBaseTaxRefunded() {\n return $this->item->getBaseTaxRefunded();\n }", "public function getBaseShippingRefunded();", "public function getBaseDiscountTaxCompensationRefunded();", "public function getBaseDiscountTaxCompensationRefunded() {\n return $this->item->getBaseDiscountTaxCompensationRefunded();\n }", "public function get_amountInvoice() {\n return $this->amountInvoice;\n }", "public function getChargeValueModifier()\n {\n $value = 0;\n\n if ($this->isCompleted() || $this->isPending()) {\n $value += $this->getValue();\n }\n\n if ($this->getBackendTransactions()) {\n foreach ($this->getBackendTransactions() as $transaction) {\n if ($transaction->isRefund() && $transaction->isSucceed()) {\n $value -= abs($transaction->getValue());\n }\n }\n }\n\n return max(0, $value);\n }", "public function getAmountRefunds()\n {\n return $this->getIfSet('refunds', $this->data->amount);\n }", "public function getCapturedAmount();", "public function getamount()\n {\n return $this->amount;\n }", "public function getShippingTaxRefunded();", "public function get_total_due() {\n \n // query database to retrieve invoices marked due\n $query_args = array(\n 'post_type' => 'invoice',\n 'meta_query' => array(\n array(\n 'key' => 'client_id',\n 'value' => $this->id\n ),\n array(\n 'key' => 'status',\n 'value' => 'due'\n )\n ),\n 'posts_per_page' => -1\n );\n $query = new WP_Query($query_args);\n\n // calculate total due invoices value\n $running_total = 0;\n while ($query->have_posts()) {\n $query->the_post();\n $running_total += get_post_meta(get_the_id(), 'i_value', true);\n }\n\n update_post_meta($this->id, 'total_due', $running_total);\n\n return $running_total;\n }", "public function getAmount()\n {\n return $this->_fields['Amount']['FieldValue'];\n }", "public function getAmount() \n {\n return $this->_fields['Amount']['FieldValue'];\n }", "public function get_total_tax_refunded( $order ) {\n\t\tglobal $wpdb;\n\n\t\t$total = $wpdb->get_var( $wpdb->prepare( \"\n\t\t\tSELECT SUM( order_itemmeta.meta_value )\n\t\t\tFROM {$wpdb->prefix}woocommerce_order_itemmeta AS order_itemmeta\n\t\t\tINNER JOIN $wpdb->posts AS posts ON ( posts.post_type = 'shop_order_refund' AND posts.post_parent = %d )\n\t\t\tINNER JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON ( order_items.order_id = posts.ID AND order_items.order_item_type = 'tax' )\n\t\t\tWHERE order_itemmeta.order_item_id = order_items.order_item_id\n\t\t\tAND order_itemmeta.meta_key IN ('tax_amount', 'shipping_tax_amount')\n\t\t\", $order->get_id() ) );\n\n\t\treturn abs( $total );\n\t}", "public function getBalance()\n {\n return (float)$this->client->requestExecute(\"credit\");\n }", "public function isRefunded()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_REFUNDED;\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 getRetMoneyTransferReqAmount() {\n return $this->_retMoneyTransferReqAmount;\n }", "private function getInvoiceAmount()\n {\n $sql = 'SELECT invoice_amount FROM s_order WHERE id = ?';\n\n return Shopware()->Db()->fetchOne($sql, ['15315351']);\n }", "public function getRefundAttribute()\n {\n if (!array_key_exists('returnsRefundedSum', $this->relations))\n $this->load('returnsRefundedSum');\n\n $related = $this->getRelation('returnsRefundedSum');\n\n // then return the count directly\n return ($related) ? (int) $related->first()?->refund : 0;\n }", "public function getAmount()\n {\n return $this->_amount;\n }", "public function getAmount()\n {\n return $this->_amount;\n }", "public function getAmountPaid()\n {\n $amountPaid = 0;\n if ($this->payments) {\n foreach ($this->payments as $payment) {\n if ($payment->getStatus() == 'OK') {\n $amountPaid = $amountPaid + $payment->getAmount();\n }\n }\n }\n return $amountPaid;\n }", "public function get_amount_requested()\n {\n }", "public function getFundsPost(): Amount\n {\n return $this->fundsPost;\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 getDiscountCanceled();", "public function getAmountMissing(): float\n {\n $amountMissing = $this->getTotalAmount() - $this->purchaseTransaction->getPaidAmount();\n if ($amountMissing > 0) {\n return $amountMissing;\n }\n return 0;\n }", "public function getBaseTaxRefunded();", "public function getAmount()\r\n\t{\r\n\t\treturn $this->getTransaction()->getAmount();\r\n\t}", "public function getAmount()\n {\n return $this->amount;\n }", "private function getShippingRefundedQty(): int\n {\n //====================================================================//\n // Walk on Refunds\n foreach ($this->object->refunds ?? array() as $refund) {\n //====================================================================//\n // Walk on Refunds Order Adjustments\n foreach ($refund[\"order_adjustments\"] ?? array() as $adjustmentLine) {\n if (\"shipping_refund\" == $adjustmentLine['kind']) {\n return 1;\n }\n }\n }\n\n return 0;\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 }" ]
[ "0.8304545", "0.80116326", "0.7800791", "0.7675217", "0.76170534", "0.7608972", "0.7533391", "0.73523563", "0.72364867", "0.7221443", "0.7206684", "0.70878255", "0.7031655", "0.69614017", "0.69494164", "0.6918775", "0.6889394", "0.6868162", "0.68619907", "0.68150043", "0.68100685", "0.67266446", "0.6723387", "0.667636", "0.6638913", "0.66348594", "0.6610348", "0.65949917", "0.65935284", "0.6581227", "0.65780103", "0.6533303", "0.6525753", "0.652422", "0.6496842", "0.64793104", "0.6439265", "0.6411077", "0.63612574", "0.63331884", "0.6278965", "0.6278296", "0.62752086", "0.6241903", "0.6211407", "0.6197729", "0.61967653", "0.6157351", "0.6151852", "0.61043274", "0.6094265", "0.60764945", "0.604039", "0.60207933", "0.60051924", "0.59986424", "0.5973283", "0.59537506", "0.5898606", "0.58955055", "0.58882135", "0.588346", "0.5880204", "0.5871908", "0.5871908", "0.5871908", "0.5871908", "0.5871908", "0.5869421", "0.58665067", "0.58634466", "0.5857772", "0.5857772", "0.5856812", "0.5843449", "0.5838772", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.5835712", "0.58332103", "0.58283955", "0.5805729", "0.5800482", "0.57996583", "0.5799162", "0.5793174", "0.5793174" ]
0.62286156
44
Get the total tax refunded.
public function get_total_tax_refunded( $order ) { global $wpdb; $total = $wpdb->get_var( $wpdb->prepare( " SELECT SUM( order_itemmeta.meta_value ) FROM {$wpdb->prefix}woocommerce_order_itemmeta AS order_itemmeta INNER JOIN $wpdb->posts AS posts ON ( posts.post_type = 'shop_order_refund' AND posts.post_parent = %d ) INNER JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON ( order_items.order_id = posts.ID AND order_items.order_item_type = 'tax' ) WHERE order_itemmeta.order_item_id = order_items.order_item_id AND order_itemmeta.meta_key IN ('tax_amount', 'shipping_tax_amount') ", $order->get_id() ) ); return abs( $total ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGwTaxAmountRefunded() {\n return $this->item->getGwTaxAmountRefunded();\n }", "public function getBaseTotalRefunded();", "public function getTaxRefunded() {\n return $this->item->getTaxRefunded();\n }", "public function getGwBaseTaxAmountRefunded() {\n return $this->item->getGwBaseTaxAmountRefunded();\n }", "public function getTaxRefunded();", "public function getTotalRefundedAmount()\n {\n return $this->total_refunded_amount;\n }", "function getTotalTax(){\n\t\t$data = $this->_collectShippingInfo();\n\t\treturn $data->getTotalTax();\n\t}", "public function getBaseTaxRefunded() {\n return $this->item->getBaseTaxRefunded();\n }", "private function get_total_tax() {\n\n\t\t$taxes = $this->order->getCombinedTax();\n\n\t\t$tax = 0;\n\n\t\tif ( empty( $taxes ) ) {\n\t\t\treturn $tax;\n\t\t}\n\n\t\tforeach( $taxes as $name => $amount ) {\n\t\t\t$tax += $amount;\n\t\t}\n\n\t\treturn $tax;\n\t}", "public function getBaseTaxRefunded();", "public function getShippingTaxRefunded();", "public function getTaxTotalAmount()\n {\n return $this->taxTotalAmount;\n }", "public function getBaseShippingTaxRefunded();", "public function getAmountRefunded() {\n return $this->item->getAmountRefunded();\n }", "public function getTaxCost()\n {\n $total = 0;\n\n foreach ($this->items as $item) {\n if ($item->TotalTax) {\n $total += $item->TotalTax;\n }\n }\n\n if ($this->postage && $this->postage->Cost && $this->postage->Tax) {\n $total += ($this->postage->Cost / 100) * $this->postage->Tax;\n }\n \n return $total;\n }", "public function getTotalRefunded();", "public function getTaxTotal() {\n $total = 0;\n\n // Calculate total from items in the list\n foreach($this->Items() as $item) {\n $total += $item->getTaxTotal();\n }\n\n // Add any tax from postage\n $total += $this->PostageTax;\n\n return $total;\n }", "public function getBaseAmountRefunded() {\n return $this->item->getBaseAmountRefunded();\n }", "public function get_total_tax() {\n\t\treturn apply_filters( 'woocommerce_cart_' . __FUNCTION__, $this->get_totals_var( 'total_tax' ) );\n\t}", "public function getTotalTaxAmount();", "public function getTaxAmount()\n {\n return $this->getOrder()->getTaxAmount();\n }", "public function getSubtotalRefunded();", "public function getTotal() \n {\n $tax = $this->getTax(); \n return $this->_subtotal + $tax; \n }", "public function getTaxAmount() {\n return $this->item->getTaxAmount();\n }", "public function getTaxAmount();", "public function getTaxAmount()\n {\n return $this->taxAmount;\n }", "function getGrandTotal(){\n\t\t$data = $this->_collectShippingInfo();\n\t\treturn $data->getGrandTotalInclTax();\n\t}", "protected function calculateTaxAmount()\n {\n\n //TAX ratio\n $tax_ratio = config('paths.tax') / 100;\n //Total amount as per current currency\n $total = Session::get('total') + Session::get('shipping_cost');\n //base currency total amount\n $bc_total = Session::get('bc_currency_total') + Session::get('bc_shipping_cost');\n //Tax amount for current currency\n $total_tax = round(($tax_ratio * $total), 2);\n //Tax amount for base currency\n $bc_total_tax = round(($tax_ratio * $bc_total), 2);\n Session::put('tax_amount', $total_tax);\n Session::put('bc_tax_amount', $bc_total_tax);\n return $total_tax;\n }", "public function getTaxAmount() {\r\n return $this->taxAmount;\r\n }", "public function getTax(){\n $brutto = $this->getBrutto();\n return $brutto - ($brutto / (107) * 100);\n }", "public function getTax()\n {\n $tax = 0;\n\n if (isset($this->_taxrate)) {\n $tax = $this->_taxrate * $this->_subtotal;\n }\n \n return $tax;\n }", "public function getBaseTotal()\n {\n return ($this->amount + $this->tax_amount) ;\n }", "public function getTotal()\n {\n return ($this->amount + $this->tax_amount)* $this->currency_converter;\n }", "public function getAmountRefunded()\n {\n return $this->amountRefunded instanceof TypedMoneyBuilder ? $this->amountRefunded->build() : $this->amountRefunded;\n }", "public function tax()\n {\n return 0;\n }", "public function getBaseSubtotalRefunded();", "public function getTotal() {\n $sub = ($this->hasDiscount()) ? $this->SubTotal - $this->DiscountAmount : $this->SubTotal;\n\n return number_format($sub + $this->Postage + $this->TaxTotal, 2);\n }", "public function getBaseTaxAmount();", "public function getBaseTaxAmount()\n {\n return $this->tax_amount;\n }", "public function getRefundedAmount()\n {\n $refunded = new Money(0, $this->amount->getCurrency());\n\n foreach ($this->refunds as $refund) {\n $refunded = $refunded->add($refund->getAmount());\n }\n\n return $refunded;\n }", "public function getGwTaxAmount() {\n return $this->item->getGwTaxAmount();\n }", "public function getBaseTaxAmount() {\n return $this->item->getBaseTaxAmount();\n }", "public function subtotalWithTax()\n {\n return $this->subtotal() + $this->tax();\n }", "public function getBaseTotalOnlineRefunded();", "public function tax(): float;", "public function getBaseShippingTaxAmount();", "function get_tax_rate()\n\t{\n\t\tif(empty($this->address))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$rate\t= 0;\n\t\t\n\t\t$rate += $this->get_country_tax_rate();\n\t\t$rate += $this->get_zone_tax_rate();\n\t\t$rate += $this->get_area_tax_rate();\n\t\t\n\t\t//returns the total rate not affected by price of merchandise.\n\t\treturn $rate;\n\t}", "public function getShippingTaxAmount();", "public function get_total_ex_tax() {\n\t\treturn apply_filters( 'woocommerce_cart_total_ex_tax', wc_price( max( 0, $this->get_total( 'edit' ) - $this->get_total_tax() ) ) );\n\t}", "public function getTaxBasisTotalAmount()\n {\n return $this->taxBasisTotalAmount;\n }", "public function getGwTaxAmountInvoiced() {\n return $this->item->getGwTaxAmountInvoiced();\n }", "static public function get_shipping_line_total_tax( $order ){\n\n \t\t$version = toret_check_wc_version();\n\n \tif( $version === false ){\n\n \t$tax = $order->get_shipping_tax(); \n \n \t}else{\n\n\t $shippings = $order->get_items( 'shipping' );\n\t\t\t\tforeach( $shippings as $shipping ){\n \t\t\t\t\t\n \t\t\t\t$tax = $shipping->get_total_tax();\n \t\t\t\t\t\n\t\t\t\t} \t\n\n \t}\n\n \treturn $tax;\n\n \t}", "public function getTotalTaxesAmountAttribute()\n {\n $taxAmount = 0;\n\n if($this->taxes) {\n foreach($this->taxes as $tax) {\n $taxAmount += $tax->amount;\n }\n }\n\n return Money::ofMinor($taxAmount, $this->purchase_order->currency)->getAmount();\n }", "public function getTotal(){\n\t\t$total = parent::getTotal();\n\t\t$total->setValue(Mage::helper('utils/discount')->getDiscountData($this->getQuote())->getDiscountInclTax());\n\t\treturn $total;\n\t}", "public function getGwBaseTaxAmountInvoiced() {\n return $this->item->getGwBaseTaxAmountInvoiced();\n }", "public function getTotalAmount()\n {\n return $this->subtotal() + $this->shippingCost() + $this->tax() - $this->discounts();\n }", "public function getFinalTaxesTotal()\n {\n return $this->getProductsSalesTaxTotal() +\n $this->getProductsImportTaxTotal();\n }", "public function getGwBaseTaxAmount() {\n return $this->item->getGwBaseTaxAmount();\n }", "protected function _getShippingTaxAmount()\n {\n $quote = $this->getCustomQuote() ? $this->getCustomQuote() : $this->getQuote();\n return $quote->getShippingAddress()->getShippingTaxAmount();\n }", "function get_cart_tax() {\n\t\t\t$cart_total_tax = $this->tax_total + $this->shipping_tax_total;\n\t\t\tif ($cart_total_tax > 0) return cmdeals_price( $cart_total_tax );\n\t\t\treturn false;\n\t\t}", "public function getTotalTaxAttribute()\n {\n if (empty($this->shopCalculations)) $this->runCalculations();\n return round($this->shopCalculations->totalTax + ($this->totalPrice * Config::get('shop.tax')), 2);\n }", "public function getTaxRate();", "public function getTaxRate()\r\n {\r\n return $this->item->getParentObject()->getOrder()->getProxy()->getTaxRate();\r\n }", "public function getTotalPriceWithoutTax() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->totalWithoutTaxPrice;\r\n\t}", "public function getPerPersonTotalTaxAmount()\n {\n return $this->PerPersonTotalTaxAmount;\n }", "public function getDiscountTaxCompensationRefunded();", "public function getBaseDiscountRefunded() {\n return $this->item->getBaseDiscountRefunded();\n }", "public function getDeliveryGrossAmount()\r\n {\r\n return $this->_deliveryNetAmount + $this->_deliveryTaxAmount;\r\n }", "public function get_total_shipping_refunded( $order ) {\n\t\tglobal $wpdb;\n\n\t\t$total = $wpdb->get_var( $wpdb->prepare( \"\n\t\t\tSELECT SUM( order_itemmeta.meta_value )\n\t\t\tFROM {$wpdb->prefix}woocommerce_order_itemmeta AS order_itemmeta\n\t\t\tINNER JOIN $wpdb->posts AS posts ON ( posts.post_type = 'shop_order_refund' AND posts.post_parent = %d )\n\t\t\tINNER JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON ( order_items.order_id = posts.ID AND order_items.order_item_type = 'shipping' )\n\t\t\tWHERE order_itemmeta.order_item_id = order_items.order_item_id\n\t\t\tAND order_itemmeta.meta_key IN ('cost')\n\t\t\", $order->get_id() ) );\n\n\t\treturn abs( $total );\n\t}", "public function getTaxPercent() {\n return $this->item->getTaxPercent();\n }", "public function getBaseDiscountTaxCompensationRefunded();", "public function countTaxValue(): float\n\t{\n\t\treturn ($this->countTaxedUnitValue() - $this->countUntaxedUnitValue()) * $this->getUnits();\n\t}", "public function getBaseDiscountTaxCompensationRefunded() {\n return $this->item->getBaseDiscountTaxCompensationRefunded();\n }", "public function getBaseTotalOfflineRefunded();", "public function get_total_refunded( $order ) {\n\t\tglobal $wpdb;\n\n\t\t$total = $wpdb->get_var( $wpdb->prepare( \"\n\t\t\tSELECT SUM( postmeta.meta_value )\n\t\t\tFROM $wpdb->postmeta AS postmeta\n\t\t\tINNER JOIN $wpdb->posts AS posts ON ( posts.post_type = 'shop_order_refund' AND posts.post_parent = %d )\n\t\t\tWHERE postmeta.meta_key = '_refund_amount'\n\t\t\tAND postmeta.post_id = posts.ID\n\t\t\", $order->get_id() ) );\n\n\t\treturn $total;\n\t}", "public function getTotalPrice()\n {\n $tax = $this->tax->tax;\n $price = $this->getFinalPrice();\n $shipping = $this->shipping_cost;\n\n return ((($price + $shipping) * $tax) + $price + $shipping);\n }", "public function getTax()\n {\n return $this->tax;\n }", "public function getTax(): ?float\n {\n return $this->tax;\n }", "public function getTaxcharges()\n {\n return $this->taxcharges;\n }", "public function getQtyRefunded() {\n return $this->item->getQtyRefunded();\n }", "public function getTax()\n {\n return $this->_tax;\n }", "public function get_fee_tax() {\n\t\treturn apply_filters( 'woocommerce_cart_' . __FUNCTION__, $this->get_totals_var( 'fee_tax' ) );\n\t}", "public function getShippingDiscountTaxCompensationAmount();", "public function getSubtotalInclTax()\n {\n if (!Mage::getSingleton('tax/config')->displayCartSubtotalBoth()) {\n return 0;\n }\n return $this->getSubtotal(false);\n }", "public function getRowTotalInclTax()\n {\n return $this->quoteItem->getRowTotalInclTax();\n }", "public function getDiscountTaxCompensationRefunded() {\n return $this->item->getDiscountTaxCompensationRefunded();\n }", "public function getTaxes() : float\n {\n $multiplier = app(CartLogistics::class)->getTaxRate(\n $this->purchaseable,\n $this->cart->shipping_address\n ) * 0.01;\n\n return $this->price * $multiplier;\n }", "public function getTaxPrice() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->TaxPrice;\r\n\t}", "public function getTotalTax(){\n return $this->getParameter('total_tax');\n }", "public function getDiscountTaxCompensationAmount();", "public function getRefundAmount()\n {\n if ($this->orderRefund === null) {\n return new Money('0');\n }\n return $this->orderRefund->getRefundAmount();\n }", "public function getTaxVal() {\n\t\treturn $this->taxVal;\n\t}", "public function get_cart_tax() {\n\t\t$cart_total_tax = wc_round_tax_total( $this->get_cart_contents_tax() + $this->get_shipping_tax() + $this->get_fee_tax() );\n\n\t\treturn apply_filters( 'woocommerce_get_cart_tax', $cart_total_tax ? wc_price( $cart_total_tax ) : '' );\n\t}", "public function getIteneraryTotalTaxesAmount()\n {\n return $this->IteneraryTotalTaxesAmount;\n }", "private function getTotalCharge() {\n $result = 0;\n\n foreach ($this->rentals as $rental) {\n $result += $rental->getCharge();\n }\n return $result;\n\n }", "public function getRowTotalInclTax() {\n return $this->item->getRowTotalInclTax();\n }", "public function tax(bool $update = true): float;", "public function setTotalRefunded($totalRefunded);", "public function getDiscountRefunded() {\n return $this->item->getDiscountRefunded();\n }", "public function getTaxAmount(): ?float\n {\n return $this->taxAmount;\n }" ]
[ "0.83200455", "0.81456846", "0.80929935", "0.8081876", "0.80330276", "0.79252505", "0.7877898", "0.7870721", "0.78052396", "0.7726598", "0.7700025", "0.7631219", "0.76224965", "0.76179683", "0.7616845", "0.7594877", "0.75917006", "0.7559692", "0.75519043", "0.7496158", "0.74907535", "0.7443545", "0.7413373", "0.73851466", "0.73630565", "0.73626703", "0.73554844", "0.73435605", "0.72992283", "0.7258682", "0.725215", "0.72340333", "0.7220951", "0.72114015", "0.7180724", "0.7169015", "0.7159368", "0.7140975", "0.7131114", "0.70893574", "0.70842713", "0.7066882", "0.7058294", "0.7053902", "0.7044578", "0.7043791", "0.70421743", "0.70352775", "0.7032561", "0.7013352", "0.7010606", "0.7006031", "0.69944966", "0.6989263", "0.69447297", "0.69382864", "0.69309294", "0.692402", "0.6923191", "0.6905614", "0.690447", "0.68966615", "0.6875404", "0.6873035", "0.68446285", "0.6843302", "0.68347293", "0.68304324", "0.6829347", "0.68243355", "0.6823943", "0.68225753", "0.679263", "0.6792554", "0.6776906", "0.6774987", "0.67431223", "0.6732068", "0.6731543", "0.6721511", "0.6715628", "0.6697881", "0.66973406", "0.6694546", "0.66866493", "0.6685344", "0.6683448", "0.6680502", "0.6673006", "0.66635466", "0.66581136", "0.66529816", "0.6633497", "0.66284776", "0.66131157", "0.6609985", "0.65908223", "0.6590712", "0.65900683", "0.65713996" ]
0.75932807
16
Get the total shipping refunded.
public function get_total_shipping_refunded( $order ) { global $wpdb; $total = $wpdb->get_var( $wpdb->prepare( " SELECT SUM( order_itemmeta.meta_value ) FROM {$wpdb->prefix}woocommerce_order_itemmeta AS order_itemmeta INNER JOIN $wpdb->posts AS posts ON ( posts.post_type = 'shop_order_refund' AND posts.post_parent = %d ) INNER JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON ( order_items.order_id = posts.ID AND order_items.order_item_type = 'shipping' ) WHERE order_itemmeta.order_item_id = order_items.order_item_id AND order_itemmeta.meta_key IN ('cost') ", $order->get_id() ) ); return abs( $total ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getShippingRefunded();", "public function getTotalRefundedAmount()\n {\n return $this->total_refunded_amount;\n }", "private function getShippingRefundedQty(): int\n {\n //====================================================================//\n // Walk on Refunds\n foreach ($this->object->refunds ?? array() as $refund) {\n //====================================================================//\n // Walk on Refunds Order Adjustments\n foreach ($refund[\"order_adjustments\"] ?? array() as $adjustmentLine) {\n if (\"shipping_refund\" == $adjustmentLine['kind']) {\n return 1;\n }\n }\n }\n\n return 0;\n }", "public function getTotalRefunded();", "public function getBaseTotalRefunded();", "public function getAmountRefunded() {\n return $this->item->getAmountRefunded();\n }", "public function getBaseShippingRefunded();", "public function getShippingAmount()\n {\n return $this->getOrder()->getShippingAmount();\n }", "public function getNewShippingTotal()\r\n {\r\n $totalItem = 0;\r\n foreach ($this->_getQuote()->getAllVisibleItems() as $item) {\r\n $totalItem += $item->getQty();\r\n }\r\n return $totalItem;\r\n }", "public function getSubtotalRefunded();", "public function getShippingAmount();", "public function getBaseTotalOfflineRefunded();", "public function getShippingTaxRefunded();", "public function getBaseTotalOnlineRefunded();", "public function getQtyRefunded() {\n return $this->item->getQtyRefunded();\n }", "public function getBaseAmountRefunded() {\n return $this->item->getBaseAmountRefunded();\n }", "public function TotalItemShipping() {\n\treturn $this->nTotShItm;\n }", "public function getBaseSubtotalRefunded();", "public function get_cart_shipping_total() {\n\t\tif ( 0 < $this->get_shipping_total() ) {\n\n\t\t\tif ( $this->display_prices_including_tax() ) {\n\t\t\t\t$return = wc_price( $this->shipping_total + $this->shipping_tax_total );\n\n\t\t\t\tif ( $this->shipping_tax_total > 0 && ! wc_prices_include_tax() ) {\n\t\t\t\t\t$return .= ' <small class=\"tax_label\">' . WC()->countries->inc_tax_or_vat() . '</small>';\n\t\t\t\t}\n\n\t\t\t\treturn $return;\n\t\t\t} else {\n\t\t\t\t$return = wc_price( $this->shipping_total );\n\n\t\t\t\tif ( $this->shipping_tax_total > 0 && wc_prices_include_tax() ) {\n\t\t\t\t\t$return .= ' <small class=\"tax_label\">' . WC()->countries->ex_tax_or_vat() . '</small>';\n\t\t\t\t}\n\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t} else {\n\t\t\treturn __( 'Free!', 'woocommerce' );\n\t\t}\n\t}", "function getGrandTotal(){\n\t\t$data = $this->_collectShippingInfo();\n\t\treturn $data->getGrandTotalInclTax();\n\t}", "public function getTotalShippingAttribute()\n {\n if (empty($this->shopCalculations)) $this->runCalculations();\n return round($this->shopCalculations->totalShipping, 2);\n }", "public function getGwTaxAmountRefunded() {\n return $this->item->getGwTaxAmountRefunded();\n }", "public function getRefundedAmount()\n {\n $refunded = new Money(0, $this->amount->getCurrency());\n\n foreach ($this->refunds as $refund) {\n $refunded = $refunded->add($refund->getAmount());\n }\n\n return $refunded;\n }", "public function getShippingDiscountAmount();", "public function getBaseShippingAmount();", "public function shippingCost()\n {\n return $this->shippingCalculator->run($this);\n }", "public function getShippingDiscountAmount()\n {\n return $this->shippingDiscountAmount;\n }", "public function getDeliveryGrossAmount()\r\n {\r\n return $this->_deliveryNetAmount + $this->_deliveryTaxAmount;\r\n }", "public function getCalculatedShippingDiscount()\n {\n return $this->calculatedShippingDiscount;\n }", "public function getDiscountRefunded() {\n return $this->item->getDiscountRefunded();\n }", "public function getShippingCost()\r\n {\r\n return $this->shipping_cost;\r\n }", "public function getAmountRefunded()\n {\n return $this->amountRefunded instanceof TypedMoneyBuilder ? $this->amountRefunded->build() : $this->amountRefunded;\n }", "function getTotalTax(){\n\t\t$data = $this->_collectShippingInfo();\n\t\treturn $data->getTotalTax();\n\t}", "public function getSubtotalShipping()\n {\n $this->initializeSubtotals();\n\n return $this->getIfSet('shipping', $this->data->amount->subtotals);\n }", "public function get_fee_total() {\n\t\treturn apply_filters( 'woocommerce_cart_' . __FUNCTION__, $this->get_totals_var( 'fee_total' ) );\n\t}", "public function getTotalAmount()\n {\n return $this->subtotal() + $this->shippingCost() + $this->tax() - $this->discounts();\n }", "public function TotalPackageShipping() {\n\treturn $this->nMaxShPkg;\n }", "public function getTotalOnlineRefunded();", "public function getAmount()\r\n {\r\n $amount = $this->getDeliveryGrossAmount();\r\n foreach ($this->_items as $item)\r\n {\r\n $amount += $item->getTotalGrossAmount();\r\n }\r\n return $amount;\r\n }", "public function getGwPriceRefunded() {\n return $this->item->getGwPriceRefunded();\n }", "public function setTotalRefunded($totalRefunded);", "public function getTotalOfflineRefunded();", "public function getBaseShippingTaxRefunded();", "public function getBaseShippingDiscountAmount()\n {\n return $this->baseShippingDiscountAmount;\n }", "public function getBaseShippingDiscountAmount();", "public function getGwBaseTaxAmountRefunded() {\n return $this->item->getGwBaseTaxAmountRefunded();\n }", "public function getFlatShippingDiscount()\n {\n return $this->flatShippingDiscount;\n }", "private function calculateShipping( )\n\t{\n\t\t\n\t\t// For this application, we are simply charging a flat fee for shipping\n\t\t// We could interface with web services provided by UPS, Fed Ex, USPS, etc. to get actual shipping fees\n\t\t// based on from address, to address, weight, size, etc.\n\t\t\n\t\t// For purposes of this school project, we are applying a flat rate of $4.50 for all shipments\n\t\treturn Configuration::getConfigValue(\"shippingRate\");\n\t\t\n\t\t\n\t}", "public function getShippingPrice() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->shippingPrice;\r\n\t}", "public function getTotalDeliveredQuantity()\n {\n return $this->totalDeliveredQuantity;\n }", "public function getShippingCost();", "public function getShippingTaxAmount();", "public function getShippingFeeAttribute(): float\n\t{\n\t\treturn $this->rental_period->shipping_fee;\n\t}", "public function getBaseDiscountRefunded() {\n return $this->item->getBaseDiscountRefunded();\n }", "public function getTotalShippingMethods() {\n\t\t$sql = \"SELECT COUNT(*) as total \n\t\t\t\tFROM \" . DB_PREFIX . \"ms_shipping_method\";\n\n\t\t$res = $this->db->query($sql);\n\t\treturn $res->row['total'];\n\t}", "public function getDisplayTotalShippingAttribute()\n {\n return Shop::format($this->totalShipping);\n }", "public function total()\n {\n return $this->subtotal() + $this->shipping() + $this->vat()->sum();\n }", "public function getRefundShippingCharges(): ?bool\n {\n return isset($this->RefundShippingCharges) ? $this->RefundShippingCharges : null;\n }", "public function getShippingrate()\n\t{\n\t\tinclude_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/shipping.php';\n\t\t$shipping = new shipping;\n\t\techo $shipping->getShippingrate_calc();\n\t\texit;\n\t}", "public function getShippingRate();", "static public function get_shipping_line_total( $order ){\n\n \t\t$version = toret_check_wc_version();\n\n \tif( $version === false ){\n\n \t$total = $order->get_total_shipping(); \n \n \t}else{\n\n\t $shippings = $order->get_items( 'shipping' );\n\t\t\t\tforeach( $shippings as $shipping ){\n \t\t\t\t\t\n \t\t\t\t$total = $shipping->get_total();\n \t\t\t\t\t\n\t\t\t\t} \t\n\n \t}\n\n \treturn $total;\n\n \t}", "public function get_total_refunded( $order ) {\n\t\tglobal $wpdb;\n\n\t\t$total = $wpdb->get_var( $wpdb->prepare( \"\n\t\t\tSELECT SUM( postmeta.meta_value )\n\t\t\tFROM $wpdb->postmeta AS postmeta\n\t\t\tINNER JOIN $wpdb->posts AS posts ON ( posts.post_type = 'shop_order_refund' AND posts.post_parent = %d )\n\t\t\tWHERE postmeta.meta_key = '_refund_amount'\n\t\t\tAND postmeta.post_id = posts.ID\n\t\t\", $order->get_id() ) );\n\n\t\treturn $total;\n\t}", "private function getTotalCharge() {\n $result = 0;\n\n foreach ($this->rentals as $rental) {\n $result += $rental->getCharge();\n }\n return $result;\n\n }", "function custom_calculated_total( $total, $cart ){\n\n\t$packages = WC()->cart->get_shipping_packages();\n\t$cost = 0;\n\tif(count($packages) > 1){\n\t\t$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' )[0];\n\t\t$shipping_methods = WC()->session->get('shipping_for_package_0')['rates'];\n\t\tforeach ( $packages as $package ) {\n\t\t\tif($package[\"recurring_cart_key\"] === false){\n\t\t\t\t// Loop through the array\n\t\t\t\tforeach ( $shipping_methods as $method_id => $shipping_rate ){\n\t\t\t\t\t$cost = $shipping_rate->cost;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn round( $total - $cost, $cart->dp );\n\t}\n\n\t/*echo '<pre>';\n\tvar_dump($cost);\n\tvar_dump($total);\n\techo '</pre>';*/\nreturn $total;\n\n}", "function get_total() {\n\t\t\treturn cmdeals_price($this->total);\n\t\t}", "public function getTotalPrice()\n {\n $tax = $this->tax->tax;\n $price = $this->getFinalPrice();\n $shipping = $this->shipping_cost;\n\n return ((($price + $shipping) * $tax) + $price + $shipping);\n }", "public function getGwBasePriceRefunded() {\n return $this->item->getGwBasePriceRefunded();\n }", "public function getDiscountRefunded();", "public function get_total_debit(){\n return $this->get_storage_cost() + $this->get_services_cost();\n }", "public function getTaxRefunded() {\n return $this->item->getTaxRefunded();\n }", "public function getShippingDiscountTaxCompensationAmount();", "public function getRefundAmount()\n {\n if ($this->orderRefund === null) {\n return new Money('0');\n }\n return $this->orderRefund->getRefundAmount();\n }", "public function getTotalRefundToBuyer()\n {\n return $this->totalRefundToBuyer;\n }", "public function getFreeShipping() {\n return $this->item->getFreeShipping();\n }", "protected function _getShippingTaxAmount()\n {\n $quote = $this->getCustomQuote() ? $this->getCustomQuote() : $this->getQuote();\n return $quote->getShippingAddress()->getShippingTaxAmount();\n }", "function getShippingPrice(){\n\t\t$data = $this->_collectShippingInfo();\n\t\tif(Mage::getModel(\"tax/config\")->displayCartShippingExclTax()) return $data->getShippingExclTax();\n\t\telse return $data->getShippingInclTax();\n\t}", "public function getRefundAmount()\n {\n return $this->refundAmount;\n }", "public function getTotal() {\n $sub = ($this->hasDiscount()) ? $this->SubTotal - $this->DiscountAmount : $this->SubTotal;\n\n return number_format($sub + $this->Postage + $this->TaxTotal, 2);\n }", "public function getChargeTotalAmount()\n {\n return $this->chargeTotalAmount;\n }", "public function getRefundAmount()\n {\n return $this->refund_amount;\n }", "public function shippingCosts(): string\n {\n return $this->rate->price;\n }", "public function getRefundableAmount()\n {\n $amount = $this->getAmount()->subtract($this->getRefundedAmount());\n\n return $amount->isNegative() ? new Money(0, $this->amount->getCurrency()) : $amount;\n }", "public function getRefundFromTransactionFee()\n {\n return $this->refund_from_transaction_fee;\n }", "public function getBaseShippingTaxAmount();", "function get_order_discount_total() {\n\t\t\treturn $this->discount_total;\n\t\t}", "public function getTotal() \n {\n $tax = $this->getTax(); \n return $this->_subtotal + $tax; \n }", "public function woocommerce_reports_sales_overview_shipping_total($shipping_total) {\n\t\tglobal $wpdb;\n\n\t\t$this->set_reporting_flag(true);\n\n\t\t// If shipping total is zero, just return it. Any conversion would also\n\t\t// return zero\n\t\tif($shipping_total === 0) {\n\t\t\treturn $shipping_total;\n\t\t}\n\n\t\t$SQL = \"\n\t\t\tSELECT\n\t\t\t\tSUM(meta_order.meta_value) AS total_sales\n\t\t\tFROM\n\t\t\t\t$wpdb->posts AS posts\n\t\t\tJOIN\n\t\t\t\t$wpdb->postmeta AS meta_order ON\n\t\t\t\t\t(meta_order.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order.meta_key = '_order_shipping_base_currency')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_relationships AS rel ON\n\t\t\t\t\t(rel.object_ID = posts.ID)\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_taxonomy AS taxonomy ON\n\t\t\t\t\t(taxonomy.term_taxonomy_id = rel.term_taxonomy_id)\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->terms AS term ON\n\t\t\t\t\t(term.term_id = taxonomy.term_id)\n\t\t\tWHERE\n\t\t\t\t(posts.post_type = 'shop_order') AND\n\t\t\t\t(posts.post_status = 'publish') AND\n\t\t\t\t(taxonomy.taxonomy = 'shop_order_status') AND\n\t\t\t\t(term.slug IN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"'))\n\t\t\";\n\n\t\t$shipping_total = $wpdb->get_var($SQL);\n\t\t$this->set_reporting_flag(false);\n\n\t\treturn $shipping_total;\n\t}", "public function getTotalWithDiscount()\n {\n return $this->totalWithDiscount;\n }", "public function getFcpoCapturableAmount() \n {\n $oTransaction = $this->getLastStatus();\n $dReceivable = 0;\n if ($oTransaction !== false) {\n $dReceivable = $oTransaction->fcpotransactionstatus__fcpo_receivable->value;\n }\n return $this->oxorder__oxtotalordersum->value - $dReceivable;\n }", "private function get_shipping_item_totals()\r\n\t{\r\n\t\t$separate_value = $this->flexi->cart_contents['settings']['shipping']['data']['separate_value'];\r\n\t\t$separate_weight = $this->flexi->cart_contents['settings']['shipping']['data']['separate_weight'];\r\n\t\t\r\n\t\t$free_value = $this->flexi->cart_contents['settings']['shipping']['data']['free_value'];\r\n\t\t$free_weight = $this->flexi->cart_contents['settings']['shipping']['data']['free_weight'];\r\n\t\r\n\t\t$item_summary_total = $this->flexi->cart_contents['summary']['item_summary_total'];\r\n\t\t$total_weight = $this->flexi->cart_contents['summary']['total_weight'];\r\n\t\t\r\n\t\t$shipping_item_data['value'] = $this->format_calculation($item_summary_total - $separate_value - $free_value);\r\n\t\t$shipping_item_data['weight'] = $this->format_calculation($total_weight - $separate_weight - $free_weight);\r\n\r\n\t\treturn $shipping_item_data;\r\n\t}", "public function get_total()\n\t{\n\t\treturn $this->EE->cartthrob->cart->total();\n\t}", "public function getBaseDiscountRefunded();", "public function total(): float\n {\n return $this->getTotal();\n }", "public function getTotalPayment()\n\t{\n\t\treturn $this->total_payment;\n\t}", "public function getUnsubscribeTotal()\n\t\t{\n\t\t\treturn $this->unsubscribe_total;\n\t\t}", "public function getShipping()\r\n {\r\n return $this->shipping;\r\n }", "public function getTotal()\n {\n return $this->service()->getTotalOfOrder();\n }", "public function total()\n {\n return $this->total;\n }", "public function total()\n {\n return $this->total;\n }", "public function calculateShippingAmount()\n {\n\n\n $kgs = 1;\n $total_cost = 0;\n $bc_shipping_cost = 0;\n $shipping_threshold = config('paths.shipping_threshold');\n $shipping_cost = config('paths.shipping_cost');\n $items_in_bag = Session::get('items');\n if (!empty($items_in_bag)) {\n foreach ($items_in_bag as $item) {\n if ($item['weight_unit'] == 'g') {\n $kgs = 0.001;\n }\n $i_weight = $item['weight'] * $kgs;\n $total_i_weight = $i_weight * $item['quantity'];\n if ($total_i_weight > $shipping_threshold) {\n $item_shipping_cost = $shipping_cost + ($total_i_weight - $shipping_threshold);\n } else {\n $item_shipping_cost = $shipping_cost;\n }\n $bc_shipping_cost = $bc_shipping_cost + $item_shipping_cost;\n $item_shipping_cost = $item_shipping_cost * Session::get('amount_per_unit');\n $total_cost = $total_cost + $item_shipping_cost;\n $total_cost = round($total_cost, 2);\n $bc_shipping_cost = round($bc_shipping_cost, 2);\n }\n }\n\n Session::put('shipping_cost', $total_cost);\n Session::put('bc_shipping_cost', $bc_shipping_cost);\n return $total_cost;\n }" ]
[ "0.80463195", "0.80019915", "0.77802473", "0.7779485", "0.7773638", "0.7675617", "0.7573201", "0.74979675", "0.7482939", "0.7355568", "0.73028356", "0.7217026", "0.7177416", "0.7173878", "0.7169405", "0.714783", "0.70951885", "0.70906353", "0.7068993", "0.70382714", "0.70227474", "0.70133203", "0.7003796", "0.69711137", "0.69498754", "0.69279253", "0.6911183", "0.69003594", "0.687784", "0.68734723", "0.68313515", "0.6806256", "0.6805937", "0.68038344", "0.67833203", "0.6770627", "0.6767102", "0.6761355", "0.6746878", "0.67287236", "0.67255425", "0.67163855", "0.67147094", "0.6705852", "0.6699758", "0.6699349", "0.66820014", "0.6670182", "0.66693395", "0.66472614", "0.6646795", "0.66072756", "0.65993476", "0.6592232", "0.6583012", "0.6558476", "0.6541015", "0.6539497", "0.6523672", "0.6520317", "0.6511629", "0.648473", "0.6482321", "0.64588815", "0.6443401", "0.63919586", "0.6389313", "0.63873863", "0.6367993", "0.6362248", "0.63566965", "0.6326473", "0.63139105", "0.63021386", "0.62995", "0.629916", "0.6298776", "0.6278768", "0.62757874", "0.62713206", "0.6249495", "0.624072", "0.623052", "0.6229944", "0.6225943", "0.62203026", "0.6211637", "0.6205207", "0.6199708", "0.61990744", "0.6188637", "0.61773235", "0.6176703", "0.6176458", "0.61690086", "0.61627936", "0.6160368", "0.6150282", "0.6150282", "0.61449236" ]
0.7455559
9
Finds an order ID based on its order key.
public function get_order_id_by_order_key( $order_key ) { global $wpdb; return $wpdb->get_var( $wpdb->prepare( "SELECT order_id FROM {$wpdb->prefix}woocommerce_orders WHERE order_key = %s", $order_key ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findById($orderId);", "public static function get_order_id() {\n\t\tglobal $order;\n\n\t\tif ( is_a( $order, 'WC_Order' ) ) {\n\t\t\treturn $order->get_id();\n\t\t}\n\n\t\t$order_id = absint( filter_input( INPUT_GET, 'order_id', FILTER_SANITIZE_NUMBER_INT ) );\n\n\t\tif ( $order_id ) {\n\t\t\treturn $order_id;\n\t\t}\n\n\t\treturn null;\n\t}", "function getCustomerIDfromOrder($orderID)\n {\n $customerID = null;\n try\n {\n $stmt = $this->db->prepare(\"SELECT CustomerID\n FROM OrderTable\n WHERE OrderID=:orderID\");\n $stmt->bindParam(':orderID', $orderID);\n $stmt->execute();\n $id = $stmt->fetch(PDO::FETCH_ASSOC);\n if ($stmt->rowCount() > 0)\n {\n $customerID = $id['CustomerID'];\n return $customerID;\n }\n else\n {\n return false;\n }\n }\n\n catch(PDOException $e)\n {\n echo $e->getMessage();\n }\n }", "public function getOrdersId($key, $type) {\r\n\t\tif ($type == 'single') {\r\n\t\t\treturn $this->ordersId;\r\n\t\t} else if ($type == 'array') {\r\n\t\t\treturn $this->ordersId [$key];\r\n\t\t} else {\r\n\t\t\techo json_encode(array(\"success\" => false, \"message\" => \"Cannot Identifiy Type String Or Array:getOrdersId ?\"));\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "public function get_order_id() {\n $order_id = $this->order_id;\n return !!$order_id ? $order_id : 0;\n }", "protected function GetOrderID() {\n\treturn $this->Value('ID_Order');\n }", "public function getExtOrderIdByOrderId($orderId)\n {\n $connection = $this->getConnection();\n $tableName = $this->getMainTable();\n $table = $this->getTable($tableName);\n\n $select = $connection->select()\n ->from($table, OrderReferenceInterface::EXT_ORDER_ID)\n ->where('order_id = :order_id');\n\n $bind = [':order_id' => (string)$orderId];\n\n return $connection->fetchOne($select, $bind);\n }", "protected function findOrder($order_id)\n\t{\n\t\t$order = false;\n\t\tforeach($this->json_object->transactions as $transaction)\n\t\t{\n\t\t\tforeach($transaction->related_resources as $resource)\n\t\t\t{\n\t\t\t\tforeach($resource as $type => $resource_data)\n\t\t\t\t{\n\t\t\t\t\tif($type == 'order' && $resource_data->id == $order_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$order = $resource_data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($order === false)\n\t\t{\n\t\t\t$text = MainFactory::create('PayPalText');\n\t\t\tthrow new Exception($text->get_text('invalid_order_id'));\n\t\t}\n\t\treturn $order;\n\t}", "public function orderId(): int\n {\n return $this->order->id();\n }", "public function getIdByOrderId($orderId)\n {\n $connection = $this->getConnection();\n $tableName = $this->getMainTable();\n $table = $this->getTable($tableName);\n\n $select = $connection->select()\n ->from($table, OrderReferenceInterface::ENTITY_ID)\n ->where('order_id = :order_id');\n\n $bind = [':order_id' => (string)$orderId];\n\n return $connection->fetchOne($select, $bind);\n }", "protected function getOrderSessionKey($order_id)\n {\n return self::RAZORPAY_ORDER_ID . $order_id;\n }", "protected function getOrderByTransactionKey()\n {\n $trxId = $this->getTransactionKey();\n\n $this->transaction->load($trxId, 'txn_id');\n $order = $this->transaction->getOrder();\n\n if (!$order) {\n throw new \\Buckaroo\\Magento2\\Exception(__('There was no order found by transaction Id'));\n }\n\n return $order;\n }", "protected function OrderID() {\n\treturn $this->Value('ID_Order');\n }", "private function _getOrderId(): int\n {\n $orderId = 123456;\n\n return $orderId;\n }", "public function getID() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->orderId;\r\n\t}", "public function getIdByExtOrderId($extOrderId)\n {\n $connection = $this->getConnection();\n $tableName = $this->getMainTable();\n $table = $this->getTable($tableName);\n\n $select = $connection->select()\n ->from($table, OrderReferenceInterface::ENTITY_ID)\n ->where('ext_order_id = :ext_order_id');\n\n $bind = [':ext_order_id' => (string)$extOrderId];\n\n return $connection->fetchOne($select, $bind);\n }", "public function getExistingOrder($orderid = '') {\n $orderid = isset($orderid) ? $orderid : '';\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($orderid);\n\n // if no order found\n if (!$order->getId())\n return FALSE;\n else\n return $order;\n}", "public static function getOrderID($_cID) {\n global $lC_Database;\n\n $Qorder = $lC_Database->query('select orders_id from :table_orders where customers_id = :customers_id order by date_purchased desc limit 1');\n $Qorder->bindTable(':table_orders', TABLE_ORDERS);\n $Qorder->bindInt(':customers_id', $_cID);\n $Qorder->execute();\n \n $oID = $Qorder->valueInt('orders_id');\n\n $Qorder->freeResult();\n \n return $oID;\n }", "public static function getOrderIdByOrderNumber($orderNumber)\n {\n\n $db = JFactory::getDBO();\n $q = 'SELECT `virtuemart_order_id` FROM `#__virtuemart_orders` WHERE `order_number`=\"' . $db->escape($orderNumber) . '\"';\n $db->setQuery($q);\n $orderId = $db->loadResult();\n return $orderId;\n }", "private function getIdFromSpecialKey($key){\n\t\t$sql = \"SELECT id FROM member_info WHERE special_key = :specialKey\";\n\t\t$query = $this->db->pdo->prepare($sql);\n\t\t$query->bindValue(':specialKey', $key);\n\t\t$query->execute();\n\t\t$result = $query->fetch(PDO::FETCH_OBJ);\n\t\treturn $result->id;\n\t}", "protected function findTransactionId(OrderInterface $order) {\n $uri = $this->prepareFindRequestUri($order);\n $response = $this->httpClient->get($uri);\n if ($response->getStatusCode() == 200) {\n $data = Json::decode($response->getBody());\n if (!empty($data['response']['data'])) {\n $transaction_data = reset($data['response']['data']);\n return $transaction_data['Conversion']['id'];\n }\n }\n else {\n // TODO - logging request fail?.\n }\n return NULL;\n }", "function getOrderID($user_id, $order_date){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT `id`\n\t\t\t\t\t\t\t\t\t\tFROM `order`\n\t\t\t\t\t\t\t\t\t\tWHERE `user_id` = ? AND `order_date` = ?');\n\t\t$sth \t-> execute(array($user_id, $order_date));\n\t\treturn \t$sth;\n\t}", "public function getOrderId()\n {\n $identifier = $this->_order->identifier();\n return $identifier['id'];\n }", "public function getOrder(string $order_id): \\GDAX\\Types\\Response\\Authenticated\\Order;", "function getOrderId($orderName) \n {\n return (int)preg_replace(\"/[^0-9]/\", \"\", $orderName);\n }", "public function find(int $key);", "public function getOrderIdByExtOrderId($extOrderId)\n {\n $connection = $this->getConnection();\n $tableName = $this->getMainTable();\n $table = $this->getTable($tableName);\n\n $select = $connection->select()\n ->from($table, OrderReferenceInterface::ORDER_ID)\n ->where('ext_order_id = :ext_order_id');\n\n $bind = [':ext_order_id' => (string)$extOrderId];\n\n return $connection->fetchOne($select, $bind);\n }", "public function getOrderId($customer_id);", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderById($orderId)\n {\n }", "public function findKey($key)\n\t{\n\t\treturn $this->find($key)->key;\n\t}", "public function getId()\n {\n return $this->source['order_item_id'];\n }", "private function getOrder($orderoid){\n $rs = selectQuery('select * from WTSORDER where KOID=\"'.$orderoid.'\"');\n if ($rs->rowcount() == 1){\n $ors = $rs->fetch();\n foreach($ors as $k=>$v){\n\t$order->{$k} = $v;\n }\n } else {\n $order = null;\n XLogs::critical(get_class($this), 'Impossible de trouver la commande ayant pour KOID : '.$orderoid);\n }\n return $order;\n }", "protected function getItemIndex(OrderItemInterface $order_item) {\n $values = $this->get('order_items')->getValue();\n $order_item_ids = array_map(function ($value) {\n return $value['target_id'];\n }, $values);\n\n return array_search($order_item->id(), $order_item_ids);\n }", "public function getOrderid() {\n\t\treturn $this->orderid;\n\t}", "public function getCustomerOrderId();", "public function getIdKey();", "public function getOrderId();", "public function get_order_id( $context = 'view' ) {\n\t\treturn $this->get_prop( 'order_id', $context ) ;\n\t}", "function getOrderbyId($order_id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT *\n\t\t\t\t\t\t\t\t\t\tFROM `order`\n\t\t\t\t\t\t\t\t\t\tWHERE `id` = ? ');\n\t\t$sth \t-> execute(array($order_id));\n\t\treturn \t$sth;\n\t}", "public function getOrderId($order_id, $direction = 'DESC')\n {\n\n if ($direction == 'ASC') {\n $arrow = '>';\n } else {\n $arrow = '<';\n }\n\n $db = JFactory::getDBO();\n $q = 'SELECT `virtuemart_order_id` FROM `#__virtuemart_orders` WHERE `virtuemart_order_id`' . $arrow . (int)$order_id;\n $q .= ' ORDER BY `virtuemart_order_id` ' . $direction;\n $db->setQuery($q);\n\n if ($oderId = $db->loadResult()) {\n return $oderId;\n }\n return 0;\n }", "public function findFirstByKey($key);", "public function getOrderByID($order_id)\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.order_id = :order_id\nORDER BY orders.order_date;\nSQL\n );\n $order->execute(array(':order_id' => $order_id));\n return $order->fetch(\\PDO::FETCH_OBJ);\n }", "function _getSSOrderID($google_order_number){\r\n\t\t\r\n\t\t\t$dbq = 'SELECT orderID FROM ?#ORDERS_TABLE WHERE google_order_number=?';\r\n\t\t\t$dbr = db_phquery($dbq, $google_order_number);\r\n\t\t\tif(!db_num_rows($dbr['resource'])){\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tlist($order_id) = db_fetch_row($dbr);\r\n\t\t\treturn $order_id;\r\n\t}", "public static function getIdByKey($key)\n {\n return static::find()\n ->select('id')\n ->where(['key' => $key])\n ->scalar();\n }", "public function getOrderId()\n {\n return $this->source['order_id'];\n }", "public function sGetArticleIdByOrderNumber($ordernumber)\n {\n $checkForProduct = $this->db->fetchRow(\n 'SELECT articleID AS id FROM s_articles_details WHERE ordernumber=?',\n [$ordernumber]\n );\n\n if (isset($checkForProduct['id'])) {\n return $checkForProduct['id'];\n }\n\n return false;\n }", "public function getOrderId()\n {\n $value = $this->get(self::order_id);\n return $value === null ? (integer)$value : $value;\n }", "static public function getOrderById($order_id) {\n $order = DB::table('orders')->where('id', $order_id)->get();\n return $order;\n }", "public static function getByOrderId($orderId) {\n $result = db_query('\n SELECT instruction_id as id\n FROM `'.self::tableName.'` \n WHERE order_id = '.(int)$orderId\n )->fetchAll(\\PDO::FETCH_OBJ);\n if(!is_array($result))\n return NULL;\n return new Instruction($result[count($result)-1]->id);\n }", "function ticket_item_id(){\r\n\t\t$product_id = ( !empty($this->order_item['variation_id'])? $this->order_item['variation_id']: $this->order_item['product_id']);\r\n\r\n\t\t// get ticket IDS saved in order\r\n\t\t\t$ticket_ids = get_post_meta($this->order_id, '_tixids', true);\r\n\t\t\t$_code_mid = $this->order_id.'-'.$product_id;\r\n\r\n\t\t\t$ticket_item_id='';\r\n\t\t\t\r\n\t\t\tif(!is_array($ticket_ids)) return $ticket_item_id;\r\n\r\n\t\t\t//find ticket item id from saved ticket item ids in order meta\r\n\t\t\tforeach($ticket_ids as $__tid){\r\n\t\t\t\t$__tid_1 = explode(',', $__tid);\r\n\t\t\t\t\r\n\t\t\t\tif(strpos($__tid_1[0], $_code_mid)){\r\n\t\t\t\t\t$tt = explode('-', $__tid_1[0]);\t\t\t\t\t\r\n\t\t\t\t\t$ticket_item_id = $tt[0];\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\treturn $ticket_item_id;\r\n\t}", "function get_pk($key_id)\n\t{\n\t\t$key_id\t= $this->prepare_input($key_id, 42);\n\t\t$key\t= $this->call(\"{$this->context} --export $key_id\");\n\n\t\tif (false === $error = $this->get_error())\n\t\t{\n\t\t\treturn $key;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie($error);\n\t\t}\n\t}", "public function get_transaction_id_from_order_id ($order_id)\n\t{\n\t\t$query = tep_db_query(\"SELECT payment_id FROM \" . self::DB_PAYMENTS_TABLE . \" WHERE osc_order_id = '\".tep_db_input($order_id).\"'\");\n\t\t$row = tep_db_fetch_array($query);\n\n\t\treturn $row ? $row['payment_id'] : 0;\n\t}", "public function find ($key);", "private function getOrderById(int $orderId): OrderInterface\n {\n return $this->orderRepository->get($orderId);\n }", "public function findOrder($orderId){\r\n \t$query = $this->getDbTable()->select()\r\n \t->from(array('d' => 'detailorder'),array('*'))\r\n \t->join(array('e' => 'equipment'),'d.equipmentId = e.equipmentId',array('e.equipmentId', 'e.name', 'e.image', 'e.price', 'e.priceSale'))\r\n \t->where('d.orderId = ?', $orderId)\r\n \t->setIntegrityCheck(false);\r\n \r\n \t$resultRows = $this->getDbTable()->fetchAll($query);\r\n \tif(count($resultRows) == 0){\r\n \t\treturn 0;\r\n \t}\r\n \telse{\r\n \t\treturn $resultRows;\r\n \t}\r\n }", "public static function find($id, $key = 'id');", "public function getExtOrderId();", "function wcs_get_order_items_product_id( $item_id ) {\n\tglobal $wpdb;\n\n\t$product_id = $wpdb->get_var( $wpdb->prepare(\n\t\t\"SELECT meta_value FROM {$wpdb->prefix}woocommerce_order_itemmeta\n\t\t WHERE order_item_id = %d\n\t\t AND meta_key = '_product_id'\",\n\t\t$item_id\n\t) );\n\n\treturn $product_id;\n}", "public function getOrderIncrementId(){\n return $this->_getData(self::ORDER_INCREMENT_ID);\n }", "public function getOrderId(){\n return $this->_getData(self::ORDER_ID);\n }", "public function getSearchedId()\n {\n return $this->get(self::_SEARCHED_ID);\n }", "public function getOrderNumber();", "public function getOrderNumber();", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getOrderId()\n {\n return $this->order_id;\n }", "public static function getKey();", "public static function getKey();", "protected function _lookupCustomerId()\n {\n return $this->_customerFactory->create()\n ->loadByEmail($this->_quote->getCustomerEmail())\n ->getId();\n }", "public function getById($orderlineId);", "public function get_order( $order_id ) {\n\t\treturn $this->request( \"orders/{$order_id}\" );\n\t}", "static function getOrder(int $OrderID) {\r\n $sqlSelect = \"SELECT * FROM Orders WHERE OrderID = :OrderID\";\r\n //Query\r\n self::$db->query($sqlSelect);\r\n //Bind\r\n self::$db->bind(':OrderID', $OrderID);\r\n //Execute\r\n self::$db->execute();\r\n //Return\r\n return self::$db->singleResult();\r\n }", "public function getKey()\n {\n return $this->id;\n }", "public function getOrderId()\n {\n return $this->getParam('order-id', 'order');\n }", "function get_by_key() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_identification\n\t\t\t\tWHERE idf_id=?\";\n\t\t$this->db->query($sql, array($this->idf_id));\n\t\treturn $query;\n\t}", "public function testFindByOrderId(): void\n {\n $order_callback = OrderCallback::findByOrderId(9);\n $this->assertIsObject($order_callback);\n\n $this->assertObjectHasAttribute('errors', $order_callback);\n $this->assertObjectHasAttribute('id', $order_callback);\n $this->assertObjectHasAttribute('order_id', $order_callback);\n $this->assertObjectHasAttribute('callback_url', $order_callback);\n $this->assertObjectHasAttribute('is_callback_sent', $order_callback);\n }", "function findById($id)\n {\n $dataService = new OrderDataService();\n\n return $dataService->findById($id);\n }", "public function generateOrderID() { global $db;\n // Generate Order ID\n $db->query(\"INSERT INTO `order_ids` (foo) VALUES(:foo)\", array('foo' => true));\n return $db->lastInsertId();\n }", "public function getID(): int {\n\t\t\treturn intval( $this->getStrippedKey() );\n\t\t}", "static public function getOrderById($id) {\n $rq = \"SELECT * FROM \" . PREFIX . \"sales.`order` \n WHERE `id` =\" . $id . \" LIMIT 1;\";\n\n $aItem = Sql::Get($rq, 1);\n \n return $aItem[0];\n }", "public static function getCartIdFromOrderReference($orderReference)\n {\n if (preg_match('/cart([0-9]+)(try([0-9]+))?/', $orderReference, $matches)) {\n return (int)$matches[1];\n }\n\n return null;\n }", "public function checkIfOrderExist($orderId);", "private function getInvoiceOrderId() {\n $config = Svea\\SveaConfig::getDefaultConfig();\n $request = WebPay::createOrder($config)\n ->addOrderRow(TestUtil::createOrderRow())\n ->addCustomerDetails(WebPayItem::individualCustomer()->setNationalIdNumber(194605092222))\n ->setCountryCode(\"SE\")\n ->setCustomerReference(\"33\")\n ->setOrderDate(\"2012-12-12\")\n ->setCurrency(\"SEK\")\n ->useInvoicePayment()// returnerar InvoiceOrder object\n //->setPasswordBasedAuthorization(\"sverigetest\", \"sverigetest\", 79021)\n ->doRequest();\n\n return $request->sveaOrderId;\n }", "public function getordershipmentdatabyorderid($orderid){\n\t\t$this->db->where('OrdId', $orderid);\n\t\t$query=$this->db->get('tbl_order_shipment');\n\t\treturn $query->result();\n\t}", "public function getOrderId(): ?int\n {\n return $this->getParam(self::ORDER_ID);\n }", "public function getOneOrder($orderId) {\n\n $this->load->model('account/order');\n return $this->model_account_order->getOrder($orderId);\n }", "private function getDbTransactionsByOrderId($idOrder)\n {\n\n $query = 'SELECT * FROM ' . _DB_PREFIX_ . PayViaEpul::MODULE_NAME . '_transactions WHERE id_order = ' . pSQL($idOrder);\n $result = Db::getInstance()->executeS($query);\n\n if (!isset($result) || count($result) === 0 || !isset($result[0])) {\n return null;\n }\n\n return $result[0];\n }", "public function getOrderId(): string\n {\n return $this->getData(self::ORDER_ID);\n }", "public function returnFindByPK($id);", "function get_fresh_orderId(){\n \t$conn=new_db_connect();\n \t$query=\"select top 1 orderId from orderinfo ORDER BY orderId DESC\";\n \t$result=$conn->query($query);\n \tif($result){\n \t\t$result=$result->fetch_assoc();\n \t\t$conn->close();\n \t\treturn $result['orderId'];\n \t} else{\n \t\t$conn->close();\n \t\treturn 0;\n \t}\n }", "public function getKey()\n {\n return $this->getId();\n }", "private function getShippingKey()\n {\n $result = '';\n if ($this->getQuoteId() !== null) {\n try {\n $quote = $this->quoteRepository->get($this->getQuoteId(), ['*']);\n\n if ($quote->getShippingAddress() !== null\n && $quote->getShippingAddress()->getCustomerAddressId() !== null\n ) {\n $result = $this->keyCustomerAddress . $quote->getShippingAddress()->getCustomerAddressId();\n }\n } catch (NoSuchEntityException $e) {\n // If no such entity, skip\n }\n }\n return $result;\n }", "public function custid($ordn) {\n\t\t$q = $this->queryOrdernumber($ordn);\n\t\t$q->select(SoModel::aliasproperty('custid'));\n\t\treturn $q->findOne();\n\t}", "public function getOrderId()\n {\n return array_key_exists('OrderId', $this->data) ? $this->data['OrderId'] : null;\n }", "protected function getOrderItem()\n\t{\n\t\t$search = $this->object->createSearch();\n\n\t\t$expr = [];\n\t\t$expr[] = $search->compare( '==', 'order.base.rebate', 14.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.sitecode', 'unittest' );\n\t\t$expr[] = $search->compare( '==', 'order.base.price', 53.50 );\n\t\t$expr[] = $search->compare( '==', 'order.base.editor', $this->editor );\n\t\t$search->setConditions( $search->combine( '&&', $expr ) );\n\t\t$results = $this->object->searchItems( $search );\n\n\t\tif( ( $item = reset( $results ) ) === false ) {\n\t\t\tthrow new \\RuntimeException( 'No order found' );\n\t\t}\n\n\t\treturn $item;\n\t}" ]
[ "0.62854606", "0.6282295", "0.61924064", "0.61667967", "0.6154146", "0.61028945", "0.6093918", "0.60818785", "0.6077686", "0.6061905", "0.59744024", "0.59649515", "0.59232247", "0.5911671", "0.5907587", "0.5889618", "0.5881896", "0.58385384", "0.57953554", "0.57846344", "0.57465255", "0.5716649", "0.5707808", "0.57013863", "0.5701121", "0.56707376", "0.56689644", "0.56624454", "0.56467056", "0.56467056", "0.56467056", "0.56467056", "0.5641986", "0.564176", "0.5640685", "0.563474", "0.56244874", "0.56198704", "0.56089425", "0.5590012", "0.5585301", "0.5541966", "0.55416024", "0.55133057", "0.5491673", "0.5475199", "0.5475072", "0.54656976", "0.5455125", "0.545191", "0.5445052", "0.544337", "0.54378164", "0.54331017", "0.5426309", "0.53921926", "0.5363755", "0.5326292", "0.5302851", "0.5261281", "0.52487016", "0.52476215", "0.524683", "0.523797", "0.5236578", "0.52171695", "0.52171695", "0.52135694", "0.52135694", "0.52135694", "0.52135694", "0.51965284", "0.51965284", "0.51889294", "0.5185751", "0.5183057", "0.51830035", "0.5182229", "0.5175847", "0.5166689", "0.5160759", "0.5147543", "0.51452136", "0.5139117", "0.5135092", "0.51331544", "0.51287735", "0.512443", "0.51147187", "0.5087652", "0.5081078", "0.5079527", "0.507665", "0.5075862", "0.5074842", "0.5074431", "0.50732815", "0.5069325", "0.5061512", "0.5061052" ]
0.7677417
0
Return count of orders with a specific status.
public function get_order_count( $status ) { global $wpdb; return absint( $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type = 'shop_order' AND post_status = %s", $status ) ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function check_commission_status( $order, $status ) { \n\n\t\tglobal $wpdb; \n\n\t\t$table_name \t= $wpdb->prefix . \"pv_commission\";\n\n\t\t$order_id \t\t= $order[ 'order_id' ]; \n\t\t$vendor_id \t\t= $order[ 'vendor_id' ]; \n \t$product_id\t\t= $order[ 'product_id' ]; \n\n\t\t$query = \"SELECT count(order_id) AS order_count \n\t\t\t\t \tFROM {$table_name}\n\t\t\t\t \tWHERE order_id = {$order_id} \n\t\t\t\t \tAND vendor_id = {$vendor_id} \n\t\t\t\t \tAND product_id = {$product_id}\n\t\t\t\t \tAND status = %s\n\t\t\"; \n\n\t\treturn $wpdb->get_var( $wpdb->prepare( $query , $status ) ); \n\n\t}", "public function getCountByStatus($status = 'Approved')\n {\n return $this->appUser->where('status', $status)->count();\n }", "public function totalOrdersByStatus()\n {\n $ano = date('Y');\n $mes = date('m');\n $dia = date('d');\n $inicioMes = \"{$ano}-{$mes}-01 00:00:00\";\n\n $pedidos = Pedido\n ::selectRaw('status, marketplace, COUNT(*) as count')\n ->whereNotNull('status')\n ->where('status', '!=', 5)\n ->where('created_at', '>=', $inicioMes)\n ->groupBy('status')\n ->groupBy('marketplace')\n ->orderBy('status', 'ASC')\n ->orderBy('marketplace', 'ASC')\n ->get();\n\n /**\n * Organiza os marketplaces\n */\n $marketplaces = [];\n foreach ($pedidos as $pedido) {\n if (!in_array(strtoupper($pedido->marketplace), $marketplaces)) {\n $marketplaces[] = strtoupper($pedido->marketplace);\n }\n }\n\n /**\n * Status possíveis\n */\n $status = \\Config::get('core.pedido_status');\n\n /**\n * Prepara a lista para quando não existir preenche corretamente com 0\n */\n $list = [];\n foreach ($status as $state) {\n foreach ($marketplaces as $marketplace) {\n $list[strtolower($state)][] = 0;\n }\n }\n\n /**\n * Organiza os dados pra mostrar no gráfico\n */\n foreach ($pedidos as $pedido) {\n $list[strtolower($status[$pedido->status])][array_search(strtoupper($pedido->marketplace), $marketplaces)] = $pedido->count;\n }\n\n /**\n * Altera o nome do marketplace\n */\n if ($index = array_search('MERCADOLIVRE', $marketplaces)) {\n $marketplaces[$index] = 'M.LIVRE';\n }\n\n $list['marketplaces'] = $marketplaces;\n\n return $this->listResponse($list);\n }", "public function getTotalxStatus($status)\n\t{\n\t\treturn count($this->findAllBySql('select tbl_orden_id,look_id from tbl_orden left join tbl_orden_has_productotallacolor on tbl_orden.id = tbl_orden_has_productotallacolor.tbl_orden_id where estado = :status AND look_id != 0 group by tbl_orden_id, look_id;',\n\t\t\tarray(':status'=>$status)));\n\t\t\n\t\t\n\t}", "public function count($class = null, $status = null)\n {\n return count($this->results($class, $status));\n }", "function getStatusCount($status) {\n\t\t// must be implemented by sub-classes\n\t\tassert(false);\n\t}", "function statuses() {\n //return parent::statusesWithCount( self::tableName(), self::arrayStatuses() );\n\n global $wpdb;\n\n $table_name = self::tableName();\n $statuses = self::arrayStatuses();\n $field_name = 'status';\n /*\n * @ToDo Decommentare qui se non vogliamo i conteggi dinamici in base al filtro\n * @ToDo La query è molto onerosa\n *\n *\n */\n $table_orders = BNMExtendsOrders::tableName();\n $sql = <<< SQL\n SELECT DISTINCT( {$table_orders}.{$field_name} ),\n COUNT(*) AS count\n FROM `{$table_name}`\n LEFT JOIN `{$table_orders}`\n ON {$table_orders}.id = {$table_name}.id_order\n GROUP BY {$table_orders}.{$field_name}\nSQL;\n\n\n\n $result = $wpdb->get_results( $sql, ARRAY_A );\n\n foreach ( $result as $status ) {\n if ( !empty( $status['status'] ) ) {\n $statuses[$status['status']]['count'] = $status['count'];\n }\n }\n\n $statuses['all']['count'] = self::count( $table_name );\n\n return $statuses;\n }", "public static function count_commission_by_order( $order_id )\n\t{\n\t\tglobal $wpdb;\n\t\t$table_name = $wpdb->prefix . \"pv_commission\";\n\n\t\tif ( is_array( $order_id ) )\n\t\t\t$order_id = implode( ',', $order_id );\n\n\t\t$query = \"SELECT COUNT(order_id) AS order_count\n\t\t\t\t FROM {$table_name}\n\t\t\t\t WHERE order_id IN ($order_id)\n\t\t\t\t AND status <> %s\";\n\t\t$count = $wpdb->get_var( $wpdb->prepare( $query, 'reversed' ) );\n\n\t\treturn $count;\n\t}", "public function getPendingOrders($status) {\r\n if($status != \"all\"):\r\n $orders = Mage::getModel('marketplace/commission')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('seller_id', Mage::getSingleton('customer/session')->getCustomer()->getId());\r\n $orders ->getSelect()\r\n ->columns('SUM(seller_amount) as seller_amount')\r\n ->group('order_id'); \r\n /**\r\n * Set order for manage order\r\n */\r\n $orders->setOrder('order_id', 'desc');\r\n /**\r\n * Return orders\r\n */\r\n $condition = new Zend_Db_Expr(\"sales.entity_id = main_table.order_id AND sales.status = '$status'\");\r\n $orders->getSelect()->join(array('sales' => $orders->getTable('sales/order')),\r\n $condition,\r\n array('status' => 'sales.status'));\r\n elseif($status == \"all\"):\r\n $orders = Mage::getModel('marketplace/commission')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('seller_id', Mage::getSingleton('customer/session')->getCustomer()->getId());\r\n $orders ->getSelect()\r\n ->columns('SUM(seller_amount) as seller_amount')\r\n ->group('order_id'); \r\n /**\r\n * Set order for manage order\r\n */\r\n $orders->setOrder('order_id', 'desc');\r\n /**\r\n * Return orders\r\n */\r\n endif;\r\n return $orders; \r\n }", "function PKG_countJobsWithStatus($client, $package, $status)\n{\n\tCHECK_FW(CC_clientname, $client, CC_package, $package, CC_jobstatus, $status);\n\t$sql = \"SELECT COUNT(*) FROM `clientjobs` WHERE `client` = '$client' AND ( `package` = '$package' OR `normalPackage` = '$package' ) AND `status` = '$status'\";\n\n\t$result = db_query($sql); //FW ok\n\t$line = mysql_fetch_row($result);\n\treturn($line[0]);\n}", "public function getOrderStatuses()\n {\n $response = $this->client->request('GET', '/v1/settings/orderstatuses');\n return new GetOrderStatusesResponse($response);\n }", "public function getCountByStatus(string|array $status, Client $client = null): int\n {\n $qb = $this->createQueryBuilder('i');\n\n $qb->select('COUNT(i)');\n\n if (is_array($status)) {\n $qb->add('where', $qb->expr()->in('i.status', ':status'));\n } else {\n $qb->where('i.status = :status');\n }\n\n $qb->setParameter('status', $status);\n\n if ($client instanceof Client) {\n $qb->andWhere('i.client = :client')\n ->setParameter('client', $client->getId(), UuidBinaryOrderedTimeType::NAME);\n }\n\n $query = $qb->getQuery();\n\n try {\n return (int) $query->getSingleScalarResult();\n } catch (NoResultException | NonUniqueResultException) {\n return 0;\n }\n }", "public function totalStatusLeadDiscussions($status)\n {\n return Lead::where('status', $status)->count();\n }", "function getStatusCount($journalId, $status = null) {\n\t\t$params = array((int) $journalId);\n\t\tif ($status !== null) $params[] = (int) $status;\n\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT\tCOUNT(*)\n\t\t\tFROM\tsubscriptions s,\n\t\t\t\tsubscription_types st\n\t\t\tWHERE\ts.type_id = st.type_id AND\n\t\t\t\tst.institutional = 1 AND\n\t\t\t\ts.journal_id = ?\n\t\t\t' . ($status !== null?' AND s.status = ?':''),\n\t\t\t$params\n\t\t);\n\n\t\t$returner = isset($result->fields[0]) ? $result->fields[0] : 0;\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $returner;\n\t}", "public function get_order_status()\n\t{\n\t\t//retrieve all orders\n\t\t$this->db->from('order_status');\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('order_status_name');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "public function getListOrderStatus(){\n\n return $this->client->makeRequest('orderstatus', 'GET');\n }", "public function getTotalClosedBatches($status = \"\") {\n\t\tif ($status != \"N\") {\n\t\t\t$query = Doctrine_Query::create() -> select(\"count(*) as Total_Batches\") -> from(\"Transaction_Batch\") -> where(\"Status = '$status'\");\n\t\t} else {\n\t\t\t$query = Doctrine_Query::create() -> select(\"count(*) as Total_Batches\") -> from(\"Transaction_Batch\");\n\t\t}\n\t\t$total = $query -> execute();\n\t\treturn $total[0]['Total_Batches'];\n\t}", "public function updateOrderStatus($orders = 0, $order_id = 0, $order_status = 0)\n {\n $total = 1;\n if (empty($orders)) {\n $orders = array();\n\n $orderslist = vRequest::getVar('orders', array());\n $total = 0;\n // Get the list of orders in post to update\n foreach ($orderslist as $key => $order) {\n if ($orderslist[$key]['order_status'] !== $orderslist[$key]['current_order_status']) {\n $orders[$key] = $orderslist[$key];\n $total++;\n }\n }\n }\n\n if (!is_array($orders)) {\n $orders = array($orders);\n }\n\n /* Process the orders to update */\n $updated = 0;\n $error = 0;\n if ($orders) {\n // $notify = vRequest::getVar('customer_notified', array()); // ???\n // $comments = vRequest::getVar('comments', array()); // ???\n foreach ($orders as $virtuemart_order_id => $order) {\n if ($order_id > 0) $virtuemart_order_id = $order_id;\n $this->useDefaultEmailOrderStatus = false;\n if ($this->updateStatusForOneOrder($virtuemart_order_id, $order, true)) {\n $updated++;\n } else {\n $error++;\n }\n }\n }\n $result = array('updated' => $updated, 'error' => $error, 'total' => $total);\n return $result;\n }", "public function getAllStatus()\n {\n return OrderStatus::all();\n }", "public function getAllByStatus(string $status) : array\n {\n $orders = $this->em->getRepository(OrderEntity::class)->findBy([\n 'status' => $status\n ]);\n \n return $orders;\n }", "public function getRecordsCount($type, $status = '')\r\r\n {\r\r\n $count = 0;\r\r\n if ($type == 'online') {\r\r\n $count = PaymentMethod::where('is_online', '=', 1)->count();\r\r\n // if($status=='')\r\r\n // $count = PaymentMethod::where('is_online', '=', 1)->count();\r\r\n // else\r\r\n // {\r\r\n // $count = Payment::where('payment_gateway', '!=', 'offline')\r\r\n // ->where('payment_status', '=', $status)\r\r\n // ->count();\r\r\n // }\r\r\n } else if ($type == 'offline') {\r\r\n $count = PaymentMethod::where('is_online', '=', '0')->count();\r\r\n /* if($status=='')\r\r\n $count = PaymentMethod::where('is_online', '=', '0')->count();\r\r\n else\r\r\n {\r\r\n $count = Payment::where('payment_gateway', '=', 'offline')\r\r\n ->where('payment_status', '=', $status)\r\r\n ->count();\r\r\n } */\r\r\n }\r\r\n return $count;\r\r\n }", "function carton_processing_order_count() {\n\tif ( false === ( $order_count = get_transient( 'carton_processing_order_count' ) ) ) {\n\t\t$order_statuses = get_terms( 'shop_order_status' );\n\t $order_count = false;\n\t foreach ( $order_statuses as $status ) {\n\t if( $status->slug === 'processing' ) {\n\t $order_count += $status->count;\n\t break;\n\t }\n\t }\n\t $order_count = apply_filters( 'carton_admin_menu_count', intval( $order_count ) );\n\t\tset_transient( 'carton_processing_order_count', $order_count );\n\t}\n\n\treturn $order_count;\n}", "public static function count_status($id, $status)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$column = strtolower($status . \"_count\");\n\t\t\t$count = DB::table('devices')\n\t\t\t\t->where('id', '=', $id)\n\t\t\t\t->only($column);\n\n\t\t\t$count += 1;\n\n\t\t\t$success = DB::table('devices')\n\t\t\t\t->where('id', '=', $id)\n\t\t\t\t->update( array(\n\t\t\t\t\t$column => $count\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn $success;\n\t\t}\n\n\t\tcatch( Exception $e)\n\t\t{\n\t\t\tLog::write('error', $e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function getOrderByStatus($status = '')\n {\n $arr_data = [];\n switch ($status) {\n case 'reserved':\n $arr_data = PaymentStatus::RESERVED;\n break;\n case 'booking':\n $arr_data = PaymentStatus::BOOKING;\n break;\n case 'dp':\n $arr_data = PaymentStatus::DP;\n break;\n case 'cash-bertahap':\n $arr_data = PaymentStatus::CASH_BERTAHAP;\n break;\n default:\n break;\n }\n $having = [];\n foreach($arr_data as $id){\n array_push($having, \"SUM(payment_status_id = $id)\");\n }\n array_push($having, \"NOT SUM(payment_status_id NOT IN (\".join(\",\", $arr_data).\"))\");\n $having = join(\" AND \", $having);\n // dd($having);\n $orderId = DB::table('payment_histories')->select('order_id')\n ->groupBy(['order_id'])\n ->havingRaw($having)\n ->get()->pluck('order_id')->toArray();\n \n return $orderId;\n }", "public static function getCountret($model,$status)\n { \n $sql = \"SELECT COUNT(*) FROM $model WHERE status='$status'\";\n $count = Yii::app()->db->createCommand($sql)->queryScalar();\n return $count; \n }", "function getordersby($status,$s=false,$e=false)\r\n\t{\r\n\t\tif($s)\r\n\t\t{\r\n\t\t\t$s=strtotime($s);\r\n\t\t\t$e=strtotime($e);\r\n\t\t}\r\n\t\t\r\n\t\t$cond = '';\r\n\t\tif($s)\r\n\t\t\t$cond.=\"\tand o.time between ? and ?\";\r\n\t\t\t\r\n\t\treturn $this->db->query(\"select count(*) as total,is_pnh,ifnull((partner_id/partner_id),0) as is_partner \r\n\t\t\t\tfrom king_transactions a \r\n\t\t\t\tjoin king_orders b on a.transid = b.transid \r\n\t\t\t\twhere b.status = 0 $cond \r\n\t\t\t\tgroup by is_pnh,is_partner \",array($s,$e))->result_array();\r\n\t}", "public function all_ActiveOrdersCount_get() {\n $result = $this->feeds_model->all_ActiveOrdersCount();\n return $this->response($result);\n }", "public static function getCountrettindakan($model,$status)\n { \n $act = '0'; \n $sql = \"SELECT COUNT(*) FROM $model WHERE status='$status' AND c_action='$act'\";\n $count = Yii::app()->db->createCommand($sql)->queryScalar();\n return $count; \n }", "public function get_order_statuses( $order ) {\n\n\t\tif ( is_numeric( $order ) ) {\n\t\t\t$order = wc_get_order( $order );\n\t\t}\n\n\t\t$statuses = get_post_meta( SV_WC_Order_Compatibility::get_prop( $order, 'id' ), '_wc_avatax_status' );\n\n\t\tif ( ! $statuses ) {\n\t\t\t$statuses = array();\n\t\t}\n\n\t\treturn $statuses;\n\t}", "function PKG_countJobs($client,$status)\n{\n\tCHECK_FW(CC_clientname, $client);\n\tif (!empty($status))\n\t{\n\t\tCHECK_FW(CC_jobstatus, $status);\n\t\t$add = \" AND status='$status'\";\n\t}\n\n\t$sql = \"SELECT count(*) FROM `clientjobs` WHERE client='$client'$add;\";\n\t$result = DB_query($sql); //FW ok\n\t$line = mysql_fetch_row($result);\n\treturn($line[0]);\n}", "public static function fetch_order_status() {\n $order_id = wc_get_order( $_POST['order_id'] );\n $order_key = OmisePluginHelperWcOrder::get_order_key_by_id( $order_id );\n\n if ( ! wp_verify_nonce( $_POST['nonce'], $order_key ) ) {\n die ( 'Busted!');\n }\n\n wp_send_json_success( array( 'order_status' => $order_id->get_status() ) );\n }", "public function getTotalOrdersMo()\n\t{\n\t\t$query = $this->db->query(\"SELECT COUNT(oc_po_product.id) as total_orders FROM oc_po_order \nLEFT JOIN oc_po_product \nON(oc_po_order.id = oc_po_product.order_id)\nWHERE oc_po_order.user_id='103' AND oc_po_product.item_status <> 0\");\n\t\t$results = $query->row;\n\t\treturn $results['total_orders'];\n\t}", "public function getTotalOrdersWs()\n\t{\n\t\t$query = $this->db->query(\"SELECT COUNT(id) as total_orders FROM oc_po_order WHERE delete_bit = \" . 1);\n\t\t$results = $query->row;\n\t\treturn $results['total_orders'];\n\t}", "public function getCountOfRequestByStatus(array $period);", "public function getUserOrderCounts() {\n\n $this->load->model('account/order');\n $count = $this->model_account_order->getTotalOrders();\n\n return $count;\n }", "public static function getProjectsCountByStatus()\n {\n return self::join('projects', 'projects.status_id', '=', 'statuses.id')\n ->where(function ($q) {\n $q->where('projects.deleted_at', null);\n $user = Auth::user();\n if ($user->hasRole('client')) {\n $q->where('projects.client_id', $user->id);\n }\n })\n ->groupBy('statuses.id')\n ->get(\n ['statuses.id','statuses.title','statuses.slug', DB::raw('count(projects.id) as count')]\n );\n }", "public function countByDate($start, $end, $status) {\n $subscriptions = Subscriptions::query()\n ->whereHas('status', function($query) use ($status) {\n $query->where('status', '=', $status);\n })\n ->where('status_change', '>=', $start)\n ->where('status_change', '<=', $end)->count();\n \n return $subscriptions;\n }", "private function getOrderStatus($orderId)\n {\n return $this->db->fetchOne(\n 'SELECT status FROM s_order WHERE id= :orderId;',\n [':orderId' => $orderId]\n );\n }", "function statusesWithCount( $table_name, $statuses, $field_name = 'status' ) {\n global $wpdb;\n\n $sql = <<< SQL\nSELECT DISTINCT( `{$field_name}` ),\n COUNT(*) AS count\nFROM `{$table_name}`\nGROUP BY `{$field_name}`\nSQL;\n $result = $wpdb->get_results( $sql, ARRAY_A );\n\n foreach ( $result as $status ) {\n if ( !empty( $status['status'] ) ) {\n $statuses[$status['status']]['count'] = $status['count'];\n }\n }\n\n $statuses['all']['count'] = self::count( $table_name );\n\n return $statuses;\n }", "public function getIssueCountByOwner($status='open')\n {\n switch ($status) {\n case 'open':\n $tags = implode(',', $this->getTagIdsByStatus('open'));\n break;\n case 'closed':\n default:\n $tags = implode(',', $this->getTagIdsByStatus('closed'));\n break;\n }\n $sqlIssueTable = Pluf::factory('IDF_Issue')->getSqlTable();\n $query = \"SELECT uid AS id,COUNT(uid) AS nb\nFROM (\n SELECT COALESCE(owner, -1) AS uid\n FROM $sqlIssueTable\n WHERE status IN ($tags)\n ) AS ff\nGROUP BY uid\";\n\n $db = Pluf::db();\n $dbData = $db->select($query);\n $ownerStatistics = array();\n foreach ($dbData as $k => $v) {\n $key = ($v['id'] === '-1') ? null : $v['id'];\n $ownerStatistics[$key] = (int)$v['nb'];\n }\n\n arsort($ownerStatistics);\n\n return $ownerStatistics;\n }", "public function getOrderCount()\n {\n return $this->count(self::order);\n }", "private function _countOrders($year, $month)\n {\n return Purchase::whereYear('created_at', $year)\n ->whereMonth('created_at', $month)\n ->get();\n }", "function get_status_count(){\n global $db_db;\n $query = \"SELECT * FROM users WHERE status = :status\";\n $statement = $db_db->prepare($query);\n $statement->bindValue(':status', 'F');\n $statement->execute();\n $results = $statement->rowcount();\n $statement->closeCursor();\n return $results;\n }", "protected function getOrderCount()\n {\n $customer = $this->customerSession->getCustomer();\n if($customer->getId())\n {\n $orders = $this->orderCollectionFactory->create()->addFieldToSelect(\n '*'\n )->addFieldToFilter(\n 'customer_id',\n $customer->getId()\n )->setOrder(\n 'created_at',\n 'desc'\n );\n return count($orders);\n }\n return 0;\n }", "function preorder_count()\n\t{\n\t\t$active = 0;\n\t\t$completed = 0;\n\n\t\twhile (list($a,$arr) = each($this->preorders))\n\t\t{\n\t\t\tif ($arr['pre_status'] == PRE_ACTIVE) { $active++; }\n\t\t\telseif ($arr['pre_status'] == PRE_COMPLETED) { $completed++; }\n\t\t}\n\t\treset($this->preorders);\n\n\t\treturn array($active,$completed);\n\t}", "public function getLookxStatus($status)\n\t{\n\t\treturn count($this->findAllBySql('select tbl_orden_id,look_id from tbl_orden left join tbl_orden_has_productotallacolor on tbl_orden.id = tbl_orden_has_productotallacolor.tbl_orden_id where estado = :status AND look_id = :look_id group by tbl_orden_id, look_id;',\n\t\t\tarray(':status'=>$status,':look_id'=>$this->id)));\n\t\t\n\t\t\n\t}", "public function countOrder(): int;", "public function inbox_total($id, $status)\n {\n $this->db->where('inboxnUsuarioRecibeId', $id);\n $this->db->where('inboxnStatus', $status);\n $query = $this->db->count_all_results('inboxn');\n return $query;\n }", "public function getTotalOrdersAmRcv()\n\t{\n $log=new Log(\"AM_RCV_TOTAL:\".date('Y-m-d').\".log\");\n $log->write(\"SELECT COUNT(id) as total_orders FROM oc_po_order WHERE delete_bit = '1' and order_status = \" . 2);\n $query = $this->db->query(\"SELECT COUNT(id) as total_orders FROM oc_po_order WHERE delete_bit = '1' and order_status = \" . 2);\n $results = $query->row;\n return $results['total_orders'];\n\t}", "public function getTotalSystemBatches($status = \"\") {\n\t\tif ($status != \"N\") {\n\t\t\t$query = Doctrine_Query::create() -> select(\"count(*) as Total_Batches\") -> from(\"Transaction_Batch\") -> where(\"Status = '$status'\");\n\t\t} else {\n\t\t\t$query = Doctrine_Query::create() -> select(\"count(*) as Total_Batches\") -> from(\"Transaction_Batch\");\n\t\t}\n\t\t$total = $query -> execute();\n\t\treturn $total[0]['Total_Batches'];\n\t}", "protected function totalOrders($all = false) {\n if (!$all) {\n return $this->shipsList->where('status_id', 1)->count();\n }\n\n return $this->shipsList->count();\n }", "public function display_order_to_approve_count_for_client(){\n // if(env(\"DB_CONNECTION\") == \"pgsql\"){\n // $getOrderToApproveCount = DB::select('SELECT COUNT(*) as data FROM orders WHERE is_approved = \"0\" AND client_id = \"'.Auth::user()->id.'\" ');\n // }else{\n // $getOrderToApproveCount = DB::select('SELECT COUNT(*) as data FROM orders WHERE is_approved = 0 AND client_id = \"'.Auth::user()->id.'\" ');\n // }\n\n $getOrderToApproveCount = Order::join('order_invoice', ['orders.invoice_id' => 'order_invoice.id'])\n ->where('is_approved',0)\n ->where('client_id', Auth::user()->id)\n ->groupBy('orders.invoice_id') \n ->get()\n ->count();\n \n return response()->json([\n 'count' => $getOrderToApproveCount,\n 'status' => 200\n ]);\n }", "public function display_order_to_approve_count(){\n // if(env(\"DB_CONNECTION\") == \"pgsql\"){\n // $getOrderToApproveCount = DB::select(\"SELECT COUNT(*) as data FROM orders WHERE is_approved = '0'\");\n // }else{\n // $getOrderToApproveCount = DB::select('SELECT COUNT(*) as data FROM orders WHERE is_approved = 0');\n // }\n \n // return response()->json([\n // 'count' => $getOrderToApproveCount[0],\n // 'status' => 200\n // ]);\n $getOrderToApproveCount = Order::join('order_invoice', ['orders.invoice_id' => 'order_invoice.id'])\n ->where('is_approved',0)\n ->groupBy('orders.invoice_id') \n ->get()\n ->count();\n\n return response()->json([\n 'count' => $getOrderToApproveCount,\n 'status' => 200\n ]);\n }", "public static function status($status) {}", "public function getTotalOrdersAm()\n\t{\n\t\t$query = $this->db->query(\"SELECT COUNT(id) as total_orders FROM oc_po_order WHERE delete_bit = \" . 1);\n\t\t$results = $query->row;\n\t\treturn $results['total_orders'];\n\t}", "public function getPorEnviar()\n\t{\n\t\t\n\t\treturn $this->countByAttributes(array(),'status = :status ',\n \t\tarray(':status'=>0)\n\t\t\t);\n\t}", "public function getOrderTrackingCount()\n {\n return $this->count(self::order_tracking);\n }", "public function add_status( $order, $status ) {\n\n\t\tif ( is_numeric( $order ) ) {\n\t\t\t$order = wc_get_order( $order );\n\t\t}\n\n\t\t// Add the status if it doesn't already exist\n\t\tif ( ! $this->order_has_status( $order, $status ) ) {\n\t\t\treturn add_post_meta( SV_WC_Order_Compatibility::get_prop( $order, 'id' ), '_wc_avatax_status', $status );\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getOrderStatus()\n {\n return $this->status;\n }", "function countByStatus(int $staus): int\n {\n return 0;\n }", "public function getOrderStatus(){\n return $this->_getData(self::ORDER_STATUS);\n }", "public function index($status)\n { \n $orders = Order::with('orderproducts')->where('user_id', auth()->user()->id)->where('status', $status)->get();\n\n foreach ($orders as $order) {\n $orderproducts = $order->orderproducts;\n if($orderproducts != null && !empty($orderproducts)) {\n $total = $orderproducts->reduce(function ($sum, $product) {\n return $sum += ($product->price * $product->quantity);\n }, 0);\n }\n }\n return view($status == 'Cart' ? 'cart' : 'orderHistory', compact('orderproducts','total','orders'));\n }", "public function getOrdersCount ( \\Maven\\Core\\Domain\\OrderFilter $filter ) {\n\t\t//\tthrow new \\Maven\\Exceptions\\MissingParameterException( \"Plugin Key is required\" );\n\n\t\treturn $this->mapper->getOrdersCount( $filter );\n\t}", "public function getOrdersCount() {\n return $this->getTable()->getOrdersCount();\n }", "public function getNotificationCount($byStatus = array()) {\n if (empty($byStatus)) {\n $count = $this->notifications->count();\n foreach ($this->ownedProjects as $project) {\n $count += $project->getNotifications()->count();\n }\n return $count;\n }\n\n // number of notifications matching a status in argument array\n $count = 0;\n foreach ($this->notifications as $notification) {\n if (in_array($notification->getStatus(), $byStatus)) { $count ++; }\n }\n foreach ($this->ownedProjects as $project) {\n foreach ($project->getNotifications() as $notification) {\n if (in_array($notification->getStatus(), $byStatus)) { $count ++; }\n }\n }\n foreach ($this->sponsorOrganisations as $organisation) {\n foreach ($organisation->getNotifications() as $notification) {\n if (in_array($notification->getStatus(), $byStatus)) { $count ++; }\n }\n }\n return $count;\n }", "public function getNumOfOrdersInBasket() {\n\n $basketUser = $this->getBasketUserFromAuth();\n\n $result = 0;\n if ($basketUser != null) {\n $basketDetailModel = new Application_Model_BasketDetail();\n\n\n $result = $basketDetailModel->getNumOfOrdersInBasket($basketUser);\n }\n\n return $result;\n }", "public function getOrdersCount() {\n\t\t$summary = $this->getMarketSummary();\n\n\t\treturn [ 'BUY' => $summary['OpenBuyOrders'], 'SELL' => $summary['OpenSellOrders'] ];\n\n\t}", "public function getPorAprovar()\n\t{\n\t\t\n\t\treturn $this->countByAttributes(array(),'status = :status ',\n \t\tarray(':status'=>1)\n\t\t\t);\n\t}", "function store_order_status(Order $order)\n {\n if ($order->order_completed_date) {\n $statuses = ee()->store->orders->order_statuses();\n $style = isset($statuses[$order->order_status_name]) ? 'color:'.$statuses[$order->order_status_name]->color : '';\n\n return '<span style=\"'.$style.'\">'.store_order_status_name($order->order_status_name).'</span>';\n } else {\n return '<span class=\"store_order_status_incomplete\">'.lang('store.incomplete').'</span>';\n }\n }", "public function count_clients_with_contracts_in_progress_status()\n {\n $this->assertEquals(\n self::$contract->count_clients_in_progress_contracts(self::$contract->client_id),\n Contract::where('client_id', self::$contract->client_id)->where('contract_status_id', 2)->count()\n );\n }", "public function sum_total_due_for_order( $order_id, $status = 'due' )\n\t{\n\t\tglobal $wpdb;\n\n\t\t$table_name = $wpdb->prefix . \"pv_commission\";\n\t\t$query = \"SELECT `id`, `total_due`, `total_shipping`, `tax`, `vendor_id`\n\t\t\t\t\t FROM `{$table_name}`\n\t\t\t\t\t WHERE `order_id` = %d\n\t\t\t\t\t AND `status` = %s\";\n\n\t\t$results = $wpdb->get_results( $wpdb->prepare( $query, $order_id, 'due' ) );\n\n\t\tforeach ( $results as $commission ) {\n\t\t\t$commission_ids[ ] = $commission->id;\n\n\t\t\t$pay[ $commission->vendor_id ] = !empty( $pay[ $commission->vendor_id ] )\n\t\t\t\t? ( $pay[ $commission->vendor_id ] + ( $commission->total_due + $commission->total_shipping + $commission->tax ) )\n\t\t\t\t: ( $commission->total_due + $commission->total_shipping + $commission->tax );\n\t\t}\n\n\t\t$return = array(\n\t\t\t'vendors' => $pay,\n\t\t\t'ids' => $commission_ids,\n\t\t);\n\n\t\treturn $return; \n\t}", "public function status($status = 'open')\n {\n switch ($status)\n {\n case 'expired':\n $this->layout->set('quotes', $this->mdl_quotes->is_expired()->paginate()->result());\n break;\n case 'invoiced':\n $this->layout->set('quotes', $this->mdl_quotes->is_invoiced()->paginate()->result());\n $this->layout->set('show_invoice_column', TRUE);\n break;\n default:\n $this->layout->set('quotes', $this->mdl_quotes->is_open()->paginate()->result());\n break;\n }\n\n $this->layout->buffer('content', 'quotes/index');\n $this->layout->render();\n }", "private function get_num_total_orders()\n\t{\n\t\treturn wp_count_posts('order_paysera')->publish;\n\t}", "public static function get_notes_count( $type = array(), $status = array() ) {\n\t\t$data_store = \\WC_Data_Store::load( 'admin-note' );\n\t\treturn $data_store->get_notes_count( $type, $status );\n\t}", "public function findByStatus($status)\n {\n return $this\n ->createModel()\n ->newQuery()\n ->where('status',$this->getStatusCodeByName($status))\n ->get();\n }", "public function execute($productId, $orderStatus)\n {\n if ($productId) {\n $orderItemTable = $this->resourceConnection->getTableName('sales_order_item');\n $select = $this->resourceConnection->getConnection()\n ->select()\n ->from(['order_item_table' => $orderItemTable], ['qty' => 'sum(qty_ordered)'])\n ->where('product_id = ?', $productId);\n if ($orderStatus) {\n $orderTable = $this->resourceConnection->getTableName('sales_order');\n $select->join(\n ['order_table' => $orderTable],\n 'order_item_table.order_id = order_table.entity_id',\n []\n )->where('order_table.status = ?', $orderStatus);\n }\n\n return $this->resourceConnection->getConnection()->fetchOne($select);\n }\n\n return 0;\n }", "public function getIssueCountByStatus($status='open', $label=null, $ids=array())\n {\n switch ($status) {\n case 'open':\n $key = 'labels_issue_open';\n $default = IDF_Form_IssueTrackingConf::init_open;\n break;\n case 'closed':\n default:\n $key = 'labels_issue_closed';\n $default = IDF_Form_IssueTrackingConf::init_closed;\n break;\n }\n $tags = array();\n foreach ($this->getTagsFromConfig($key, $default, 'Status') as $tag) {\n $tags[] = (int)$tag->id;\n }\n if (count($tags) == 0) return array();\n $sql = new Pluf_SQL(sprintf('project=%%s AND status IN (%s)', implode(', ', $tags)), array($this->id));\n if (!is_null($label)) {\n $sql2 = new Pluf_SQL('idf_tag_id=%s', array($label->id));\n $sql->SAnd($sql2);\n }\n if (count($ids) > 0) {\n $sql2 = new Pluf_SQL(sprintf('id IN (%s)', implode(', ', $ids)));\n $sql->SAnd($sql2);\n }\n $params = array('filter' => $sql->gen());\n if (!is_null($label)) { $params['view'] = 'join_tags'; }\n $gissue = new IDF_Issue();\n return $gissue->getCount($params);\n }", "public function getOrderIdCount()\n {\n return $this->count(self::order_id);\n }", "public function deleteStatus()\n {\n $order_status = new OrderState((int)ConfPPM::getConf('status_paysto'));\n if (Validate::isLoadedObject($order_status)) {\n $order_status->delete();\n }\n }", "public function orderStatus($order_ref)\n {\n try {\n $orderResponse = Order::getOrderStatus($order_ref);\n\n if($orderResponse['error'])\n {\n return ApiResponseHandler::failure($orderResponse['message'],$orderResponse['exception']);\n }else{\n $response = $orderResponse['body'];\n\n return ApiResponseHandler::success($response, trans('bSecurePayments::messages.order.status.success'));\n }\n } catch (\\Exception $e) {\n return ApiResponseHandler::failure(trans('bSecurePayments::messages.order.status.failure'), $e->getTraceAsString());\n }\n }", "public function show(OrderStatus $orderStatus)\n {\n //\n }", "protected function status($status)\n {\n if ($status === 'unpublished') {\n return $this->builder->onlyTrashed();\n }\n }", "public function display_order_to_deliver_count(){\n $getOrderToDeliverCount = Order::join('order_invoice', ['orders.invoice_id' => 'order_invoice.id'])\n ->where('is_approved',1)\n ->where('delivery_date', '=', date('Y-m-d'))\n ->groupBy('orders.invoice_id') \n ->get()\n ->count();\n\n return response()->json([\n 'count' => $getOrderToDeliverCount,\n 'status' => 200\n ]);\n }", "public function hasOrders()\n {\n return $this->orders->count();\n }", "function checkOrderStatus($orderItem, $status){\n $statusCode = getOrderStatusCode($status);\n return $orderItem->status == $statusCode;\n}", "private function getOrderPaymentStatus($orderId)\n {\n return $this->db->fetchOne(\n 'SELECT `cleared` FROM `s_order` WHERE `id`=:orderId;',\n [':orderId' => $orderId]\n );\n }", "public function count() {\n\t\treturn $this->field('Cart.order_item_count', $this->cartConditions());\n\t}", "function listOrderStatus() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\n\t\t$_ = '';\n\n\t\t// only show orders if user has access\n\t\tif($page->validatePath(\"/janitor/admin/shop/order/list\")) {\n\n\t\t\tinclude_once(\"classes/shop/supershop.class.php\");\n\t\t\t$model = new SuperShop();\n\n\t\t\t$_ .= '<div class=\"orders\">';\n\t\t\t$_ .= '<h2>Order status</h2>';\n\n\n\t\t\tif($model->order_statuses) {\n\t\t\t\t$_ .= '<ul class=\"orders\">';\n\t\t\t\tforeach($model->order_statuses as $order_status => $order_status_name) {\n\t\t\t\t\t$_ .= '<li class=\"'.superNormalize($order_status_name).'\">';\n\t\t\t\t\t$_ .= '<h3>';\n\t\t\t\t\t$_ .= '<a href=\"/janitor/admin/shop/order/list/\"'.$order_status.'\">'.$order_status_name.'</a> ';\n\t\t\t\t\t$_ .= '<span class=\"count\">'.$model->getOrderCount(array(\"status\" => $order_status)).'</span>';\n\t\t\t\t\t$_ .= '<h3>';\n\n\t\t\t\t\t$_ .= '</li>';\n\t\t\t\t}\n\t\t\t\t$_ .= '</ul>';\n\t\t\t}\n\n\t\t\t$_ .= '</div>';\n\t\t}\n\n\t\treturn $_;\n\t}", "public function getStatus(OrderInterface $order) {\n\t\t\treturn $this->getClient()->get_status(\n\t\t\t\tarray(\n\t\t\t\t\t'order' => array(\n\t\t\t\t\t\t'shop_id' => $this->getShopId(),\n\t\t\t\t\t\t'number' => $order->getId()\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function clientStatus($title, $status)\n {\n $sha1 = sha1($title . $status . $this->szkwalApiHash);\n\n $postData = array(\n static::APILOGIN => $this->szkwalApiLogin,\n static::APIPASS => $this->szkwalApiPass,\n static::TITLE => $title,\n 'status' => $status,\n 'hash' => $sha1,\n );\n\n return $this->request('ClientStatus', $postData);\n }", "function searchOrderStatus ($status_log,&$orderPaid, &$orderClosed) {\n\t\t$orderPaid = false;\n\t\t$orderClosed = false;\n\t\tif (isset($status_log) && is_array($status_log)) {\n\t\t\tforeach($status_log as $key=>$val) {\n\t\t\t\tif ($val['status'] == 13) {// Numbers 13 means order has been payed\n\t\t\t\t\t$orderPaid = true;\n\t\t\t\t}\n\t\t\t\tif ($val['status'] >= 100) {// Numbers 13 means order has been payed\n\t\t\t\t\t$orderClosed = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function get_entradas_contabilidad_sin_list_count($estatus)\n\t{\n\t\t$u = new Entrada();\n\t\t$sql=\"select count(distinct(e.pr_facturas_id)) as total from entradas as e left join cproveedores as pr on pr.id=e.cproveedores_id left join pr_facturas as prf on prf.id=e.pr_facturas_id left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id left join estatus_general as eg on eg.id=e.estatus_general_id where e.estatus_general_id=1 and ctipo_entrada=1\";\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows == 1){\n\t\t\treturn $u->total;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function setTransactionStatus($orderId, string $status);", "function by_status_berlaku()\n {\n $this->db->select(\"COUNT(id) AS total,COUNT( CASE WHEN status_berlaku = '1' THEN 1 END ) AS berlaku,COUNT( CASE WHEN status_berlaku = '0' THEN 1 END ) AS tidak_berlaku\");\n $this->db->from($this->table);\n return $this->db->get()->row();\n }", "public function cabang($status)\n {\n $cabang = User::select('cabang')->where('status',$status)->groupBy('cabang')->get();\n if($cabang != null){\n $cabang['count'] = $cabang->count();\n }\n return $cabang;\n }", "public function orders() {\n return $this->hasMany('\\Veer\\Models\\Order', 'status_id', 'id'); \n }", "public function search($status = null)\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\t\t$criteria->with = array('invoices');\n\t\t//$criteria->join='LEFT JOIN hts_invoices ON hts_invoices.orderId=t.orderId';\n\t\t$criteria->compare('orderId',$this->orderId);\n\t\t$criteria->compare('sellerId',$this->sellerId);\n\t\t$criteria->compare('totalCost',$this->totalCost,true);\n\t\t$criteria->compare('totalShipping',$this->totalShipping,true);\n\t\t$criteria->compare('discount',$this->discount,true);\n\t\t$criteria->compare('discountSource',$this->discountSource,true);\n\t\t$criteria->compare(\"from_unixtime(`orderDate`, '%d-%m-%Y')\",$this->orderDate,true);\n\t\t/*if(!empty($this->orderDate))\n\t\t $criteria->condition = \"from_unixtime(`orderDate`, '%d-%m-%Y') = '$this->orderDate'\";\n\t\t else\n\t\t $criteria->compare('orderDate',$this->orderDate); */\n\t\t$criteria->compare('shippingAddress',$this->shippingAddress);\n\t\t$criteria->compare('currency',$this->currency,true);\n\n\n\t\tif(Yii::app()->controller->action->id == 'scroworders') {\n\t\t\t$criteria->addCondition(\"trackPayment != ''\");\n\t\t\tif($status == 'approved') {\n\t\t\t\t$criteria->addCondition(\"trackPayment = 'paid'\");\n\t\t\t} elseif($status == 'delivered') {\n\t\t\t\t$criteria->addCondition(\"trackPayment = 'pending'\");\n\t\t\t\t$criteria->addCondition(\"status = 'delivered'\");\n\t\t\t} elseif($status == 'cancelled') {\n\t\t\t\t$criteria->addCondition(\"trackPayment = 'pending'\");\n\t\t\t\t$criteria->addCondition(\"status = 'cancelled'\");\n\t\t\t} elseif($status == 'refunded') {\n\t\t\t\t$criteria->addCondition(\"trackPayment = 'refunded'\");\n\t\t\t\t$criteria->addCondition(\"status = 'cancelled'\");\n\t\t\t} else {\n\t\t\t\t$criteria->compare('status',$status,true);\n\t\t\t}\n\t\t} else {\n\t\t\t$criteria->addCondition(\"trackPayment = ''\");\n\t\t\t$criteria->compare('status',$status,true);\n\t\t}\n\t\tif(Yii::app()->request->isAjaxRequest) {\n\t\t\tif(!empty($status))\n\t\t\t$criteria->addCondition(\"status = '$status'\");\n\t\t\t\n\t\t}\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t'sort'=>array(\n 'defaultOrder'=>'orderId DESC',\n\t\t)\n\t\t));\n\t}", "function ostDeleteOrderStatus( $statusID )\r\n{\r\n\t$statusID = intval($statusID);\r\n\t$q = db_query(\"select count(*) from \".ORDERS_TABLE.\" where statusID=\".$statusID );\r\n\t$r = db_fetch_row( $q );\r\n\tif ( $r[0] != 0 )\r\n\treturn false;\r\n\tdb_query(\"delete from \".ORDER_STATUSES_TABLE.\r\n\t\t\" where statusID=$statusID\" );\r\n\treturn true;\r\n}", "public function status($status)\n {\n if ($status == 16) {\n return \"<span class='badge badge-warning'>Order Placed</span>\";\n }\n\n if ($status == 3) {\n return \"<span class='badge badge-danger'>Canceled</span>\";\n }\n\n if ($status == 2) {\n return \"<span class='badge badge-warning'>Pending</span>\";\n }\n\n if ($status == 17) {\n return \"<span class='badge badge-danger'>Delivered</span>\";\n }\n\n return \"<span class='badge badge-danger'>Something Wrong</span>\";\n \n }", "public function count_entries_written($entry_status = '') {\n\n $query = $this->entries;\n\n if ($entry_status !== ''\n && in_array($entry_status, Entry::$STATUSES)) {\n $query->where('status', '=', $entry_status);\n }\n\n return $query->count_all();\n }" ]
[ "0.7232755", "0.7017634", "0.69810367", "0.6761564", "0.67516303", "0.6727714", "0.6505145", "0.6405812", "0.63512236", "0.62337416", "0.62201345", "0.6212407", "0.61802846", "0.61389464", "0.61317515", "0.6085192", "0.605804", "0.60483867", "0.6044908", "0.60436994", "0.60375416", "0.60174143", "0.60007596", "0.59944236", "0.59814644", "0.5978687", "0.59711695", "0.59430045", "0.5939181", "0.59093696", "0.5908419", "0.5886765", "0.5879667", "0.5857645", "0.5843043", "0.58395314", "0.5827449", "0.5827015", "0.58243227", "0.58226603", "0.58181006", "0.58131313", "0.58016145", "0.5793193", "0.5781505", "0.5778575", "0.57763386", "0.5774136", "0.5742044", "0.5731308", "0.57222736", "0.571951", "0.5715863", "0.5704351", "0.5693275", "0.5679026", "0.5655729", "0.5636399", "0.56298304", "0.56241995", "0.56062704", "0.5606238", "0.5599346", "0.5592659", "0.55918056", "0.5591708", "0.55883133", "0.55878186", "0.55815333", "0.5566198", "0.5562828", "0.5557284", "0.5548719", "0.5542917", "0.55425024", "0.5541737", "0.5539874", "0.5536738", "0.55296826", "0.5519484", "0.5516955", "0.5513786", "0.5509564", "0.54929185", "0.5481492", "0.5480813", "0.5470195", "0.54672384", "0.545827", "0.5455367", "0.54395545", "0.54370284", "0.5425591", "0.5422481", "0.54203314", "0.5414724", "0.5407837", "0.5391744", "0.53704643", "0.5353048" ]
0.80535203
0
Generate meta query for wc_get_orders.
private function get_orders_generate_customer_meta_query( $values, $relation = 'or' ) { $meta_query = array( 'relation' => strtoupper( $relation ), 'customer_emails' => array( 'key' => '_billing_email', 'value' => array(), 'compare' => 'IN', ), 'customer_ids' => array( 'key' => '_customer_user', 'value' => array(), 'compare' => 'IN', ), ); foreach ( $values as $value ) { if ( is_array( $value ) ) { $meta_query[] = $this->get_orders_generate_customer_meta_query( $value, 'and' ); } elseif ( is_email( $value ) ) { $meta_query['customer_emails']['value'][] = sanitize_email( $value ); } else { $meta_query['customer_ids']['value'][] = strval( absint( $value ) ); } } if ( empty( $meta_query['customer_emails']['value'] ) ) { unset( $meta_query['customer_emails'] ); unset( $meta_query['relation'] ); } if ( empty( $meta_query['customer_ids']['value'] ) ) { unset( $meta_query['customer_ids'] ); unset( $meta_query['relation'] ); } return $meta_query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function orders_get_list() {\n\t\t $sql = <<<EOD\n\t\t SELECT\n\t\t \t{$this->wpdb->prefix}topspin_orders.id,\n\t\t \t{$this->wpdb->prefix}topspin_orders.artist_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders.created_at,\n\t\t \t{$this->wpdb->prefix}topspin_orders.subtotal,\n\t\t\t{$this->wpdb->prefix}topspin_currency.currency,\n\t\t\t{$this->wpdb->prefix}topspin_currency.symbol,\n\t\t \t{$this->wpdb->prefix}topspin_orders.tax,\n\t\t \t{$this->wpdb->prefix}topspin_orders.phone,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_method_calculator,\n\t\t \t{$this->wpdb->prefix}topspin_orders.reshipment,\n\t\t \t{$this->wpdb->prefix}topspin_orders.fan,\n\t\t \t{$this->wpdb->prefix}topspin_orders.details_url,\n\t\t \t{$this->wpdb->prefix}topspin_orders.exchange_rate,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_method_code,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_firstname,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_lastname,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_lastname,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_address1,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_address2,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_city,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_state,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_postal_code,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_country,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_phone\n\t\t FROM {$this->wpdb->prefix}topspin_orders\n\t\t LEFT JOIN\n\t\t \t{$this->wpdb->prefix}topspin_currency ON {$this->wpdb->prefix}topspin_orders.currency = {$this->wpdb->prefix}topspin_currency.currency\n\t\t WHERE\n\t\t \t{$this->wpdb->prefix}topspin_orders.artist_id = '%d'\n\t\t GROUP BY\n\t\t \t{$this->wpdb->prefix}topspin_orders.id\n\t\t ORDER BY\n\t\t \t{$this->wpdb->prefix}topspin_orders.created_at DESC\nEOD;\n\t\t$ordersList = $this->wpdb->get_results($this->wpdb->prepare($sql,array($this->artist_id)));\n\t\tif(count($ordersList)) {\n\t\t\tforeach($ordersList as $key=>$order) {\n\t\t\t\t$ordersList[$key]->items_list = $this->orders_get_items_list($order->id);\n\t\t\t}\n\t\t}\n\t\treturn $ordersList;\n\t}", "private function getQuery(string $orderId = null)\n {\n $filter = $orderId ? \"(filter:{number:{eq:\\\"$orderId\\\"}})\" : \"\";\n return <<<QUERY\n{\n customer {\n orders {$filter}{\n items {\n number\n status\n items {\n product_sku\n }\n carrier\n shipping_method\n shipments {\n id\n number\n tracking {\n title\n carrier\n number\n }\n items {\n id\n order_item {\n product_sku\n }\n product_name\n product_sku\n product_sale_price {\n value\n currency\n }\n ... on BundleShipmentItem {\n bundle_options {\n label\n values {\n product_name\n product_sku\n quantity\n price {\n value\n }\n }\n }\n }\n quantity_shipped\n }\n comments {\n timestamp\n message\n }\n }\n }\n }\n }\n}\nQUERY;\n }", "function wisataone_X1_get_all_order() {\n global $wpdb, $wisataone_X1_tblname;\n $wp_track_table = $wpdb->prefix . $wisataone_X1_tblname;\n\n return $wpdb->get_results( \n \"\n SELECT *\n FROM {$wp_track_table}\n \"\n );\n}", "function query_orderby( $orderby ) {\n\t\tglobal $wpdb;\n\n\t\t$array_return = [];\n\n\t\tif ( $this->is_woocommerce_search() && ! empty( $this->ordering ) ) {\n\n\t\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\t$this->get_woocommerce_ordering();\n\t\t\t}\n\n\t\t\t// depending on the sorting we need to do different things\n\t\t\tif ( isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\t$order = isset( $this->ordering['order'] ) ? $this->ordering['order'] : 'ASC';\n\t\t\t\tswitch ( $this->ordering['wc_orderby'] ) {\n\t\t\t\t\tcase 'price':\n\t\t\t\t\tcase 'price-desc':\n\t\t\t\t\tcase 'popularity':\n\t\t\t\t\t\t$order = in_array( $this->ordering['wc_orderby'], array( 'popularity', 'price-desc' ) )\n\t\t\t\t\t\t\t? 'DESC' : $order;\n\n\t\t\t\t\t\t$array_return[] = [\n\t\t\t\t\t\t\t'column' => 'swpwc.meta_value+0',\n\t\t\t\t\t\t\t'direction' => $order,\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t// SeachWP 3.x compat.\n\t\t\t\t\t\t$orderby = \"ORDER BY swpwc.meta_value+0 {$order}, \" . str_replace( 'ORDER BY', '', $orderby );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t/* case 'price-desc':\n\t\t\t\t\t\t$orderby = \"ORDER BY {$wpdb->postmeta}.meta_value+0 DESC, \" . str_replace( 'ORDER BY', '', $orderby );\n\t\t\t\t\t\tbreak; */\n\t\t\t\t\tcase 'date':\n\t\t\t\t\t\t$array_return[] = [\n\t\t\t\t\t\t\t'column' => \"{$wpdb->posts}.post_date\",\n\t\t\t\t\t\t\t'direction' => 'DESC',\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t// SeachWP 3.x compat.\n\t\t\t\t\t\t$orderby = 'ORDER BY post_date DESC';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rating':\n\t\t\t\t\t\t$array_return[] = [\n\t\t\t\t\t\t\t'column' => 'average_rating',\n\t\t\t\t\t\t\t'direction' => 'DESC',\n\t\t\t\t\t\t];\n\t\t\t\t\t\t$array_return[] = [\n\t\t\t\t\t\t\t'column' => \"{$wpdb->posts}.post_date\",\n\t\t\t\t\t\t\t'direction' => 'DESC',\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t// SeachWP 3.x compat.\n\t\t\t\t\t\t$orderby = \"ORDER BY average_rating DESC, {$wpdb->posts}.post_date DESC\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'name':\n\t\t\t\t\t\t$array_return[] = [\n\t\t\t\t\t\t\t'column' => 'post_title',\n\t\t\t\t\t\t\t'direction' => 'ASC',\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t// SeachWP 3.x compat.\n\t\t\t\t\t\t$orderby = 'ORDER BY post_title ASC';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->is_legacy_searchwp() ? $orderby : $array_return;\n\t}", "function returned_orders() {\n global $wpdb;\n $woo_cust_id = get_current_user_id();\n $returned_orders = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM randys_orders o LEFT JOIN randys_customers c ON c.custnmbr = o.randys_customer_id WHERE c.woocustid=%s AND status='returned'\", array($woo_cust_id) ) );\n\n return $returned_orders;\n}", "function woocommerce_export_csv_query($status, $startdate = NULL, $enddate = NULL) {\n\n\t\t\tglobal $wpdb;\n\n\t\t\t$statusquery = '(';\n\n\t\t\tfor ( $i = 0; $i < count( $status ); $i++ ) {\n\t\t\t\tif ( $i == 0 )\n\t\t\t\t\t$statusquery .= $wpdb->prefix . \"terms.name = '\" . $status[$i] . \"'\";\n\t\t\t\telse\n\t\t\t\t\t$statusquery .= \" OR \" . $wpdb->prefix . \"terms.name = '\" . $status[$i] . \"'\";\n\t\t\t}\n\t\t\t$statusquery .= ')';\n\n\t\t\t// Get an array of completed orders (id values)\n\t\t\t$orders_sql = \"SELECT DISTINCT \" . $wpdb->prefix . \"postmeta.post_id AS orders FROM \" . $wpdb->prefix . \"postmeta LEFT JOIN \" . $wpdb->prefix . \"posts ON (\" . $wpdb->prefix . \"postmeta.post_id = \" . $wpdb->prefix . \"posts.ID) LEFT JOIN \" . $wpdb->prefix . \"term_relationships ON (\" . $wpdb->prefix . \"posts.ID = \" . $wpdb->prefix . \"term_relationships.object_id) LEFT JOIN \" . $wpdb->prefix . \"term_taxonomy ON (\" . $wpdb->prefix . \"term_relationships.term_taxonomy_id = \" . $wpdb->prefix . \"term_taxonomy.term_taxonomy_id) LEFT JOIN \" . $wpdb->prefix . \"terms ON (\" . $wpdb->prefix . \"term_taxonomy.term_id = \" . $wpdb->prefix . \"terms.term_id) WHERE \" . $wpdb->prefix . \"posts.post_status = 'publish' AND \" . $wpdb->prefix . \"term_taxonomy.taxonomy = 'shop_order_status' AND \" . $statusquery;\n\t\t\t// Insert start date if provided\n\t\t\tif ($startdate!=NULL) {\n\t\t\t\t$orders_sql .= \" AND DATE_FORMAT(\" . $wpdb->prefix . \"posts.post_date, '%Y-%m-%d') >= '\" . $startdate . \"'\";\n\t\t\t}\n\t\t\t// Insert end date if provided\n\t\t\tif ($enddate!=NULL) {\n\t\t\t\t$orders_sql .= \" AND DATE_FORMAT(\" . $wpdb->prefix . \"posts.post_date, '%Y-%m-%d') <= '\" . $enddate . \"'\";\n\t\t\t}\n\n\t\t\t$orders_sql .= \" ORDER BY orders DESC\";\n\n\t\t\treturn $wpdb->get_results( $orders_sql );\n\n\t\t}", "public function woocommerce_reports_category_sales_order_items($orders) {\n\t\tglobal $wpdb;\n\t\t$this->set_reporting_flag(true);\n\n\t\t// If no data was retrieved by WooCommerce, just return the empty dataset\n\t\tif(empty($orders)) {\n\t\t\treturn $orders;\n\t\t}\n\n\t\t// This report requires one year to retrieve the data, but such information\n\t\t// is not passed by the apply_filter() call. It's therefore necessary to\n\t\t// extract it from the data that was retrieved by WooCommerce, using the\n\t\t// first date found in the dataset\n\t\t$order = $orders[0];\n\t\t$reference_date = DateTime::createFromFormat('Y-m-d H:i:s', get_value('post_date', $orders[0]));\n\t\t$year_to_retrieve = $reference_date->format('Y');\n\n\t\t// Calculate the first date of year passed as a parameter and the start date\n\t\t// of next one\n\t\t$start_date = $year_to_retrieve . '0101000000';\n\t\t$end_date = date('Ymd000000', strtotime($start_date . ' +1 year'));\n\n\t\t$SQL = \"\n\t\t\tSELECT\n\t\t\t\torder_item_meta_2.meta_value as product_id\n\t\t\t\t,posts.post_date\n\t\t\t\t-- ,SUM(order_item_meta_3.meta_value) AS line_total\n\t\t\t\t-- Return Line total converted to base currency\n\t\t\t\t,SUM(order_item_meta_3.meta_value * meta_order_base_curr.meta_value / meta_order.meta_value) AS line_total\n\t\t\tFROM\n\t\t\t\t{$wpdb->prefix}woocommerce_order_items AS order_items\n\t\t\tJOIN\n\t\t\t\t{$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta_2 ON\n\t\t\t\t\t(order_item_meta_2.order_item_id = order_items.order_item_id) AND\n\t\t\t\t\t(order_item_meta_2.meta_key = '_product_id')\n\t\t\tJOIN\n\t\t\t\t{$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta_3 ON\n\t\t\t\t\t(order_item_meta_3.order_item_id = order_items.order_item_id) AND\n\t\t\t\t\t(order_item_meta_3.meta_key = '_line_total')\n\t\t\tJOIN\n\t\t\t\t$wpdb->posts AS posts ON\n\t\t\t\t\t(posts.ID = order_items.order_id) AND\n\t\t\t\t\t(posts.post_type = 'shop_order') AND\n\t\t\t\t\t(posts.post_status = 'publish') AND\n\t\t\t\t\t(posts.post_date >= $start_date) AND\n\t\t\t\t\t(posts.post_date < $end_date)\n\t\t\tJOIN\n\t\t\t\t$wpdb->postmeta AS meta_order ON\n\t\t\t\t\t(meta_order.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order.meta_key = '_order_total')\n\t\t\tJOIN\n\t\t\t\t$wpdb->postmeta AS meta_order_base_curr ON\n\t\t\t\t\t(meta_order_base_curr.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order_base_curr.meta_key = '_order_total_base_currency')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_relationships AS rel ON\n\t\t\t\t\t(rel.object_ID = posts.ID)\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_taxonomy AS taxonomy ON\n\t\t\t\t\t(taxonomy.term_taxonomy_id = rel.term_taxonomy_id) AND\n\t\t\t\t\t(taxonomy.taxonomy = 'shop_order_status')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->terms AS term ON\n\t\t\t\t\t(term.term_id = taxonomy.term_id) AND\n\t\t\t\t\t(term.slug IN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"'))\n\t\t\tWHERE\n\t\t\t\t(order_items.order_item_type = 'line_item')\n\t\t\tGROUP BY\n\t\t\t\torder_items.order_item_id\n\t\t\tORDER BY\n\t\t\t\tposts.post_date ASC\n\t\t\";\n\n\t\t$orders_base_curr = $wpdb->get_results($SQL);\n\t\t$this->set_reporting_flag(false);\n\n\t\treturn $orders_base_curr;\n\t}", "public function retrieveOrders() {\r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n global $wpdb;\r\n \r\n $query = \"SELECT ID FROM {$wpdb->prefix}posts WHERE profaktura_status = %d AND post_type = %s ORDER BY post_date DESC\";\r\n \r\n $sql = $wpdb->prepare($query, [0, 'shop_order']);\r\n \r\n $dbOrdersProStatZero = $wpdb->get_results($sql);\r\n \r\n $allOrders = $client->get('orders');\r\n \r\n $orders = [];\r\n \r\n if (count($allOrders) > 0 && count($dbOrdersProStatZero) > 0) {\r\n foreach ($allOrders as $o) {\r\n foreach ($dbOrdersProStatZero as $d) {\r\n if ($o->id == $d->ID) {\r\n $orders[] = $o;\r\n continue;\r\n }\r\n }\r\n } \r\n }\r\n \r\n if (count($orders) < 1) {\r\n return new WP_REST_Response(['message' => 'No orders found!']);\r\n }\r\n \r\n return new WP_REST_Response($orders);\r\n }", "protected function parse_orderby_meta($orderby_raw)\n {\n }", "private function _sql_meta() {\n\t\tglobal $wpdb;\n\n\t\tif ( $this->meta_key && $this->meta_value) {\n\t\t\treturn sprintf(\"%s (%s.meta_key=%s AND %s.meta_value=%s)\"\n\t\t\t\t, $this->join_rule\n\t\t\t\t, $wpdb->postmeta\n\t\t\t\t, $wpdb->prepare('%s', $this->meta_key)\n\t\t\t\t, $wpdb->postmeta\n\t\t\t\t, $wpdb->prepare('%s', $this->meta_value)\n\t\t\t);\n\t\t}\n\t\telseif ($this->meta_key) {\n\t\t\treturn $this->_sql_filter($wpdb->postmeta, 'meta_key', '=', $this->meta_key);\n\t\t}\n\t\telse {\n\t\t\treturn $this->_sql_filter($wpdb->postmeta, 'meta_value', '=', $this->meta_value);\n\t\t}\n\t}", "public function getOrders() \n {\n return $this->_fields['Orders']['FieldValue'];\n }", "public function get_my_orders( $args = array() )\n {\n return $this->_request('myorders', $args);\n }", "protected function getOrders(array $orders) : string {\r\n // defaults\r\n $order = '';\r\n $appliedOrders = 0;\r\n\r\n // order fields\r\n foreach($orders as $myOrder) {\r\n $order .= ($appliedOrders > 0) ? ', ' : ' ORDER BY ';\r\n $identifier = array();\r\n\r\n $schema = $myOrder->field->getSchema();\r\n $table = $myOrder->field->getTable();\r\n $field = $myOrder->field->get();\r\n\r\n $specifier = [];\r\n if($schema && $table) {\r\n $specifier[] = $this->getServicingSqlInstance()->getTableIdentifierParametrized($schema, $table);\r\n } else if($table) {\r\n $specifier[] = $table;\r\n } else {\r\n // might be local alias\r\n }\r\n $specifier[] = $field;\r\n\r\n $order .= implode('.', $specifier) . ' ' . $myOrder->direction . ' ';\r\n $appliedOrders++;\r\n }\r\n\r\n return $order;\r\n }", "function orderByClause( $orderby ) {\n\t global $wpdb;\n\t return \"dm.meta_value+0 {$this->order}, $wpdb->posts.post_title ASC\";\n\t}", "function searchwp_query_inject() {\n\t\tglobal $wpdb;\n\n\t\t$sql = '';\n\n\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t$this->get_woocommerce_ordering();\n\t\t}\n\n\t\tif ( $this->is_woocommerce_search() && ! empty( $this->ordering ) ) {\n\t\t\t// ratings need moar SQL\n\t\t\tif ( 'rating' === $this->ordering['wc_orderby'] ) {\n\t\t\t\t$sql = \" AVG( swpwpcommeta.meta_value ) as average_rating \";\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function lstOrder(){\n\t\t$Sql = \"SELECT \n\t\t\t\t\torder_id,\n\t\t\t\t\tcustomer_id,\n\t\t\t\t\tproduct_id,\n\t\t\t\t\tproduct_name,\n\t\t\t\t\torder_date,\n\t\t\t\t\tsub_total,\n\t\t\t\t\tgrand_total,\n\t\t\t\t\torder_type,\n\t\t\t\t\tstart_date,\n\t\t\t\t\tend_date,\n\t\t\t\t\tpickup_location_id,\n\t\t\t\t\tdrop_location_id,\n\t\t\t\t\tproduct_price,\n\t\t\t\t\torder_status,\n\t\t\t\t\tpayment_method\n\t\t\t\tFROM\n\t\t\t\t\trs_tbl_order\n\t\t\t\tWHERE\n\t\t\t\t\t1=1\";\n\t\t\n\t\tif($this->isPropertySet(\"order_id\", \"V\")){\n\t\t\t$Sql .= \" AND order_id='\" . $this->getProperty(\"order_id\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"customer_id\", \"V\")){\n\t\t\t$Sql .= \" AND customer_id=\" . $this->getProperty(\"customer_id\");\n\t\t}\n\t\tif($this->isPropertySet(\"product_id\", \"V\")){\n\t\t\t$Sql .= \" AND product_id=\" . $this->getProperty(\"product_id\");\n\t\t}\n\t\tif($this->isPropertySet(\"order_type\", \"V\")){\n\t\t\t$Sql .= \" AND order_type='\" . $this->getProperty(\"order_type\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"order_status\", \"V\")){\n\t\t\t$Sql .= \" AND order_status='\" . $this->getProperty(\"order_status\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"from_dt\", \"V\") && $this->isPropertySet(\"to_dt\", \"V\")){\n\t\t\t$Sql .= \" AND LEFT(order_date, 10) BETWEEN '\" . $this->getProperty(\"from_dt\") . \"' AND '\" . $this->getProperty(\"to_dt\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"from_date\", \"V\") && $this->isPropertySet(\"to_date\", \"V\")){\n\t\t\t$Sql .= \" AND order_date BETWEEN '\" . $this->getProperty(\"from_date\") . \"' AND '\" . $this->getProperty(\"to_date\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\")){\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\n\t\t}\n\t\t\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\n\t\treturn $this->dbQuery($Sql);\n\t}", "public function query() {\n\t\tif (get_current_login_user() == 'admin') {\n\t\t\treturn Order::get();\n\t\t} else if (get_current_login_user() == 'store') {\n\t\t\t$store_id = auth()->guard('store')->user()->id;\n\t\t\treturn Order::where('store_id', $store_id)->get();\n\t\t}\n\t}", "protected function add_sql_query_params( $query_args ) {\n\t\tglobal $wpdb;\n\t\t$order_stats_lookup_table = self::get_db_table_name();\n\t\t$order_coupon_lookup_table = $wpdb->prefix . 'wc_order_coupon_lookup';\n\t\t$order_product_lookup_table = $wpdb->prefix . 'wc_order_product_lookup';\n\t\t$order_tax_lookup_table = $wpdb->prefix . 'wc_order_tax_lookup';\n\t\t$operator = $this->get_match_operator( $query_args );\n\t\t$where_subquery = array();\n\t\t$have_joined_products_table = false;\n\n\t\t$this->add_time_period_sql_params( $query_args, $order_stats_lookup_table );\n\t\t$this->get_limit_sql_params( $query_args );\n\t\t$this->add_order_by_sql_params( $query_args );\n\n\t\t$status_subquery = $this->get_status_subquery( $query_args );\n\t\tif ( $status_subquery ) {\n\t\t\tif ( empty( $query_args['status_is'] ) && empty( $query_args['status_is_not'] ) ) {\n\t\t\t\t$this->subquery->add_sql_clause( 'where', \"AND {$status_subquery}\" );\n\t\t\t} else {\n\t\t\t\t$where_subquery[] = $status_subquery;\n\t\t\t}\n\t\t}\n\n\t\t$included_orders = $this->get_included_orders( $query_args );\n\t\tif ( $included_orders ) {\n\t\t\t$where_subquery[] = \"{$order_stats_lookup_table}.order_id IN ({$included_orders})\";\n\t\t}\n\n\t\t$excluded_orders = $this->get_excluded_orders( $query_args );\n\t\tif ( $excluded_orders ) {\n\t\t\t$where_subquery[] = \"{$order_stats_lookup_table}.order_id NOT IN ({$excluded_orders})\";\n\t\t}\n\n\t\tif ( $query_args['customer_type'] ) {\n\t\t\t$returning_customer = 'returning' === $query_args['customer_type'] ? 1 : 0;\n\t\t\t$where_subquery[] = \"{$order_stats_lookup_table}.returning_customer = ${returning_customer}\";\n\t\t}\n\n\t\t$refund_subquery = $this->get_refund_subquery( $query_args );\n\t\t$this->subquery->add_sql_clause( 'from', $refund_subquery['from_clause'] );\n\t\tif ( $refund_subquery['where_clause'] ) {\n\t\t\t$where_subquery[] = $refund_subquery['where_clause'];\n\t\t}\n\n\t\t$included_coupons = $this->get_included_coupons( $query_args );\n\t\t$excluded_coupons = $this->get_excluded_coupons( $query_args );\n\t\tif ( $included_coupons || $excluded_coupons ) {\n\t\t\t$this->subquery->add_sql_clause( 'join', \"JOIN {$order_coupon_lookup_table} ON {$order_stats_lookup_table}.order_id = {$order_coupon_lookup_table}.order_id\" );\n\t\t}\n\t\tif ( $included_coupons ) {\n\t\t\t$where_subquery[] = \"{$order_coupon_lookup_table}.coupon_id IN ({$included_coupons})\";\n\t\t}\n\t\tif ( $excluded_coupons ) {\n\t\t\t$where_subquery[] = \"{$order_coupon_lookup_table}.coupon_id NOT IN ({$excluded_coupons})\";\n\t\t}\n\n\t\t$included_products = $this->get_included_products( $query_args );\n\t\t$excluded_products = $this->get_excluded_products( $query_args );\n\t\tif ( $included_products || $excluded_products ) {\n\t\t\t$have_joined_products_table = true;\n\t\t\t$this->subquery->add_sql_clause( 'join', \"JOIN {$order_product_lookup_table} ON {$order_stats_lookup_table}.order_id = {$order_product_lookup_table}.order_id\" );\n\t\t}\n\t\tif ( $included_products ) {\n\t\t\t$where_subquery[] = \"{$order_product_lookup_table}.product_id IN ({$included_products})\";\n\t\t}\n\t\tif ( $excluded_products ) {\n\t\t\t$where_subquery[] = \"{$order_product_lookup_table}.product_id NOT IN ({$excluded_products})\";\n\t\t}\n\n\t\t$included_variations = $this->get_included_variations( $query_args );\n\t\t$excluded_variations = $this->get_excluded_variations( $query_args );\n\t\tif ( ! $have_joined_products_table && ( $included_variations || $excluded_variations ) ) {\n\t\t\t$have_joined_products_table = true;\n\t\t\t$this->subquery->add_sql_clause( 'join', \"JOIN {$order_product_lookup_table} ON {$order_stats_lookup_table}.order_id = {$order_product_lookup_table}.order_id\" );\n\t\t}\n\t\tif ( $included_variations ) {\n\t\t\t$where_subquery[] = \"{$order_product_lookup_table}.variation_id IN ({$included_variations})\";\n\t\t}\n\t\tif ( $excluded_variations ) {\n\t\t\t$where_subquery[] = \"{$order_product_lookup_table}.variation_id NOT IN ({$excluded_variations})\";\n\t\t}\n\n\t\t$included_tax_rates = ! empty( $query_args['tax_rate_includes'] ) ? implode( ',', $query_args['tax_rate_includes'] ) : false;\n\t\t$excluded_tax_rates = ! empty( $query_args['tax_rate_excludes'] ) ? implode( ',', $query_args['tax_rate_excludes'] ) : false;\n\t\tif ( $included_tax_rates || $excluded_tax_rates ) {\n\t\t\t$this->subquery->add_sql_clause( 'join', \"LEFT JOIN {$order_tax_lookup_table} ON {$order_stats_lookup_table}.order_id = {$order_tax_lookup_table}.order_id\" );\n\t\t}\n\t\tif ( $included_tax_rates ) {\n\t\t\t$where_subquery[] = \"{$order_tax_lookup_table}.tax_rate_id IN ({$included_tax_rates})\";\n\t\t}\n\t\tif ( $excluded_tax_rates ) {\n\t\t\t$where_subquery[] = \"{$order_tax_lookup_table}.tax_rate_id NOT IN ({$excluded_tax_rates}) OR {$order_tax_lookup_table}.tax_rate_id IS NULL\";\n\t\t}\n\n\t\t$attribute_subqueries = $this->get_attribute_subqueries( $query_args );\n\t\tif ( $attribute_subqueries['join'] && $attribute_subqueries['where'] ) {\n\t\t\t// JOIN on product lookup if we haven't already.\n\t\t\tif ( ! $have_joined_products_table ) {\n\t\t\t\t$have_joined_products_table = true;\n\t\t\t\t$this->subquery->add_sql_clause( 'join', \"JOIN {$order_product_lookup_table} ON {$order_stats_lookup_table}.order_id = {$order_product_lookup_table}.order_id\" );\n\t\t\t}\n\t\t\t// Add JOINs for matching attributes.\n\t\t\tforeach ( $attribute_subqueries['join'] as $attribute_join ) {\n\t\t\t\t$this->subquery->add_sql_clause( 'join', $attribute_join );\n\t\t\t}\n\t\t\t// Add WHEREs for matching attributes.\n\t\t\t$where_subquery = array_merge( $where_subquery, $attribute_subqueries['where'] );\n\t\t}\n\n\t\tif ( 0 < count( $where_subquery ) ) {\n\t\t\t$this->subquery->add_sql_clause( 'where', 'AND (' . implode( \" {$operator} \", $where_subquery ) . ')' );\n\t\t}\n\t}", "public function get_items_query_clauses( $args, $wp_query ) {\n\t\tglobal $wpdb;\n\n\t\tif ( $wp_query->get( 'search' ) ) {\n\t\t\t$search = \"'%\" . $wpdb->esc_like( $wp_query->get( 'search' ) ) . \"%'\";\n\t\t\t$args['join'] = $this->append_product_sorting_table_join( $args['join'] );\n\t\t\t$args['where'] .= \" AND ({$wpdb->posts}.post_title LIKE {$search}\";\n\t\t\t$args['where'] .= wc_product_sku_enabled() ? ' OR wc_product_meta_lookup.sku LIKE ' . $search . ')' : ')';\n\t\t}\n\n\t\tif ( $wp_query->get( 'sku' ) ) {\n\t\t\t$skus = explode( ',', $wp_query->get( 'sku' ) );\n\t\t\t// Include the current string as a SKU too.\n\t\t\tif ( 1 < count( $skus ) ) {\n\t\t\t\t$skus[] = $wp_query->get( 'sku' );\n\t\t\t}\n\t\t\t$args['join'] = $this->append_product_sorting_table_join( $args['join'] );\n\t\t\t$args['where'] .= ' AND wc_product_meta_lookup.sku IN (\"' . implode( '\",\"', array_map( 'esc_sql', $skus ) ) . '\")';\n\t\t}\n\n\t\tif ( $wp_query->get( 'min_price' ) ) {\n\t\t\t$args['join'] = $this->append_product_sorting_table_join( $args['join'] );\n\t\t\t$args['where'] .= $wpdb->prepare( ' AND wc_product_meta_lookup.min_price >= %f ', floatval( $wp_query->get( 'min_price' ) ) );\n\t\t}\n\n\t\tif ( $wp_query->get( 'max_price' ) ) {\n\t\t\t$args['join'] = $this->append_product_sorting_table_join( $args['join'] );\n\t\t\t$args['where'] .= $wpdb->prepare( ' AND wc_product_meta_lookup.max_price <= %f ', floatval( $wp_query->get( 'max_price' ) ) );\n\t\t}\n\n\t\tif ( $wp_query->get( 'stock_status' ) ) {\n\t\t\t$args['join'] = $this->append_product_sorting_table_join( $args['join'] );\n\t\t\t$args['where'] .= $wpdb->prepare( ' AND wc_product_meta_lookup.stock_status = %s ', $wp_query->get( 'stock_status' ) );\n\t\t}\n\n\t\tif ( $wp_query->get( 'low_in_stock' ) ) {\n\t\t\t$low_stock = absint( max( get_option( 'woocommerce_notify_low_stock_amount' ), 1 ) );\n\t\t\t$args['join'] = $this->append_product_sorting_table_join( $args['join'] );\n\t\t\t$args['where'] .= $wpdb->prepare( ' AND wc_product_meta_lookup.stock_quantity <= %d', $low_stock );\n\t\t}\n\n\t\treturn $args;\n\t}", "public function query( $query_vars ) {\n\t\t$args = $this->get_wp_query_args( $query_vars );\n\n\t\tif ( ! empty( $args['errors'] ) ) {\n\t\t\t$query = (object) array(\n\t\t\t\t'posts' => array(),\n\t\t\t\t'found_posts' => 0,\n\t\t\t\t'max_num_pages' => 0,\n\t\t\t);\n\t\t} else {\n\t\t\t$query = new WP_Query( $args );\n\t\t}\n\n\t\t$orders = ( isset( $query_vars['return'] ) && 'ids' === $query_vars['return'] ) ? $query->posts : array_filter( array_map( 'wc_get_order', $query->posts ) );\n\n\t\tif ( isset( $query_vars['paginate'] ) && $query_vars['paginate'] ) {\n\t\t\treturn (object) array(\n\t\t\t\t'orders' => $orders,\n\t\t\t\t'total' => $query->found_posts,\n\t\t\t\t'max_num_pages' => $query->max_num_pages,\n\t\t\t);\n\t\t}\n\n\t\treturn $orders;\n\t}", "function alg_wc_custom_order_numbers() {\n\t\treturn Alg_WC_Custom_Order_Numbers::instance();\n\t}", "private function getShopOrderList() {\n\t\tif (array_key_exists('shopTemplate', $this->template->conf)) {\n\t\t\t$templateCode = $this->template->plugin->fileResource($this->template->conf['shopTemplate']);\n\t\t\t//$templateCode = $this->template->tplutils->getSubpart($tmpl, '###ORDERS_LIST_TEMPLATE###');\n\t\t} else {\n\t\t\t$templateCode = $this->template->plugin->getTemplate('###SHOP###');\n\t\t}\n\n\t\t$feusers_uid = $GLOBALS['TSFE']->fe_user->user['uid'];\n\t\tif (!$feusers_uid) {\n\t\t\treturn $this->template->tplutils->getSubpart($templateCode, '###MEMO_NOT_LOGGED_IN###');\n\t\t}\n\n\t\t$cond = array();\n\t\t$cond['select'] = '*';\n\t\t$cond['from'] = 'sys_products_orders';\n\t\t$cond['order'] = 'crdate';\n\n\t\t$cond['limit'] = '';\n\n\t\t// Get a custom where, or default if none\n\t\t$cond = $this->calc->custom->getOrderListCondition();\n\t\tif (!$cond) {\n\t\t\t$cond['where'] = 'feusers_uid=' . intval($feusers_uid) . ' AND NOT deleted';\n\t\t} else if (!is_array($cond)) {\n\t\t\t$cond['where'] = $cond;\n\t\t}\n\n\t\treturn $this->layoutOrderList($templateCode, $cond);\n\t}", "function get_orders($order_id = false)\n {\n global $sql_conn;\n\n $where = ( $order_id ) ? ' WHERE order_id = ' . $order_id : '';\n $sql = \"\nSELECT\n DATE_FORMAT(o.order_date,'%d/%m/%Y %h:%i') order_date,\n GROUP_CONCAT(concat(p.product_label,' (',op.product_quantity,')') SEPARATOR ',' ) products,\n o.order_id,\n u.user_id,\n CONCAT(user_firstname, ' ', user_lastname) user_fullname,\n o.amount_ex_tax,\n o.amount_inc_tax\nFROM orders o\nleft JOIN orders_products op ON o.order_id = op.order_id\nleft JOIN products p ON p.product_id = op.product_id\nleft JOIN users u ON o.user_id = u.user_id\ngroup by op.order_id\" . $where;\n\n $q = mysqli_query($sql_conn, $sql);\n\n $orders = false;\n\n if( mysqli_num_rows($q) > 0 )\n {\n while ($resp = mysqli_fetch_assoc($q))\n {\n $orders[$resp['order_id']]['order_id'] = $resp['order_id'];\n $orders[$resp['order_id']]['user_id'] = $resp['user_id'];\n $orders[$resp['order_id']]['order_date'] = $resp['order_date'];\n $orders[$resp['order_id']]['user_fullname'] = $resp['user_fullname'];\n $orders[$resp['order_id']]['amount_ex_tax'] = $resp['amount_ex_tax'];\n $orders[$resp['order_id']]['amount_inc_tax'] = $resp['amount_inc_tax'];\n $orders[$resp['order_id']]['products'] = $resp['products'];\n }\n }\n\n return $orders;\n }", "function carton_terms_clauses( $clauses, $taxonomies, $args ) {\n\tglobal $wpdb, $carton;\n\n\t// No sorting when menu_order is false\n\tif ( isset($args['menu_order']) && $args['menu_order'] == false ) return $clauses;\n\n\t// No sorting when orderby is non default\n\tif ( isset($args['orderby']) && $args['orderby'] != 'name' ) return $clauses;\n\n\t// No sorting in admin when sorting by a column\n\tif ( is_admin() && isset($_GET['orderby']) ) return $clauses;\n\n\t// wordpress should give us the taxonomies asked when calling the get_terms function. Only apply to categories and pa_ attributes\n\t$found = false;\n\tforeach ( (array) $taxonomies as $taxonomy ) :\n\t\tif ( strstr($taxonomy, 'pa_') || in_array( $taxonomy, apply_filters( 'carton_sortable_taxonomies', array( 'product_cat' ) ) ) ) :\n\t\t\t$found = true;\n\t\t\tbreak;\n\t\tendif;\n\tendforeach;\n\tif (!$found) return $clauses;\n\n\t// Meta name\n\tif ( ! empty( $taxonomies[0] ) && strstr($taxonomies[0], 'pa_') ) {\n\t\t$meta_name = 'order_' . esc_attr($taxonomies[0]);\n\t} else {\n\t\t$meta_name = 'order';\n\t}\n\n\t// query fields\n\tif ( strpos('COUNT(*)', $clauses['fields']) === false ) $clauses['fields'] .= ', tm.* ';\n\n\t//query join\n\t$clauses['join'] .= \" LEFT JOIN {$wpdb->carton_termmeta} AS tm ON (t.term_id = tm.carton_term_id AND tm.meta_key = '\". $meta_name .\"') \";\n\n\t// default to ASC\n\tif ( ! isset($args['menu_order']) || ! in_array( strtoupper($args['menu_order']), array('ASC', 'DESC')) ) $args['menu_order'] = 'ASC';\n\n\t$order = \"ORDER BY CAST(tm.meta_value AS INTEGER) \" . $args['menu_order'];\n if ( strpos('COUNT(*)', $clauses['fields']) !== false ){\n $order = '';\n }\n\n\tif ( $clauses['orderby'] ):\n\t\t$clauses['orderby'] = str_replace('ORDER BY', $order . ',', $clauses['orderby'] );\n\telse:\n\t\t$clauses['orderby'] = $order;\n\tendif;\n\n\treturn $clauses;\n}", "private function GetOrders()\n\t{\t$orders = array();\n\t\t$where = array();\n\t\t\n\t\tif ($this->startdate)\n\t\t{\t$where[] = 'orderdate>=\"' . $this->startdate . ' 00:00:00\"';\n\t\t}\n\t\tif ($this->enddate)\n\t\t{\t$where[] = 'orderdate<=\"' . $this->enddate . ' 23:59:59\"';\n\t\t}\n\t\tif (!$this->showunpaid)\n\t\t{\t$where[] = 'NOT paiddate=\"0000-00-00 00:00:00\"';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT * FROM storeorders';\n\t\tif ($wstr = implode(' AND ', $where))\n\t\t{\t$sql .= ' WHERE ' . $wstr;\n\t\t}\n\t\t$sql .= ' ORDER BY orderdate DESC';\n\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$orders[$row['id']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $orders;\n\t}", "public function get_all_my_orders()\n {\n return $this->_request('allmyorders');\n }", "function orders() {\n\t \treturn $this->hook(\"/{$this->subject_slug}/v1/orders.xml?api_key={$this->api_key}\",\"order\");\n\t}", "public function getCustomerInformationByOrderId($orderId)\n {\n $sql = <<<'EOT'\nSELECT\n `b`.`company` AS `billing_company`,\n `b`.`department` AS `billing_department`,\n `b`.`salutation` AS `billing_salutation`,\n `u`.`customernumber`,\n `b`.`firstname` AS `billing_firstname`,\n `b`.`lastname` AS `billing_lastname`,\n `b`.`street` AS `billing_street`,\n `b`.`additional_address_line1` AS `billing_additional_address_line1`,\n `b`.`additional_address_line2` AS `billing_additional_address_line2`,\n `b`.`zipcode` AS `billing_zipcode`,\n `b`.`city` AS `billing_city`,\n `b`.`phone` AS `phone`,\n `b`.`phone` AS `billing_phone`,\n `b`.`countryID` AS `billing_countryID`,\n `b`.`stateID` AS `billing_stateID`,\n `bc`.`countryname` AS `billing_country`,\n `bc`.`countryiso` AS `billing_countryiso`,\n `bca`.`name` AS `billing_countryarea`,\n `bc`.`countryen` AS `billing_countryen`,\n `b`.`ustid`,\n `ba`.`text1` AS `billing_text1`,\n `ba`.`text2` AS `billing_text2`,\n `ba`.`text3` AS `billing_text3`,\n `ba`.`text4` AS `billing_text4`,\n `ba`.`text5` AS `billing_text5`,\n `ba`.`text6` AS `billing_text6`,\n `b`.`orderID` AS `orderID`,\n `s`.`company` AS `shipping_company`,\n `s`.`department` AS `shipping_department`,\n `s`.`salutation` AS `shipping_salutation`,\n `s`.`firstname` AS `shipping_firstname`,\n `s`.`lastname` AS `shipping_lastname`,\n `s`.`street` AS `shipping_street`,\n `s`.`additional_address_line1` AS `shipping_additional_address_line1`,\n `s`.`additional_address_line2` AS `shipping_additional_address_line2`,\n `s`.`zipcode` AS `shipping_zipcode`,\n `s`.`city` AS `shipping_city`,\n `s`.`stateID` AS `shipping_stateID`,\n `s`.`countryID` AS `shipping_countryID`,\n `sc`.`countryname` AS `shipping_country`,\n `sc`.`countryiso` AS `shipping_countryiso`,\n `sca`.`name` AS `shipping_countryarea`,\n `sc`.`countryen` AS `shipping_countryen`,\n `sa`.`text1` AS `shipping_text1`,\n `sa`.`text2` AS `shipping_text2`,\n `sa`.`text3` AS `shipping_text3`,\n `sa`.`text4` AS `shipping_text4`,\n `sa`.`text5` AS `shipping_text5`,\n `sa`.`text6` AS `shipping_text6`,\n `u`.*,\n `g`.`id` AS `preisgruppe`,\n `g`.`tax` AS `billing_net`\nFROM\n `s_order_billingaddress` AS `b`\nLEFT JOIN `s_order_shippingaddress` AS `s`\n ON `s`.`orderID` = `b`.`orderID`\nLEFT JOIN `s_user` AS `u`\n ON `b`.`userID` = `u`.`id`\nLEFT JOIN `s_user_addresses` AS `ub`\n ON `u`.`default_billing_address_id`=`ub`.`id`\n AND `u`.`id`=`ub`.`user_id`\nLEFT JOIN `s_core_countries` AS `bc`\n ON `bc`.`id` = `b`.`countryID`\nLEFT JOIN `s_core_countries` AS `sc`\n ON `sc`.`id` = `s`.`countryID`\nLEFT JOIN `s_core_customergroups` AS `g`\n ON `u`.`customergroup` = `g`.`groupkey`\nLEFT JOIN s_core_countries_areas bca\n ON bc.areaID = bca.id\nLEFT JOIN s_core_countries_areas sca\n ON sc.areaID = sca.id\nLEFT JOIN s_order_billingaddress_attributes ba\n ON b.id = ba.billingID\nLEFT JOIN s_order_shippingaddress_attributes sa\n ON s.id = sa.shippingID\nWHERE\n `b`.`orderID`=:orderId\nEOT;\n\n return $this->db->fetchRow($sql, ['orderId' => $orderId]);\n }", "function getOrderings() ;", "public function getOrders()\n {\n return $this->orders;\n }", "public function rebuildOrders() {\n\t\t$totalOrdersPage = $this->ordersGetTotalPages();\n\t\tfor($i=1;$i<=$totalOrdersPage;$i++) {\n\t\t\t$page = $this->getOrders($i);\n\t\t\tif(count($page->response)) {\n\t\t\t\tforeach($page->response as $order) {\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'id' => $order->id,\n\t\t\t\t\t\t'artist_id' => $order->artist_id,\n\t\t\t\t\t\t'created_at' => $order->created_at,\n\t\t\t\t\t\t'subtotal' => $order->subtotal,\n\t\t\t\t\t\t'tax' => $order->tax,\n\t\t\t\t\t\t'currency' => $order->currency,\n\t\t\t\t\t\t'phone' => $order->phone,\n\t\t\t\t\t\t'shipping_method_calculator' => $order->shipping_method_calculator,\n\t\t\t\t\t\t'reshipment' => $order->reshipment,\n\t\t\t\t\t\t'fan' => $order->fan,\n\t\t\t\t\t\t'details_url' => $order->details_url,\n\t\t\t\t\t\t'exchange_rate' => $order->exchange_rate,\n\t\t\t\t\t\t'shipping_method_code' => $order->shipping_method_code,\n\t\t\t\t\t\t'shipping_address_firstname' => $order->shipping_address->firstname,\n\t\t\t\t\t\t'shipping_address_lastname' => $order->shipping_address->lastname,\n\t\t\t\t\t\t'shipping_address_address1' => $order->shipping_address->address1,\n\t\t\t\t\t\t'shipping_address_address2' => $order->shipping_address->address2,\n\t\t\t\t\t\t'shipping_address_city' => $order->shipping_address->city,\n\t\t\t\t\t\t'shipping_address_state' => $order->shipping_address->state,\n\t\t\t\t\t\t'shipping_address_postal_code' => $order->shipping_address->postal_code,\n\t\t\t\t\t\t'shipping_address_country' => $order->shipping_address->country,\n\t\t\t\t\t\t'shipping_address_phone' => $order->shipping_address->phone\n\t\t\t\t\t);\n\t\t\t\t\t$format = array('%d','%d','%s','%f','%f','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');\n\t\t\t\t\t$tableFields = implode(',',array_keys($data));\n\t\t\t\t\t$tableFormat = implode(',',$format);\n\t\t\t\t\t$orderOnDuplicateUpdate = '';\n\t\t\t\t\t$keyIndex = 0;\n\t\t\t\t\tforeach($data as $key=>$field) {\n\t\t\t\t\t\tif($keyIndex>0) { $orderOnDuplicateUpdate .= ', '; }\n\t\t\t\t\t\t$orderOnDuplicateUpdate .= $key.'=VALUES('.$key.')';\n\t\t\t\t\t\t$keyIndex++;\n\t\t\t\t\t}\n\t\t\t\t\t$orderSQL = <<<EOD\n\t\t\t\t\tINSERT INTO {$this->wpdb->prefix}topspin_orders ({$tableFields}) VALUES ({$tableFormat})\n\t\t\t\t\tON DUPLICATE KEY UPDATE {$orderOnDuplicateUpdate}\nEOD;\n\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($orderSQL,$data));\n\t\t\t\t\t\n\t\t\t\t\t//Build items for the order\n\t\t\t\t\tforeach($order->items as $item) {\n\t\t\t\t\t\t$itemData = array(\n\t\t\t\t\t\t\t'id' => $item->id,\n\t\t\t\t\t\t\t'order_id' => $order->id,\n\t\t\t\t\t\t\t'campaign_id' => $item->campaign_id,\n\t\t\t\t\t\t\t'line_item_id' => $item->line_item_id,\n\t\t\t\t\t\t\t'spin_name' => $item->spin_name,\n\t\t\t\t\t\t\t'product_id' => $item->product_id,\n\t\t\t\t\t\t\t'product_name' => $item->product_name,\n\t\t\t\t\t\t\t'product_type' => $item->product_type,\n\t\t\t\t\t\t\t'merchandise_type' => $item->merchandise_type,\n\t\t\t\t\t\t\t'quantity' => $item->quantity,\n\t\t\t\t\t\t\t'sku_id' => $item->sku_id,\n\t\t\t\t\t\t\t'sku_upc' => $item->sku_upc,\n\t\t\t\t\t\t\t'sku_attributes' => serialize($item->sku_attributes),\n\t\t\t\t\t\t\t'factory_sku' => $item->factory_sku,\n\t\t\t\t\t\t\t'shipped' => $item->shipped,\n\t\t\t\t\t\t\t'status' => $item->status,\n\t\t\t\t\t\t\t'weight' => serialize($item->weight),\n\t\t\t\t\t\t\t'bundle_sku_id' => $item->bundle_sku_id,\n\t\t\t\t\t\t\t'shipping_date' => $item->shipping_date\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$itemFormat = array('%d','%d','%d','%d','%s','%d','%s','%s','%s','%d','%d','%s','%s','%s','%d','%s','%s','%d','%s');\n\t\t\t\t\t\t$itemTableFields = implode(',',array_keys($itemData));\n\t\t\t\t\t\t$itemTableFormats = implode(',',$itemFormat);\n\t\t\t\t\t\t$itemOnDuplicateUpdate = '';\n\t\t\t\t\t\t$itemKeyIndex = 0;\n\t\t\t\t\t\tforeach($itemData as $itemKey=>$itemField) {\n\t\t\t\t\t\t\tif($itemKeyIndex>0) { $itemOnDuplicateUpdate .= ', '; }\n\t\t\t\t\t\t\t$itemOnDuplicateUpdate .= $itemKey.'=VALUES('.$itemKey.')';\n\t\t\t\t\t\t\t$itemKeyIndex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$itemSQL = <<<EOD\n\t\t\t\t\t\tINSERT INTO {$this->wpdb->prefix}topspin_orders_items ({$itemTableFields}) VALUES ({$itemTableFormats})\n\t\t\t\t\t\tON DUPLICATE KEY UPDATE {$itemOnDuplicateUpdate}\nEOD;\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($itemSQL,$itemData));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getOrders() {\n\t\t$orders = Mage::getModel ( 'sales/order' )->getCollection ()->addAttributeToSelect ( \"*\" )->addAttributeToFilter ( 'status', array ('complete') );\n\t\t$orders_data = $this->preapreOrdersTosend ( $orders );\n\t\treturn $orders_data;\n\t}", "public function orderQueryAction()\n {\n // https://api.weixin.qq.com/pay/orderquery?access_token=xxxxxx\n $orderId = $this->params()->fromRoute('id', '0');\n\n $order = $this->getOrderTable()->getOrder($orderId);\n if ($orderId == '0' || !$order) {\n return $this->errorViewModel(array('code' => 1, 'msg' => 'order '.$orderId.' not exist.'));\n }\n\n $postResult = $this->orderQuery($orderId);\n // echo $postResult;\n echo '<br>errcode:';\n echo $postResult->errcode;\n echo '<br>errmsg:';\n echo $postResult->errmsg;\n if ($postResult->errcode == 0) {\n echo '<br>orderinfo:';\n var_dump($postResult->order_info);\n }\n\n return $this->viewModel();\n }", "private static function getAllNewSystem(): array\n {\n $args = [\n 'post_status' => self::$ordersStatuses,\n 'posts_per_page' => self::$limit,\n 'paged' => self::$currentPage,\n 'orderby' => 'date',\n 'paginate' => true,\n 'order' => 'DESC',\n 'meta_query' => [\n 'relation' => 'OR',\n [\n 'key' => '_moloni_sent',\n 'compare' => 'NOT EXISTS'\n ],\n [\n 'key' => '_moloni_sent',\n 'value' => '0',\n 'compare' => '='\n ]\n ],\n ];\n\n $args = apply_filters('moloni_before_pending_orders_fetch', $args);\n\n $results = wc_get_orders($args);\n\n self::$totalPages = $results->max_num_pages;\n\n return $results->orders;\n }", "function getAllOrders()\n {\n $dataService = new OrderDataService();\n\n return $dataService->getAllOrders();\n }", "protected static function order_index() {\n\t\t\treturn self::index() . 'orders';\n\t\t}", "public function query(Order $model)\n {\n return $model->newQuery()->select('id', 'product_id', 'user_id','amount', 'created_at', 'updated_at');\n }", "public static function getOrders()\n\t{\n $orders = DB::query(\"SELECT orderproducts.*, products.strName, products.strDescription, products.strFeatures, products.price, products.category_id, products.status_id, orders.totalAmount, orders.date, inventoryproducts.name AS inventoryproductsname\n FROM orderproducts\n LEFT JOIN orders ON orderproducts.orderId=orders.id\n LEFT JOIN products ON orderproducts.productId=products.id\n LEFT JOIN inventoryproducts ON products.inventoryproductsId=inventoryproducts.id\");\n\n // acting as a factory\n // empty array to avoid errors when nothing was found\n\t\t$ordersArray = array();\n\t\tforeach($orders as $order)\n\t\t{\n\t\t\t// create an instance / object for this SPECIFIC \n\t\t\t$ordersArray[] = new OrdersAdmin($order); // put this object onto the array\n }\n\t\t// return the list of objects\n\t\t//return $ordersArray;\n }", "protected function include_extended_info( &$orders_data, $query_args ) {\n\t\t$mapped_orders = $this->map_array_by_key( $orders_data, 'order_id' );\n\t\t$products = $this->get_products_by_order_ids( array_keys( $mapped_orders ) );\n\t\t$coupons = $this->get_coupons_by_order_ids( array_keys( $mapped_orders ) );\n\t\t$customers = $this->get_customers_by_orders( $orders_data );\n\t\t$mapped_customers = $this->map_array_by_key( $customers, 'customer_id' );\n\n\t\t$mapped_data = array();\n\t\tforeach ( $products as $product ) {\n\t\t\tif ( ! isset( $mapped_data[ $product['order_id'] ] ) ) {\n\t\t\t\t$mapped_data[ $product['order_id'] ]['products'] = array();\n\t\t\t}\n\n\t\t\t$is_variation = '0' !== $product['variation_id'];\n\t\t\t$product_data = array(\n\t\t\t\t'id' => $is_variation ? $product['variation_id'] : $product['product_id'],\n\t\t\t\t'name' => $product['product_name'],\n\t\t\t\t'quantity' => $product['product_quantity'],\n\t\t\t);\n\n\t\t\tif ( $is_variation ) {\n\t\t\t\t$variation = wc_get_product( $product_data['id'] );\n\t\t\t\t$separator = apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $variation );\n\n\t\t\t\tif ( false === strpos( $product_data['name'], $separator ) ) {\n\t\t\t\t\t$attributes = wc_get_formatted_variation( $variation, true, false );\n\t\t\t\t\t$product_data['name'] .= $separator . $attributes;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$mapped_data[ $product['order_id'] ]['products'][] = $product_data;\n\t\t}\n\n\t\tforeach ( $coupons as $coupon ) {\n\t\t\tif ( ! isset( $mapped_data[ $coupon['order_id'] ] ) ) {\n\t\t\t\t$mapped_data[ $product['order_id'] ]['coupons'] = array();\n\t\t\t}\n\n\t\t\t$mapped_data[ $coupon['order_id'] ]['coupons'][] = array(\n\t\t\t\t'id' => $coupon['coupon_id'],\n\t\t\t\t'code' => wc_format_coupon_code( $coupon['coupon_code'] ),\n\t\t\t);\n\t\t}\n\n\t\tforeach ( $orders_data as $key => $order_data ) {\n\t\t\t$defaults = array(\n\t\t\t\t'products' => array(),\n\t\t\t\t'coupons' => array(),\n\t\t\t\t'customer' => array(),\n\t\t\t);\n\t\t\t$orders_data[ $key ]['extended_info'] = isset( $mapped_data[ $order_data['order_id'] ] ) ? array_merge( $defaults, $mapped_data[ $order_data['order_id'] ] ) : $defaults;\n\t\t\tif ( $order_data['customer_id'] && isset( $mapped_customers[ $order_data['customer_id'] ] ) ) {\n\t\t\t\t$orders_data[ $key ]['extended_info']['customer'] = $mapped_customers[ $order_data['customer_id'] ];\n\t\t\t}\n\t\t}\n\t}", "public function getOrdersForCustomer($customerId);", "public function getOrders() : \\TheCodingMachine\\TDBM\\AlterableResultIterator\n {\n return $this->retrieveManyToOneRelationshipsStorage('orders', 'from__product_id__to__table__products__columns__id', ['orders.product_id' => $this->get('id', 'products')]);\n }", "public function lstOrderDetail(){\n\t\t$Sql = \"SELECT \n\t\t\t\t\torder_detail_id,\n\t\t\t\t\torder_id,\n\t\t\t\t\tcustomer_id,\n\t\t\t\t\textra_feature_id,\n\t\t\t\t\tfeature_name,\n\t\t\t\t\tquantity,\n\t\t\t\t\tprice\n\t\t\t\tFROM\n\t\t\t\t\trs_tbl_order_details\n\t\t\t\tWHERE\n\t\t\t\t\t1=1\";\n\t\t\n\t\tif($this->isPropertySet(\"order_detail_id\", \"V\")){\n\t\t\t$Sql .= \" AND order_detail_id='\" . $this->getProperty(\"order_detail_id\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"order_id\", \"V\")){\n\t\t\t$Sql .= \" AND order_id='\" . $this->getProperty(\"order_id\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"customer_id\", \"V\")){\n\t\t\t$Sql .= \" AND customer_id=\" . $this->getProperty(\"customer_id\");\n\t\t}\n\t\tif($this->isPropertySet(\"extra_feature_id\", \"V\")){\n\t\t\t$Sql .= \" AND extra_feature_id='\" . $this->getProperty(\"extra_feature_id\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\")){\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\n\t\t}\n\t\t\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\n\t\treturn $this->dbQuery($Sql);\n\t}", "function get_order()\n{\n\n}", "public function getData($order = '',$custom = FALSE){\n if($custom == FALSE){\n return $this->db->query('SELECT * FROM `'.$this->prefix.$this->table.'` '.$order.';')->setFetchMode(\\PDO::FETCH_ASSOC)->get(); \n }else{\n return $this->db->query($custom)->setFetchMode(\\PDO::FETCH_ASSOC)->get(); \n }\n }", "public function getOrderings() {}", "public function get_order_items($order_id)\n\t{\n\t\t$this->db->select('product.product_name, product.product_thumb_name, order_item.*, vendor.vendor_store_name, vendor.vendor_id');\n\t\t$this->db->where('product.created_by = vendor.vendor_id AND product.product_id = order_item.product_id AND order_item.order_id = '.$order_id);\n\t\t$query = $this->db->get('order_item, product, vendor');\n\t\t\n\t\treturn $query;\n\t}", "static function get_orders_by_product_id($product_id, $offset = null, $per_page = null ) {\n\n global $wpdb;\n $tabelaOrderItemMeta = $wpdb->prefix . 'woocommerce_order_itemmeta';\n $tabelaOrderItems = $wpdb->prefix . 'woocommerce_order_items';\n $limiter_str = '';\n\n if( $offset !== null && $per_page !== null ) {\n $limiter_str = \" LIMIT $offset, $per_page \";\n }\n\n if( is_array( $product_id ) ) {\n\n echo \"SELECT b.order_id, a.meta_value as product_id\nFROM {$tabelaOrderItemMeta} a, {$tabelaOrderItems} b\nWHERE a.meta_key = '_product_id'\nAND a.meta_value IN (%s)\nAND a.order_item_id = b.order_item_id\nORDER BY b.order_id DESC $limiter_str\";\n\n $results = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT b.order_id, a.meta_value as product_id\nFROM {$tabelaOrderItemMeta} a, {$tabelaOrderItems} b\nWHERE a.meta_key = '_product_id'\nAND a.meta_value IN (%s)\nAND a.order_item_id = b.order_item_id\nORDER BY b.order_id DESC $limiter_str\",\n\n implode(',', $product_id ) //array('336','378')\n )\n );\n } else {\n $results = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT b.order_id\nFROM {$tabelaOrderItemMeta} a, {$tabelaOrderItems} b\nWHERE a.meta_key = '_product_id'\nAND a.meta_value = %s\nAND a.order_item_id = b.order_item_id\nORDER BY b.order_id DESC $limiter_str\",\n $product_id\n )\n );\n }\n\n\n if ($results) {\n\n $order_ids = array();\n foreach ($results as $item)\n array_push($order_ids, $item->order_id);\n\n if ($order_ids) {\n $args = array(\n 'post_type' => 'shop_order',\n 'post_status' => array('wc-processing', 'wc-completed'),\n 'posts_per_page' => -1,\n 'post__in' => $order_ids,\n 'fields' => 'ids'\n );\n $query = new WP_Query($args);\n return $query;\n }\n }\n\n return false;\n }", "public static function admin_order_add_custom_meta_data( $data, $wc_order )\n {\n $configs = OmnivaLt_Core::get_configs();\n $order = OmnivaLt_Wc_Order::get_data($wc_order->get_id(), array('omniva'));\n\n foreach ( $configs['method_params'] as $method_key => $method_values ) {\n if ( ! $method_values['is_shipping_method'] ) continue;\n if ( $order->omniva->method != $method_values['key'] ) continue;\n\n if ( $method_values['key'] == 'pt' || $method_values['key'] == 'ps' ) {\n $data['shipping_via'] = 'Omniva ' . strtolower($method_values['title']) . \": \" . OmnivaLt_Terminals::get_terminal_address($order->omniva->terminal_id);\n }\n }\n\n if ($order->omniva->method) {\n $shipping_settings = OmnivaLt_Core::get_settings();\n $omnivalt_labels = new OmnivaLt_Labels();\n\n $barcode = $order->omniva->barcodes[0];\n $country_code = $shipping_settings['shop_countrycode'];\n $data['omnivalt_tracking_link'] = $omnivalt_labels->get_tracking_link($country_code, $barcode, true);\n $data['omnivalt_barcode'] = $barcode;\n }\n\n return $data;\n }", "public function getOrders()\n {\n $response = $this->orderDesk->get( \"orders\" );\n $orders = $response[ \"orders\" ];\n $values = [];\n\n if (!empty($orders)) {\n foreach ( $orders as $order ) {\n\n $value = [\n $order[\"shipping\"][\"first_name\"],\n $order[\"shipping\"][\"last_name\"],\n $order[\"email\"],\n $order[\"shipping_method\"],\n $order[\"payment_type\"],\n $order[\"order_total\"]\n ];\n \n array_push( $values, $value );\n }\n \n $this->updateGoogleSheets( $values );\n } else {\n return $response['message'];\n }\n }", "protected function build_sql() {\n\n\t\t$builder = new Builder();\n\n\t\t$select = $this->parse_select();\n\t\t$from = new From( $this->table->get_table_name( $GLOBALS['wpdb'] ), 'q' );\n\n\t\t$where = new Where( 1, true, 1 );\n\n\t\tif ( ( $id = $this->parse_id() ) !== null ) {\n\t\t\t$where->qAnd( $id );\n\t\t}\n\n\t\tif ( ( $transaction = $this->parse_transaction() ) !== null ) {\n\t\t\t$where->qAnd( $transaction );\n\t\t}\n\n\t\tif ( ( $customer = $this->parse_customer() ) !== null ) {\n\t\t\t$where->qAnd( $customer );\n\t\t}\n\n\t\tif ( ( $membership = $this->parse_membership() ) !== null ) {\n\t\t\t$where->qAnd( $membership );\n\t\t}\n\n\t\tif ( ( $seats = $this->parse_seats() ) !== null ) {\n\t\t\t$where->qAnd( $seats );\n\t\t}\n\n\t\tif ( ( $seats_gt = $this->parse_seats_gt() ) !== null ) {\n\t\t\t$where->qAnd( $seats_gt );\n\t\t}\n\n\t\tif ( ( $seats_lt = $this->parse_seats_lt() ) !== null ) {\n\t\t\t$where->qAnd( $seats_lt );\n\t\t}\n\n\t\tif ( ( $active = $this->parse_active() ) !== null ) {\n\t\t\t$where->qAnd( $active );\n\t\t}\n\n\t\t$order = $this->parse_order();\n\t\t$limit = $this->parse_pagination();\n\n\t\tif ( $this->args['return_value'] == 'relationships' ) {\n\n\t\t\t$match = new Where_Raw( 'r.purchase = q.id' );\n\t\t\t$match->qAnd( $where );\n\n\t\t\t$select = $this->parse_select( 'r' );\n\t\t\t$join = new Join( $from, $match );\n\n\t\t\t$from = new From(\n\t\t\t\tManager::get( 'itegms-relationships' )->get_table_name( $GLOBALS['wpdb'] ), 'r'\n\t\t\t);\n\t\t\t$where = $join;\n\t\t}\n\n\t\t$builder->append( $select );\n\t\t$builder->append( $from );\n\t\t$builder->append( $where );\n\t\t$builder->append( $order );\n\n\t\tif ( $limit !== null ) {\n\t\t\t$builder->append( $limit );\n\t\t}\n\n\t\treturn $builder->build();\n\t}", "function mycpt_custom_orderby( $query ) {\n if ( ! is_admin() )\n return;\n \n $orderby = $query->get( 'orderby');\n \n if ( 'email' == $orderby ) {\n $query->set( 'meta_key', 'email' );\n $query->set( 'orderby', 'meta_value' );\n }\n else if( 'company' == $orderby ) {\n $query->set( 'meta_key', 'company');\n $query->set( 'orderby', 'meta_value');\n } else {\n $query->set( 'orderby', 'title');\n }\n}", "function buildOrder($orders) {\n\t$order = [\n\t\t\"service_uid\" => $orders[0][15],\n\t\t\"points\" => 0,\n\t\t\"invoice_number\" => $orders[0][2],\n\t\t\"purchase_detail\" => [],\n\t\t\"prices\" => [],\n\t\t\"branch_name\" => $orders[0][0],\n\t\t\"createtime\" => date('Y-m-d H:i:s')\n\t];\n\n\t$total = 0;\n\t$discount = 0;\n\tforeach ($orders as $o) {\n\t\t$order['purchase_detail'][] = [\n\t\t\t\"sku\" => $o[3],\n\t\t\t\"product_name\" => $o[4],\n\t\t\t\"category\" => [$o[5], $o[6]],\n\t\t\t\"quantity\" => (int) abs($o[16]),\n\t\t\t\"unit_price\" => (float) $o[17],\n\t\t\t\"variations\" => [\n\t\t\t\t['name' => 'Linea', 'value' => $o[5]],\n\t\t\t\t['name' => 'Color', 'value' => $o[10]],\n\t\t\t\t['name' => 'Talle', 'value' => $o[11]],\n\t\t\t]\n\t\t];\n\n\t\t$total += (int) abs($o[16]) * (float) $o[17];\n\t\t$discount += abs($o[19]);\n\t}\n\n\t$order['prices'] = [\n\t\t\"gross\" => $total,\n\t\t\"discount\" => $discount,\n\t\t\"total\" => $total - $discount\n\t];\n\n\treturn $order;\n}", "function qmgt_sort_quotes( $vars ) {\r\n\r\n\t/* Check if we're viewing the 'quote' post type. */\r\n\tif ( isset( $vars['post_type'] ) && 'quote' == $vars['post_type'] ) {\r\n\r\n\t\t/* Check if 'orderby' is set to 'duration'. */\r\n\t\tif ( isset( $vars['orderby'] ) && 'last_ran_date' == $vars['orderby'] ) {\r\n\r\n\t\t\t/* Merge the query vars with our custom variables. */\r\n\t\t\t$vars = array_merge(\r\n\t\t\t\t$vars,\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'meta_key' => '_cmb_last_ran_date',\r\n\t\t\t\t\t'meta_type' => 'DATETIME',\r\n\t\t\t\t\t'orderby' => 'meta_value'\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\treturn $vars;\r\n}", "function product_query( $q, $woocommerce ) {\n\t\tglobal $wp_query;\n\n\t\t$this->woocommerce_query = $q;\n\t\t$this->woocommerce = $woocommerce;\n\n\t\tif ( $this->is_woocommerce_search() ) {\n\t\t\t$q->set( 's', '' );\n\t\t}\n\n\t\t// if SearchWP found search results we want the order of results to be returned by SearchWP weight in descending order\n\t\tif ( $this->is_woocommerce_search() && apply_filters( 'searchwp_woocommerce_force_weight_sort', true ) ) {\n\t\t\t$wp_query->set( 'order', 'DESC' );\n\t\t\t$wp_query->set( 'orderby', 'post__in' );\n\n\t\t\t// if it's not the main Search page, it's the WooCommerce Shop page\n\t\t\tif ( ! is_search() && wc_get_page_id( 'shop' ) == get_queried_object_id() ) {\n\t\t\t\t$wp_query->set( 's', '' );\n\t\t\t}\n\t\t}\n\t}", "public function index(Orders $orders , Request $request)\n {\n $orders = $orders->with('customs');\n $request->user()->customer_id && $orders = $orders->where('cid',$request->user()->customer_id);\n if($request->money){\n $arr = explode('-',$request->money);\n if(count($arr) == 1){\n $orders = $orders->where('money','>',$arr[0]);\n }else if(count($arr) == 2){\n $orders = $orders->whereBetween('money',explode('-',$request->money));\n }\n }\n $request->status && $orders = $orders->where('order_status',$request->status);\n $request->name && $orders = $orders->whereHas('customs',function($query) use ($request){\n $query->where('company_name','like',\"%{$request->name}%\")->orWhere('company_addr','like','%'.$request->name.'%');\n });\n $request->time && $orders = $orders->whereDate('created_at',$request->time);\n return new OrdersResources($orders->orderBy('id','desc')->paginate($request->pageSize ?? $request->pageSize));\n }", "function cb_order_meta_general( $order ) {\n\tif ($order->get_payment_method() == 'coinbase') {\n\t\t?>\n\n\t\t<br class=\"clear\"/>\n\t\t<h3>Coinbase Commerce Data</h3>\n\t\t<div class=\"\">\n\t\t\t<p>Coinbase Commerce Reference # <?php echo esc_html($order->get_meta('_coinbase_charge_id')); ?></p>\n\t\t</div>\n\n\t\t<?php\n\t}\n}", "function get_woocommerce_ordering() {\n\t\tif ( ! $this->is_woocommerce_search() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! function_exists( 'WC' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isset( WC()->query ) && ! is_object( WC()->query ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! method_exists( WC()->query, 'get_catalog_ordering_args' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->ordering = WC()->query->get_catalog_ordering_args();\n\t\t$this->ordering['wc_orderby'] = isset( $_GET['orderby'] ) ? $_GET['orderby'] : '';\n\t}", "protected function getAllOrders()\n {\n return Order::withTrashed()\n ->with(['address', 'user'])\n ->orderBy('id', 'DESC')\n ->get();\n }", "public function wp_query_customer_query( $join, $wp_query ) {\n global $wpdb;\n\n // If there is no wc_customer_query then no need to process anything\n if( ! isset( $wp_query->query_vars['wc_customer_query'] ) ) {\n return $join;\n }\n\n $customer_query = $this->generate_wc_customer_query( $wp_query->query_vars['wc_customer_query'] );\n\n\n $query_parts = array();\n\n if( ! empty( $customer_query['emails'] ) ) {\n $emails = '\\'' . implode( '\\', \\'', array_unique( $customer_query['emails'] ) ) . '\\'';\n $query_parts[] = \"{$this->get_table_name()}.billing_email IN ( {$emails} )\";\n }\n\n if( ! empty( $customer_query['users'] ) ) {\n $users = implode( ',', array_unique( $customer_query['users'] ) );\n $query_parts[] = \"{$this->get_table_name()}.customer_id IN ( {$users} )\";\n }\n\n if( ! empty( $query_parts ) ) {\n $query = '( ' . implode( ') OR (', $query_parts ) . ' )';\n $join .= \"\n JOIN {$this->get_table_name()} ON\n ( {$wpdb->posts}.ID = {$this->get_table_name()}.order_id )\n AND ( {$query} )\";\n }\n\n return $join;\n }", "function apptivo_recent_products($per_page=8,$orderby='date',$order='desc')\n{\n\twp_reset_query();\n\t$args = array(\n\t\t'post_type'\t=> 'item',\n\t\t'post_status' => 'publish',\t \n\t\t'posts_per_page' => $per_page,\n\t\t'orderby' => $orderby,\n\t\t'order' => $order,\n\t 'meta_key' \t=> '_apptivo_sale_price',\n\t\t'meta_query' => array(\n\tarray('key' => '_apptivo_enabled','value' => 'yes','compare' => '=','type' => 'CHAR')\n\t)\n\t);\n\n\tquery_posts($args);\n}", "public function findAllOrders()\n {\n return $this->createQueryBuilder('o')\n ->orderBy('o.createdDate' , 'DESC');\n }", "public function query($filters = array(), $meta_controls = array()) {\n\n global $user;\n\n // We don't care if an anonymous user wants to see orders that other users\n // created. We just don't send other people's email addresses to anonymous users\n\n // Implemented filters:\n // Single order by order id (order_id=<id>) (used also for cart orders created\n // by anonymous users)\n // Cart order of the logged in user (status='cart' and user id from $user->uid)\n // Every order for the logged in user (uid from $user->uid and no filter)\n\n // The filter status='cart' used to get all cart order for the logged in user\n // is still working but it's not used on the Angular side.\n // Angular uses this api to retrieve all orders for the logged-in user and\n // cart orders are included in the reply\n\n // Notice that the 'cart' filter returns all 'cart' orders for the logged-in user\n // if there are many of them\n\n // @attention here, what about orders in 'checkout_...'?\n // If an order is anonymous and it's in 'checkout_*' status, we won't be able\n // to find it by using this api. It's lost and the user will have to restart\n // from scratch\n\n $return_cart_for_current_user = false;\n $return_every_order_for_current_user = false;\n $order_id = 0;\n\n if (!empty($filters['order_id'])) {\n // If we have the order id, just send the order back\n $order_id = $filters['order_id'];\n } else {\n // No order id, let's check the status\n\n if (!empty($filters['status'])) {\n // If we have a status, it should be 'cart'. We are not supporting filtering\n // on other statuses now\n $status = $filters['status'];\n if ($status == 'cart') {\n\n // This REST api shouldn't be called to get 'cart' orders for the logged-in user\n // It's still working if called, but let me watchdog a warning\n\n watchdog('musth_restws',\n '6TG2PL Why is this api called to get cart orders?. (!f) (!u) ',\n array('!f' => print_r($filters, true),\n '!u' => print_r($user, true)),\n WATCHDOG_WARNING);\n\n // Let's go on with checking if the user is logged in\n if ($user->uid != 0) {\n $return_cart_for_current_user = true;\n } else {\n // No order id is provided, so we can only send back the 'cart' order of the\n // logged-in user. But no user is logged in, or the credentials were wrong\n\n watchdog('musth_restws',\n 'W3E069 User not logged in, we cant send back the cart order. (!f) (!u) ',\n array('!f' => print_r($filters, true),\n '!u' => print_r($user, true)),\n WATCHDOG_ERROR);\n\n throw new RestWSException('No logged-in user or wrong credentials', 403);\n }\n\n } else {\n\n watchdog('musth_restws',\n 'W3E070 Filtering on statuses other than cart not supported (!f)',\n array('!f' => print_r($filters, true)),\n WATCHDOG_ERROR);\n\n throw new RestWSException('Filtering on statuses other than cart not supported', 412);\n }\n\n } else {\n // No status set (and no order_id)\n // In this case we return every order associated to the logged-in user\n\n if ($user->uid != 0) {\n $return_every_order_for_current_user = true;\n } else {\n\n watchdog('musth_restws',\n 'W3E071 We send the full list of orders only to logged-in users. (!f) (!u) ',\n array('!f' => print_r($filters, true),\n '!u' => print_r($user, true)),\n WATCHDOG_ERROR);\n\n throw new RestWSException('We send the full list of orders only to logged-in users', 403);\n }\n\n }\n\n } // if (isset($filters['order_id']))\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'commerce_order')\n ->entityCondition('bundle', 'commerce_order');\n\n if ($return_cart_for_current_user)\n $query->propertyCondition('status', 'cart');\n\n if ($return_cart_for_current_user || $return_every_order_for_current_user)\n $query->propertyCondition('uid', $user->uid);\n\n if ($order_id)\n $query->propertyCondition('order_id', $order_id);\n\n $result = $query->execute();\n\n if (isset($result['commerce_order'])) {\n $order_ids = array_keys($result['commerce_order']);\n } else {\n // No order found? Throw an exception unless angular asked for all orders for the current user\n\n if ($return_every_order_for_current_user) {\n\n // If angular asked for all orders for the current user, we are in the case that the user\n // has no orders. It can be.\n $order_ids = array();\n\n } else {\n // In any other case we throw an exception because we should find an order\n\n watchdog('musth_rules', 'W3E072 No orders found (!f) (!u) ',\n array('!f' => print_r($filters, true),\n '!u' => print_r($user, true)),\n WATCHDOG_ERROR);\n\n // Get out of here!\n throw new RestWSException('No orders found', 404);\n\n }\n\n }\n\n // Commerce apis calculate the order total themselves, nothing to do about it\n\n //watchdog('musth_restws', 'W7D001 8181 order query flags (!f) (!m) (!n) (!i) (!q) ',\n // array('!f' => print_r($return_cart_for_current_user, true),\n // '!m' => print_r($return_every_order_for_current_user, true),\n // '!n' => print_r($order_id, true),\n // '!i' => print_r($order_ids, true),\n // '!q' => print_r($query, true),\n // ), WATCHDOG_DEBUG);\n\n return $order_ids;\n }", "public function getOrders()\n {\n return $this->hasMany(Order::className(), ['customer_id' => 'id']);\n }", "function getAllOrders(){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT *\n\t\t\t\t\t\t\t\t\t\tFROM `order`');\n\t\t$sth \t-> execute();\n\t\treturn \t$sth;\n\t}", "public static function getCustomerPreordersData($orders)\n {\n $sql = 'SELECT jc.`name` as \"Name\", jc.`number` as \"Phone number\", jc.`address` as \"Address\", jc.`message` as \"Message\", jc.`email` as \"Email\", jc.`datetime` as \"Date\"\n FROM '._DB_PREFIX_.'jxoneclickorder_customers jc\n LEFT JOIN '._DB_PREFIX_.'jxoneclickorder j\n ON(j.`id_order` = jc.`id_order`)\n WHERE j.`id_original_order` IN('.implode(',', $orders).')';\n\n return Db::getInstance()->executeS($sql);\n }", "public function fetchWarehouseOrders() {\n $pullList = $this->find('all', array(\n 'conditions' => array(\n 'Order.status' => array('Released', 'Pulled')\n ),\n 'contain' => array(\n 'User',\n 'UserCustomer' => array(\n 'Customer' => array(\n 'fields' => array(\n 'id',\n 'allow_backorder'\n )\n )\n ),\n 'Budget',\n 'OrderItem' => array(\n 'Catalog' => array(\n 'ParentCatalog' => array(\n 'Item'\n )\n ),\n 'Item' => array(\n 'Image',\n 'Location'\n )\n ),\n 'Shipment',\n 'Document' => array(\n 'fields' => array(\n 'id'\n )\n )\n )));\n $this->groupWarehouseOrders($pullList);\n return $this->statusOutputOrder;\n }", "protected function getVendorOrders() {\n\n\t\t$this->load->model('sale/vdi_order');\n\t\t$data = array();\n\n if (isset($this->request->request['filter_order_status'])) {\n //check input - should be list of integers\n if (1 === preg_match('/^[0-9,\\s]+$/',\n $this->request->request['filter_order_status'])) {\n $data['filter_order_status'] = $this->request->request['filter_order_status'];\n }\n }\n\n $result = array();\n $orderCount = $this->model_sale_vdi_order->getTotalOrders($data);\n $result['total_order_count'] = $orderCount;\n\n if (!isset($this->request->request['metaonly']) ||\n (\"true\" !== $this->request->request['metaonly'])) {\n $orders = $this->model_sale_vdi_order->getOrdersByOrderProductStatus($data);\n $result['orders'] = $orders;\n }\n\n\t\treturn $result;\n\t}", "public function AllOrders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllOrders($per_page, $offset);\n return $this->response($result);\n }", "public function actionWalmartorderinfo()\n {\n $status = false;\n if (isset($_GET['status'])) {\n $status = $_GET['status'];\n }\n $merchant_id = MERCHANT_ID;\n $test = false;\n $prev_date = date('Y-m-d', strtotime(date('Y-m-d') . ' -2 month'));\n $config = Data::getConfiguration($merchant_id);\n $walmartHelper = new Walmartapi($config['consumer_id'], $config['secret_key']);\n if ($status) {\n $orderdata = $walmartHelper->getOrders(['status' => $status, 'limit' => '100', 'createdStartDate' => $prev_date], Walmartapi::GET_ORDERS_SUB_URL, $test);\n } else {\n $orderdata = $walmartHelper->getOrders(['limit' => '100', 'createdStartDate' => $prev_date], Walmartapi::GET_ORDERS_SUB_URL, $test);\n }\n\n print_r($orderdata);\n die;\n }", "public function getOrderings();", "private function _buildOrderClause()\n {\n $order = array();\n\n switch ( $this->orderby ) {\n case self::ORDERBY_DATE:\n $order[] = 'date_enreg' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_BEGIN_DATE:\n $order[] = 'date_debut_cotis' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_END_DATE:\n $order[] = 'date_fin_cotis' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_MEMBER:\n $order[] = 'nom_adh' . ' ' . $this->ordered;\n $order[] = 'prenom_adh' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_TYPE:\n $order[] = ContributionsTypes::PK;\n break;\n case self::ORDERBY_AMOUNT:\n $order[] = 'montant_cotis' . ' ' . $this->ordered;\n break;\n /*\n Hum... I really do not know how to sort a query with a value that\n is calculated code side :/\n case self::ORDERBY_DURATION:\n break;*/\n default:\n $order[] = $this->orderby . ' ' . $this->ordered;\n break;\n }\n\n return $order;\n }", "public function query(Order $model)\n {\n if(auth()->user()->hasRole(['admin', 'manager', 'manager'])){\n return $model\n ->where('library_id', 1) // 1 is default admin library\n ->where('status', '!=', 1)\n ->with('orderItems.book')\n ->newQuery();\n }else{\n return $model\n ->where('library_id', Auth::user()->library->id)\n ->where('status', '!=', 1)\n ->with('orderItems.book')\n ->newQuery();\n }\n }", "public function woocommerce_reports_customer_overview_customer_orders($orders) {\n\t}", "public function get_supported_orders(\\context $context) {\n $orders = parent::get_supported_orders($context);\n\n // If not within a course, no other kind of sorting supported.\n $coursecontext = $context->get_course_context(false);\n if ($coursecontext) {\n // Within a course or activity/block, support sort by location.\n $orders['location'] = get_string('order_location', 'search',\n $context->get_context_name());\n }\n\n return $orders;\n }", "private function fetchOrders(): Builder\n {\n $sortOrder = request('order') ?? 'desc';\n $sortBy = request('sort') ?? 'created_at';\n\n if (! request()->filled('search')) {\n return Order::orderBy($sortBy, $sortOrder);\n }\n\n return $this->searchOrders();\n }", "private function getOrdersListQuery($byOrderItem = false)\n {\n $q = ' FROM #__virtuemart_orders as o\n\t\t\t\tLEFT JOIN #__virtuemart_order_userinfos as u\n\t\t\t\tON u.virtuemart_order_id = o.virtuemart_order_id AND u.address_type=\"BT\"\n\t\t\t\tLEFT JOIN #__virtuemart_order_userinfos as st\n\t\t\t\tON st.virtuemart_order_id = o.virtuemart_order_id AND st.address_type=\"ST\" ';\n if ($byOrderItem) {\n $q .= ' LEFT JOIN #__virtuemart_order_items as oi\n\t\t\t\tON o.virtuemart_order_id = oi.virtuemart_order_id ';\n }\n $q .= '\tLEFT JOIN #__virtuemart_paymentmethods_' . VmConfig::$vmlang . ' as pm\n\t\t\t\tON o.virtuemart_paymentmethod_id = pm.virtuemart_paymentmethod_id\n\t\t\t\tLEFT JOIN #__virtuemart_shipmentmethods_' . VmConfig::$vmlang . ' as sm\n\t\t\t\tON o.virtuemart_shipmentmethod_id = sm.virtuemart_shipmentmethod_id';\n return $q;\n }", "public function get_all($value='', $field='', $order_by='', $field_type='%d', $order_direction='ASC',$only_fields=array()) {\r\n\t \tglobal $wpdb;\r\n\t \t\r\n\t \tif ($field=='')\r\n\t \t\t$field = 'id';\r\n\t \t\r\n\t \t// Special cases for ordering that requires innerjoins\r\n\t \t$extra_sql = '';\r\n\t \t// Special case for categories\r\n\t \tif ($order_by=='term_id') {\r\n\t \t\t// \"left outer join\" is used to take in care the case of category ID \"0\"\r\n\t \t\t$extra_sql = \"left outer join `$wpdb->terms` on (`$wpdb->terms`.term_id=`$this->table`.term_id)\";\r\n\t \t\t$order_by = \"`$wpdb->terms`.name\";\r\n\t \t}\r\n\t \telseif ($order_by!='') {\r\n\t \t\t// Set order by ` where is a simple column\r\n\t \t\t$order_by = \"`$order_by`\";\r\n\t \t}\r\n\t \t\t\r\n\t \tif ($order_by!='') $order_by = \" order by $order_by $order_direction\";\r\n\t \t\r\n\t \t// Specify the fields to return\r\n\t \tif (count($only_fields)==0) {\r\n\t \t\t// Add\r\n\t \t\t$fields_to_return = \"`$this->table`.*\";\r\n\t \t}\r\n\t \telse {\r\n\t \t\t// Only specified\r\n\t \t\t$fields_to_return = \"`$this->table`.\" . implode(\",`$this->table`.\",$only_fields);\t \t\t\r\n\t \t}\r\n\t \t\t\r\n\t \tif ($value!=='' && $value!==null)\r\n\t \t{\r\n\t \t\tif ($field_type=='%d') // %d\r\n\t\t \t\t$query = $wpdb->prepare( \"SELECT $fields_to_return from `$this->table` $extra_sql WHERE `$this->table`.`$field` = %d $order_by\", $value );\r\n\t\t \telse // %s\r\n\t\t \t\t$query = $wpdb->prepare( \"SELECT $fields_to_return from `$this->table` $extra_sql WHERE `$this->table`.`$field` = %s $order_by\", $value );\r\n\t \t}\r\n\t \telse \r\n\t \t\t$query = \"SELECT $fields_to_return from `$this->table` $extra_sql $order_by\";\r\n\t \t\r\n\t \t\r\n\t \t$results = $wpdb->get_results($query);\r\n\t\t\t\r\n\t \t// Parse returned fields to strip slashes\r\n\t \t$parsed_results = array();\r\n\t \tforeach ($results as $result) {\r\n\t \t\t$tmp_result = (array) $result;\r\n\t\t \t$parsed_result = WPPostsRateKeys_Validator::parse_array_output($tmp_result);\r\n\t\t \t$parsed_result = (object) $parsed_result;\r\n\t\t \t\r\n\t\t \t$parsed_results[] = $parsed_result;\r\n\t \t}\r\n\t \t// End: Parse returned fields to strip slashes\r\n\t \t\r\n\t \treturn $parsed_results;\r\n\t }", "public function getOrdersData() {\n $store = Auth::user()->stores()->first();\n $store_ids = [];\n\n if (!$store) {\n $request->session()->flash('alert-danger', 'There is no store associated with this account.');\n } else {\n $stores = Auth::user()->stores()->get();\n foreach ($stores as $s) {\n $store_ids[] = $s->id;\n }\n }\n\n $query = Order::select('orders.*');\n $query->join('order_status', 'orders.order_status_id', '=', 'order_status.id');\n $query->leftJoin('order_items', 'orders.id', '=', 'order_items.orders_id');\n $query->leftJoin('products', 'order_items.products_id', '=', 'products.id');\n // $query->join('users', 'orders.users_id', '=', 'users.id');\n $query->groupBy('orders.id');\n\n // only show orders related to one of user's stores\n $query = $query->whereIn('orders.store_id', $store_ids);\n\n $query = $this->customFilters($query);\n // tableCustomFilter\n $orders = $this->tablePaginate($query);\n\n $form_body = view('backoffice.orders.tables.orders-list', ['orders' => $orders])->render();\n $form_pagination = view('backoffice.orders.tables.orders-list-pagination', ['orders' => $orders])->render();\n\n $form_data = [ 'form_body' => $form_body, 'form_pagination' => $form_pagination ];\n\n return $form_data;\n }", "function action_woocommerce_order_items_table( $order ) {\n\t\t// make action magic happen here... \n\t\t$data = get_post_meta( $order->id, '_metatest_data', true );\n\t\techo '<tr>\n\t\t\t\t<th scope=\"row\"><span class=\"np_forudpdate\">Накладная (Новая почта):</span></th>\n\t\t\t\t\t<td>' . $data . '</td>\n\t\t\t\t</tr>';\n\t}", "private function getCustomerOrderQueryBundleProduct()\n {\n $query =\n <<<QUERY\n {\n customer {\n orders(pageSize: 20) {\n items {\n id\n order_date\n items {\n product_name\n product_sku\n ... on BundleOrderItem {\n bundle_options {\n __typename\n label\n values {\n product_name\n product_sku\n price {\n value\n currency\n }\n }\n }\n }\n }\n total {\n grand_total {\n value\n currency\n }\n }\n status\n }\n }\n }\n }\n QUERY;\n $response = $this->graphQlQuery(\n $query,\n [],\n '',\n $this->customerAuthenticationHeader->execute('[email protected]', 'password')\n );\n\n $this->assertArrayHasKey('orders', $response['customer']);\n $this->assertArrayHasKey('items', $response['customer']['orders']);\n return $response['customer']['orders']['items'];\n }", "public function getOrderById($orderId)\n {\n $sql = <<<'EOT'\nSELECT\n `o`.`id` AS `orderID`,\n `o`.`ordernumber`,\n `o`.`ordernumber` AS `order_number`,\n `o`.`userID`,\n `o`.`userID` AS `customerID`,\n `o`.`invoice_amount`,\n `o`.`invoice_amount_net`,\n `o`.`invoice_shipping`,\n `o`.`invoice_shipping_net`,\n `o`.`ordertime` AS `ordertime`,\n `o`.`status`,\n `o`.`status` AS `statusID`,\n `o`.`cleared` AS `cleared`,\n `o`.`cleared` AS `clearedID`,\n `o`.`paymentID` AS `paymentID`,\n `o`.`transactionID` AS `transactionID`,\n `o`.`comment`,\n `o`.`customercomment`,\n `o`.`net`,\n `o`.`net` AS `netto`,\n `o`.`partnerID`,\n `o`.`temporaryID`,\n `o`.`referer`,\n o.cleareddate,\n o.cleareddate AS cleared_date,\n o.trackingcode,\n o.language,\n o.currency,\n o.currencyFactor,\n o.subshopID,\n o.dispatchID,\n cu.id AS currencyID,\n `c`.`name` AS `cleared_name`,\n `c`.`description` AS `cleared_description`,\n `s`.`name` AS `status_name`,\n `s`.`description` AS `status_description`,\n `p`.`description` AS `payment_description`,\n `d`.`name` AS `dispatch_description`,\n `cu`.`name` AS `currency_description`\nFROM\n `s_order` AS `o`\nLEFT JOIN `s_core_states` AS `s`\n ON (`o`.`status` = `s`.`id`)\nLEFT JOIN `s_core_states` AS `c`\n ON (`o`.`cleared` = `c`.`id`)\nLEFT JOIN `s_core_paymentmeans` AS `p`\n ON (`o`.`paymentID` = `p`.`id`)\nLEFT JOIN `s_premium_dispatch` AS `d`\n ON (`o`.`dispatchID` = `d`.`id`)\nLEFT JOIN `s_core_currencies` AS `cu`\n ON (`o`.`currency` = `cu`.`currency`)\nWHERE\n `o`.`id` = :orderId\nEOT;\n\n return $this->db->fetchRow($sql, ['orderId' => $orderId]);\n }", "public function orders_get_items_list($orderID) {\n\t\t $sql = <<<EOD\n\t\t SELECT\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.order_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.campaign_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.line_item_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.spin_name,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.product_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.product_name,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.product_type,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.merchandise_type,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.quantity,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.sku_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.sku_upc,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.sku_attributes,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.factory_sku,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.shipped,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.status,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.weight,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.bundle_sku_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.shipping_date\n\t\t FROM {$this->wpdb->prefix}topspin_orders_items\n\t\t WHERE\n\t\t \t{$this->wpdb->prefix}topspin_orders_items.order_id = '%d'\nEOD;\n\t\t$itemsList = $this->wpdb->get_results($this->wpdb->prepare($sql,array($orderID)));\n\t\t$unserialize = array('sku_attributes','weight');\n\t\tforeach($unserialize as $key) {\n\t\t\tforeach($itemsList as $itemKey=>$item) {\n\t\t\t\t$itemsList[$itemKey]->$key = unserialize($itemsList[$itemKey]->$key);\n\t\t\t}\n\t\t}\n\t\treturn $itemsList;\n\t}", "public function getQueryOrderby() {\n return '`'.$this->name.'`';\n }", "public function getSingleOrders()\n {\n\t\t$order = $this->ShopifyClient->call('GET','/admin/orders/'.$this->config['order_id'].'.json');\n\t\t//print_r($order); exit;\n\t\t$arra = array();\n\t\tif(!empty($order['order']))\n\t\t{\n\t\t\t$keyArr = array('id','email','created_at','number','note','token','gateway','total_price',\n\t\t\t\t\t\t\t'subtotal_price','total_weight','total_tax','taxes_included','currency','financial_status','confirmed','total_discounts',\n\t\t\t\t\t\t\t'total_line_items_price','name','cancelled_at','cancel_reason','total_price_usd','user_id','location_id',\n\t\t\t\t\t\t 'order_number','discount_codes','payment_gateway_names','processing_method','fulfillment_status','tax_lines','refunds',\n\t\t\t\t\t\t\t'line_items');\n\t\t\t$shopifyKeyArr = array('id','email','created_at','number','note','token','gateway','total_price',\n\t\t\t\t\t\t\t\t'subtotal_price','total_weight','total_tax','taxes_included','currency','financial_status','confirmed',\n\t\t\t\t\t\t\t \t'total_discounts','total_line_items_price','name','cancelled_at','cancel_reason','total_price_usd','user_id','location_id',\n\t\t\t\t\t\t \t\t'order_number','discount_codes','payment_gateway_names','processing_method','fulfillment_status','tax_lines','refunds',\n\t\t\t\t\t\t\t\t 'line_items');\n\t\t\t\n\t\t\tforeach($order as $key=>$val) {\t\t\t\t\n\t\t\t\t\tif(!empty($val['billing_address'])){\n\t\t\t\t\t\tarray_push($keyArr, 'billing_address');\n\t\t\t\t\t\tarray_push($shopifyKeyArr, 'billing_address');\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($val['shipping_address'])){\n\t\t\t\t\t\tarray_push($keyArr, 'shipping_address');\n\t\t\t\t\t\tarray_push($shopifyKeyArr, 'shipping_address');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$arra['data'][] = $this->createProductArray($val,$shopifyKeyArr,$keyArr);\n\t\t\t}\n\t\t\t$status_code = 200;\n\t\t\t$message = 'success';\t\n\t}else\n\t{\n\t\t$status_code = 404; \n\t\t$message = 'Orders not found';\n\t\t$arra['data'] = array();\n\t\t$arra['data_count'] = 0;\n\t}\t\n\t\t$order = $this->getJsonDataFormat($arra,$status_code,$message);\n\t\treturn $order;\n }", "private function compare_with_meta_field(string $meta_key, string $order)\n {\n }", "private function compare_with_meta_field(string $meta_key, string $order)\n {\n }", "function admin_get_all_orders(){\n\t //$orders = $this->Order->find('all');\n\t $this->paginate = array('limit' => 10, 'order' => 'Order.od_date DESC');\n\t \n\t $this->set('orders', $this->paginate());\n\t \n\t \n\t if(!empty($this->data)){\n\t $this->Order->id = $this->data['Order']['id'];\n\t $this->Order->saveField('od_status', $this->data['Order']['od_status']);\n\t \n\t $result = $this->Order->get_ordered_items($this->data['Order']['id']);\n\t \n\t\t//enviar el correo electronico de la situacion\n\t $this->set('orderedProducts',$result);\n\t $this->set('status', $this->data['Order']['od_status']);\n\t $this->MyEmail->sendOrderStatusEmail($this->data['Order']['od_payment_email']);\n\t $this->redirect($this->referer());\n\t } \n\t}", "function wv_commission_get_woo_orderitem_metavalue($order_itemid, $metakey) {\n global $wpdb;\n\n $sql_query = \"SELECT meta_value FROM `\" . $wpdb->prefix . \"woocommerce_order_itemmeta` WHERE `meta_key`='$metakey' AND `order_item_id`=$order_itemid\";\n $val = $wpdb->get_row($sql_query);\n\n return $val->meta_value;\n }", "function dokan_generate_sync_table() {\n global $wpdb;\n\n $sql = \"SELECT oi.order_id, p.ID as product_id, p.post_title, p.post_author as seller_id,\n oim2.meta_value as order_total, terms.name as order_status\n FROM {$wpdb->prefix}woocommerce_order_items oi\n LEFT JOIN {$wpdb->prefix}woocommerce_order_itemmeta oim ON oim.order_item_id = oi.order_item_id\n LEFT JOIN {$wpdb->prefix}woocommerce_order_itemmeta oim2 ON oim2.order_item_id = oi.order_item_id\n LEFT JOIN $wpdb->posts p ON oim.meta_value = p.ID\n LEFT JOIN {$wpdb->term_relationships} rel ON oi.order_id = rel.object_id\n LEFT JOIN {$wpdb->term_taxonomy} tax ON rel.term_taxonomy_id = tax.term_taxonomy_id\n LEFT JOIN {$wpdb->terms} terms ON tax.term_id = terms.term_id\n WHERE\n oim.meta_key = '_product_id' AND\n oim2.meta_key = '_line_total'\n GROUP BY oi.order_id\";\n\n $orders = $wpdb->get_results( $sql );\n $table_name = $wpdb->prefix . 'dokan_orders';\n\n $wpdb->query( 'TRUNCATE TABLE ' . $table_name );\n\n if ( $orders ) {\n foreach ($orders as $order) {\n $percentage = dokan_get_seller_percentage( $order->seller_id );\n\n $wpdb->insert(\n $table_name,\n array(\n 'order_id' => $order->order_id,\n 'seller_id' => $order->seller_id,\n 'order_total' => $order->order_total,\n 'net_amount' => ($order->order_total * $percentage)/100,\n 'order_status' => $order->order_status,\n ),\n array(\n '%d',\n '%d',\n '%f',\n '%f',\n '%s',\n )\n );\n } // foreach\n } // if\n}", "public function woocommerce_subscriptions_renewal_order_meta_query( $order_meta_query, $original_order_id, $renewal_order_id, $new_order_role ) {\n\t\t$order_meta_query .= \" AND `meta_key` NOT IN ( '_wc_shipment_tracking_items' )\";\n\t\treturn $order_meta_query;\n\t}", "public function get_user_orders($customer_id)\n\t{\n\t\t$this->db->select('payment_method.payment_method_name, orders.*, order_status.order_status_name');\n\t\t$this->db->where('orders.payment_method_id = payment_method.payment_method_id AND orders.order_status_id = order_status.order_status_id AND orders.customer_id = '.$customer_id);\n\t\t$this->db->order_by('order_created', 'DESC');\n\t\t$query = $this->db->get('orders, order_status, payment_method');\n\t\t\n\t\treturn $query;\n\t}", "private function build_query_by_properties()\n {\n $l_sql = '';\n\n foreach ($this->m_view_properties as $l_category_type_id => $l_categories) {\n foreach ($l_categories as $l_category_id => $l_properties) {\n if (isset($l_properties['table'])) {\n $l_table = $l_properties['table'];\n $l_obj_field = $l_properties['obj_id'];\n\n $l_sql .= 'LEFT JOIN ' . $l_table . ' ON ' . $l_obj_field . ' = main.isys_obj__id ';\n\n if (isset($l_properties['join'])) {\n $l_sql .= $l_properties['join']['join_type'] . ' JOIN ' . $l_properties['join']['table'] . ' AS ' . $l_properties['join']['alias'] . ' ON ';\n $l_sql .= $l_properties['join']['join_field'] . ' = ' . $l_properties['join']['alias'] . '.' . $l_properties['join']['field'] . ' ';\n }\n\n foreach ($l_properties['properties'] as $l_property_key => $l_property_info) {\n $this->m_headers[$l_property_key] = $l_property_info;\n }\n\n if (isset($l_properties['helper'])) {\n foreach ($l_properties['helper'] as $l_field => $l_helper) {\n $this->m_helpers[$l_field] = $l_helper;\n }\n }\n } else {\n // Dynamic property.\n foreach ($l_properties['properties'] as $l_property_key => $l_property_info) {\n $this->m_dynamic_headers[$l_property_key] = $l_property_info;\n }\n\n if (isset($l_properties['helper'])) {\n foreach ($l_properties['helper'] as $l_field => $l_helper) {\n $this->m_helpers[$l_field] = $l_helper;\n }\n }\n }\n }\n }\n\n $l_selection = '*';\n\n if (count($this->m_headers) > 0) {\n $l_selection = '';\n foreach ($this->m_headers as $l_field_alias => $l_field) {\n $l_selection .= $l_field . ' AS ' . $l_field_alias . ',';\n }\n\n $l_selection = rtrim($l_selection, ',');\n }\n\n $this->m_headers = array_merge_recursive($this->m_headers, $this->m_dynamic_headers);\n\n $l_sql_main = 'SELECT ' . $l_selection . ', main.isys_obj__id AS __objid__ FROM isys_obj AS main ' .\n 'INNER JOIN isys_obj_type ON main.isys_obj__isys_obj_type__id = isys_obj_type__id ' . $l_sql;\n\n $this->m_sql = $l_sql_main;\n }", "function index()\n {\n $this->orders = get_all(\"SELECT * FROM `order` NATURAL JOIN product\");\n }", "private function searchOrders(): Builder\n {\n $search = request('search');\n $searchTerm = \"%{$search}%\";\n\n return Order::where(function ($query) use ($searchTerm) {\n $query->where('customer', 'like', $searchTerm)\n ->orWhere('id', 'like', $searchTerm)\n ->orWhere('number', 'like', $searchTerm)\n ->orWhere('status', 'like', $searchTerm)\n ->orWhere('total_amount', 'like', $searchTerm)\n ->orWhere('created_at', 'like', $searchTerm);\n });\n }", "function get_recent_orders(){\n\t $orders = $this->Order->get_recent_orders();\n\t if($this->params['requested']){\n\t return $orders;\n\t }else{\n\t $this->set('orders', $orders);\n\t }\n \n\t}", "public function get_order() {\n return wc_get_order( $this->get_order_id() );\n }", "function query_main_join( $sql, $engine ) {\n\t\tglobal $wpdb;\n\n\t\tif ( isset( $engine ) ) {\n\t\t\t$engine = null;\n\t\t}\n\n\t\t// if WooCommerce is sorting results we need to tell SearchWP to return them in that order\n\t\tif ( $this->is_woocommerce_search() ) {\n\n\t\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\t$this->get_woocommerce_ordering();\n\t\t\t}\n\n\t\t\t// depending on the sorting we need to do different things\n\t\t\tif ( isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\tswitch ( $this->ordering['wc_orderby'] ) {\n\t\t\t\t\tcase 'price':\n\t\t\t\t\tcase 'price-desc':\n\t\t\t\t\tcase 'popularity':\n\t\t\t\t\t\t$meta_key = 'price' === $this->ordering['wc_orderby'] ? '_price' : 'total_sales';\n\t\t\t\t\t\t$sql = $sql . $wpdb->prepare( \" LEFT JOIN {$wpdb->postmeta} AS swpwc ON {$wpdb->posts}.ID = swpwc.post_id AND swpwc.meta_key = %s\", $meta_key );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rating':\n\t\t\t\t\t\t$sql = $sql . \" LEFT OUTER JOIN {$wpdb->comments} swpwpcom ON({$wpdb->posts}.ID = swpwpcom.comment_post_ID) LEFT JOIN {$wpdb->commentmeta} swpwpcommeta ON(swpwpcom.comment_ID = swpwpcommeta.comment_id) \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// for visibility we always need to join postmeta\n\t\t\tif ( function_exists( 'WC' ) && ! empty( WC()->version ) && version_compare( WC()->version, '2.6.0', '<' ) ) { // Moved to a taxonomy\n\t\t\t\t$sql = $sql . \" INNER JOIN {$wpdb->postmeta} as woovisibility ON {$wpdb->posts}.ID = woovisibility.post_id \";\n\t\t\t}\n\n\t\t}\n\n\t\treturn $sql;\n\t}", "protected function getOrders()\n {\n \\Rakuten\\Connector\\Resources\\Log\\Logger::info('Processing initialize in getOrders in Batch.');\n $resource = Mage::getSingleton('core/resource');\n $write = $resource->getConnection('core_write');\n $order = $resource->getTableName('sales/order');\n $rakutenOrder = $resource->getTableName('rakuten_rakutenlogistics/order');\n $payment = $resource->getTableName('sales/order_payment');\n\n $select = $write->select()\n ->from(['order' => $order], ['entity_id', 'increment_id', 'customer_firstname', 'customer_lastname', 'state', 'created_at'])\n ->join(['payment' => $payment], 'order.entity_id = payment.entity_id', ['additional_information'])\n ->join(['rakutenOrder' => $rakutenOrder], 'order.entity_id = rakutenOrder.order_id', ['calculation_code', 'order_id'])\n ->where('DATEDIFF(NOW(), order.created_at) <= ?', $this->days)\n ->where('order.state = ?', Mage_Sales_Model_Order::STATE_PROCESSING);\n\n $data = $write->fetchAll($select);\n foreach ($data as $key => $item) {\n if (!$item['calculation_code']) {\n continue;\n }\n if (!$this->hasBatchCode($item['additional_information'])) {\n $this->orders[$key]['orderId'] = $item['order_id'];\n $this->orders[$key]['incrementId'] = $item['increment_id'];\n $this->orders[$key]['status'] = $item['state'];\n $this->orders[$key]['billingName'] = $item['customer_firstname'] . ' ' . $item['customer_lastname'];\n $createdAt = new \\DateTime($item['created_at']);\n $this->orders[$key]['createdAt'] = $createdAt->format('d/m/Y H:m:s');\n $this->orders[$key]['calculationCode'] = $item['calculation_code'];\n }\n }\n if (count($this->orders)) {\n $this->orders = array_values($this->orders);\n }\n }", "function es_filter_products_query( &$query ) {\n\tglobal $typenow, $wp_query;\n\n\tif ( 'product' == $typenow ) {\n\t\tif ( isset( $_GET['allow_backorders_filter'] ) && ! empty ( $_GET['allow_backorders_filter'] ) ) {\n\t\t\t$backorders = array(\n 'key' => '_backorders',\n 'value' => $_GET['allow_backorders_filter'],\n 'compare' => '='\n );\n\t\t\t\n\t\t\t$meta_query_array[] = $backorders;\n\t\t\t//$query->query_vars['meta_value'] = $_GET['allow_backorders_filter'];\n\t\t\t//$query->query_vars['meta_key'] = '_backorders';\n\t\t}\n\t\t\n\t\tif ( isset( $_GET['price_filter'] ) && ! empty ( $_GET['price_filter'] ) ) {\n\t\t\t\n\t\t\tif ( $_GET['price_filter'] == 'member-price' )\n\t\t\t\t$prices = array(\n\t\t\t\t\t'key' => 'member_price',\n\t\t\t\t\t'value' => 0,\n\t\t\t\t\t'compare' => '>'\n\t\t\t\t);\n\t\t\telseif ( $_GET['price_filter'] == 'sale-price' )\n\t\t\t\t$prices = array(\n\t\t\t\t\t'key' => '_sale_price',\n\t\t\t\t\t'value' => 0,\n\t\t\t\t\t'compare' => '>'\n\t\t\t\t);\n\t\t\t\n\t\t\t$meta_query_array[] = $prices;\n\t\t\t//$query->query_vars['meta_value'] = $_GET['allow_backorders_filter'];\n\t\t\t//$query->query_vars['meta_key'] = '_backorders';\n\t\t}\n\t\t\n\t\tif (!empty($meta_query_array))\n\t\t\t$query->query_vars['meta_query'] = $meta_query_array;\n\t}\n}", "protected function list_orders() {\r\n // Get response\r\n $dt = new DataTableResponse( $this->user );\r\n\r\n $website_order = new WebsiteOrder();\r\n\r\n // Set Order by\r\n $dt->order_by( '`website_order_id`', '`total_cost`', '`status`', '`date_created`' );\r\n $dt->add_where( ' AND `website_id` = ' . (int) $this->user->account->id );\r\n $dt->search( array( '`website_order_id`' => false ) );\r\n\r\n // Get items\r\n $website_orders = $website_order->list_all( $dt->get_variables() );\r\n $dt->set_row_count( $website_order->count_all( $dt->get_count_variables() ) );\r\n\r\n // Set initial data\r\n $data = false;\r\n\r\n /**\r\n * @var WebsiteOrder $order\r\n */\r\n if ( is_array( $website_orders ) )\r\n foreach ( $website_orders as $order ) {\r\n switch ( $order->status ) {\r\n case WebsiteOrder::STATUS_DECLINED:\r\n $status = 'Declined';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_PURCHASED:\r\n $status = 'Purchased';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_PENDING:\r\n $status = 'Pending';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_DELIVERED:\r\n $status = 'Delivered';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_RECEIVED:\r\n $status = 'Received';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_SHIPPED:\r\n $status = 'Shipped';\r\n break;\r\n\r\n default:\r\n $status = 'Error';\r\n break;\r\n }\r\n\r\n $date = new DateTime( $order->date_created );\r\n\r\n $link_text = '';\r\n if ( $order->is_ashley_express() ) {\r\n $link_text = \" - Express Delivery\";\r\n }\r\n\r\n $data[] = array(\r\n '<a href=\"' . url::add_query_arg( 'woid', $order->id, '/shopping-cart/orders/view/' ) . '\" title=\"' . _('View') . '\">' . $order->id . '</a>' . $link_text\r\n , $order->name\r\n , '$' . number_format( $order->total_cost, 2 )\r\n , $status\r\n , $date->format('F jS, Y')\r\n );\r\n }\r\n\r\n // Send response\r\n $dt->set_data( $data );\r\n\r\n return $dt;\r\n }" ]
[ "0.61404073", "0.5998684", "0.57909095", "0.57745105", "0.57376784", "0.5713991", "0.5643663", "0.56390125", "0.5618665", "0.5589128", "0.5552518", "0.5502556", "0.5496199", "0.54956275", "0.54696244", "0.5451452", "0.5435705", "0.541846", "0.5409171", "0.540086", "0.5392334", "0.5383356", "0.53771615", "0.5369662", "0.53677696", "0.5366637", "0.5365407", "0.5358946", "0.53396815", "0.53362584", "0.53337854", "0.5312416", "0.52850413", "0.5278243", "0.52671176", "0.52613807", "0.52575594", "0.52489746", "0.5240452", "0.52110165", "0.5208748", "0.52002144", "0.51940536", "0.51935875", "0.51836306", "0.5183054", "0.5177857", "0.5159528", "0.51588434", "0.5150694", "0.5144722", "0.513826", "0.5131849", "0.5121954", "0.5119646", "0.5119361", "0.51167446", "0.50961024", "0.5096075", "0.509483", "0.5092301", "0.5082918", "0.5081744", "0.5071504", "0.5068585", "0.5068187", "0.5068144", "0.50657225", "0.50629157", "0.5059933", "0.50567436", "0.5048786", "0.5045922", "0.50417274", "0.5041111", "0.50307435", "0.5030231", "0.50294966", "0.50273514", "0.5025029", "0.5024979", "0.50183487", "0.50096303", "0.5008355", "0.5006307", "0.5006307", "0.50046283", "0.4999008", "0.49968767", "0.49963787", "0.49912953", "0.4989787", "0.498246", "0.49822366", "0.4967527", "0.49672145", "0.4959456", "0.49554327", "0.49470735", "0.49354735" ]
0.6132021
1
Get unpaid orders after a certain date.
public function get_unpaid_orders( $date ) { global $wpdb; $unpaid_orders = $wpdb->get_col( $wpdb->prepare( " SELECT posts.ID FROM {$wpdb->posts} AS posts WHERE posts.post_type IN ('" . implode( "','", wc_get_order_types() ) . "') AND posts.post_status = 'wc-pending' AND posts.post_modified < %s ", date( 'Y-m-d H:i:s', absint( $date ) ) ) ); return $unpaid_orders; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getoverdue() {\r\n $today = new DateTime(); \r\n $dueDate = date_modify($today, '-11 months');\r\n $date = $dueDate->format('Y-m-d');\r\n \r\n $db = static::getDB();\r\n $stmt = $db->query(\r\n \"SELECT * FROM lifts \"\r\n . \"WHERE last_insp_date < '$date' \"\r\n . \"AND active = '1' \"\r\n . \"ORDER BY last_insp_date ASC\");\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n return $results;\r\n }", "public function fetchOrdersSince($user_id, $date)\n {\n $rowset = $this->select(function($select) use ($user_id, $date) {\n $select->where->greaterThanOrEqualTo('sd_orders.completed', $date);\n $select->where->equalTo('sd_orders.user_id', $user_id);\n\n return $this->_addQueryFeatures($select);\n });\n\n return $this->_returnArray($rowset);\n }", "public function scopeUnpaid($query) {\n return $query->where('order_status_id', '=', 1);\n }", "public function getOutstandingOrders()\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.arrival_date IS NULL\nORDER BY orders.order_date;\nSQL\n );\n $order->execute();\n return $order->fetchAll(\\PDO::FETCH_OBJ);\n }", "function kv_get_recurrent_invoices($date = null)\n{\n // last_sent stores end date of last generated invoice _plus_ 1 (or is empty)\n if ($date) {\n $date = date2sql($date);\n // we can issue invoice after or at last day of covered period\n $sql = \"SELECT *, DATE_ADD(DATE_ADD(IF(`last_sent`='0000-00-00', `begin`, `last_sent`), INTERVAL `monthly` MONTH), INTERVAL `days` DAY) <= '$date'\n AND last_sent < DATE_ADD(`end`, INTERVAL 1 DAY) as overdue\";\n } else\n $sql = \"SELECT * \";\n\n $sql .= \" FROM \" . TB_PREF . \"recurrent_invoices ORDER BY description, group_no, debtor_no\";\n\n return db_query($sql, \"could not get recurrent invoices\");\n}", "public function getAllDeliveriesExpired() //get delivery more than 3 days not received by toko\n {\n // join sma_sales on sma_deliveries.sale_id = sma_sales.id and sma_sales.client_id = \"aksestoko\"\n // where DATE(sma_deliveries.date + INTERVAL 3 DAY) < current_date\n $this->db->select('sma_deliveries.id as do_id, sma_deliveries.do_reference_no as do_ref, sma_purchases.id as purchase_id');\n $this->db->join('sma_sales', 'sma_deliveries.sale_id = sma_sales.id and sma_sales.client_id = \"aksestoko\"');\n $this->db->join('sma_purchases', 'sma_purchases.cf1 = sma_sales.reference_no and sma_purchases.supplier_id = sma_sales.biller_id');\n $this->db->where('DATE(sma_deliveries.date + INTERVAL 3 DAY) < NOW() AND sma_deliveries.date > \"2019-08-01\" AND sma_deliveries.receive_status is null');\n $q = $this->db->get('sma_deliveries');\n if ($q->num_rows() > 0) {\n return $q->result();\n }\n return [];\n }", "public static function whereNotExpired()\n {\n return self::where('expiration_date', '>', date('Y-m-d'));\n }", "public function lastPaidOrderCustomers()\n {\n return $this->model->select('id', 'user_id', 'paid_date')\n ->with('user')\n ->whereStatusId(OrderStatusConstants::PAID)\n ->whereNotNull('paid_date')\n ->orderByDesc('paid_date')\n ->paginate();\n }", "private function getOutstandingExpiredDueQueryBuilder()\n {\n $qb = $this->createQueryBuilder('o');\n $ex = $qb->expr();\n\n $qb\n ->join('o.paymentTerm', 't')\n ->where($ex->andX(\n $ex->eq('o.sample', ':not_sample'), // Not sample\n $ex->lt('o.paidTotal', 'o.grandTotal'), // Paid total lower than grand total\n $ex->notIn('o.invoiceState', ':canceled_or_refunded'), // Not canceled/refunded\n $qb->expr()->lte('o.outstandingDate', ':today'), // Payment limit date lower than today\n $this->getDueClauses() // Terms triggered\n ))\n ->addOrderBy('o.outstandingDate', 'ASC')\n ->setParameter('not_sample', false)\n ->setParameter('today', (new \\DateTime())->setTime(23, 59, 59, 999999), Types::DATETIME_MUTABLE)\n ->setParameter('canceled_or_refunded', [InvoiceStates::STATE_CANCELED, InvoiceStates::STATE_CREDITED]);\n\n $this->setDueParameters($qb);\n\n return $qb;\n }", "public function getPurchaseOrdersWaitingToBeApproved()\n {\n try {\n return $this->xero->load(PurchaseOrder::class)\n ->setParameter('status', 'SUBMITTED')\n ->orderBy('Date')\n ->execute();\n } catch (\\Exception $e){\n $this->addToErrors(\"xero error :: Failed to retrieve purchase orders :: {$e->getMessage()}\");\n }\n }", "public function getNotShippedOrders(){\n\n $resource = $this->_productFactory->create()->getResource();\n $connection = $resource->getConnection();\n $select = $connection->select();\n $select->from(\n [\"main_table\"=>$resource->getTable('ves_vendor_sales_order')],\n ['*']\n )->join(\n [\n 'order_grid'=>$resource->getTable('sales_order')],\n 'main_table.order_id = order_grid.entity_id',\n [\n 'is_virtual'\n ]\n )->join(\n [\n 'order_item'=>$resource->getTable('sales_order_item')],\n 'main_table.entity_id=order_item.vendor_order_id',\n [\n 'is_virtual',\n 'locked_do_ship',\n 'parent_item_id',\n ]\n )->where(\n 'main_table.vendor_id = :vendor_id'\n )->where(\n 'order_grid.is_virtual = 0'\n )->where(\n 'order_item.locked_do_ship IS NULL'\n )->where(\n 'order_item.is_virtual = 0'\n )\n ->where(\n 'order_item.parent_item_id IS NULL'\n )->where(\n '(order_item.qty_ordered - order_item.qty_shipped - order_item.qty_refunded - order_item.qty_canceled) >= 1'\n )->group('main_table.order_id');\n $bind = ['vendor_id' => $this->getVendor()->getId()];\n\n $total = $connection->fetchALL($select,$bind);\n\n return count($total);\n }", "public function upcomingDebit()\n {\n $where = \"(SELECT DATEDIFF(so.`due_date`, '$this->curDate') AS days) < 14 AND so.`status_paid` = 0 AND so.active = 1\";\n $so = $this->db\n ->from('sales_order so')\n ->join('customer c', 'c.id_customer = so.id_customer')\n ->where($where)\n ->order_by('so.id_sales_order asc')\n ->get()\n ->result();\n\n return $so;\n }", "public function getTodayRevisitOrders()\n {\n return \\DB::select(\"SELECT a.id, a.propaddress1, a.propaddress2, a.propcity, a.propstate, a.propzip, s.descrip as status_name FROM appr_dashboard_delay_order d LEFT JOIN appr_order a ON (a.id=d.orderid) LEFT JOIN order_status s ON (a.status=s.id) WHERE d.created_date BETWEEN :from AND :to AND d.delay_date BETWEEN :t AND :b\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':t' => strtotime('today'), ':b' => strtotime('tomorrow')]);\n }", "public function getInvoicesModifiedSinceDate($date = null)\n {\n try {\n return $this->xero->load(Invoice::class)\n ->where(\"Date >= DateTime({$date->format('Y, m, d')})\")\n ->orWhere(\"AmountDue > 0\")\n ->execute();\n } catch (\\Exception $e){\n $this->addToErrors(\"xero error :: Failed to retrieve invoices :: {$e->getMessage()}\");\n }\n }", "public function getFulfilledOrders()\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.arrival_date IS NOT NULL\nORDER BY orders.order_date;\nSQL\n );\n $order->execute();\n return $order->fetchAll(\\PDO::FETCH_OBJ);\n }", "public function indexPast()\n {\n $orders = Order::orderBy('delivery_dt', 'desc')\n ->whereDate('delivery_dt', '>', Carbon::now())\n ->where('status', OrderStatus::SUCCESS)\n ->limit(50)\n ->get();\n\n return $this->index($orders);\n }", "public function getFutureRevisitOrders()\n {\n return \\DB::select(\"SELECT a.id, a.propaddress1, a.propaddress2, a.propcity, a.propstate, a.propzip, s.descrip as status_name FROM appr_dashboard_delay_order d LEFT JOIN appr_order a ON (a.id=d.orderid) LEFT JOIN order_status s ON (a.status=s.id) WHERE d.created_date BETWEEN :from AND :to AND d.delay_date > :today\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':today' => strtotime('tomorrow')]);\n }", "public function findAllExpired()\n {\n $queryBuilder = $this->createQueryBuilder('r');\n $date = date('Y-m-d', strtotime(\"-30 days\"));\n\n $queryBuilder\n ->where('r.validated = :state')\n ->setParameter('state', 0)\n ->andWhere('r.addedOn <= :date')\n ->setParameter('date', new \\DateTime($date));\n\n return $queryBuilder\n ->getQuery()\n ->getResult()\n ;\n }", "public function nonPaidOrder()\n {\n $orders = Order::where('user_id',0)\n ->orderBy('id','desc')\n ->get();\n return view('user.admin.order.non-paid-order',[\n 'orders' => $orders\n ]);\n }", "public function get_unapproved_items() {\n return $this->query(\"SELECT * FROM `items` where NOT `approved` order by `premium` desc, `date`\");\n }", "public function bookingsCancelledAfter(string $date): MorphMany\n {\n return $this->bookings()\n ->whereNotNull('cancelled_at')\n ->where('cancelled_at', '>', new Carbon($date));\n }", "public function cleanReceivedOrders () {\n\n\t\t$filter = new \\Maven\\Core\\Domain\\OrderFilter();\n\t\t$filter->setStatusID( OrderStatusManager::getReceivedStatus()->getId() );\n\n\t\t// A week old\n\t\t$today = MavenDateTime::getWPCurrentDateTime();\n\n\t\t$toDate = new \\Maven\\Core\\MavenDateTime( $today );\n\t\t$toDate->subFromInterval( 'P1W' );\n\n\t\t$filter->setOrderDateTo( $toDate->mySqlFormatDate() );\n\n\t\t$orders = $this->getOrders( $filter );\n\n\t\tforeach ( $orders as $order ) {\n\n\t\t\t//Check if the order has some contact on it.\n\t\t\tif ( !$order->hasBillingInformation() && !$order->hasShippingInformation() && !$order->hasContactInformation() ) {\n\t\t\t\t$this->delete( $order->getId() );\n\t\t\t}\n\t\t}\n\t}", "function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}", "public static function getRecentDoneOrders() {\n\n\t\treturn Order::fullActive()\n\t\t\t\t\t->where('state', '=', '3')\n\t\t\t\t\t->orderBy('date', 'desc')\n\t\t\t\t\t->take(10)\n\t\t\t\t\t->get();\n\t}", "function rejectOrder() {\n\t\t$sql = \"SELECT FROM \";\n\t\t$this -> db -> select(\"id, user_name, contact, addr1, addr2, pin, city, email, DATE_FORMAT(order_date, '%b %d %Y') AS order_date, DATE_FORMAT(order_date, '%h:%i %p') AS order_time, CASE WHEN DATEDIFF(order_date, now()) > 0 THEN 1 ELSE 0 END AS isnew, order_status, quantity\");\n\t\t$query = $this -> db -> get('registrations');\n\t\t$result = $query -> result();\n\t\treturn $result;\n\t}", "public function getOrdersSince($startDate) {\n $apiUrl = sprintf('%s/orderExtend?full=1&excludeAbandonedCart=1&limit=200&createdAtMin=%s&createdAtMax=%s', env('SHOPRENTER_API'), $startDate->toDateTimeLocalString(), Carbon::now()->toDateTimeLocalString());\n $data = [\n 'data' => [\n 'requests' => [],\n ],\n ];\n\n // Megrendelések 1. oldala lekérése\n $ch = curl_init();\n curl_setopt_array($ch, [\n CURLOPT_URL => $apiUrl,\n CURLOPT_HTTPHEADER => ['Content-Type:application/json', 'Accept:application/json'],\n CURLOPT_USERPWD => sprintf('%s:%s', env('SHOPRENTER_USER'), env('SHOPRENTER_PASSWORD')),\n CURLOPT_TIMEOUT => 120,\n CURLOPT_RETURNTRANSFER => true,\n ]);\n $response = json_decode(curl_exec($ch), true);\n $orders = array_key_exists('items', $response) ? $response['items'] : null;\n curl_close($ch);\n\n // Többi megrendelés hozzácsatolása\n if (array_key_exists('pageCount', $response) && $response['pageCount'] > 1) {\n for ($i = 1; $i <= $response['pageCount']; $i++) {\n $nextUrl = str_replace('page=1', 'page='.$i, $response['next']['href']);\n\n $data['data']['requests'][] = [\n 'method' => 'GET',\n 'uri' => $nextUrl,\n ];\n }\n }\n\n $ch = curl_init();\n curl_setopt_array($ch, [\n CURLOPT_URL => sprintf('%s/batch', env('SHOPRENTER_API')),\n CURLOPT_HTTPHEADER => ['Accept:application/json'],\n CURLOPT_USERPWD => sprintf('%s:%s', env('SHOPRENTER_USER'), env('SHOPRENTER_PASSWORD')),\n CURLOPT_TIMEOUT => 120,\n CURLOPT_POST => 1,\n CURLOPT_RETURNTRANSFER => true,\n ]);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\n $response = json_decode(curl_exec($ch), true);\n curl_close($ch);\n if ($response) {\n foreach ($response['requests']['request'] as $responseData) {\n if ($responseData['response']['header']['statusCode'] == 200) {\n // Összerakjuk\n $orders = array_merge($orders, $responseData['response']['body']['items']);\n }\n }\n }\n\n // Státuszok\n foreach ($orders as $order) {\n $data['data']['requests'][] = [\n 'method' => 'GET',\n 'uri' => str_replace('orderStatuses/', 'orderStatusDescriptions?orderStatusId=', $order['orderStatus']['href']).'&full=1',\n ];\n }\n $ch = curl_init();\n curl_setopt_array($ch, [\n CURLOPT_URL => sprintf('%s/batch', env('SHOPRENTER_API')),\n CURLOPT_HTTPHEADER => ['Accept:application/json'],\n CURLOPT_USERPWD => sprintf('%s:%s', env('SHOPRENTER_USER'), env('SHOPRENTER_PASSWORD')),\n CURLOPT_TIMEOUT => 120,\n CURLOPT_POST => 1,\n CURLOPT_RETURNTRANSFER => true,\n ]);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\n $response = json_decode(curl_exec($ch), true);\n curl_close($ch);\n if ($response) {\n foreach ($response['requests']['request'] as $responseData) {\n if ($responseData['response']['header']['statusCode'] == 200) {\n // Megkeressük, h melyik megrendeléshez való\n $found = false;\n foreach ($orders as &$order) {\n if ($order['orderStatus']['href'] == $responseData['response']['body']['items'][0]['orderStatus']['href']) {\n $order['statusData'] = $responseData['response']['body']['items'][0];\n $found = true;\n }\n }\n\n if (! $found) {\n Log::info('Nem található státusz egyik megrendeléshez sem:');\n Log::info('- ID: '.$responseData['response']['body']['items'][0]['id']);\n }\n }\n }\n }\n\n return $orders;\n }", "public function getFindAllWithDeletedOrderedByDateRaw()\n {\n $this->getEntityManager()->getFilters()->disable('softdeleteable');\n $paymentsQueryBuilder = $this->createQueryBuilder('payment');\n\n $paymentsQueryBuilder\n ->leftJoin('payment.user', 'user')\n ->leftJoin('payment.trainingProgram', 'trainingProgram')\n ->orderBy('payment.date', 'DESC');\n\n return $paymentsQueryBuilder;\n }", "public function weekly_deposits()\n\t{\n\t\t// $date->format('Y-m-d'); \n\n\t\t// $date = strtotime(\"-6 day\");\n\t\t // date(\"Y-m-d\", $date);\n\t\t \n\t\t$today = date(\"Y-m-d\");\n\t\t$newDate = date(\"Y-m-d\",strtotime($today.\"-6 day\"));\n\t\t\n\t\t//`date_transaction` BETWEEN '$newDate' AND '$today'\n\t\t//OR\n\t\t//`date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK)\t\n\t\t\n\t\t$query = $this->db->prepare(\"SELECT * FROM `statement` WHERE `credit` <> 0 AND `date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK) ORDER BY `date_transaction` DESC\");\n\n\t\ttry{\n\t\t\t\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t\t\n\t\t\t\n\t\t}catch(PDOException $e){\n\t\t\tdie($e->getMessage());\n\t\t}\n\n\t}", "public function getRecurringOrders();", "public function getExpired()\n {\n return Item::join('item_batches', 'items.id', '=', 'item_batches.item_id')\n ->join('measurement_units', 'items.unit_id', '=', 'measurement_units.id')\n ->where('item_batches.expiry_date', '<', Carbon::now())\n ->where('item_batches.current_quantity', '!=', 0)\n ->select('items.description', 'item_batches.current_quantity', 'measurement_units.short_name', 'item_batches.expiry_date')\n ->get();\n }", "public function getExpiringSoon()\n {\n return Item::join('item_batches', 'items.id', '=', 'item_batches.item_id')\n ->join('measurement_units', 'items.unit_id', '=', 'measurement_units.id')\n ->where('item_batches.expiry_date', '<', Carbon::now()->addMonths(3))\n ->where('item_batches.expiry_date', '>', Carbon::now())\n ->where('item_batches.current_quantity', '!=', 0)\n ->select('items.description', 'item_batches.current_quantity', 'measurement_units.short_name', 'item_batches.expiry_date')\n ->get();\n }", "public function get_waiting_orders()\n\t{\n\t\treturn get_posts(array(\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby' => 'date',\n\t\t\t'order' => 'DESC',\n\t\t\t'meta_query' => array(\n\t\t\t\t'relation' => 'OR',\n\t\t\t\tarray(\n\t\t\t\t\t'key' => '_kd_letters_generated',\n\t\t\t\t\t'compare' => 'NOT EXISTS'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => '_kd_letters_generated',\n\t\t\t\t\t'value' => '0'\n\t\t\t\t)\n\t\t\t),\n\t\t\t'post_type' => 'order_paysera'\n\t\t));\n\t}", "public function upcomingCredit()\n {\n $where = \"(SELECT DATEDIFF(po.`due_date`, '$this->curDate') AS days) < 14 AND po.`status_paid` = 0\";\n $po = $this->db\n ->from('purchase_order po')\n ->join('principal p', 'p.id_principal = po.id_principal')\n ->where($where)\n ->order_by('po.id_purchase_order asc')\n ->get()\n ->result();\n return $po;\n }", "static function getUnpaidDepositReport() {\n global $wpdb;\n $resultset = $wpdb->get_results(\n \"SELECT guest_name, checkin_date, checkout_date, payment_total, data_href, booking_reference, \n booking_source, booked_date, notes, viewed_yn, created_date\n FROM wp_lh_rpt_unpaid_deposit\n WHERE job_id IN (SELECT CAST(value AS UNSIGNED) FROM wp_lh_job_param WHERE name = 'allocation_scraper_job_id' AND job_id = (SELECT MAX(job_id) FROM wp_lh_jobs WHERE classname = 'com.macbackpackers.jobs.UnpaidDepositReportJob' AND status = 'completed'))\n ORDER BY checkin_date\");\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n return $resultset;\n }", "function show_estimated_ship_date_under_view_order_for_subscriptions( $order_id ) {\n $order = wc_get_order( $order_id );\n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}", "public function findWithoutArchive()\n {\n $nowmoins = date('y-m-d', strtotime('- 1 month'));\n $todayConvert = DateTime::createFromFormat(\"y-m-d\",$nowmoins,null);\n dump($todayConvert);\n\n $qb = $this->createQueryBuilder('s');\n $qb->andwhere('s.datedebut > :todayConvert')->setParameter('todayConvert',$todayConvert);\n $query = $qb->getQuery();\n return $query->getResult();\n\n }", "public function getnonavailabledates() {\n\n if ( self::isEmptyResult() ) {\n return array();\n }\n\n $dates = array();\n\n $non_available = $this->data[self::resultinnernode];\n\n $non_available = $this->normalize($non_available);\n\n foreach ($non_available as $dateObj ) {\n $startDate = new \\DateTime($dateObj['dtFromDate']);\n $endDate = new \\DateTime($dateObj['dtToDate']);\n\n $periodInterval = new \\DateInterval('P1D');\n $period = new \\DatePeriod( $startDate, $periodInterval, $endDate );\n\n foreach ($period as $date ) {\n $dates[] = array(\n 'date' => $date->format('Y-m-d'),\n 'available' => 0,\n 'staytype' => $dateObj['strStayType'],\n 'property_id' => $this->property_id,\n\n // Confirmation number\n 'quotenum' => $dateObj['intQuoteNum'],\n );\n }\n\n }\n\n return $dates;\n }", "function getOrderBetweenDates($date1, $date2)\n {\n $dataService = new OrderDataService();\n\n return $dataService->getOrderBetweenDates($date1, $date2);\n }", "public function getUnsubscriptions($date) {\n $start = $date . ' 00:00:00';\n $end = $date . ' 23:59:59';\n \n return $this->countByDate($start, $end, 'unsubscribe');\n }", "public static function getPunishmentsByDate($db, $date) {\n // Prepares and executes the query.\n $query = \"SELECT * From \" . Bill::$table_name . \" WHERE date=:date AND payment != 1 AND payment != 2 ORDER BY payment, user\";\n\n $stmt = $db->prepare($query);\n $stmt->bindParam(\":date\", $date);\n\n $stmt->execute();\n\n // Create a Bill object array\n $bill_array = array();\n\n // Traverses the Resultset of the query Execution.\n // Adds a new element to the array for each record.\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n $bill = new Bill($db);\n Bill::updateAttributes($bill, $row);\n // Adds the Bill object to the array\n $bill_array[] = $bill;\n }\n\n return $bill_array;\n }", "public function cancelOrdersInPending()\n {\n //Etape 1 : on recupere pour chaque comptes le nombre de jours pour l'annulation\n $col = Mage::getModel('be2bill/merchandconfigurationaccount')->getCollection();\n $tabLimitedTime = array();\n foreach ($col as $obj) {\n $tabLimitedTime[$obj->getData('id_b2b_merchand_configuration_account')] = $obj->getData('order_canceled_limited_time') != null ? $obj->getData('order_canceled_limited_time') : 0;\n }\n\n //Etape 2\n $collection = Mage::getResourceModel('sales/order_collection')\n ->addFieldToFilter('main_table.state', Mage_Sales_Model_Order::STATE_NEW)\n ->addFieldToFilter('op.method', 'be2bill');\n $select = $collection->getSelect();\n $select->joinLeft(array(\n 'op' => Mage::getModel('sales/order_payment')->getResource()->getTable('sales/order_payment')), 'op.parent_id = main_table.entity_id', array('method', 'additional_information')\n );\n\n Mage::log((string)$collection->getSelect(), Zend_Log::DEBUG, \"debug_clean_pending.log\");\n\n // @var $order Mage_Sales_Model_Order\n foreach ($collection as $order) {\n $addInfo = unserialize($order->getData('additional_information'));\n $accountId = $addInfo['account_id'];\n $limitedTime = (int)$tabLimitedTime[$accountId];\n\n if ($limitedTime <= 0) {\n continue;\n }\n\n $store = Mage::app()->getStore($order->getStoreId());\n $currentStoreDate = Mage::app()->getLocale()->storeDate($store, null, true);\n $createdAtStoreDate = Mage::app()->getLocale()->storeDate($store, strtotime($order->getCreatedAt()), true);\n\n $difference = $currentStoreDate->sub($createdAtStoreDate);\n\n $measure = new Zend_Measure_Time($difference->toValue(), Zend_Measure_Time::SECOND);\n $measure->convertTo(Zend_Measure_Time::MINUTE);\n\n if ($limitedTime < $measure->getValue() && $order->canCancel()) {\n try {\n $order->cancel();\n $order->addStatusToHistory($order->getStatus(),\n // keep order status/state\n Mage::helper('be2bill')->__(\"Commande annulée automatique par le cron car la commande est en 'attente' depuis %d minutes\", $limitedTime));\n $order->save();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n }\n\n return $this;\n }", "function get_recent_orders(){\n\t $orders = $this->Order->get_recent_orders();\n\t if($this->params['requested']){\n\t return $orders;\n\t }else{\n\t $this->set('orders', $orders);\n\t }\n \n\t}", "public function scopeNotDeactivated($query)\n {\n return $query->where($this->ends_at_field, '>=', date('Y-m-d H:i:s'));\n }", "function getPastEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events WHERE endtime < CURRENT_DATE AND archive != 1 ORDER BY starttime DESC\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "private function GetOrders()\n\t{\t$orders = array();\n\t\t$where = array();\n\t\t\n\t\tif ($this->startdate)\n\t\t{\t$where[] = 'orderdate>=\"' . $this->startdate . ' 00:00:00\"';\n\t\t}\n\t\tif ($this->enddate)\n\t\t{\t$where[] = 'orderdate<=\"' . $this->enddate . ' 23:59:59\"';\n\t\t}\n\t\tif (!$this->showunpaid)\n\t\t{\t$where[] = 'NOT paiddate=\"0000-00-00 00:00:00\"';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT * FROM storeorders';\n\t\tif ($wstr = implode(' AND ', $where))\n\t\t{\t$sql .= ' WHERE ' . $wstr;\n\t\t}\n\t\t$sql .= ' ORDER BY orderdate DESC';\n\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$orders[$row['id']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $orders;\n\t}", "public function listNotValidatedOrdersAction(){\n\t\t$user = $this->get('security.token_storage')->getToken()->getUser();\n\t\t$orders = $this->getDoctrine()->getManager()->getRepository('EcommerceBundle:UserOrder')->getTheLastNotValidatedOrdersByUser($user, -1);\n\n\t\treturn $this->render('UserBundle:DashboardModules:dashLastNotValidatedOrders.html.twig', array(\n\t\t\t\t'orders' => $orders\n\t\t\t)\n\t\t);\n\t}", "function ppt_resources_get_delivered_planned_orders($data)\n{\n global $user;\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n if (empty($data['accounts'])) {\n return services_error('Accounts is not defined!', 500);\n }\n\n if (empty($data['products'])) {\n return services_error('Products is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = $data['accounts'];\n $products = $data['products'];\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_product', 'target_id', $products, 'IN')\n ->fieldCondition('field_planned_actual_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_actual_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n $final_arr = [];\n\n if (isset($records['node'])) {\n $nodes_ids = array_keys($records['node']);\n $nodes = node_load_multiple($nodes_ids);\n\n foreach ($nodes as $node) {\n // Get node planned product name.\n $planned_product_tid = $node->field_planned_product['und'][0]['target_id'];\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n\n // Get node date for product (planned).\n if (isset($node->field_planned_actual_period['und'])) {\n $node_date = $node->field_planned_actual_period['und'][0]['value'];\n $delivered_month = date(\"F\", strtotime($node_date));\n }\n\n // Get node values for planned quantity.\n $delivered_quantity = 0;\n if (isset($node->field_planned_delivered_quantity['und'])) {\n $delivered_quantity = $node->field_planned_delivered_quantity['und'][0]['value'];\n }\n\n // If product already exists, update its values for node months.\n if (isset($final_arr['delivered'][$planned_product_name])) {\n if (isset($final_arr['delivered'][$planned_product_name][$delivered_month])) {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] += (int) $delivered_quantity;\n } else {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] = [(int) $delivered_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr['delivered'][$planned_product_name] = [];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr['delivered'][$planned_product_name][$month] = [0];\n }\n $final_arr['delivered'][$planned_product_name][$delivered_month] = [(int) $delivered_quantity];\n }\n }\n }\n return $final_arr;\n}", "public function bookingsCancelledBefore(string $date): MorphMany\n {\n return $this->bookings()\n ->whereNotNull('cancelled_at')\n ->where('cancelled_at', '<', new Carbon($date));\n }", "public function test() {\n// $from = Carbon::parse('2017-05-15 24:00');\n// $ordersToday = Order::whereDate('reserved_from', $from->toDateString())\n// ->where('position', 0)\n// ->where(function ($q) use ($to, $from) {\n// $q->where(function ($q) use ($to, $from) {\n// $q->where('reserved_from', '>', $from)\n// ->where('reserved_to', '<', $to);\n// })\n// ->orWhere(function ($q) use ($to, $from) {\n// $q->where('reserved_from', '<', $from)\n// ->where('reserved_to', '>', $to);\n// })\n// ->orWhere(function ($q) use ($to, $from) {\n// $q->whereBetween('reserved_from', [$from->addMinute(), $to->subMinute()])\n// ->orWhere(function ($q) use ($to, $from) {\n// $q->whereBetween('reserved_to', [$from->addMinute(), $to->subMinute()]);\n// });\n// });\n// })\n// ->get();\n }", "public function notificacionesExpiradas()\n\t{\n\t\t$fechahoy = Carbon::now()->toDateString();\n\n\t\t$notificaciones = Notificacion::where('expiradate','<', $fechahoy)->orWhere('estatus_visto','=',\"visto\")->get();\n\n\t\treturn $notificaciones;\n\t}", "public static function getUnpaidInvoices( $customer = null )\n {\n $qb = self::getStaticD2EM()->createQueryBuilder()\n ->select( 'i.*' )\n ->from( '\\\\Entities\\\\Invoice', 'i' )\n ->where( \"i.paid_date IS NULL\" )\n ->orderBy( 'i.start_date', 'ASC' );\n\n if( $customer )\n $qb->andWhere( 'i.Customer = ?1' )\n ->setParam( 1, $customer );\n\n return $qb->getQuery()->getResult();\n\n }", "function ppt_resources_get_next_planned_orders($data)\n{\n global $user;\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n if (empty($data['accounts'])) {\n return services_error('Accounts is not defined!', 500);\n }\n\n if (empty($data['products'])) {\n return services_error('Products is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = $data['accounts'];\n $products = $data['products'];\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_product', 'target_id', $products, 'IN')\n ->fieldCondition('field_planned_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n $final_arr = [];\n\n if (isset($records['node'])) {\n $nodes_ids = array_keys($records['node']);\n $nodes = node_load_multiple($nodes_ids);\n\n foreach ($nodes as $node) {\n // Get node planned product name.\n $planned_product_tid = $node->field_planned_product['und'][0]['target_id'];\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n\n // Get node date for product (planned).\n if (isset($node->field_planned_period['und'])) {\n $node_date = $node->field_planned_period['und'][0]['value'];\n $planned_month = date(\"F\", strtotime($node_date));\n }\n\n // Get node values for planned quantity.\n $planned_quantity = 0;\n if (isset($node->field_planned_quantity['und'])) {\n $planned_quantity = $node->field_planned_quantity['und'][0]['value'];\n }\n\n // If product already exists, update its values for node months.\n if (isset($final_arr['planned'][$planned_product_name])) {\n if (isset($final_arr['planned'][$planned_product_name][$planned_month])) {\n $final_arr['planned'][$planned_product_name][$planned_month][0] += (int) $planned_quantity;\n } else {\n $final_arr['planned'][$planned_product_name][$planned_month][0] = [(int) $planned_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr['planned'][$planned_product_name] = [];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr['planned'][$planned_product_name][$month] = [0];\n }\n $final_arr['planned'][$planned_product_name][$planned_month] = [(int) $planned_quantity];\n }\n }\n }\n return $final_arr;\n}", "public function getItemAfterDate ($date) {\n\t$result = mysql_query(\"SELECT item_number, listing_start_date, listing_end_date, item_name, description, listing_user_email, TO_BASE64(item_picture) AS item_picture, TO_BASE64(item_picture_thumbnail) AS item_picture_thumbnail, item_price, category_number FROM item WHERE listing_end_date > $date ORDER BY listing_end_date ASC\");\n\tif ($result) {\n //$result = mysql_fetch_assoc($result);\n return $result;\n } else {\n $error = mysql_errno();\n return -$error;\n }\n }", "function wdts_delete_past_dates( $report ) {\n\t$today = date('d-m-Y');\n\tforeach ( $report as $key => $value ) {\n\t\tif ( strtotime( $key ) < strtotime($today) ) {\n\t\t\tunset( $report[ $key ] );\n\t\t}\n\t}\n\treturn $report;\n}", "public function fetchForSuspension($date)\n {\n $qb = $this->createQueryBuilder();\n $qb->innerJoin('m.communityLicSuspensions', 's')\n ->innerJoin('s.communityLicSuspensionReasons', 'sr')\n ->andWhere($qb->expr()->eq($this->alias . '.status', ':status'))\n ->andWhere($qb->expr()->lte('s.startDate', ':startDate'))\n ->andWhere(\n $qb->expr()->orX(\n $qb->expr()->isNull('s.endDate'),\n $qb->expr()->gt('s.endDate', ':endDate')\n )\n )\n ->setParameter('status', CommunityLicEntity::STATUS_ACTIVE)\n ->setParameter('startDate', $date)\n ->setParameter('endDate', $date);\n\n return $qb->getQuery()->execute();\n }", "public function cleanOrdersInPendingBe2bill()\n {\n $limit_day = Mage::getStoreConfig('payment/be2bill/auth_validity_day');\n\n if (!$limit_day) {\n return $this;\n }\n\n $orders = $this->getOrdersBySubDay(20, 10);\n\n foreach ($orders as $order) {\n try {\n //@var $order Mage_Sales_Model_Order\n if ($order->canCancel()) {\n $order->cancel();\n $order->addStatusToHistory(\n $order->getStatus(),\n // keep order status/state\n Mage::helper('be2bill')->__(\"Commande annulée par le cron be2bill\")\n );\n } else {\n $order->addStatusToHistory(\n $order->getStatus(),\n // keep order status/state\n Mage::helper('be2bill')->__(\"L'annulation de la commande par le cron Be2bill a échoué\")\n );\n }\n $order->save();\n } catch (Exception $e) {\n Mage::log($e->getMessage(), null, \"be2bill_error_cron.log\");\n Mage::throwException($e->getMessage());\n }\n }\n return $this;\n }", "public function bookingsStartsAfter(string $date): MorphMany\n {\n return $this->bookings()\n ->whereNull('cancelled_at')\n ->whereNotNull('starts_at')\n ->where('starts_at', '>', new Carbon($date));\n }", "public function getPendingOrders($status) {\r\n if($status != \"all\"):\r\n $orders = Mage::getModel('marketplace/commission')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('seller_id', Mage::getSingleton('customer/session')->getCustomer()->getId());\r\n $orders ->getSelect()\r\n ->columns('SUM(seller_amount) as seller_amount')\r\n ->group('order_id'); \r\n /**\r\n * Set order for manage order\r\n */\r\n $orders->setOrder('order_id', 'desc');\r\n /**\r\n * Return orders\r\n */\r\n $condition = new Zend_Db_Expr(\"sales.entity_id = main_table.order_id AND sales.status = '$status'\");\r\n $orders->getSelect()->join(array('sales' => $orders->getTable('sales/order')),\r\n $condition,\r\n array('status' => 'sales.status'));\r\n elseif($status == \"all\"):\r\n $orders = Mage::getModel('marketplace/commission')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('seller_id', Mage::getSingleton('customer/session')->getCustomer()->getId());\r\n $orders ->getSelect()\r\n ->columns('SUM(seller_amount) as seller_amount')\r\n ->group('order_id'); \r\n /**\r\n * Set order for manage order\r\n */\r\n $orders->setOrder('order_id', 'desc');\r\n /**\r\n * Return orders\r\n */\r\n endif;\r\n return $orders; \r\n }", "function getOrders() {\n\t\t$orders = Mage::getModel ( 'sales/order' )->getCollection ()->addAttributeToSelect ( \"*\" )->addAttributeToFilter ( 'status', array ('complete') );\n\t\t$orders_data = $this->preapreOrdersTosend ( $orders );\n\t\treturn $orders_data;\n\t}", "public function fetchShippingOrders($status, $date) {\n $f = $this->find('list', array(\n 'conditions' => array ('status' => $status, 'modified > ' => $date),\n 'fields' => array('id', 'id')\n ));\n return new ArrayIterator($f);\n }", "public function removeExpired(Date $date, $exact = false)\n\t{\n\t\t$sign = ($exact) ? '=' : '<=';\n\n\t\t// Get the items\n\t\t$items = CreditModel::where('expires', $sign, $date)->get();\n\n\t\tif ($items->count() > 0)\n\t\t{\n\t\t\tforeach ($items as $item)\n\t\t\t{\n\t\t\t\t$item->delete();\n\t\t\t}\n\t\t}\n\t}", "public function getUnexpiredContents()\n {\n return $this->reader\n ->addFilter([$this, 'filterByDate'])\n ->addSortBy([$this, 'orderByDate'])\n ->fetchAssoc($this->associativeMap);\n }", "public function bookingsEndsBefore(string $date): MorphMany\n {\n return $this->bookings()\n ->whereNull('cancelled_at')\n ->whereNotNull('ends_at')\n ->where('ends_at', '<', new Carbon($date));\n }", "public static function fetchDueList()\n {\n $aDueList = eZPersistentObject::fetchObjectList( eZStaticExportScheduler::definition(),\n \t null,\n \t array( 'date' => array( '<=', time() ) ),\n \t array( 'date' => 'desc' ) );\n\n\t\t\n\t\treturn $aDueList;\n }", "public static function optionForFromDateUlip($policy_id)\n {\n $policy = LifeInsuranceUlip::find($policy_id);\n $start_date = $policy->issue_date;\n $end_date = $policy->last_premium_date;\n $dates = [];\n for ($i = 0; $i < $policy->permium_paying_term; $i++) {\n $dates[] = [\n 'date' => date('Y-m-d', strtotime(\"+$i year\", strtotime($start_date))),\n 'disable' => false\n ];\n }\n $dates[0]['disable'] = true;\n\n // Get all paid Premium Date\n $paid_premiums = PremiumMaster::where('tbl_key', LifeInsuranceUlip::$tablename)->where('policy_id', $policy_id)->orderBy('premium_date', 'desc')->first();\n $paid_premiums = json_decode(json_encode($paid_premiums), true);\n\n foreach ($dates as $key => $value) {\n if ($value['disable'] || date('Y', strtotime($paid_premiums['premium_date'])) >= date('Y', strtotime($value['date']))) {\n $dates[$key]['disable'] = true;\n }\n }\n\n $premium_modes = InsuranceInstallmentModeHist::where('tbl_type', LifeInsuranceUlip::$tablename)->where('policy_id', $policy_id)->get();\n $premium_modes = json_decode(json_encode($premium_modes), true);\n $premium_modes = array_column($premium_modes, 'from_date');\n\n foreach ($dates as $key => $value) {\n if ($value['disable'] || in_array($value['date'], $premium_modes)) {\n $dates[$key]['disable'] = true;\n }\n }\n $dates = array_map(function ($val) {\n return [\n 'key' => !empty($val['date']) ? $val['date'] : '',\n 'value' => !empty($val['date']) ? date('d-m-Y', strtotime($val['date'])) : '',\n 'disabled' => !empty($val['disable']) ? true : '',\n ];\n }, $dates);\n\n return $dates;\n }", "function getFilterDatePast($top){\n\tif(!$top)\n\t\t$top=20;\n\n\t$data = M('event');\n\t$date_set = Array();\n\t$condition = Array('event_date' => Array('elt', todayDate()));\n\t$result = $data->where($condition)->group('event_date')->limit($top)->order('event_date desc')->select();\n\tforeach($result as $value)\n\t\tarray_push($date_set, $value['event_date']);\n\n\treturn $date_set;\n}", "public function scopePast($query)\n {\n return $query->whereDate('metadata_order.value', '<', Carbon::today());\n }", "public function fetchArchivingOrderInList() {\n $date = date('Y-m-d', (time() - MONTH));\n $list = $this->find('list', array(\n 'conditions' => array(\n 'Order.status' => 'Invoiced',\n 'Order.modified <' => $date\n ),\n 'fields' => array('order_number', 'id')\n ));\n $logData = implode(',', $list);\n return $list;\n }", "public function usersWithMoreThanOnePaidOrder()\n {\n return $this->model->select('id', 'paid_date')\n ->select([DB::raw(\"COUNT(user_id) total_orders\"), 'user_id'])\n ->with('user')\n ->where('status_id', OrderStatusConstants::PAID)\n ->groupBy(\"user_id\")\n ->havingRaw(\"COUNT(user_id) > 1\")\n ->orderBy('total_orders')\n ->paginate();\n }", "public function getDebitWithdrawGroupDatesByDate($date)\n {\n $user = auth()->user();\n $account = $user->account;\n\n $items = QueryBuilder::for(Transaction::class)\n ->whereIn('type', [TransactionType::Deposit, TransactionType::Withdraw])\n ->whereIn('status', [TransactionStatus::Holding, TransactionStatus::Completed])\n ->whereDate('created_at', Carbon::parse($date)->toDateString())\n ->where(function($query) use ($account){\n $query->where('account_sender_id', $account->id)\n ->orWhere('account_receiver_id', $account->id);\n })->jsonPaginate();\n\n return TransactionResource::collection($items);\n }", "protected function byDateOrders(Request $request)\n {\n if ($request->from_to) {\n $from_to_array = explode('/', $request->from_to);\n $request['from'] = Carbon::create($from_to_array[0]);\n $request['to'] = Carbon::create($from_to_array[1]) ? Carbon::create($from_to_array[1]) : Carbon::today();\n if ($request->from && $request->to) {\n $this->validate($request, [\n 'to' => 'date|after_or_equal:from',\n 'from' => 'date|before_or_equal:to',\n ]);\n return POSOrder::where('warehouse_id', auth()->user()->warehouse_id)->orderBy('id', 'desc')->whereBetween('created_at', [$request->from, $request->to])->get();\n }\n } else {\n return POSOrder::where('warehouse_id', auth()->user()->warehouse_id)->orderBy('id', 'desc')->whereBetween('created_at', [Carbon::today(), Carbon::tomorrow()])->get();\n }\n }", "public function scopeNotDelivered($query)\n {\n return $query->whereNull('delivered_at')\n ->where('status', '=', '1')\n ->whereDate('published_at', '<=', Carbon::today()->toDateString());\n }", "public function excludePendingOrders()\n {\n return $this->scopeConfig->getValue('wesupply_api/wesupply_order_export/wesupply_order_filter_pending', ScopeInterface::SCOPE_STORE);\n }", "public function getByExpiredUsers($paymentGateway='')\n\t{\n\t\t$today = time();\n\t\t$startat = 1477060836;\n $queryBuilder = $this->createQueryBuilder('s');\n $query = $queryBuilder\n ->select('s')\n ->innerJoin('Api\\\\V1\\\\Entity\\\\User', 'u')\n ->where('u.subscriptionId = s.id')\n ->andWhere('s.paymentGateway = :paymentGateway')\n ->andWhere('u.subscriptionExpireAt > 0')\n ->andWhere('u.subscriptionExpireAt <= :today')\n ->andWhere('u.subscriptionStartAt >= :startat')\n ->andWhere('u.flags <> :status')\n ->setParameter('paymentGateway', $paymentGateway)\n ->setParameter('today', $today)\n ->setParameter('startat', $startat)\n ->setParameter('status', User::STATUS_SUSPENDED)\n\t\t\t->getQuery();\n\t\t/*$sql =\"select * from subscription as s INNER JOIN user as u where u.subscription_id=s.id and u.subscription_start_at>=$start_at and u.subscription_expire_at >0 and u.subscription_expire_at<=$today and u.flags!=1 and s.payment_gateway='$paymentGateway'\";\n\t\t$stmt = $this->getEntityManager()->getConnection()->prepare($sql);\n $stmt->execute();\n\t\t$subscriptions = $stmt->fetchAll();*/\n\t//\t$q=$query->getSQL();\n\t//\terror_log(\"Query: \".$q.\"\\n\" , 3, \"/volumes/log/api/test-log.log\");\n\t//\terror_log(\"Parameters: \".print_r($query->getParameters(), TRUE).\"\\n\" , 3, \"/volumes/log/api/test-log.log\");\n $subscriptions = $query->getResult();\n\n return $subscriptions;\n }", "public function getInvoiceDueDate()\n {\n if ($this->payment_method->id != 1) {\n throw new \\Exception(\"There is no due date for non-invoice orders.\");\n }\n\n $dueDate = clone($this->order_date);\n $dueDate->add(new \\DateInterval(\"P30D\"));\n\n return $dueDate;\n }", "public function getPayments($date)\n\t{\n\t\treturn array_merge(\n\t\t\t$this->getNonAchPayments($date),\n\t\t\t$this->getAchFailures($date),\n\t\t\t$this->getAchPayments($date)\n\t\t);\n\t}", "public function get_expired_posts() {\n $today = date(\"Y-m-d\");\n\n $args = array(\n 'post_type' => $this->_post_types_to_cover,\n 'meta_key' => 'bbx_best_before_expiry_date',\n 'orderby' => 'meta_value',\n 'order' => 'ASC',\n 'post_status' => 'publish',\n 'meta_query' => array(\n array(\n 'key' => 'bbx_best_before_expiry_date',\n 'value' => $today,\n 'compare' => '<=',\n 'type' => 'DATE'\n )\n )\n );\n\n $expired_posts = get_posts( $args );\n\n return $expired_posts;\n }", "function getOldOpenOrders($minutes)\n\t{\n\t\t$threshold_timestamp = time()-($minutes*60);\n\t\t$threshold_dt_tm = date(\"Y-m-d H:i:s\",$threshold_timestamp);\n\t\t$old_order_data['status'] = 'O';\n\t\t$old_order_data['created'] = array(\"<\"=>$threshold_dt_tm);\n\t\t$options[TONIC_FIND_BY_METADATA] = \t$old_order_data;\n\t\t$options[TONIC_JOIN_STATEMENT] = \" JOIN Merchant ON Orders.merchant_id = Merchant.merchant_id \";\n\t\t$options[TONIC_FIND_STATIC_FIELD] = \" Merchant.time_zone, Merchant.state \";\n\n\t\t$default_timezone_string = date_default_timezone_get();\n\n\t\t$old_order_resources = Resource::findAll($this,'',$options);\n\t\t$old_open_orders = array();\n\t\tforeach ($old_order_resources as $order_resource)\n\t\t{\n\t\t\tsetTheDefaultTimeZone($order_resource->time_zone,$order_resource->state);\n\t\t\t$pickup_timestamp = strtotime($order_resource->pickup_dt_tm);\n\t\t\tif ($pickup_timestamp < $threshold_timestamp)\n\t\t\t{\n\t\t\t\tmyerror_log(\"we have an open order that was scheduled to be picke up over $minutes minutes ago\");\n\t\t\t\t$old_open_orders[] = $order_resource;\n\t\t\t}\n\t\t}\n\t\tdate_default_timezone_set($default_timezone_string);\n\t\treturn $old_open_orders;\n\n\t}", "public function buyer_orders()\n {\n $query = $this->db->where('buyer_id', $this->current_user->user_id)\n ->order_by('time desc')\n //->order_by('progress asc, time desc')\n ->get('orders');\n #echo $this->db->last_query();\n return ($query->num_rows() > 0) ? $this->build_array($query->result_array()) : array();\n\n }", "public function scopeDeactivated($query)\n {\n return $query->where($this->ends_at_field, '<', date('Y-m-d H:i:s'));\n }", "function findAllOrdersDescPaginated();", "public function bookingsEndsAfter(string $date): MorphMany\n {\n return $this->bookings()\n ->whereNull('cancelled_at')\n ->whereNotNull('ends_at')\n ->where('ends_at', '>', new Carbon($date));\n }", "function genUpcomingInvoices($order_id)\n {\n $conf = $this->BL->conf;\n // $conf['u_invoice_date'] is how many months in advance to generate upcoming invoices\n if ($conf['u_invoice_date'] > 0)\n {\n // Force generated invoices to be status \"Upcoming\"\n $this->REQUEST['force_status'] = $this->props->invoice_status[5];\n\n $echo = \"\";\n $continue = false;\n\n $temp = $this->BL->recurring_data($order_id, 0, \"SELECT\");\n $next_due_date = $temp['rec_next_date'];\n $next_due_date_array= $this->utils->getDateArray($next_due_date);\n $restore_actual_due = $next_due_date; //restore later\n\n $delta_date = ($conf['u_invoice_date'] > 12)?floor($conf['u_invoice_date'] / 30):$conf['u_invoice_date'];\n $max_upcoming_date_array = $this->utils->getXmonthsAfter($delta_date, getdate());\n $max_upcoming_date = date('Y-m-d', strtotime($max_upcoming_date_array['year'] . \"-\" . $max_upcoming_date_array['mon'] . \"-\" . $max_upcoming_date_array['mday']));\n\n if ($this->utils->compareDates(\n $max_upcoming_date_array['mday'],$max_upcoming_date_array['mon'],$max_upcoming_date_array['year'],\n $next_due_date_array['mday'], $next_due_date_array['mon'],$next_due_date_array['year'])\n !=-1) // If $max_upcoming_date_arr >= $next_due_date_array\n {\n $continue = true;\n }\n\n while ($continue && $next_due_date<$max_upcoming_date)\n {\n $echo .= \"$next_due_date\\n\";\n $echo .= $this->genInvoice($order_id);\n $temp = $this->BL->recurring_data($order_id, 0, \"SELECT\");\n\n $rec_next_date_array = $this->utils->getDateArray($temp['rec_next_date']);\n $next_due_date_array = $this->utils->getDateArray($next_due_date);\n\n $date_compare1 = $this->utils->compareDates($max_upcoming_date_array['mday'],$max_upcoming_date_array['mon'],$max_upcoming_date_array['year'],$rec_next_date_array['mday'],$rec_next_date_array['mon'],$rec_next_date_array['year']);\n $date_compare2 = $this->utils->compareDates($rec_next_date_array['mday'],$rec_next_date_array['mon'],$rec_next_date_array['year'],$next_due_date_array['mday'],$next_due_date_array['mon'],$next_due_date_array['year']);\n\n if($temp['rec_next_date']<$max_upcoming_date && $temp['rec_next_date']!=$next_due_date)\n {\n $next_due_date = $temp['rec_next_date'];\n }\n else\n {\n $continue = false;\n }\n }\n\n // Restore proper due date\n $sqlUPDATE = \"UPDATE {$this->props->tbl_ord_inv_recs} SET `rec_next_date`='\" . $restore_actual_due . \"' WHERE `rec_ord_id`=\" . intval($order_id);\n $this->dbL->executeUPDATE($sqlUPDATE);\n $echo .= \"Restored due date\\n\";\n }\n return $echo;\n }", "public function getOrdersByCreditCard($creditcard, $finalized = 0){\n $select = new Select($this->table);\n \n $predicate1 = new Predicate();\n $predicate1->expression('cancelled_orders.items >= ao.items',null);\n \n $predicate = new \\Zend\\Db\\Sql\\Where();\n $subselect = new Select(\"cancelled_orders\");\n $subselect->columns(array(\n 'orderno' => 'orderno'\n ))->join(array('ao' => 'admin_order'),\"cancelled_orders.orderno = ao.orderno\",array())\n ->where->addPredicate($predicate1,Predicate::COMBINED_BY_AND) ;\n \n \n \n $select->columns(array(\n \t'orderno' => 'orderno',\n 'admin' => 'admin',\n 'orderdate' => 'orderdate',\n 'store_id' => 'store_id',\n 'items' => 'items',\n 'total_web' => 'total_web',\n 'total_web1' => 'total_web1',\n 'discount' => 'discount',\n 'tax' => 'tax',\n 'ship_us' => 'ship_us',\n 'total_final' => 'total_final',\n 'creditcard' => 'creditcard',\n 'holder' => 'holder', \n ))->join(array('s' => 'store'), \"$this->table.store_id = s.id\",array(\n \t'store_name' => 'name'\n ))->where(array(\n \t'finalized' => $finalized,\n 'creditcard' => $creditcard,\n new \\Zend\\Db\\Sql\\Predicate\\NotIn('orderno',$subselect)\n \n ))->order(array(\n \t'orderdate' => 'DESC'\n ));\n \n \n \n $resultSet = $this->selectWith($select);\n $items = $resultSet->toArray();\n $list = array();\n \n $cancelledItemTable = new CancelledItemsTable($this->adapter);\n $cancelledOrderTable = new CancelledOrdersTable($this->adapter);\n $orderdetailTable = new AdminOrderDetailsTable($this->adapter);\n \n \n foreach ($items as $row) {\n \t$item = new OrderFinalizing();\n \t$item->setData($row);\n \t\n \t\n \t$cancelledItem = $cancelledItemTable->getTotalItemByOrderno($item->getOrderno());\n \tif ($cancelledItem){\n \t $item->setCancelled_items($cancelledItem);\n \t}else{\n \t $item->setCancelled_items(0);\n \t}\n \t\n \t$totalCancel = $cancelledOrderTable->getTotalWeb1ByOrderNo($item->getOrderno());\n \t\n \tif ($totalCancel){\n \t $item->setTotal_cancelled($totalCancel);\n \t}else{\n \t $item->setTotal_cancelled(0);\n \t}\n \t\n \t$service = $orderdetailTable->getTotalServiceByOrderno($item->getOrderno());\n \t$totalFinal = $orderdetailTable->getTotalFinalByOrderno($item->getOrderno());\n \t\n \t//$item->setPaid($totalFinal - $service - $item->getTotal_cancelled());\n \t$item->setPaid($item->getTotal_final() - $item->getTotal_cancelled());\n \t\n \t$list[] = $item;\n }\n return $list;\n \n }", "public function getDueDates(){\n\t\t$startDate = new DateTime($this->Params['start_date']);\n\t\t$monthDay = $startDate->format('d');\n\t\t$periodDueDate = new DateTime($this->Params['due_date']);\n\t\tswitch($this->Params['payment_mode']){\n\t\t\tcase 1: // DAILY\n\t\t\t\tif($this->Params['num'] > 1){\n\t\t\t\t\tif($this->Params['amortization_type'] == 2){ // STRAIGHT-LINE\n\t\t\t\t\t\t$periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\t\t$datePeriodTimeStamp = strtotime($datePeriod);\n\t\t\t\t\t\t$getPeriodDay = date('D', $datePeriodTimeStamp);\n\t\t\t\t\t\tif($getPeriodDay === \"Sun\") $periodDueDate->modify('+1 day');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 2: // WEEKLY\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 3: // SEMI-MONTHLY\n\t\t\t\tswitch($this->Params['dd_type']){\n\t\t\t\t\tcase 3: // 15th and End of the Month\n\t\t\t\t\t\tif($monthDay <= 15){\n\t\t\t\t\t\t\t$dueDateDay = [1 => 15, 2 => 'last_day_month'];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dueDateDay = [1 => 'last_day_month', 2 => 15];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dueDatePeriod = $dueDateDay[$this->Params['count_reset']];\n\t\t\t\t\t\tif(is_int($dueDatePeriod)){\n\t\t\t\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$monthName = $periodDueDate->format('F');\n\t\t\t\t\t\t\t$periodDueDate->modify('last day of '.$monthName);\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5: // 5th and 20th of the Month\n\t\t\t\t\t\tif($monthDay <= 5){\n\t\t\t\t\t\t\t$dueDateDay = [1 => '05', 2 => 20];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dueDateDay = [1 => 20, 2 => '05'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dueDatePeriod = $dueDateDay[$this->Params['count_reset']];\n\t\t\t\t\t\tif($dueDatePeriod == '05' && $this->Params['num'] > 1) $periodDueDate->modify('+1 month');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6: // 10th and 25th of the Month\n\t\t\t\t\t\tif($monthDay <= 10){\n\t\t\t\t\t\t\t$dueDateDay = [1 => 10, 2 => 25];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dueDateDay = [1 => 25, 2 => 10];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dueDatePeriod = $dueDateDay[$this->Params['count_reset']];\n\t\t\t\t\t\tif($dueDatePeriod == 10 && $this->Params['num'] > 1) $periodDueDate->modify('+1 month');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 7: // 15th and 30th of the Month\n\t\t\t\t\t\tif($monthDay <= 15){\n\t\t\t\t\t\t\t$dueDateDay = [1 => 15, 2 => 30];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dueDateDay = [1 => 30, 2 => 15];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dueDatePeriod = $dueDateDay[$this->Params['count_reset']];\n\t\t\t\t\t\tif($dueDatePeriod == 15 && $this->Params['num'] > 1) $periodDueDate->modify('+28 days');\n\t\t\t\t\t\t\n\t\t\t\t\t\t$monthName = $periodDueDate->format('F');\n\t\t\t\t\t\tif($monthName == \"February\"){\n\t\t\t\t\t\t\tif($dueDatePeriod == 15){\n\t\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$periodDueDate->modify('last day of '.$monthName);\n\t\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 4: // MONTHLY\n\t\t\t\tswitch($this->Params['dd_type']){\n\t\t\t\t\tcase 2: // END OF THE MONTH\n\t\t\t\t\t\tif($this->Params['num'] > 1){\n\t\t\t\t\t\t\t$periodDueDate->modify('+28 days');\n\t\t\t\t\t\t\t$periodDueDate->modify('last day of this month');\n\t\t\t\t\t\t}else{ // ALLOWANCE OF 15 DAYS\n\t\t\t\t\t\t\t$periodDueDate->modify('-1 month');\n\t\t\t\t\t\t\t$periodDueDate->modify('+15 days');\n\t\t\t\t\t\t\t$periodDueDate->modify('last day of this month');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4: // SAME DAY OF EACH MONTH\n\t\t\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('next month');\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($this->Params['isFebruary']) && $this->Params['isFebruary']){\n\t\t\t\t\t\t\t$startDate = new DateTime($this->Params['due_date']);\n\t\t\t\t\t\t\t$periodDueDate->modify('-1 month');\n\t\t\t\t\t\t\t$periodDueDate->modify('last day of this month');\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\t\t\tunset($this->Params['isFebruary']);\n\t\t\t\t\t\t\t$this->Params['isFebruary'] = false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$startDate = new DateTime($this->Params['start_date']);\n\t\t\t\t\t\t\t$monthDay = $startDate->format('d');\n\t\t\t\t\t\t\t$periodDueDate->format($monthDay);\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$monthDay);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$monthName = $periodDueDate->format('F');\n\t\t\t\t\t\t$isLeapYear = $periodDueDate->format('L'); // CHECK IF LEAPYEAR\n\t\t\t\t\t\t$leapDays = ($isLeapYear > 0) ? 29 : 28;\n\t\t\t\t\t\tif($monthName == \"January\" && $monthDay > $leapDays){ // TO SET ON FEBRUARY\n\t\t\t\t\t\t\t$this->Params['isFebruary'] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 5: // QUARTERLY\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['monthly_terms'].' month');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 6: // SEMESTRAL\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['monthly_terms'].' month');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 7: // YEARLY\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+1 year');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 9: // LUMPSUM\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('next month');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $datePeriod;\n\t}", "public function searchUnpublishPending( \\DateTime $currentDatetime = null );", "public function getScheduledPayments($data) {\n\t\t// provide the EziDebit API endpoint\n\t\t$soapclient = new SoapClient($this->nonPci);\n\n\t\t$params = [\n\t\t\t\t'DigitalKey' => $this->digitalKey,\n\t\t\t\t'DateFrom' => $data['dateFrom'],\n\t\t\t\t'DateTo' => $data['dateTo'],\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->getScheduledPayments($params);\n\t}", "function get_amount($date) {\n global $debug;\n $val = null;\n $money = 0;\n //if ($debug) { echo \"comparing value range for this object: \"; print_r($item); }\n foreach ($this->list as $item) {\n if ($item->includes($date)) {\n $val = $item;\n }\n }\n if (!$val) {\n return $money;\n }\n $period = $val->period;\n switch ($period) {\n case 'weekly':\n // this is only debited once every week.\n // make sure it is a multiple of 1 week offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 7 == 0) {\n $money = $val->amount;\n }\n break;\n case 'biweekly':\n // this is only debited once every 2 weeks.\n // make sure it is a multiple of 2 weeks offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 14 == 0) {\n $money = $val->amount;\n }\n break;\n case 'monthly': \n // this is debited once per month\n // make sure the day of month matches the day from $val->extra\n $day_amount = date('d', strtotime($val->extra));\n $day_this = date('d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'semiannual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_amount_semi = date('m-d', strtotime(\"+6 months\", strtotime($val->extra)));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount || $day_this == $day_amount_semi) {\n $money = $val->amount;\n }\n break;\n case 'annual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'once':\n // make sure date matches exactly with $val->extra\n if ($date == $val->extra) {\n $money = $val->amount;\n }\n break;\n case 'daily':\n // always return the same value\n $money = $val->amount;\n break;\n default:\n throw new Exception(\"unkown period '$period'\");\n }\n if ($debug) {\n printf(\"get_amount($date) $val->period, $val->amount, $val->extra -> $money\\n\");\n }\n return $money;\n }", "public function getUnsentOrderCutoffDate()\n {\n return date('Y-m-d H:i:s', strtotime('-'.$this->getUnsentOrderCutoff().' days'));\n }", "public function soonToExpire()\n {\n $fifteen_before = Carbon::now()->subMinutes(15)->toDateTimeString();\n $fifteen_later = Carbon::now()->addMinutes(15)->toDateTimeString();\n\n return $this->getModel()->whereBetween('expires_at', [$fifteen_before, $fifteen_later])->get();\n }", "public function getDistribusiHistory($date)\n {\n $distribusi = PenyimpananDistribusi::whereMonth('created_at', Carbon::now()->format('m'))\n ->whereYear('created_at', Carbon::now()->format('Y'))\n ->get();\n\n \n if($date !== \"\")\n {\n $distribusi = PenyimpananDistribusi::whereMonth('created_at', Carbon::parse($date)->format('m'))\n ->whereYear('created_at', Carbon::parse($date)->format('Y'))\n ->get();\n }\n return $distribusi;\n }", "private function queryDepositsAndWithdrawals() {\r\n return $this->queryAPI( 'returnDepositsWithdrawals', //\r\n [\r\n 'start' => time() - 14 * 24 * 3600,\r\n 'end' => time() + 3600\r\n ]\r\n );\r\n\r\n }", "public function fetchForActivation($date)\n {\n $qb = $this->createQueryBuilder();\n $qb->innerJoin('m.communityLicSuspensions', 's')\n ->innerJoin('s.communityLicSuspensionReasons', 'sr')\n ->andWhere($qb->expr()->eq($this->alias . '.status', ':status'))\n ->andWhere($qb->expr()->lte('s.endDate', ':endDate'))\n ->setParameter('status', CommunityLicEntity::STATUS_SUSPENDED)\n ->setParameter('endDate', $date);\n\n return $qb->getQuery()->execute();\n }", "public function due($no)\n {\n $handle = $this->getHandle($no);\n\n return $this->client\n ->Quotation_GetDueDate([\n 'quotationHandle' => $handle\n ])\n ->Quotation_GetDueDateResult;\n }", "public function scopeSoonerToBeDeactivated($query)\n {\n return $query->orderBy($this->ends_at_field, 'asc');\n }", "public function fromDate($date = null)\n {\n if (!($date = $this->filterDate($date)))\n {\n return $this;\n }\n else\n {\n return $this->andWhere('i.customer_id = id')\n ->andWhere('i.issue_date >= ?', sfDate::getInstance($date)->to_database());\n }\n }", "public function getPastEvents(){\n\t\t// get the events\n\t\t$events = $this->getEvents();\n\n\t\t$pastEvents = [];\n\t\t$eventNumber = sizeof($events);\n\n\t\t// extracts the events which has not happened yet, which date is not passed\n\t\tfor ($i = 0; $i < $eventNumber; $i++){\n\t\t\t$event = array_shift($events);\n\t\t\tif($event['is_approved'] == 1 && $event['date'] < date('Y-m-d')){\n\t\t\t\tarray_push($pastEvents, $event);\n\t\t\t}\n\t\t}\n\n\t\treturn $pastEvents;\n\t}", "public static function get_all_due()\n\t{\n\t\tglobal $wpdb;\n\n\t\t$table_name = $wpdb->prefix . \"pv_commission\";\n\t\t$where = $wpdb->prepare( 'WHERE status = %s', 'due' );\n\t\t$where \t\t= apply_filters( 'topgroupshops_commission_all_due_where', $where ); \n\t\t$query = \"SELECT id, vendor_id, total_due FROM `{$table_name}` $where\"; \n\t\t$query \t\t= apply_filters( 'topgroupshops_commission_all_due_sql', $wpdb->prepare( $query ) ); \n\t\t$results = $wpdb->get_results( $query );\n\n\t\treturn $results;\n\t}", "public function getDailyOrders($id=null)\n {\n $startDate = date(\"Y-m-d H:i:s\", strtotime('-1 month', time()));\n $endDate = date('Y-m-d H:i:s');\n\n $userData = User::find()->andFilterWhere(['u_id' => $id])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n\n $orderList = \\Yii::$app->api->getOrdersList('Created', $startDate, $endDate);\n foreach ($orderList as $order) {\n $order = (array)$order;\n $order = array_shift($order);\n if ($order) {\n\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $order['AmazonOrderId'], 'aol_user_id' => $user->u_id]);\n if (!$model) {\n $model = new AllOrdesList();\n }\n $model->aol_amazon_order_id = (key_exists('AmazonOrderId', $order)) ? $order['AmazonOrderId'] : null;\n $model->aol_seller_order_id = (key_exists('SellerOrderId', $order)) ? $order['SellerOrderId'] : null;\n $model->aol_purchase_date = (key_exists('PurchaseDate', $order)) ? $order['PurchaseDate'] : null;\n $model->aol_last_updated_date = (key_exists('LastUpdateDate', $order)) ? $order['LastUpdateDate'] : null;\n $model->aol_order_status = (key_exists('OrderStatus', $order)) ? $order['OrderStatus'] : null;\n $model->aol_fulfilment_channel = (key_exists('FulfillmentChannel', $order)) ? $order['FulfillmentChannel'] : null;\n $model->aol_sales_channel = (key_exists('SalesChannel', $order)) ? $order['SalesChannel'] : null;\n $model->aol_ship_service = (key_exists('ShipServiceLevel', $order)) ? $order['ShipServiceLevel'] : null;\n $model->aol_order_total = (key_exists('OrderTotal', $order)) ? $order['OrderTotal']['Amount'] : 0;\n $model->aol_shipped_items = (key_exists('NumberOfItemsShipped', $order)) ? $order['NumberOfItemsShipped'] : null;\n $model->aol_unshipped_items = (key_exists('NumberOfItemsUnshipped', $order)) ? $order['NumberOfItemsUnshipped'] : null;\n $model->aol_user_id = $user->u_id;\n if($model->save(false)) {\n echo $model->aol_amazon_order_id.\" is Saved. \";\n }\n\n $model = AllOrdesList::findOne($model->aol_amazon_order_id);\n if($model) {\n sleep(2);\n /**\n * Get Finance Event Data\n */\n $financeEventData = \\Yii::$app->api->getFinanceEventList($model->aol_amazon_order_id);\n $amazonOrderId = $sellerOrderId = $shipmentRefundId = null;\n\n if ($financeEventData) {\n // print_r($financeEventData); exit();\n /**\n * Store Shipment Event Data 111-8188019-0760241\n */\n if ($shipmentData = $financeEventData['shipmentEventData']) {\n foreach ($shipmentData as $sVal) {\n $modelSR = new ShipmentRefundEventData();\n $modelSR->sred_amazon_order_id = $amazonOrderId = $sVal['AmazonOrderId'];\n $modelSR->sred_seller_order_id = $sellerOrderId = $sVal['SellerOrderId'];\n $modelSR->sred_marketplace_name = $sVal['MarketplaceName'];\n $modelSR->sred_shipment_posted_date = $sVal['PostedDate'];\n $modelSR->sred_event_type = 'Order';\n\n if ($modelSR->save(false)) {\n $shipmentRefundId = $modelSR->sred_id;\n if (key_exists('ShipmentItemList', $sVal) && is_array($sVal['ShipmentItemList']) && $shipmentItemData = $sVal['ShipmentItemList']) {\n foreach ($shipmentItemData as $sItem) {\n $sellerSku = $sItem['SellerSKU'];\n $orderItemId = $sItem['OrderItemId'];\n $shippedQuantity = $sItem['QuantityShipped'];\n\n if (key_exists('ItemChargeList', $sItem) && is_array($sItem['ItemChargeList']) && $itemChargeData = $sItem['ItemChargeList']) {\n foreach ($itemChargeData as $iData) {\n $itemModel = new ItemChargeListData();\n $itemModel->icld_quantity_shipped = $shippedQuantity;\n $itemModel->icld_seller_sku = $sellerSku;\n $itemModel->icld_order_item_id = $orderItemId;\n $itemModel->icld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $itemModel->icld_seller_order_id = $modelSR->sred_seller_order_id;\n $itemModel->icld_item_charge_type = $iData['ChargeType'];\n $itemModel->icld_charge_amount = $iData['Amount'];\n $itemModel->icld_currency = $iData['CurrencyCode'];\n $itemModel->icld_transaction_type = 'Order';\n $itemModel->icld_item_type = 'Shipment';\n $itemModel->icld_shipment_refund_event_data_id = $modelSR->sred_id;\n if ($itemModel->save(false)) {\n echo \"Item Charge Saved.\";\n }\n } //$itemChargeData\n }\n\n if (key_exists('ItemFeeList', $sItem) && is_array($sItem['ItemFeeList']) && $itemFeeChargeData = $sItem['ItemFeeList']) {\n foreach ($itemFeeChargeData as $ifData) {\n $feeModel = new ItemFeeListData();\n $feeModel->ifld_quantity_shipped = $shippedQuantity;\n $feeModel->ifld_seller_sku = $sellerSku;\n $feeModel->ifld_order_item_id = $orderItemId;\n $feeModel->ifld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $feeModel->ifld_seller_order_id = $modelSR->sred_seller_order_id;\n $feeModel->ifld_fee_type = $ifData['FeeType'];\n $feeModel->ifld_fee_amount = $ifData['Amount'];\n $feeModel->ifld_currency = $ifData['CurrencyCode'];\n $feeModel->ifld_transaction_type = 'Order';\n $feeModel->ifld_item_type = 'Shipment';\n $feeModel->ifld_shipment_refund_event_id = $modelSR->sred_id;\n if ($feeModel->save(false)) {\n echo \"Item Fee Saved.\";\n }\n } // $itemFeeChargeData\n }\n } // $shipmentItemData\n }\n }\n } //$shipmentData\n } // if : $shipmentData\n\n /**\n * Store Refund Event Data\n */\n if ($refundData = $financeEventData['refundEventData']) {\n foreach ($refundData as $rValue) {\n $modelSR = new ShipmentRefundEventData();\n $modelSR->sred_amazon_order_id = $rValue['AmazonOrderId'];\n $modelSR->sred_seller_order_id = $rValue['SellerOrderId'];\n $modelSR->sred_marketplace_name = $rValue['MarketplaceName'];\n $modelSR->sred_refund_posted_date = $rValue['PostedDate'];\n $modelSR->sred_event_type = 'Refund';\n\n if ($model->save(false)) {\n /*$vnModel = new VaNotification();\n $vnModel->vn_amazon_order_id = $modelSR->sred_amazon_order_id;\n $vnModel->vn_refund_posted_date = $modelSR->sred_refund_posted_date;\n $vnModel->vn_shipment_refund_event_data_id = $modelSR->sred_id;\n $vnModel->save(false);*/\n\n if (key_exists('ShipmentItemAdjustmentList', $rValue) && is_array($rValue['ShipmentItemAdjustmentList']) && $shipmentItemData = $rValue['ShipmentItemAdjustmentList']) {\n foreach ($shipmentItemData as $sItem) {\n $sellerSku = $sItem['SellerSKU'];\n $orderItemId = (key_exists('OrderAdjustmentItemId', $sItem)) ? $sItem['OrderAdjustmentItemId'] : null;\n $shippedQuantity = (key_exists('QuantityShipped', $sItem)) ? $sItem['QuantityShipped'] : null;\n\n if (key_exists('ItemChargeAdjustmentList', $sItem) && is_array($sItem['ItemChargeAdjustmentList']) && $itemChargeData = $sItem['ItemChargeAdjustmentList']) {\n foreach ($itemChargeData as $iData) {\n $itemModel = new ItemChargeListData();\n $itemModel->icld_quantity_shipped = $shippedQuantity;\n $itemModel->icld_seller_sku = $sellerSku;\n $itemModel->icld_order_adjustment_item_id = $orderItemId;\n $itemModel->icld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $itemModel->icld_seller_order_id = $modelSR->sred_seller_order_id;\n $itemModel->icld_item_charge_type = $iData['ChargeType'];\n $itemModel->icld_charge_amount = $iData['Amount'];\n $itemModel->icld_currency = $iData['CurrencyCode'];\n $itemModel->icld_transaction_type = 'Refund';\n $itemModel->icld_item_type = 'Refund';\n $itemModel->icld_shipment_refund_event_data_id = $modelSR->sred_id;\n if ($itemModel->save(false)) {\n echo \"Refund Item Charge Saved.\";\n }\n } //$itemChargeData\n }\n\n if (key_exists('ItemFeeAdjustmentList', $sItem) && is_array($sItem['ItemFeeAdjustmentList']) && $itemFeeChargeData = $sItem['ItemFeeAdjustmentList']) {\n foreach ($itemFeeChargeData as $ifData) {\n $feeModel = new ItemFeeListData();\n $feeModel->ifld_quantity_shipped = $shippedQuantity;\n $feeModel->ifld_seller_sku = $sellerSku;\n $feeModel->ifld_order_adjustment_item_id = $orderItemId;\n $feeModel->ifld_amazon_order_id = $modelSR->sred_amazon_order_id;\n $feeModel->ifld_seller_order_id = $modelSR->sred_seller_order_id;\n $feeModel->ifld_fee_type = $ifData['FeeType'];\n $feeModel->ifld_fee_amount = $ifData['Amount'];\n $feeModel->ifld_currency = $ifData['CurrencyCode'];\n $feeModel->ifld_transaction_type = 'Refund';\n $feeModel->ifld_item_type = 'Refund';\n $feeModel->ifld_shipment_refund_event_id = $modelSR->sred_id;\n if ($feeModel->save(false)) {\n echo \"Refund Item Fee Saved.\";\n }\n } // $itemFeeChargeData\n }\n } // $shipmentItemData\n }\n }\n }\n } // if : Refund Event\n\n /*\n * Store Service Fee Event Data\n */\n if ($serviceFeeEventData = $financeEventData['serviceFeeEventData']) {\n foreach ($serviceFeeEventData as $rValue) {\n $aOrderId = $rValue['AmazonOrderId'];\n $feeReason = $rValue['FeeReason'];\n $sellerSku = $rValue['SellerSKU'];\n $fnSku = $rValue['FnSKU'];\n $feeDesc = $rValue['FeeDescription'];\n $asin = $rValue['ASIN'];\n\n if (key_exists('FeeList', $rValue) && is_array($rValue['FeeList']) && $itemChargeData = $rValue['FeeList']) {\n foreach ($itemChargeData as $iData) {\n $sModel = new ServiceFeeData();\n $sModel->sfd_amazon_order_id = $aOrderId;\n $sModel->sfd_seller_order_id = $sellerOrderId;\n $sModel->sfd_fee_reason = $feeReason;\n $sModel->sfd_seller_sku = $sellerSku;\n $sModel->sfd_fnsku = $fnSku;\n $sModel->sfd_fee_description = $feeDesc;\n $sModel->sfd_asin = $asin;\n $sModel->sfd_fee_type = $iData['FeeType'];\n $sModel->sfd_fee_amount = $iData['Amount'];\n $sModel->sfd_currency = $iData['CurrencyCode'];\n $sModel->sfd_shipment_refund_event_data_id = $shipmentRefundId;\n if ($sModel->save(false)) {\n echo \"Service Fee Data Saved.\";\n }\n }\n }\n }\n } // if : service Fee Event\n\n /**\n * Adjustment Event Data\n */\n if ($adjustmentEventData = $financeEventData['adjustmentEventData']) {\n foreach ($adjustmentEventData as $raValue) {\n $adModel = new OrderAdjustmentEventData();\n $adModel->oaed_amazon_order_id = $amazonOrderId;\n $adModel->oaed_seller_order_id = $sellerOrderId;\n $adModel->oaed_adjustment_type = $raValue['AdjustmentType'];\n $adModel->oaed_amount = $raValue['Amount'];\n $adModel->oaed_currency = $raValue['CurrencyCode'];\n\n if ($adModel->save(false)) {\n if (key_exists('AdjustmentItemList', $raValue) && is_array($raValue['AdjustmentItemList']) && $AdjustmentItemList = $raValue['AdjustmentItemList']) {\n foreach ($AdjustmentItemList as $siItem) {\n $adIModel = new OrderAdjustmentItemListData();\n $adIModel->oaild_amazon_order_id = $amazonOrderId;\n $adIModel->oaild_seller_order_id = $sellerOrderId;\n $adIModel->oaild_quantity = $siItem['Quantity'];\n $adIModel->oaild_per_unit_amount = $siItem['PerUnitAmount']['Amount'];\n $adIModel->oaild_total_amount = $siItem['TotalAmount']['Amount'];\n $adIModel->oaild_currency = $siItem['TotalAmount']['CurrencyCode'];\n $adIModel->oaild_seller_sku = $siItem['SellerSKU'];\n $adIModel->oaild_fnsku = $siItem['FnSKU'];\n $adIModel->oaild_product_description = $siItem['ProductDescription'];\n $adIModel->oaild_asin = $siItem['ASIN'];\n $adIModel->order_adjustment_event_data_id = $adModel->oaed_id;\n $adIModel->oaild_shipment_refund_event_data_id = $shipmentRefundId;\n if ($adIModel->save(false)) {\n echo \"Adjustment Item Data Saved.\";\n }\n }\n }\n }\n }\n } // if : adjustment Event Data\n\n } // main if : $financeEventData\n\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $amazonOrderId]);\n if($model) {\n $model->aol_status = 1; // Finance Event Data Pulled.\n if ($model->save(false)) {\n echo \"Finance Event Data of Order No: \" . $model->aol_amazon_order_id . \" is Saved.\";\n }\n }\n sleep(3);\n\n /**\n * Get Shipped Order Details\n */\n $model = AllOrdesList::findOne(['aol_amazon_order_id' => $model->aol_amazon_order_id]);\n if ($model && $model->aol_order_status == 'Shipped') {\n $orderDetails = \\Yii::$app->api->getOrderDetails($model->aol_amazon_order_id);\n $orderItemAsin = \\Yii::$app->api->getOrderItems($model->aol_amazon_order_id);\n if ($orderDetails) {\n $model->aol_shipping_username = key_exists('Name', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['Name'] : null;\n $model->aol_shipping_address_1 = key_exists('AddressLine1', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['AddressLine1'] : null;\n $model->aol_shipping_address_2 = key_exists('AddressLine2', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['AddressLine2'] : null;\n $model->aol_shipping_address_3 = key_exists('AddressLine3', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['AddressLine3'] : null;\n $model->aol_city = key_exists('City', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['City'] : null;\n $model->aol_country = key_exists('County', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['County'] : null;\n $model->aol_district = key_exists('District', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['District'] : null;\n $model->aol_state_or_region = key_exists('StateOrRegion', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['StateOrRegion'] : null;\n $model->aol_postal_code = key_exists('PostalCode', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['PostalCode'] : null;\n $model->aol_country_code = key_exists('CountryCode', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['CountryCode'] : null;\n $model->aol_phone = key_exists('Phone', $orderDetails['ShippingAddress']) ? $orderDetails['ShippingAddress']['Phone'] : null;\n $model->aol_buyer_name = key_exists('BuyerName', $orderDetails) ? $orderDetails['BuyerName'] : null;\n $model->aol_buyer_email = key_exists('BuyerEmail', $orderDetails) ? $orderDetails['BuyerEmail'] : null;\n $model->aol_asin = $orderItemAsin;\n $model->aol_shipped_status = 1; //Order Details Pulled\n if ($model->save(false))\n echo $model->aol_amazon_order_id . \" Details Saved.\";\n }\n sleep(3);\n\n /**\n * Get All ASIN for Order\n */\n $orderItemAsinData = \\Yii::$app->api->getOrderItems($model->aol_amazon_order_id, true);\n if ($orderItemAsinData) {\n foreach ($orderItemAsinData as $asinData) {\n $modelOI = OrderItemsAsin::findOne(['oia_order_id' => $model->aol_amazon_order_id]);\n if (!$modelOI) {\n $modelOI = new OrderItemsAsin();\n }\n $modelOI->oia_order_id = $model->aol_amazon_order_id;\n $modelOI->oia_asin = $asinData['ASIN'];\n $catData = ($modelOI->oia_asin) ? \\Yii::$app->api->getProductCategory($modelOI->oia_asin) : null;\n if ($catData) {\n $modelP = FbaAllListingData::findOne(['asin1' => $modelOI->oia_asin]);\n $sPrice = ($modelP) ? $modelP->price : 0;\n $fees = GetApiData::mwsFeesEstimate($modelOI->oia_asin, $sPrice);\n $referralFee = ($fees) ? $fees['ReferralFee'] : 0;\n\n $modelOI->oia_referral_fee = $referralFee;\n $modelOI->oia_category = $catData;\n $modelOI->oia_purchase_date = $model->aol_purchase_date;\n\n $productDimensionData = \\Yii::$app->api->getProductDimensions($modelOI->oia_asin);\n if ($productDimensionData) {\n $modelOI->oia_item_height = $productDimensionData['ItemHeight'];\n $modelOI->oia_item_length = $productDimensionData['ItemLength'];\n $modelOI->oia_item_weight = $productDimensionData['ItemWeight'];\n $modelOI->oia_item_width = $productDimensionData['ItemWidth'];\n $modelOI->oia_package_height = $productDimensionData['PackageHeight'];\n $modelOI->oia_package_length = $productDimensionData['PackageLength'];\n $modelOI->oia_package_weight = $productDimensionData['PackageWeight'];\n $modelOI->oia_package_width = $productDimensionData['PackageWidth'];\n }\n }\n if ($modelOI->save(false)) {\n echo \"ASIN Saved.\";\n }\n sleep(3);\n }\n }\n }\n }\n }\n }\n\n /*if($id) {\n $user->order_cron_status = 1;\n $user->save(false);\n }*/\n }\n echo \"Done..\";\n }", "public function readOverdueInvoices()\n {\n $user = auth()->user();\n\n // Mark invoice notifications as read\n foreach ($user->unreadNotifications as $notification) {\n // Not an invoice notification\n if ($notification->getAttribute('type') != 'App\\Notifications\\Income\\Invoice') {\n continue;\n }\n\n $notification->markAsRead();\n }\n\n // Redirect to invoices\n return redirect('customers/invoices');\n }" ]
[ "0.610975", "0.59874517", "0.5729414", "0.5727679", "0.55674666", "0.5560314", "0.5531941", "0.5531653", "0.54981416", "0.54607594", "0.546021", "0.5448515", "0.54480505", "0.5447236", "0.5440886", "0.5432344", "0.54214364", "0.54068923", "0.5382415", "0.5366837", "0.53535074", "0.5310644", "0.5283046", "0.52644855", "0.52643394", "0.52527165", "0.52504224", "0.5248121", "0.5236576", "0.5222071", "0.5198349", "0.51863384", "0.5120655", "0.5100431", "0.5100344", "0.5097846", "0.50919586", "0.50830686", "0.50795484", "0.50763154", "0.5054081", "0.50332123", "0.50318265", "0.50270325", "0.5004694", "0.50002575", "0.49975082", "0.4963097", "0.49470684", "0.49447963", "0.49444738", "0.4941483", "0.49373436", "0.49213752", "0.492016", "0.48968527", "0.48823687", "0.48821014", "0.48671082", "0.485886", "0.4853728", "0.4852888", "0.48508048", "0.48476526", "0.48391357", "0.4838398", "0.4836589", "0.4835697", "0.48321453", "0.48319194", "0.4827821", "0.48157609", "0.48017323", "0.47699338", "0.47599778", "0.47566804", "0.4746646", "0.47456285", "0.47444424", "0.4743841", "0.47400835", "0.4734018", "0.47309905", "0.47234514", "0.4722273", "0.47199607", "0.4718859", "0.4715782", "0.4712858", "0.46990037", "0.46984786", "0.4692664", "0.4681652", "0.46775568", "0.46673805", "0.46672967", "0.46663353", "0.46620512", "0.46446502", "0.46434814" ]
0.7650482
0
Search order data for a term and return ids.
public function search_orders( $term ) { global $wpdb; $order_ids = array(); if ( is_numeric( $term ) ) { $order_ids[] = absint( $term ); } /** * Searches on meta data can be slow - this lets you choose what fields to search. * * WooCommerce 2.7.0 added _billing_address and _shipping_address meta which contains all * address data to make this faster. However, this won't work on older orders unless they * are updated, so search a few others (expand this using the filter if needed). */ $meta_search_fields = array_map( 'wc_clean', apply_filters( 'woocommerce_shop_order_search_fields', array( // While we are searching the custom table, we will also search meta when filtered for backwards compatibility. ) ) ); $postmeta_search = ! empty( $meta_search_fields ) ? $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT p1.post_id FROM {$wpdb->postmeta} p1 WHERE p1.meta_key IN ('" . implode( "','", array_map( 'esc_sql', $search_fields ) ) . "') AND p1.meta_value LIKE '%%%s%%';", wc_clean( $term ) ) ) : array(); return array_unique( array_merge( $order_ids, $postmeta_search, $wpdb->get_col( $wpdb->prepare( " SELECT order_id FROM {$wpdb->prefix}woocommerce_order_items as order_items WHERE order_item_name LIKE '%%%s%%' ", $term ) ) ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find(string $term, string $namespace) : array;", "public function loadArrayByCreatedByAgentID($searchTerm) {\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DNASequencingRunID FROM dnasequencingrun WHERE CreatedByAgentID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DNASequencingRunID FROM dnasequencingrun WHERE CreatedByAgentID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_dnasequencingrun();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "public function loadArrayByTaxonID($searchTerm) {\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DeterminationID FROM determination WHERE TaxonID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DeterminationID FROM determination WHERE TaxonID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_determination();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "function get_item_list_search($terms)\n {\n $this->company_db->select(\"i.*\");\n $this->company_db->from('tbl_inventory i');\n //$this->company_db->where('i.void', 'No');\n $column_search = array(\"CONVERT(i.description USING utf8)\", \"i.item_number\");\n\n if(isset($terms) && !empty($terms)) // if datatable send POST for search\n {\n $i = 0;\n foreach ($column_search as $item) // loop column \n { \n if($i===0) // first loop\n {\n $this->company_db->group_start(); // open bracket. query Where with OR clause better with bracket. because maybe can combine with other WHERE with AND.\n $this->company_db->like($item, $terms);\n }\n else\n {\n $this->company_db->or_like($item, $terms);\n }\n \n if(count($column_search) - 1 == $i) //last loop\n $this->company_db->group_end(); //close bracket\n \n $i++;\n }\n }\n\n $query = $this->company_db->get();\n \n if($query->num_rows() >= 1)\n {\n foreach ($query->result() as $key => $value) {\n $value->description = strtolower($value->description);\n }\n return $query->result_array();\n }\n else\n {\n return array();\n }\n }", "public function loadArrayByModifiedByAgentID($searchTerm) {\n // ******* Note: $connection must be a mysqli object.\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DNASequencingRunID FROM dnasequencingrun WHERE ModifiedByAgentID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DNASequencingRunID FROM dnasequencingrun WHERE ModifiedByAgentID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_dnasequencingrun();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "function get_INDI_rows(Tree $tree, $term) {\n\treturn Database::prepare(\n\t\t\"SELECT 'INDI' AS type, i_id AS xref, i_gedcom AS gedcom, n_full\" .\n\t\t\" FROM `##individuals`\" .\n\t\t\" JOIN `##name` ON i_id = n_id AND i_file = n_file\" .\n\t\t\" WHERE n_full LIKE CONCAT('%', REPLACE(:term, ' ', '%'), '%') AND i_file = :tree_id ORDER BY n_full COLLATE :collation\"\n\t)->execute(array(\n\t\t'term' => $term,\n\t\t'tree_id' => $tree->getTreeId(),\n\t\t'collation' => I18N::collation(),\n\t))->fetchAll();\n}", "public function loadArrayByCreatedByAgentID($searchTerm) {\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DeterminationID FROM determination WHERE CreatedByAgentID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DeterminationID FROM determination WHERE CreatedByAgentID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_determination();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "public function search($term)\n {\n try {\n $list = (self::MODEL)\n ::with('enderecos')\n ->where('nome', 'LIKE', \"%{$term}%\")\n ->orWhere('taxvat', 'LIKE', \"%{$term}%\")\n ->get();\n\n return $this->listResponse(ClientTransformer::directSearch($list));\n } catch (\\Exception $exception) {\n return $this->listResponse([]);\n }\n }", "public function searchByTerm($term)\n {\n //objet qui permet de crée des requete SQL pour une table donné\n $queryBuilder = $this->createQueryBuilder('article');\n\n // requete sql mais en language PHP qui permet d'aller dans article et de chercher ce qu'on veux en fonction de term\n $query = $queryBuilder\n ->select('article')\n\n ->where('article.content LIKE :term')\n ->setParameter('term', '%'.$term.'%')\n\n //transforme la sorte de requette sql en vrai requette sql\n ->getQuery();\n\n return $query->getResult();\n }", "public function search_ticket($terms) {\n $terms = explode(\" \", $terms); //explode multiple terms into an array\n //select statement for AND serach\n $sql = \"SELECT * FROM \" . $this->tblTicket . \" WHERE \" . $this->tblTicket . \".id AND (0\";\n\n foreach ($terms as $term) {\n $sql .= \" OR arrival_location LIKE '%\" . $term . \"%' OR arrival_time LIKE '%\" . $term . \"%'\";\n }\n\n $sql .= \")\";\n\n //execute the query\n $query = $this->dbConnection->query($sql);\n\n // the search failed, return false. \n if (!$query)\n return false;\n\n //search succeeded, but no ticket was found.\n if ($query->num_rows == 0)\n return 0;\n\n //search succeeded, and found at least 1 ticket found.\n //create an array to store all the returned tickets\n $tickets = array();\n\n //loop through all rows in the returned recordsets\n while ($obj = $query->fetch_object()) {\n $ticket = new Ticket($obj->price, $obj->gate, $obj->seat, $obj->class, $obj->depart_time, $obj->arrival_location, $obj->arrival_time, $obj->image);\n\n //set the id for the ticket\n $ticket->setId($obj->id);\n\n //add the ticket into the array\n $tickets[] = $ticket;\n }\n return $tickets;\n }", "public static function search($term)\n {\n $sql = \"\n SELECT p.uri as uri, p.name as name, e.data as data\n FROM tbl_element AS e\n INNER JOIN tbl_article AS a ON e.article_id = a.id\n INNER JOIN tbl_page AS p ON a.parent_id = p.id\n WHERE e.data LIKE '%{$term}%'\n \";\n\n foreach ($this->_db->fetchAll($sql) as $result) {\n $result['data'] = unserialize($result['data']);\n }\n\n return isset($result) ? $result : false;\n }", "public function loadArrayByModifiedByAgentID($searchTerm) {\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DeterminationID FROM determination WHERE ModifiedByAgentID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DeterminationID FROM determination WHERE ModifiedByAgentID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_determination();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "public function searchByName(string $term)\n {\n $results = [];\n \n foreach($this->products as $product) {\n if (strstr($product['name'], $term)) {\n $results[] = $product;\n }\n }\n return $results;\n }", "public function loadArrayByPreferredTaxonID($searchTerm) {\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DeterminationID FROM determination WHERE PreferredTaxonID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DeterminationID FROM determination WHERE PreferredTaxonID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_determination();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "public function loadArrayByDNASequenceID($searchTerm) {\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DNASequencingRunID FROM dnasequencingrun WHERE DNASequenceID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DNASequencingRunID FROM dnasequencingrun WHERE DNASequenceID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_dnasequencingrun();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "public function retrieveObjectIds( $termId = 0, $args = array() )\n\t{\n\t\tif( 0 === $termId ) {\n\t\t\treturn false;\n\t\t}\n\t\n\t\tif( !is_array($args) ) {\n\t\t\t$args = array($args);\n\t\t}\n\t\n\t\t$ids = get_objects_in_term( $termId, $this->taxomomyStr, $args );\n\t\n\t\tif( empty( $ids ) || is_wp_error( $ids ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn $ids;\n\t\t}\n\t}", "public function getAll($searchTerm);", "public function loadArrayByDeterminerID($searchTerm) {\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DeterminationID FROM determination WHERE DeterminerID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DeterminationID FROM determination WHERE DeterminerID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_determination();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "function searchwp_filter_search( $ids, $engine, $terms ) {\n /* https://searchwp.com/docs/hooks/searchwp_include/ */\n return \\LsbSearchUtil::books_matching_current_query_vars();\n}", "function get_REPO_rows(Tree $tree, $term) {\n\treturn Database::prepare(\n\t\t\"SELECT o_id AS xref, o_gedcom AS gedcom\" .\n\t\t\" FROM `##other`\" .\n\t\t\" JOIN `##name` ON o_id = n_id AND o_file = n_file\" .\n\t\t\" WHERE n_full LIKE CONCAT('%', REPLACE(:term, ' ', '%'), '%') AND o_file = :tree_id AND o_type = 'REPO'\" .\n\t\t\" ORDER BY n_full COLLATE :collation\"\n\t)->execute(array(\n\t\t'term' => $term,\n\t\t'tree_id' => $tree->getTreeId(),\n\t\t'collation' => I18N::collation(),\n\t))->fetchAll();\n}", "public function search($term = null);", "function getItemsType($searchTerm){\n $searchTerm =trim($searchTerm);global $con;\n if(!$con)$con=getConnection();\n $query=\"select distinct term as term_name,term_type_id as term_type from query_terms\";\n $query .=\" where term like '$searchTerm%' \";\n $result = mysql_query($query,$con);$itemTypeList=array();\n if($result){ \n $numRows =mysql_numrows($result);\n while($row = mysql_fetch_assoc($result)){\n $term=$row[\"term_name\"];$id=$row[\"term_type\"];$itemTypeList[$id]=$term;\n }\n }\n return $itemTypeList;\n}", "function get_OBJE_rows(Tree $tree, $term) {\n\treturn Database::prepare(\n\t\t\"SELECT 'OBJE' AS type, m_id AS xref, m_gedcom AS gedcom\" .\n\t\t\" FROM `##media`\" .\n\t\t\" WHERE (m_titl LIKE CONCAT('%', REPLACE(:term_1, ' ', '%'), '%') OR m_id LIKE CONCAT('%', REPLACE(:term_2, ' ', '%'), '%')) AND m_file = :tree_id\" .\n\t\t\" ORDER BY m_titl COLLATE :collation\"\n\t)->execute(array(\n\t\t'term_1' => $term,\n\t\t'term_2' => $term,\n\t\t'tree_id' => $tree->getTreeId(),\n\t\t'collation' => I18N::collation(),\n\t))->fetchAll();\n}", "function term_get($term_key)\n{\n $query = \"SELECT * FROM term WHERE term_key={$term_key}\";\n $result = mysql_query($query);\n while (@$row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n $results[] = $row;\n }\n return $results;\n}", "private function searchTag()\n {\n $term = $_REQUEST['term'];\n \n $list = array();\n $sql = \"SELECT * \n FROM \" . TAGS_TBL . \" \n WHERE tag_title LIKE '$term%'\";\n try\n {\n $rows = $this->db->select($sql);\n }\n catch(Exception $Exception){}\n \n if($rows)\n {\n foreach($rows as $index => $row)\n {\n $list[] = stripslashes(trim(ucwords(strtolower($row->tag_title))));\n }\n }\n \n $str = implode('\",\"', $list);\n if($str)\n {\n echo '[\"' . $str . '\"]';\n }\n else\n {\n echo '[]';\n }\n \n exit;\n }", "private function getIdInArray($array, $term)\n {\n foreach ($array as $key => $value) {\n if ($value == $term) {\n return $key;\n }\n }\n\t\tthrow new UnexpectedValueException;\n }", "function get_NOTE_rows(Tree $tree, $term) {\n\treturn Database::prepare(\n\t\t\"SELECT o_id AS xref, o_gedcom AS gedcom\" .\n\t\t\" FROM `##other`\" .\n\t\t\" JOIN `##name` ON o_id = n_id AND o_file = n_file\" .\n\t\t\" WHERE o_gedcom LIKE CONCAT('%', REPLACE(:term, ' ', '%'), '%') AND o_file = :tree_id AND o_type = 'NOTE'\" .\n\t\t\" ORDER BY n_full COLLATE :collation\"\n\t)->execute(array(\n\t\t'term' => $term,\n\t\t'tree_id' => $tree->getTreeId(),\n\t\t'collation' => I18N::collation(),\n\t))->fetchAll();\n}", "public function matchSearchTerm($searchTerm, $wordList){\n \n $matches = array();\n \n foreach($wordList as $type => $nodes){\n \n foreach($nodes as $node){\n\n if($node['value'] == $searchTerm){\n $matches[$node['openieId']] = $type;\n }\n }\n }\n \n return $matches;\n }", "public function getListOfProducts($term)\n {\n // build find() options\n $filter = NULL;\n if ($term) {\n $regex = new Regex($term, 'i');\n $filter = ['title' => $regex];\n }\n $options = [\n 'sort' => ['title' => 1],\n 'projection' => ['sku' => 1, 'title' => 1]\n ];\n\n // perform find\n $result = [];\n try {\n $cursor = $this->find($this->products, $filter, $options);\n foreach ($cursor as $document) {\n //$result[] = var_export($document, TRUE);\n $result[] = $document->title . ' [' . $document->sku . ']';\n }\n } catch (Throwable $e) {\n error_log(__METHOD__ . ':' . $e->getMessage());\n $result[] = 'ERROR: unable to find products';\n }\n return $result;\n }", "function listAllWithSearch($term) \r\n {\r\n\r\n $newTerm = \"%\".$term.\"%\";\r\n\r\n //new PDOAgent\r\n $p = new PDOAgent(\"mysql\", DB_USER, DB_PASS, DB_HOST, DB_NAME);\r\n\r\n //Connect to the Database\r\n $p->connect();\r\n\r\n //Setup the Bind Parameters\r\n $bindParams = [\"term\"=>$newTerm];\r\n \r\n //Get the results of the insert query (rows inserted)\r\n $results = $p->query(\"SELECT * FROM Coaches WHERE coachFName LIKE :term OR\r\n coachLName LIKE :term OR salary LIKE :term OR teamName LIKE :term \r\n OR dateStarted LIKE :term OR endOfContract LIKE :term;\", $bindParams);\r\n \r\n //Disconnect from the database\r\n $p->disconnect();\r\n \r\n //Return the objects\r\n return $results;\r\n }", "public function searchIngredients(string $searchTerm)\n {\n $ingredients = Ingredient::where('label', 'LIKE', \"{$searchTerm}%\")->get();\n return $ingredients;\n }", "private function _getProductIdsFromSearchQuery($query)\n {\n $ids = array();\n $client = Mage::helper('catalogsearch')->getEngine()->getClient();\n $response = $client->search($query);\n foreach ($response['hits']['hits'] as $hit) {\n $currentId = $hit['fields']['entity_id'];\n if (is_array($currentId)) {\n $currentId = current($currentId);\n }\n $ids[] = (int) $currentId;\n }\n return $ids;\n }", "function get_customer_list_search($terms)\n {\n $this->company_db->select(\"c.*, CONCAT(c.tele_country_code, ' ', c.telephone_number) as telephone_number, CONCAT(c.cell_country_code , ' ', c.cellphone_number) as cellphone_number, CONCAT(c.fname, ' ', c.lname) as name\");\n $this->company_db->from('tbl_customer c');\n //$this->company_db->where('c.void', 'No');\n $column_search = array(\"c.address_line1\", \"CONCAT(c.tele_country_code, ' ', c.telephone_number)\", \"CONCAT(c.cell_country_code , ' ', c.cellphone_number)\", \"CONCAT(c.fname, ' ', c.lname)\");\n\n if(isset($terms) && !empty($terms)) // if datatable send POST for search\n {\n $i = 0;\n foreach ($column_search as $item) // loop column \n { \n if($i===0) // first loop\n {\n $this->company_db->group_start(); // open bracket. query Where with OR clause better with bracket. because maybe can combine with other WHERE with AND.\n $this->company_db->like($item, $terms);\n }\n else\n {\n $this->company_db->or_like($item, $terms);\n }\n \n if(count($column_search) - 1 == $i) //last loop\n $this->company_db->group_end(); //close bracket\n \n $i++;\n }\n }\n\n $query = $this->company_db->get();\n\n if($query->num_rows() >= 1)\n {\n return $query->result_array();\n }\n else\n {\n return array();\n }\n }", "private function getIdInArray($array, $term)\n\t{\n\t\tforeach ($array as $key => $value) {\n\t\t\tif ($value == $term) {\n\t\t\t\treturn $key;\n\t\t\t}\n\t\t}\n\n\t\tthrow new UnexpectedValueException;\n\t}", "private function getIdInArray($array, $term)\n\t{\n\t\tforeach ($array as $key => $value) {\n\t\t\tif ($value == $term) {\n\t\t\t\treturn $key;\n\t\t\t}\n\t\t}\n\n\t\tthrow new UnexpectedValueException;\n\t}", "function getSearchResults(&$text, &$phrase, Registry &$pluginParam, $itemid, $ordering) {\n\t\t$highlights = array();\n\t\t$search = new Search($this->getJname());\n\t\t$results = $search->ft_pageSearch($text, $highlights);\n\t\t//pass results back to the plugin in case they need to be filtered\n\n\t\t$this->filterSearchResults($results, $pluginParam);\n\t\t$rows = array();\n\t\t$pos = 0;\n\n\t\tforeach ($results as $key => $index) {\n\t\t\t$rows[$pos]->title = Text::_($key);\n\t\t\t$rows[$pos]->text = $search->getPage($key);\n\t\t\t$rows[$pos]->created = $search->getPageModifiedDateTime($key);\n\t\t\t//dokuwiki doesn't track hits\n\t\t\t$rows[$pos]->hits = 0;\n\t\t\t$rows[$pos]->href = JFusionFunction::routeURL(str_replace(':', ';', $this->getSearchResultLink($key)), $itemid);\n\t\t\t$rows[$pos]->section = Text::_($key);\n\t\t\t$pos++;\n\t\t}\n\t\treturn $rows;\n\t}", "private function getSearchTerms($phrase) {\n\t\t// Discard anything after a comma in the phrase\n\t\t$commaPos = stripos($phrase, ',');\n\t\tif ($commaPos !== false) {\n\t\t\t$phrase = substr($phrase, 0, $commaPos);\n\t\t}\n\t\t\n\t\t// Replace all periods with a space\n\t\t$phrase = str_replace('.', ' ', $phrase);\n\t\t\n\t\t$terms = explode(' ', $phrase);\n\t\t\n\t\t// Add the entire phrase as a term\n\t\tif (!in_array($phrase, $terms)) {\n\t\t\tarray_unshift($terms, $phrase);\n\t\t}\n\t\t\n\t\t// Sanitize\n\t\t$cleanTerms = array();\n\t\tforeach ($terms as $term) {\n\t\t\t$term = strtolower(trim($term));\n\t\t\tif (!empty($term)) {\n\t\t\t\t$cleanTerms[] = $term;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Abbreviations\n\t\tforeach (self::$searchAbbreviations as $abbrv => $wholeWord) {\n\t\t\tif (in_array($abbrv, $cleanTerms)) {\n\t\t\t\t$cleanTerms[] = $wholeWord;\n\t\t\t}\n\t\t\telse if (in_array($wholeWord, $cleanTerms)) {\n\t\t\t\t$cleanTerms[] = $abbrv;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $cleanTerms;\n\t}", "function get_SOUR_rows(Tree $tree, $term) {\n\treturn Database::prepare(\n\t\t\"SELECT s_id AS xref, s_gedcom AS gedcom\" .\n\t\t\" FROM `##sources`\" .\n\t\t\" WHERE s_name LIKE CONCAT('%', REPLACE(:term, ' ', '%'), '%') AND s_file = :tree_id\" .\n\t\t\" ORDER BY s_name COLLATE :collation\"\n\t)->execute(array(\n\t\t'term' => $term,\n\t\t'tree_id' => $tree->getTreeId(),\n\t\t'collation' => I18N::collation(),\n\t))->fetchAll();\n}", "function get_taxonomy_term_ids_inside_vocab($vocab_machine_name) {\n $vocab = taxonomy_vocabulary_machine_name_load($vocab_machine_name);\n if (is_object($vocab)) {\n $term_tree = taxonomy_get_tree($vocab->vid);\n if (is_array($term_tree) && !empty($term_tree)) {\n foreach ($term_tree as $key => $value) {\n $tids[] = $value->tid;\n }\n } if (empty($term_tree)) {\n $tids = array();\n }\n } else\n return \"No Vocab Found with the given name\";\n\n return ($tids);\n}", "public static function searchModelTags($term)\n {\n $term = trim($term);\n return Tag::join('taggable_taggables','taggable_taggables.tag_id','=','taggable_tags.tag_id')->where('taggable_type','=',static::class)->where('name', 'like', \"%\".$term.\"%\")->offset(0)->limit(10)->pluck('name')->toArray();\n }", "public static function get_entries_by_term($id, $term, $from, $limit, $options) {\n $params = self::validate_parameters(self::get_entries_by_term_parameters(), array(\n 'id' => $id,\n 'term' => $term,\n 'from' => $from,\n 'limit' => $limit,\n 'options' => $options,\n ));\n $id = $params['id'];\n $term = $params['term'];\n $from = $params['from'];\n $limit = $params['limit'];\n $options = $params['options'];\n $warnings = array();\n\n // Get and validate the glossary.\n list($glossary, $context) = self::validate_glossary($id);\n\n // Fetching the entries.\n $entries = array();\n list($records, $count) = glossary_get_entries_by_term($glossary, $context, $term, $from, $limit, $options);\n foreach ($records as $key => $record) {\n self::fill_entry_details($record, $context);\n $entries[] = $record;\n }\n\n return array(\n 'count' => $count,\n 'entries' => $entries,\n 'ratinginfo' => \\core_rating\\external\\util::get_rating_info($glossary, $context, 'mod_glossary', 'entry', $entries),\n 'warnings' => $warnings\n );\n }", "public function searchGlobalTerm ($term){\n $json = new JsonFile ($this->host. '/api/key/' . $term );\n $json->parse();\n \n return $json;\n }", "public function getListOfCustomers($term)\n {\n // build find() options\n $filter = NULL;\n if ($term) {\n $regex = new Regex($term, 'i');\n $filter = ['name' => $regex];\n }\n $options = [\n 'sort' => ['name' => 1],\n 'projection' => ['name' => 1]\n ];\n\n // perform find\n $result = [];\n try {\n $cursor = $this->find($this->customers, $filter, $options);\n foreach ($cursor as $document) {\n //$result[] = var_export($document, TRUE);\n $result[$document->name] = $document->name;\n }\n } catch (Throwable $e) {\n error_log(__METHOD__ . ':' . $e->getMessage());\n $result[] = 'ERROR: unable to find customers';\n }\n return $result;\n }", "function searchRecordsArray($array, $searchTerm) {\n\t\tforeach($array as $row) {\n\t\t\tif ($row['activityId'] == $searchTerm) {\n\t\t\t\treturn $row;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static function getPersons($term) {\n $sql = \"SELECT \n usuarios.dni, usuarios.nombre_persona, usuarios.dni+' '+usuarios.nombre_persona as label\n FROM\n (select \n persona.CodPer as dni\n ,persona.Nombres\n ,persona.Ape1\n ,persona.Ape2\n ,(RTRIM(persona.Nombres)+' '+RTRIM(persona.Ape1)+' '+RTRIM(persona.Ape2)) as nombre_persona\n from dbo.Identis persona\n left join dbo.permis usuario ON(\n persona.CodPer = usuario.LogIn\n )\n where usuario.FHasta >= GETDATE()\n ) usuarios\n WHERE usuarios.nombre_persona+usuarios.dni LIKE '%{$term}%'\n group BY usuarios.dni, usuarios.nombre_persona \";\n\n $command = Yii::$app->chacad->createCommand($sql);\n return $command->queryAll();\n }", "public function search($search_term = \"\"){\r\n\t\tif($search_term != \"\"){\r\n\t\t\t$req = $this->config->getDomain() . \"Search\";\r\n\t\t\t$req .= \"?search_term=\" . $search_term;\r\n\t\t\t$req .= \"&dataType=\" . $this->config->getDataType();\r\n\t\t\t$resp = $this->helper->curlGet($req);\r\n\t\t\t$resultsArray = array();\r\n\t\t\tforeach (json_decode($resp) as $obj){\r\n\t\t\t\t$searchResult = new CurtSearchResult;\r\n\t\t\t\t$sR = $searchResult->castToSearchResult($obj);\r\n\t\t\t\tarray_push($resultsArray, $sR);\r\n\t\t\t}\r\n\t\t\treturn $resultsArray;\r\n\t\t} // end if\r\n\t}", "function _muckypup_database_get_term_ids ($vocabularies) {\n\n $terms = array ();\n \n foreach ($vocabularies as $vocabulary) {\n if ($vocabulary != 0) {\n $term_tree = taxonomy_get_tree($vocabulary);\n \n foreach ($term_tree as $term_branch) {\n $terms[] = $term_branch->tid;\n }\n }\n }\n\n\treturn $terms;\n}", "public function findAllSearch(string $term)\n {\n return $this->em\n ->getRepository('App:Mail')\n ->findAllSearch($term)\n ;\n }", "private function getIdInArray($array, $term)\n {\n foreach ($array as $key => $value) {\n if ($value == $term) {\n return $key;\n }\n }\n\n throw new UnexpectedValueException;\n }", "public function search_result(string $term)\n {\n # select table to count data\n $query = \"SELECT\n (SELECT COUNT(*) FROM news WHERE title LIKE '%{$term}%') as news,\n (SELECT COUNT(*) FROM accounts WHERE username LIKE '%{$term}%' OR email LIKE '%{$term}%') as accounts,\n (SELECT COUNT(*) FROM blog WHERE title LIKE '%{$term}%') as blog,\n (SELECT COUNT(*) FROM contect WHERE seen = 0) as message\n FROM DUAL\";\n # use fake table (use count table)\n return $this->db->query($query)->result_array()[0];\n }", "public static function searchLineItems($term,\n $start_element = 0, $num_elements = 100)\n {\n // construct url\n $url = self::getBaseUrl() . '?' . http_build_query(array(\n 'search' => $term,\n 'start_element' => $start_element,\n 'num_elements' => $num_elements\n ));\n\n // query app nexus server\n $response = self::makeRequest($url, Api::GET);\n\n // wrap response with app nexus object\n return new AppNexusArray($response, AppNexusObject::MODE_READ_WRITE);\n }", "public static function findAllByTerm($term, $parentId)\n {\n $QueryBuilder = self::getQueryBuilder()\n ->select('iddepartamento,nombre,estado')\n ->from('departamento')\n ->where('pais_idpais = :parentId')\n ->andWhere('nombre like :like')\n ->setParameter(':like', \"%{$term}%\")\n ->orderBy('nombre', 'asc');\n\n return self::findByQueryBuilder($QueryBuilder);\n }", "public function getTerm()\n\t{\n\t $year_id = $this->getYear();\n\t\t$sqlTerm = \"SELECT * FROM edu_terms WHERE NOW() >= from_date AND NOW() <= to_date AND year_id = '$year_id' AND status = 'Active'\";\n\t\t$term_result = $this->db->query($sqlTerm);\n\t\t$ress_term = $term_result->result();\n\n\t\tif($term_result->num_rows()==1)\n\t\t{\n\t\t\tforeach ($term_result->result() as $rows)\n\t\t\t{\n\t\t\t $term_id = $rows->term_id;\n\t\t\t}\n\t\t\treturn $term_id;\n\t\t}\n\t}", "public function searchAction() {\n\t\n\t if($this->getRequest()->isXmlHttpRequest()){\n\t\n\t $term = $this->getParam('term');\n\t $id = $this->getParam('id');\n\t\n\t if(!empty($term)){\n\t $term = \"%$term%\";\n\t $records = Invoices::findbyCustomFields(\"formatted_number LIKE ? OR number LIKE ?\", array($term, $term));\n\t die(json_encode($records));\n\t }\n\t\n\t if(!empty($id)){\n\t $records = Invoices::find($id);\n\t if($records){\n\t $records = $records->toArray();\n\t }\n\t die(json_encode(array($records)));\n\t }\n\t\n\t $records = Invoices::getAll();\n\t die(json_encode($records));\n\t }else{\n\t die();\n\t }\n\t}", "public function loadArrayByFragmentID($searchTerm) {\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DeterminationID FROM determination WHERE FragmentID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DeterminationID FROM determination WHERE FragmentID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_determination();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "private function searchById($id){\n \n $searchResults = null;\n $items = $this->items;\n if(strlen(trim($id)) == 0 ) return $searchResults;\n \n foreach($items as $item){\n if($item->id == $id){\n $searchResults[] = $item;\n } \n }\n \n return $searchResults;\n \n }", "function autocompleteList($term = null) {\n\t\t$autocomplete_list = array();\n\t\tif ($term) {\n\t\t\t$conditions = array(\n\t\t\t\t'Category.active' => true,\n\t\t\t\t'Category.name LIKE \"%' . $term . '%\"'\n\t\t\t);\n\t\t\t\n\t\t\t$unwanted_categories_ids = $this->unwanted_subtree_ids($this->unactive_categories_ids);\n\t\t\tif (!empty($unwanted_categories_ids)) {\n\t\t\t\t$conditions[] = 'Category.id NOT IN (' . implode(',', $unwanted_categories_ids) . ')';\n\t\t\t}\n\t\n\t\t\t// do autocomplete chci vratit cestu ke kategorii\n\t\t\t$categories = $this->find('all', array(\n\t\t\t\t'conditions' => $conditions,\n\t\t\t\t'contain' => array(),\n\t\t\t\t'fields' => array('Category.id', 'Category.name'),\n\t\t\t\t'order' => array('Category.lft' => 'asc')\n\t\t\t));\n\t\n\t\t\tforeach ($categories as $category) {\n\t\t\t\t$path = $this->pathToString($category['Category']['id']);\n\t\t\t\t$autocomplete_list[] = array(\n\t\t\t\t\t'label' => $path,\n\t\t\t\t\t'value' => $category['Category']['id']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $autocomplete_list;\n\t}", "public function getSearchQuery($term = '', $order = 'ASC', $status = '', $branch = '')\n\t{\n\t\treturn $this->where('rma_number', 'LIKE', '%'. $term. '%')\n\t\t\t\t\t->orWhere('item', 'LIKE', '%'. $term. '%')\n\t\t\t\t\t->orWhere('serial_number', 'LIKE', '%'. $term. '%')\n\t\t\t\t\t->orWhere('pa_fv', 'LIKE', '%'. $term. '%')\n\t\t\t\t\t->orWhere('ext_service', 'LIKE', '%'. $term. '%')\n\t\t\t\t\t->orWhere('client', 'LIKE', '%'. $term. '%')\n\t\t\t\t\t->orWhere('client_phone', 'LIKE', '%'. $term. '%')\n\t\t\t\t\t->orWhere('description', 'LIKE', '%'. $term. '%')\n\t\t\t\t\t->orWhere('diagnose', 'LIKE', '%'. $term. '%')\n\t\t\t\t\t->orWhere('comments', 'LIKE', '%'. $term. '%')\n\t\t\t\t\t->orWhere('accesories', 'LIKE', '%'. $term. '%')\n\t\t\t\t\t->where('status_id', '=', $status)\n\t\t\t\t\t->where('branch_id', '=', $branch)\n\t\t\t\t\t->orderBy('status_id', $order);\n\t}", "public function search($term)\n {\n $terms = explode(\" \", $term);\n\n $searchQuery = array();\n foreach ($terms as $term) {\n $term = $this->_localConfig->database()->quote(\"[[:<:]]\" . $term . \"[[:>:]]\");\n $searchQuery[] = \"(users.name regexp $term) * 5 + (users.username regexp $term)\";\n }\n\n $searchQuery = implode(\" + \", $searchQuery);\n\n $query = $this->selectAll();\n $query->columns(new Zend_Db_Expr(\"($searchQuery) as hits\"));\n $query->having('hits > 0');\n\n // We need to reset the ordering that was put on in selectAll()\n $query->reset( Zend_Db_Select::ORDER );\n $query->order(\"hits DESC\");\n\n $rows = $this->_localConfig->database()->fetchAll($query);\n\n $models = array();\n foreach ($rows as $row) {\n $model = $this->_getContainer()->User()->setData($row);\n $models[] = $model;\n }\n\n return $models;\n }", "public function search_tickets($keyword){\t\n $this->db->from('tickets'); \n $this->db->select('*');\n $this->db->like('tickets.title', $keyword);\n $this->db->or_like('tickets.body',$keyword);\n\t\t$this->db->or_like('tickets.raisedBy',$keyword);\n $this->db->or_like('tickets.status',$keyword);\n $query = $this->db->get();\n return $query->result_array();\t\t\t\n }", "function cwrc_get_authorities_list($setup_data, $query) {\n $collection = $setup_data['collection'];\n $query_string = 'collection:\"' . $collection . '\"';\n // $records = emic_process_query($query_string);\n $terms = explode(' ', $query);\n $terms = array_filter($terms);\n $solr = variable_get('islandora_solr_search_block_url', 'http://localhost:8080/solr');\n\n $url = \"http://$solr/select?indent=on&version=2.2&q=$query_string&fq=&start=0&rows=1000&qt=standard&wt=json&explainOther=&hl.fl=\";\n $results = json_decode(file_get_contents($url), TRUE);\n $docs = $results['response']['docs'];\n foreach ($docs as $doc) {\n $pid = $doc['PID'];\n $contents = array();\n foreach ($doc['emic.searchname'] as $sample) {\n $identifier = null;\n if (!empty($sample) & !$identifier) {\n $identifier = $sample;\n }\n }\n //$identifier = implode('', $doc['emic.searchname']);\n $contents['identifier'] = $identifier;\n $contents['Object'] = \"<a href='/fedora/repository/$pid' target='_blank'>$pid</a>\";\n $contents['Note'] = $doc['dc.description'][0];\n $records[$doc['PID']] = $contents;\n }\n\n while (count($terms) > 0) {\n $term = array_shift($terms) . \"*\";\n $query_string = 'collection:\"' . $collection . '\" AND emic.searchname:' . strtolower($term);\n\n $new_records = emic_process_query($query_string);\n if (is_array($new_records) && is_array($records)) {\n $records = array_intersect_key($records, $new_records);\n }\n }\n if (is_array($records)) {\n return array_values($records);\n }\n}", "private function _getArticlesByOrderId($user, $organization_id, $orderResults) {\n\n $results = [];\n\n $articlesOrdersTable = TableRegistry::get('ArticlesOrders');\n \n\n /*\n * articoli associati all'ordine \n */\n $articlesOrdersTable = $articlesOrdersTable->factory($user, $organization_id, $orderResults);\n $articlesOrdersTable->addBehavior('GdxpArticleOrders');\n\n if($articlesOrdersTable!==false) {\n\n $where = [];\n $where['ArticlesOrders'] = [$articlesOrdersTable->getAlias().'.organization_id' => $orderResults->organization_id,\n $articlesOrdersTable->getAlias().'.order_id' => $orderResults->id,\n /*\n * prendo solo articoli acquistati\n */\n $articlesOrdersTable->getAlias().'.qta_cart > ' => 0\n ]; \n\n $options = [];\n $options['sort'] = [];\n $options['limit'] = Configure::read('sql.no.limit');\n $results = $articlesOrdersTable->gets($user, $organization_id, $orderResults, $where, $options=[]);\n }\n\n // debug($results);\n return $results;\n }", "public function loadArrayByCollectionMemberID($searchTerm) {\n // ******* Note: $connection must be a mysqli object.\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DeterminationID FROM determination WHERE CollectionMemberID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DeterminationID FROM determination WHERE CollectionMemberID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_determination();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "function getSearchTerms(ProductInterface $product);", "function &_doSearch($searchTerms) {\n\t\tassert(!empty($this->getEmail));\n\t\t$eSearchUrl = CITATION_LOOKUP_PUBMED_BASEURL_ESEARCH.\n\t\t\t\t'&tool=PKP-WAL&email='.urlencode($this->getEmail()).'&term='.\n\t\t\t\turlencode($searchTerms);\n\t\t\n\t\t// Call the eSearch web service and get an XML result\n\t\t$xmlResult = $this->callWebService($url);\n\t\t\n\t\t// create a temporary DOM document\n\t\t// FIXME: This is PHP5 only. Use DOM XML for PHP4\n\t\t$resultDOM = new DOMDocument();\n\t\t// Try to handle non-well-formed responses\n\t\t$resultDOM->recover = true;\n\n\t\t$resultDOM->loadXML($xmlResult);\n\n\t\t// Loop through any results we have and add them to a PMID array\n\t\t$pmidArray = array();\n\t\tforeach ($resultDOM->getElementsByTagName('Id') as $idNode) {\n\t\t\t$pmidArray[] = $idNode->textContent;\n\t\t}\n\t\t\n\t\treturn $pmidArray; \n\t}", "private function _get_datatables_query($term=''){\n $column = array('k.id','k.code', 'k.startActivity', 'k.activity', 'k.nit', 'k.state', 'c.nameCus', 'a.nameActivity', 'c.nit');\n $this->db->select('k.id, k.code, k.startActivity, k.state, k.name, k.nit, k.activity, k.ordenenka, c.nameCus, c.nit, a.nameActivity');\n $this->db->from('order as k');\n $this->db->join('customers as c', 'c.id = k.name','left');\n $this->db->join('activity as a', 'a.id = k.activity','left');\n $this->db->like('k.id', $term);\n $this->db->or_like('k.nit', $term);\n $this->db->or_like('k.startActivity', $term);\n $this->db->or_like('k.code', $term);\n $this->db->or_like('c.nameCus', $term);\n $this->db->or_like('k.state', $term);\n if(isset($_REQUEST['order'])) // here order processing\n {\n $this->db->order_by($column[$_REQUEST['order']['0']['column']], $_REQUEST['order']['0']['dir']);\n }\n else if(isset($this->order))\n {\n $order = $this->order;\n $this->db->order_by(key($order), $order[key($order)]);\n }\n }", "public function searchTerm ($theme, $term){\n $json = new JsonFile ($this->host . '/api/'.$theme.'/key/' . $term);\n $json->parse();\n \n return $json;\n }", "public function getTerms($term)\n {\n return $this->terms = wp_get_post_terms($this->id, $term);\n }", "function mini_get_term_id_by_pid( $pid ){\n \n $terms = get_the_terms( $pid, 'project_tax' );\n\nif ( $terms && ! is_wp_error( $terms ) ){ \n \n $p_terms = array();\n \n foreach ( $terms as $term ) {\n $p_terms[] = $term->term_id;\n }\n \n return $p_terms;\n } else {\n return [];\n //return $p_terms;\n }\n}", "function industry_search($search_term)\n {\n\n $this->db->select('id, name');\n $this->db->like('name', $search_term, 'both');//both, after, before\n $this->db->limit('100');\n $this->db->order_by(\"name\", \"asc\");\n $query = $this->db->get('ref_category');\n $count = $query->num_rows(); \n\n if($query)\n { \n $result_array = array();\n foreach($query->result_array() as $row=>$item)\n {\n $result_array[$row]['id'] = $item['id'];\n $result_array[$row]['text'] = $item['name'];\n }\n $output = json_encode($result_array); \n return $output; \n } \n }", "function performSearch($sessionID, $table, $field, $term, $order){\r\n\t\tif($this->userCanPerformSearch('', $table)){\r\n\t\t\t//Allow user to search by sensitive or normal for level\r\n\t\t\tif($table == 'issues' && $field == 'Level'\r\n\t\t\t && $term!='A' && $term!='a' && $term!='B' && $term!='b'){\r\n\t\t\t\tif(strstr('sensitive', $term))\r\n\t\t\t\t\t$term = 'A';\r\n\t\t\t\telseif(strstr('normal', $term))\r\n\t\t\t\t\t$term = 'B';\r\n\t\t\t}\r\n\t\t\tif($table == 'students'){\r\n\t\t\t\tif(!$this->fieldInTable($table, $field)){\r\n\t\t\t\t\tif($this->fieldInTable('X_PNSY_STUDENT', $field))\r\n\t\t\t\t\t\t$table = 'X_PNSY_STUDENT';\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$table = 'X_PNSY_ADDRESS';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($table == 'students'){\r\n\t\t\t\t$query = \"SELECT * FROM X_PNSY_STUDENT ss, $table s where s.$field like '%$term%' AND s.StudentID IN\r\n\t\t\t\t\t\t\t(SELECT ID FROM X_PNSY_STUDENT WHERE ID = s.StudentID) AND s.StudentID = ss.ID GROUP BY s.StudentID\";\r\n\t\t\t}\r\n\t\t\telseif($table == 'X_PNSY_ADDRESS'){\r\n\t\t\t\t$query = \"SELECT * FROM X_PNSY_STUDENT ss, $table s WHERE s.$field LIKE '%$term%'AND s.ADDRESS_ID IN \r\n\t\t\t\t\t\t\t(SELECT ADDRESS_ID FROM $table WHERE ADDRESS_ID=s.ADDRESS_ID) \r\n\t\t\t\t\t\t\tAND s.ADDRESS_ID=ss.ADDRESS_ID GROUP BY s.ADDRESS_ID\";\r\n\t\t\t\tif($field == 'STREET'){\r\n\t\t\t\t//\"SELECT ID, CONCAT(FirstName, ' ', MiddleIn, ' ', LastName) AS FullName FROM students WHERE\r\n\t\t\t\t//\tCONCAT(FirstName, ' ', MiddleIn, ' ', LastName) LIKE '%$name%'\";\r\n\t\t\t\t\r\n\t\t\t\t\t$query = \"SELECT * FROM X_PNSY_STUDENT ss, $table s WHERE (s.STREET_1 LIKE '%$term%' OR s.STREET_2 LIKE '%$term%'\r\n\t\t\t\t\t\t\tOR s.STREET_3 LIKE '%$term%' OR s.STREET_4 LIKE '%$term%' OR s.STREET_5 LIKE '%$term%') AND s.ADDRESS_ID IN \r\n\t\t\t\t\t\t\t(SELECT ADDRESS_ID FROM $table WHERE ADDRESS_ID=s.ADDRESS_ID) AND s.ADDRESS_ID=ss.ADDRESS_ID GROUP BY s.ADDRESS_ID\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telseif($table == 'X_PNSY_STUDENT' && $field == 'ADVISOR'){\r\n\t\t\t\t$table = 'X_PNSY_FACULTY';\r\n\t\t\t\t$query = \"SELECT s . * FROM X_PNSY_STUDENT s, $table ss WHERE (CONCAT(ss.FIRST_NAME, ' ',\r\n\t\t\t\t\t\t\t ss.LAST_NAME) LIKE '%$term%') AND s.$field IN (SELECT ID FROM $table WHERE ID = s.$field)\r\n\t\t\t\t\t\t\tAND s.$field = ss.ID GROUP BY s.$field, s.ID\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$query = \"SELECT * FROM $table WHERE $field like '%$term%'\";\r\n// Michael Thompson * 12/07/2005 * Added Below line to tack order onto sql sentence\r\n if ($order != \"\") $query .= \" ORDER BY $order\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\tfor($i=0; $results = mysql_fetch_assoc($result); $i++){\r\n\t\t\t\t$return[$i] = $results;\r\n\t\t\t}\r\n\t\t\treturn $return;\r\n\t\t}\r\n\t}", "function searchSongs($term, $database) {\n\t// Get list of books\n\t$term = $term . '%';\n\t$sql = file_get_contents('sql/getSongs.sql');\n\t$params = array(\n\t\t'term' => $term\n\t);\n\t$statement = $database->prepare($sql);\n\t$statement->execute($params);\n\t$songs = $statement->fetchAll(PDO::FETCH_ASSOC);\n\treturn $books;\n}", "function search($user_id,$term,$limit=1000){\r\n\t\t$idRange=array();\r\n\t\tif($term){\r\n\t\t\t$users=iterator_to_array(\\app\\models\\User::model()->find(array('username'=>new \\MongoRegex(\"/^$term/\")))->sort(array('username'=>1))->limit($limit));\r\n\t\t\t$mongoIds=array();\r\n\t\t\tforeach($users as $_id=>$user)\r\n\t\t\t\t$mongoIds[]=new \\MongoId($_id);\r\n\t\t\t$idRange=array('toId'=>array('$in'=>$mongoIds));\r\n\t\t\t\r\n\t\t\t$following=self::model()->find(array_merge(array('fromId'=>$user_id),$idRange));\r\n\t\t\t\r\n\t\t\t$followedUsers=array();\r\n\t\t\tforeach($following as $_id=>$follower){\r\n\t\t\t\tif($user=$users[strval($follower->toId)])\r\n\t\t\t\t\t$followedUsers[strval($user->_id)]=$user;\r\n\t\t\t}\r\n\t\t\treturn $followedUsers;\t\t\t\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t$following=self::model()->find(array('fromId'=>$user_id))->limit(20);\r\n\t\t\tforeach($following as $_id=>$follower)\r\n\t\t\t\t$mongoIds[]=new \\MongoId($follower->toId);\t\t\t\r\n\t\t\t$users=\\app\\models\\User::model()->find(array('_id'=>array('$in'=>$mongoIds)))->sort(array('username'=>1));\r\n\t\t\treturn $users;\r\n\t\t}\r\n\t}", "public function autoCompleteHelper($term, $what)\n {\n $term = $this->esc($term);\n $what = $this->esc($what);\n $return = array();\n foreach (array('tasks', 'events') as $where) {\n $qid = $this->query('SELECT `'.$what.'` FROM '\n .($where == 'tasks' ? $this->Tbl['cal_task'] : $this->Tbl['cal_event'])\n .' WHERE uid='.$this->uid.' AND `'.$what.'` LIKE \"%'.$term.'%\" GROUP BY `'.$what.'`');\n while ($line = $this->assoc($qid)) {\n $return[] = $line[$what];\n }\n }\n return array_values(array_unique($return, SORT_STRING));\n }", "public function searchContacts($userId, $searchterm)\n { \n $sql = \"SELECT * FROM contacts WHERE ((`firstname` LIKE ?) OR (`lastname` LIKE ?) OR (`phone` LIKE ?) OR (`city` LIKE ?) OR (`birthday` LIKE ?) OR (`email` LIKE ?)) AND (`userid`=?)\";\n $stmt = $this->pdo->prepare($sql);\n $stmt->execute([\"%$searchterm%\", \"%$searchterm%\", \"%$searchterm%\", \"%$searchterm%\", \"%$searchterm%\", \"%$searchterm%\", $userId]);\n return $stmt->fetchAll();\n }", "public function query($term) {\n $matches = $this->getMatchesService('vienna',$term,array('showSyn'=>false,'NearMatch'=>false,'includeCommonNames'=>true));\n return $matches;\n }", "public function findBySearchTerm($searchterm = '') {\n\n\t\t\t// create the query object\n\t\t$query = $this->createQuery();\n\n\t\t\t// break up the searchterm into searchwords\n\t\t$searchwords = Tx_Catalogueraisonne_Utility_Search::wordSplit($searchterm);\n\n\t\t\t// create constraints if multiple searchwords\n\t\tif (count($searchwords) > 0) {\n\t\t\tforeach ($searchwords as $searchword) {\n\t\t\t\t$searchword = '%' . $searchword. '%';\n\t\t\t\t$autConstraints[] = $query->like('aut', $searchword);\n\t\t\t\t$titelConstraints[] = $query->like('titel', $searchword);\n\t\t\t\t$seriesConstraints[] = $query->like('series', $searchword);\n\t\t\t}\n\t\t\t$query->matching(\n\t\t\t\t$query-> logicalOr(\n\t\t\t\t\t$query->logicalAnd($autConstraints),\n\t\t\t\t\t$query->logicalAnd($titelConstraints),\n\t\t\t\t\t$query->logicalAnd($seriesConstraints)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t\t// result order\n\t\t$query->setOrderings(\n\t\t\tarray('aut' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING),\n\t\t\tarray('titel' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING)\n\t\t);\n\n\t\t\t// go\n\t\treturn $query->execute();\n\t}", "function _fullcalendar_colors_filter_term_ids($fields) {\n $term_ids = array();\n foreach ($fields as $key => $value) {\n foreach ($value as $language => $term) {\n foreach ($term as $content) {\n if (isset($content['tid'])) {\n $term_ids[] = $content['tid'];\n }\n }\n }\n }\n return $term_ids;\n}", "function rs_get_custom_term_values($type) {\n\n\t$items = array();\n\t$terms = get_terms($type, array('orderby' => 'name'));\n\tif (is_array($terms) && !is_wp_error($terms)) {\n\t\tforeach ($terms as $term) {\n\t\t\t$items[$term -> name] = $term -> term_id;\n\t\t}\n\t}\n\treturn $items;\n}", "public function get_supplier_in_order($order_id) {\n\n $query = $this->db->query(\"SELECT * FROM supplier_in_order inner join supplier \n on\n ( supplier_in_order.code_supplier= supplier.code_supplier)\n where supplier_in_order.id_order='\" . $order_id . \"'\");\n\n if ($query) {\n return $query->result_array();\n }\n }", "public function findEntityIdsByName($q){\r\n\t\t$this->recursive = 0;\r\n\t\t$entities = $this->find('list', array(\r\n\t\t\t'fields' => array('Entity.id'),\r\n\t\t\t'conditions' => array(\r\n\t\t\t\t'Entity.name LIKE' => '%'.$q.'%',\r\n\t\t\t\t'Entity.active' => 1,\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t);\r\n\t\treturn $entities;\r\n\t}", "function get_term_by_id_only($term, $output = OBJECT, $filter = 'raw') \n{\n global $wpdb;\n $null = null;\n\n if(empty($term)) \n {\n $error = new WP_Error('invalid_term', __('Empty Term'));\n return $error;\n }\n\n if (is_object($term) && empty($term->filter)) \n {\n wp_cache_add($term->term_id, $term, 'my_custom_queries');\n $_term = $term;\n } \n else \n {\n if (is_object($term)) $term = $term->term_id;\n $term = (int) $term;\n if (!$_term = wp_cache_get($term, 'my_custom_queries')) \n {\n $_term = $wpdb->get_row( $wpdb->prepare( \"SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE t.term_id = %s LIMIT 1\", $term) );\n if(!$_term) return $null;\n wp_cache_add($term, $_term, 'my_custom_queries');\n }\n }\n\n if ( $output == OBJECT ) \n {\n return $_term;\n } \n else if ($output == ARRAY_A) \n\t{\n $__term = get_object_vars($_term);\n return $__term;\n } \n else if ( $output == ARRAY_N ) \n {\n $__term = array_values(get_object_vars($_term));\n return $__term;\n } \n else \n {\n return $_term;\n }\n}", "public function autocomplete(Request $req)\n {\n $term = $req->input('term') ?? '';\n $page = $req->page ?? 1;\n $per_page = 10;\n $offset = ($page - 1) * $per_page;\n if ($term) {\n // DB::connection()->enableQueryLog();\n $a = EmployeeData::where('id', 'like', '%' . $term . '%')\n ->offset($offset)\n ->limit($per_page)\n ->orderBy('id')\n ->get()\n ->map(function ($item) {\n $label = $item->name . ' ' . $item->surname;\n return [\n 'value' => $label,\n 'id' => $item->id,\n 'text' => $label,\n 'label' => $label,\n 'title' => $item->name,\n ];\n });\n // dd(DB::getQueryLog());\n return $a;\n } else {\n return [];\n }\n }", "public function searchProduct(){\n if($this->checkKeyWord() === false && $this->searchOrNoSearch == 0) return array();\n $this->check_branch();\n $andWhere = '';\n if($this->active == 0) $andWhere .= ' AND usp_active = 0';\n else $andWhere .= ' AND usp_active = 1';\n if($this->checkKeyWord() && $this->searchOrNoSearch == 0){\n if($this->class_import_export->detect_barcode($this->keyword)){\n if($this->class_import_export->detect_me_barcode($this->keyword)) $andWhere .= \" AND usp_me_barcode LIKE '%\".$this->keyword.\"%'\";\n else $andWhere .= \" AND usp_barcode LIKE '%\".$this->keyword.\"%'\";\n }else{\n $andWhere .= \" AND usp_pro_name LIKE '%\".$this->keyword.\"%'\";\n }\n }\n $sql_search = \"SELECT * FROM \".USER_PRODUCTS.\"\n WHERE usp_branch_id = \" . $this->branch_id . \"\n AND usp_use_child_id = \".$this->use_id.\"\n AND usp_use_parent_id = \" . $this->admim_id .$andWhere;\n $db_query = new db_query($sql_search);\n return $db_query->resultArray();\n }", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public static function fetch_all_data($searchTerm): array\n {\n static::$searchItem = 'category';\n static::$searchValue = $searchTerm;\n $sql = \"SELECT * FROM \" . static::$table . \" WHERE category=:category\";\n return static::fetch_all_by_column_name($sql);\n\n }", "static function get_search_results() {\n\n\t\t$post_ids = array();\n\n\t\tif ( ! empty( QS::get_request_taxonomy( 'platform' ) ) && QS::get_request_taxonomy( 'platform' ) == get_field( 'handgun_term' ) ) {\n\t\t\t$taxonomies = array( 'platform', 'brand', 'model', 'product_cat', 'sight_type' );\n\t\t} else {\n\t\t\t$taxonomies = array( 'platform', 'application', 'manification', 'day_night' );\n\t\t}\n\n\t\tforeach ( $taxonomies as $tax ) {\n\t\t\tif ( QS::get_request_taxonomy( $tax ) ) {\n\t\t\t\t$tax_query[] = array(\n\t\t\t\t\t'taxonomy' => $tax,\n\t\t\t\t\t'terms' => QS::get_request_taxonomy( $tax ),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tdo {\n\t\t\twp_reset_query();\n\n\t\t\t$args = array(\n\t\t\t\t'post_type' => 'product',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'tax_query' => $tax_query,\n\t\t\t\t'fields' => 'ids',\n\t\t\t);\n\n\t\t\tif ( count( $tax_query ) != 1 ) {\n\t\t\t\tunset( $tax_query[ count( $tax_query ) - 1 ] );\n\t\t\t}\n\n\t\t\t$query = new WP_Query( $args );\n\n\t\t\t$post_ids = array_merge( $post_ids, $query->posts );\n\n\t\t} while ( count( $post_ids ) < 8 && count( $tax_query ) >= 1 );\n\n\t\t$post_ids = array_slice( $post_ids, 0, 8 );\n\n\t\treturn $post_ids;\n\t}", "public function search($terms){\n\t \n if(!$this->t_mirrors){\n\t\t@$this->retrieveMirrors;\n\t }\n\t if(!$this->t_mirrors){\n\t\treturn false;\n\t }\n\t \n\t $terms=str_replace(' ', '%20', $terms);\n\t $terms=str_replace(\"'\", '%27', $terms);\n\t \n\t \n $url = $this->t_mirrors[0].'/api/GetSeries.php?seriesname='.$terms;\n\n $xmlStr=$this->curl_get_file_contents($url);\n \n $results = new SimpleXMLElement($xmlStr);\n \n $i=0;\n \n foreach ($results->Series as $s) {\n \n $this->t_sResults[$i]=array('seriesid' => $s->seriesid,\n 'SeriesName' => $s->SeriesName,\n 'banner' => $s->banner,\n 'FirstAired' => $s->FirstAired,\n 'Overview' => $s->Overview);\n \n $i++;\n }\n \n return $this->t_sResults;\n \n }", "public function get_custom_term_id_values( $type ) {\n\n\t\t$items = array();\n\t\t$terms = get_terms( $type, array('orderby' => 'name' ) );\n\t\tif ( is_array( $terms ) && ! is_wp_error( $terms ) ) {\n\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t$items[$term -> name] = $term -> term_id;\n\t\t\t}\n\t\t}\n\t\treturn $items;\n\t}", "public function search(string $keyword): array\n {\n $multi_handle = curl_multi_init();\n\n // Build an array of curl handles for API requests.\n $handles = array_map(function (Service $service) use ($keyword) {\n return $service->getCURLHandle($keyword);\n }, $this->services);\n\n // Attach all the request handles to the CURL multi-handle.\n foreach ($handles as $handle) {\n curl_multi_add_handle($multi_handle, $handle);\n }\n\n // Execute all the queries.\n $running = null;\n do {\n curl_multi_exec($multi_handle, $running);\n } while ($running);\n\n // Remove the API handles from the multi handle and close it.\n foreach ($handles as $handle) {\n curl_multi_remove_handle($multi_handle, $handle);\n }\n curl_multi_close($multi_handle);\n\n $result = [];\n\n $num_services = count($this->services);\n for ($i = 0; $i < $num_services; $i++) {\n $service = $this->services[$i];\n $handle = $handles[$i];\n\n $json_text = curl_multi_getcontent($handle);\n $response_json = json_decode($json_text, true);\n $result[] = $service->readResponse($response_json);\n }\n\n return $result;\n }", "private function _getProductIdsFromSearchQuery($query)\n {\n if (is_null($this->_productIds)) {\n $ids = array();\n $client = Mage::helper('catalogsearch')->getEngine()->getClient();\n\n $response = $client->search($query);\n\n foreach ($response['hits']['hits'] as $hit) {\n $currentId = $hit['fields']['entity_id'];\n if (is_array($currentId)) {\n $currentId = current($currentId);\n }\n $ids[] = (int) $currentId;\n }\n $this->_productIds = $ids;\n }\n\n return $this->_productIds;\n }", "function get_all_employees($terms = null ){\n\t\tif(!is_null($terms)){\n\t\t\t$sql = \"SELECT *\n\t\t\tFROM employees\n\t\t\tWHERE employee_name LIKE '$terms%' \";\n\t\t\tif(is_numeric($terms)){\n\t\t\t$sql = \"SELECT *\n\t\t\tFROM employees\n\t\t\t\tWHERE employee_id = '$terms' \";\n\t\t\t}\n\t\t\t$query = $this->db->query($sql);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t$query = $this->db->get('employees');\n\t\t}\n\t\treturn $query->result();\n\t\t\n\t}", "function searchOrders() {\n //\terror_log ( 'addOrder\\n', 3, '/var/tmp/php.log' );\n $request = Slim::getInstance ()->request ();\n\t$criteria = json_decode ( $request->getBody () );\n try {\n $db = new DbOperation();\n $orders = $db->searchOrders ( $criteria );\n if ( $orders != null ) {\n echo '{\"orders\":' . json_encode ( $orders ) . '}';\n } else {\n echo '{\"error\":{\"text\":' . \"Unable to search order\" . '}}';\n }\n } catch ( Exception $e ) {\n\t\techo '{\"errorText\":\"search orders fail with text as\", \"text\":}' . $e->getMessage () . $e . '}';\n }\n}", "function Search($nodes, $rq) {\n $nds = array();\n Find($nodes, $nds, $rq->fid, -1, $rq->fnd);\n $rlt = array();\n $a = array_keys($nds);\n foreach ($nds as $id => $nde) {\n if (!$nde[0]) {\n for ($i = 0; $i < count($a); $i++) {\n if ($nds[$a[$i]][1] == $id && $nds[$a[$i]][0]) {\n $nde[0] = true;\n }\n }\n }\n if ($nde[0]) {\n $rlt[] = $rq->pfx . $id;\n }\n }\n return $rlt;\n}", "public function wordIdWithOrder()\n {\n return $this->word_to_sentence()->orderBy('order', 'asc')->get('word_id')->toArray();\n }", "public static function getAllSdById($term){\n // ->join('clienttype as ct', function($join){\n // $join->on('c.ClientType', '=', 'ct.ClientTypeID');\n // })\n // ->join('acctstat as as', function($join){\n // $join->on('c.AccountStatus', '=', 'as.AcctStatID');\n // })\n // ->where('c.ClientID', '=', $clientIdSd)\n // ->get();\n\n return DB::table('client as c')\n ->join('clienttype as ct', function($join) {\n $join->on('c.ClientType', '=', 'ct.ClientTypeID');\n })\n ->join('acctstat as acs', function($join){\n $join->on('c.AccountStatus', '=', 'acs.AcctStatID');\n })\n ->where('c.ClientID', '=', $term)\n ->orWhere('c.FName', 'like', '%'.$term.'%')\n ->orWhere('c.LName', 'like', '%'.$term.'%')\n // ->where('c.AccountStatus', '=', $status)\n // ->orWhere('c.AccountStatus', '=', $status)\n // ->orWhere('c.AccountStatus', '=', $status)\n ->paginate(10);\n }", "public function getSearch(string $term){\n \n try {\n $sql = \"SELECT\n img.*,\n COUNT(DISTINCT lik.id) AS likes ,\n COUNT(DISTINCT dis.id) AS dislikes\n FROM images AS img\n LEFT JOIN image_likes AS lik ON img.id = lik.images_id\n LEFT JOIN image_dislikes AS dis ON img.id = dis.images_id\n WHERE img.title LIKE ? OR img.description LIKE ?\n GROUP BY img.id\n ORDER BY COUNT(lik.images_id) DESC LIMIT 20\";\n \n $statement = $this->connection->prepare($sql);\n $success = $statement->execute([\n '%' . $term . '%',\n '%' . $term . '%'\n ]);\n \n if($success){\n $result = [\n 'status' => 200,\n 'message' => 'Success',\n 'data' => ['data' => $statement->fetchAll(PDO::FETCH_ASSOC)]\n\n ];\n }\n \n }catch(PDOException $e){\n \n return [\n 'status' => 204,\n 'message' => $e->getMessage(),\n 'data' => ['data' => []]\n\n ];\n }\n \n return $result;\n }", "protected function searchOrderById($id)\n {\n return $this->_rootElement->find(sprintf($this->itemOrder, $id), Locator::SELECTOR_XPATH);\n }", "public function searchWord($dataset = array(), $datalatih = array()){\n\n\t$data = array();\n\t$term = array_unique($datalatih);// menghilangkan array yg duplikat\n\n\tfor($i=0; $i<count($dataset); $i++){\n\t\t$key[$i] = 0;\n\t\tforeach($dataset[$i]['stopword'] AS $keys => $value){\n\t\t\t$data[$i][$key[$i]] = array($key[$i] => $value);\n\t\t\t$key[$i] ++;\n\t\t}\n\t}\n\n\tforeach ($term as $keys => $val) {\n\t\tfor($x = 0; $x < count($data); $x++) {\n\t\t\t$sum[$x] = 0;\n\t\t\tfor($y = 0; $y < count($data[$x]); $y++) {\n\t\t\t\tforeach ($data[$x][$y] as $key => $value) {\n\t\t\t\t\tif($val == $value) {\n\t\t\t\t\t\t$nilai = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t \t$nilai = 0; \n\t\t\t\t\t}\n\t\t\t\t\t$sum[$x] += $nilai;\n\t\t\t\t} \n\t\t\t}\n\n\t\t\t$params[$x] = array($val, $sum[$x]);\n\t\t}\n\n\t\t$df[$keys] = $params;\n\n\t}\n\n\treturn $df;\n\n}", "public function getSearchterms(): array\n {\n return explode(' ', $this->getSearchterm());\n }" ]
[ "0.6233762", "0.5996679", "0.59806424", "0.5860475", "0.5846695", "0.58376443", "0.58057004", "0.5802774", "0.578627", "0.578199", "0.5660996", "0.5659146", "0.56335175", "0.558993", "0.55708325", "0.55706227", "0.5568678", "0.5564585", "0.54941046", "0.54929745", "0.5466665", "0.54469746", "0.53593093", "0.5354387", "0.53532445", "0.53446144", "0.5341446", "0.52971274", "0.5295399", "0.5274574", "0.5224075", "0.5212202", "0.52121353", "0.5211198", "0.5211198", "0.5199083", "0.51975834", "0.51870906", "0.51848453", "0.5170304", "0.51663727", "0.5165696", "0.5163486", "0.51522934", "0.515114", "0.51478314", "0.5147815", "0.5110358", "0.5103432", "0.5090281", "0.5063583", "0.50534505", "0.5052002", "0.50472933", "0.5043682", "0.5040284", "0.50235194", "0.5023054", "0.50177276", "0.5008614", "0.50083673", "0.5007054", "0.49929053", "0.49816033", "0.49661162", "0.4960045", "0.4959039", "0.49581468", "0.4957985", "0.49567506", "0.49533284", "0.49466807", "0.49347576", "0.4931922", "0.4927388", "0.49212855", "0.49202946", "0.4911956", "0.49109763", "0.49081758", "0.48995048", "0.48975945", "0.4891116", "0.48910412", "0.48858225", "0.48847756", "0.48846027", "0.48793253", "0.48770648", "0.48767266", "0.48761177", "0.48747963", "0.48727608", "0.48694077", "0.48682997", "0.48605204", "0.48544616", "0.4852299", "0.4851043", "0.48339006" ]
0.73761
0
Gets information about whether permissions were generated yet.
public function get_download_permissions_granted( $order ) { $order_id = WC_Order_Factory::get_order_id( $order ); return wc_string_to_bool( get_post_meta( $order_id, '_download_permissions_granted', true ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasPermissions()\n {\n return ! empty($this->permissions);\n }", "public function hasPermissions()\n {\n return $this->permissions !== null;\n }", "public static function uses_permissions(): bool;", "static function hasInitializedPermission()\n {\n $position = self::getPermissionPosition();\n\n return isset($position);\n }", "public function permissions()\n\t{\n\t\t// add any additional custom permission checking here and \n\t\t// return FALSE if user doesn't have permission\n\t\n\t\treturn TRUE;\n\t}", "public function getPermissions() {}", "public function getPermissions() {}", "public function permissions()\n {\n return $this->permissions;\n }", "protected function _hasModPermission(){\n global $auth;\n return $auth->acl_get('m_inttree');\n }", "public function getPermission(){\n\t\tif (Yii::$app->getUserOpt->Modul_akses('11')){\n\t\t\treturn Yii::$app->getUserOpt->Modul_akses('11');\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getPossiblePermissions();", "public function getPermissions()\r\n {\r\n return $this->getGuardUser()->getPermissions();\r\n }", "public function getPermissions()\n {\n return $this->permissions;\n }", "public function getPermissions()\n {\n return $this->permissions;\n }", "public function getPermissions()\n {\n return $this->permissions;\n }", "public function getPermissions() {\n\t\treturn $this->addressBookInfo['permissions'];\n\t}", "public function hasAccess(){\n \treturn $this->hasAccess;\n }", "public function hasAccess() {\n return $this->_has(16);\n }", "public function getPermissions() {\n return $this->getGuardUser()->getPermissions();\n }", "public function & GetPermissions ();", "public function get_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function getPermissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Accept an OAuth callback?\n $p['callback'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing SalesforceSource?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing SalesforceSource?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing SalesforceSources?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View API limits?\n $p['limits'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing SalesforceSource?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }", "public function HasPermission()\n\t\t{\n\t\t\tstatic $perms = null;\n\t\t\tif ($perms === null) {\n\t\t\t\t$perms = $GLOBALS[\"ISC_CLASS_ADMIN_AUTH\"]->GetPermissions();\n\t\t\t}\n\n\t\t\tif (in_array(AUTH_Edit_Customers, $perms)\n\t\t\t\t&& in_array(AUTH_Edit_Orders, $perms)\n\t\t\t\t&& in_array(AUTH_Newsletter_Subscribers, $perms)) {\n\t\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 checkPermissions();", "public function permissions() {\n\t$this->loadPermissions();\n\treturn $this->permissions;\n}", "static function getPermissions() {\n if(self::$permissions === false) {\n self::$permissions = new NamedList(array(\n\n ));\n\n EventsManager::trigger('on_system_permissions', array(&self::$permissions));\n } // if\n\n return self::$permissions;\n }", "function check_has_permissions() {\n $details = $this->get_user_details('1');\n\t\treturn 0 != strcmp(strtoupper($details['StatusInfo']), '\"ACCESS DENIED\"');\n\t}", "public function validPermissions()\n {\n if (!ConfigHelper::cacheEnabled()) {\n return $this->getCurrentUserPermissions();\n }\n\n $cacheKey = 'laravelroles_permissions_' . Users::userModelCacheKey() . '_' . $this->getKey();\n\n return Cache::remember($cacheKey, ConfigHelper::cacheExpiryTime(), function () {\n return $this->getCurrentUserPermissions();\n });\n }", "public function hasPermissions()\n {\n return $this->roles()->count() > 1;\n }", "public function perms()\n {\n if ($this->exists()) {\n return substr(sprintf('%o', fileperms($this->path)), -4);\n }\n\n return false;\n }", "public function permissions()\n\t{\n\t\treturn $this->get('permissions');\n\t}", "abstract public function getPermissions();", "public function hasUsageRights() {}", "public function getAllAvailable()\n {\n return $this->allPermissions;\n }", "public function get_available_permissions()\n {\n try {\n $url = $this->get_url(\"graph\", \"me\", array(\"metadata\" => \"1\"));\n $data = $this->api_call($url);\n //echo $url;\n } catch (Exception $ex) {\n print_r($ex->getMessage());\n exit;\n }\n\n return $this->convert_array_to_object($data->metadata);\n }", "public function getEvaluatePermissions() {}", "public function getPermissions(): array {\n\t\treturn [];\n\t}", "protected function check_permission()\n {\n return true;\n }", "public static function getPermissions(): array\n {\n return [];\n }", "public function getRequiredPermissions()\n {\n return $this->requiredPermissions;\n }", "public function permission(): string;", "protected function isPermissionCorrect() {}", "public function getPermissions()\n {\n return $this->get(self::PERMISSIONS);\n }", "public static function permissions(): array\n {\n return [];\n }", "static function access () {\n onapp_debug(__CLASS__.' :: '.__FUNCTION__);\n $return = onapp_has_permission( array( 'roles' ) );\n onapp_debug( 'return => '.$return );\n return $return;\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new Data Scrubber Filter Attribute?\n $p['add'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Delete an existing Data Scrubber Filter Attribute?\n $p['delete'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['edit'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // View all existing Data Scrubber Filter Attribute?\n $p['index'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX \n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Data Scrubber Filter Attribute?\n $p['view'] = $roles['cmadmin'] || $roles['coadmin'];\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }", "public function getAllPermissions(): array;", "static public function getRequiredPermissions(): array\n {\n return static::$required_permissions;\n }", "public function getDontAutograntPermissions()\n {\n return $this->dont_autogrant_permissions;\n }", "protected function getPermission(){\n if(Session::getKey(\"loggedIn\")):\n $userPermissions = array();\n $userPermission = Session::getKey(\"level\");\n if($userPermission[0]) { // tiene permiso para crear\n $userPermissions[] = \"create\";\n }\n if($userPermission[1]) { // tiene permiso para crear\n $userPermissions[] = \"read\";\n }\n if($userPermission[2]) { // tiene permiso para crear\n $userPermissions[] = \"update\";\n }\n if($userPermission[3]) { // tiene permiso para crear\n $userPermissions[] = \"delete\";\n }\n return $userPermissions; \n else:\n return false;\n endif;\n }", "public function hasAccess(): bool;", "private function getPermissions()\n\t{\n\t\tif (!isset($this->permissions)) {\n\t\t\t$this->permissions = $this->permissions()->get();\n\t\t}\n\t\treturn $this->permissions;\n\t}", "public function getPermissions(): int\n {\n return $this->permissions;\n }", "public function getPossiblePermissions()\n {\n return array_keys($this->map);\n }", "public function hasAccess($permission);", "public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function get_permissions()\n\t{\n\t\treturn $this->area->get_permissions($this->path);\n\t}", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Add a new Match Server Attribute?\n $p['add'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing Match Server Attribute?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Match Server Attribute?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n\n // View all existing Match Server Attributes?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Match Server Attribute?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n\n $this->set('permissions', $p);\n return $p[$this->action];\n }", "public function checkPermissions() {\r\n\t\treturn $this->modx->hasPermission('edit_document');\r\n\t}", "public function getPermission()\n {\n return $this->permission;\n }", "public function getPermissionNames()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getPermissionNames() : array();\r\n }", "public function canManagePermissions()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn ( static::$permApp !== NULL and static::$permType !== NULL and static::restrictionCheck( 'permissions' ) );\n\t}", "public function getPermissions() :array\n {\n return $this->permissions;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public static function synchronizelPermission(): bool\n {\n if (self::allPermission()) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function getPermissionNames() {\n return $this->getGuardUser() ? $this->getGuardUser()->getPermissionNames() : array();\n }", "public function getPermission()\n {\n return $this->permission ?: 'everyone';\n }", "protected function getCurrentPermission() {}", "public function hasAccessions(){\n return $this->_has(2);\n }", "public function hasAccessions(){\n return $this->_has(2);\n }", "static function getPermissionNames() {\n return static::getPermissions()->keys();\n }", "public function can_read () {\r\n\r\n return $this->permissions[\"R\"] ? true : false;\r\n\r\n }", "public static function canDisplayPermissionsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PERMISSION);\n\t}", "public function getAllPermissions();", "public function getAllPermissions();", "public function getCustomerResultPermissions(): array;", "public function permissionInUse(string $permission): bool;", "public function getDirectoryPermissionStatus()\n {\n $ok = true;\n try {\n $mageFile = new Varien_Io_File();\n $mageFile->checkAndCreateFolder(Mage::getBaseDir(Emv_Core_Helper_Data::BASE_CONTAINER));\n $mageFile->checkAndCreateFolder(\n Mage::getBaseDir(Emv_Core_Helper_Data::BASE_CONTAINER)\n . DS . Emv_Core_Helper_Data::BASE_WORKING_DIR\n );\n } catch (Exception $e) {\n $ok = false;\n }\n\n $message = '';\n if ($ok) {\n $image = $this->_getTickImageLink();\n $message = Mage::helper('emvcore')->__(\n '<span class=\"icon-status\">%s</span> Write permission is correctly set to <strong>%s</strong>.',\n $image,\n Mage::getBaseDir(Emv_Core_Helper_Data::BASE_CONTAINER)\n );\n } else {\n $image = $this->_getUnTickImageLink();\n $message = Mage::helper('emvcore')->__(\n '<span class=\"icon-status\">%s</span> Write permission is not correctly set to <strong>%s</strong>.',\n $image,\n Mage::getBaseDir(Emv_Core_Helper_Data::BASE_CONTAINER)\n );\n }\n return $message;\n }", "public function getAdminPermissions(): array;", "public function getPermissionsDescription()\n {\n if (class_exists(Subsite::class)) {\n Subsite::disable_subsite_filter(true);\n }\n\n $permissionsUsr = Permission::permissions_for_member($this->owner->ID);\n $permissionsSrc = Permission::get_codes(true);\n sort($permissionsUsr);\n\n $permissionNames = array();\n foreach ($permissionsUsr as $code) {\n $code = strtoupper($code ?? '');\n foreach ($permissionsSrc as $k => $v) {\n if (isset($v[$code])) {\n $name = empty($v[$code]['name'])\n ? _t(__CLASS__ . '.UNKNOWN', 'Unknown')\n : $v[$code]['name'];\n $permissionNames[] = $name;\n }\n }\n }\n\n $result = $permissionNames\n ? implode(', ', $permissionNames)\n : _t(__CLASS__ . '.NOPERMISSIONS', 'No Permissions');\n\n if (class_exists(Subsite::class)) {\n Subsite::disable_subsite_filter(false);\n }\n return $result;\n }", "public function getObjectPermissions(): array;", "public function getRequiredPermissions()\r\n\t{\r\n\t\treturn array();\r\n\t}", "public function getAllPermissions()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getAllPermissions() : array();\r\n }", "public function hasPermission(array $permissions);", "public function getRequiredPermissions()\n\t{\n\t\treturn array();\n\t}", "public function hasPermission(int $permission, int $permissions): bool;", "public function count()\n {\n return count($this->permissions);\n }", "public function allowedPermissions()\n {\n return $this->permissions()->wherePivot('has_access', true)->orderBy('name');\n }", "public function isPermissionsEmpty()\n {\n if (! $role = auth()->guard('user')->user()->role) {\n abort(401, 'This action is unauthorized.');\n }\n\n if ($role->permission_type === 'all') {\n return false;\n }\n\n if ($role->permission_type !== 'all' && empty($role->permissions)) {\n return true;\n }\n\n $this->checkIfAuthorized();\n\n return false;\n }", "public function permissions() : ?array\n {\n if ($apiRoot = $this->request('GET', $this->identity->getUrl('/')))\n {\n $payload = $apiRoot->getPayload();\n\n if (isset($payload['permissions']) && is_array($payload['permissions']))\n {\n return $payload['permissions'];\n }\n }\n\n return null;\n }", "private function getPermissionsPermissions()\n {\n return [\n [\n 'name' => 'Permissions - List all permissions',\n 'description' => 'Allow to list all permissions.',\n 'slug' => PermissionsPolicy::PERMISSION_LIST,\n ],\n [\n 'name' => 'Permissions - View a permission',\n 'description' => 'Allow to view the permission\\'s details.',\n 'slug' => PermissionsPolicy::PERMISSION_SHOW,\n ],\n [\n 'name' => 'Permissions - Update a permission',\n 'description' => 'Allow to update a permission.',\n 'slug' => PermissionsPolicy::PERMISSION_UPDATE,\n ],\n ];\n }", "public function getPermissions()\n\t{\n\t\tif(isset($this->permissions))\n\t\t{\n\t\t\treturn $this->permissions;\n\t\t}\n\n\t\t$request = new ColoCrossing_Http_Request('/', 'GET');\n\t\t$executor = $this->getHttpExecutor();\n\t\t$response = $executor->executeRequest($request);\n\t\t$content = $response->getContent();\n\n\t\treturn $this->permissions = isset($content) && isset($content['permissions']) ? $content['permissions'] : array();\n\t}", "public function permissions()\n {\n return $this->permissionModel->findAll();\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Add a new Vetting Step?\n $p['add'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing Vetting Step?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Vetting Step?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing Vetting Steps?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Vetting Step's order?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX\n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Vetting Step?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }" ]
[ "0.723515", "0.7118613", "0.6985475", "0.6947495", "0.6905761", "0.6901681", "0.6901681", "0.68762946", "0.6749651", "0.67174363", "0.6697164", "0.66802335", "0.66757697", "0.66757697", "0.66757697", "0.66388017", "0.6630216", "0.6627044", "0.66139126", "0.660092", "0.65772015", "0.65761304", "0.65566134", "0.65566134", "0.65566134", "0.65566134", "0.65566134", "0.6528076", "0.65243036", "0.65059644", "0.65029085", "0.6499424", "0.6491762", "0.6478134", "0.6450731", "0.64426124", "0.6441014", "0.6438519", "0.64320946", "0.64230657", "0.641276", "0.64015913", "0.6400768", "0.6394922", "0.63831115", "0.6381128", "0.6373839", "0.6365358", "0.6349865", "0.63475204", "0.6344451", "0.63359827", "0.6330474", "0.6312128", "0.6311891", "0.63058937", "0.6299633", "0.6298974", "0.6293292", "0.6288253", "0.6279683", "0.62742114", "0.62701356", "0.62653255", "0.6259664", "0.6258646", "0.6245243", "0.62231857", "0.62203777", "0.62014943", "0.6197921", "0.6196859", "0.6191219", "0.6175942", "0.6171733", "0.6169339", "0.6169339", "0.6168698", "0.6164962", "0.61594385", "0.61427104", "0.61427104", "0.61335844", "0.61333066", "0.61283374", "0.6124379", "0.6123774", "0.6117529", "0.6098652", "0.6091679", "0.608682", "0.60800755", "0.60703367", "0.6061895", "0.6060211", "0.6055608", "0.60541624", "0.6048362", "0.6046049", "0.60447294", "0.6043704" ]
0.0
-1
Stores information about whether permissions were generated yet.
public function set_download_permissions_granted( $order, $set ) { $order_id = WC_Order_Factory::get_order_id( $order ); update_post_meta( $order_id, '_download_permissions_granted', wc_bool_to_string( $set ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function SavePermissions()\n\t{\n\t\treturn true;\n\t}", "private function loadPermissions(): void\n {\n $permissions = Cache::get($this->cacheKey());\n\n $this->isPayor = $permissions['isPayor'];\n $this->isAgencyBankAccountSetup = $permissions['isAgencyBankAccountSetup'];\n $this->canViewDocumentation = $permissions['canViewDocumentation'];\n }", "static function hasInitializedPermission()\n {\n $position = self::getPermissionPosition();\n\n return isset($position);\n }", "private function savePermissions(): void\n {\n $this->client->isPayor = $this->isPayor;\n $this->client->isAgencyBankAccountSetup = $this->isAgencyBankAccountSetup;\n $this->client->canViewDocumentation = $this->canViewDocumentation;\n }", "private function cachePermissions(): void\n {\n Cache::put($this->cacheKey(), [\n 'isPayor' => $this->isPayor,\n 'isAgencyBankAccountSetup' => $this->isAgencyBankAccountSetup,\n 'canViewDocumentation' => $this->canViewDocumentation,\n ]);\n }", "protected function isPermissionCorrect() {}", "public static function uses_permissions(): bool;", "public function beforeSave()\n {\n if (!$this->checkPermissions()) {\n return $this->modx->lexicon('access_denied');\n }\n return true;\n }", "public function beforeSave()\n {\n if (!$this->checkPermissions()) {\n return $this->modx->lexicon('access_denied');\n }\n\n return true;\n }", "public function beforeSave()\n {\n if (!$this->checkPermissions()) {\n return $this->modx->lexicon('access_denied');\n }\n\n return true;\n }", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function setPermissions() {\r\n\t\tif ($this->canSave) {\r\n\t\t\t$this->canSave = $this->resource->checkPolicy('save');\r\n\t\t}\r\n\t\t$this->canEdit = $this->modx->hasPermission('edit_document');\r\n\t\t$this->canCreate = $this->modx->hasPermission('new_document');\r\n\t\t$this->canPublish = $this->modx->hasPermission('publish_document');\r\n\t\t$this->canDelete = ($this->modx->hasPermission('delete_document') && $this->resource->checkPolicy(array('save' => true, 'delete' => true)));\r\n\t\t$this->canDuplicate = $this->resource->checkPolicy('save');\r\n\t}", "public function hasPermissions()\n {\n return ! empty($this->permissions);\n }", "public function beforeSave() {\n\t\tif (!$this->checkPermissions()) {\n\t\t\treturn $this->modx->lexicon('access_denied');\n\t\t}\n\n\t\treturn true;\n\t}", "public function hasPermissions()\n {\n return $this->permissions !== null;\n }", "function permissions() {\r\n\t\treturn false;\r\n\t}", "public function permissions()\n\t{\n\t\t// add any additional custom permission checking here and \n\t\t// return FALSE if user doesn't have permission\n\t\n\t\treturn TRUE;\n\t}", "public function validPermissions()\n {\n if (!ConfigHelper::cacheEnabled()) {\n return $this->getCurrentUserPermissions();\n }\n\n $cacheKey = 'laravelroles_permissions_' . Users::userModelCacheKey() . '_' . $this->getKey();\n\n return Cache::remember($cacheKey, ConfigHelper::cacheExpiryTime(), function () {\n return $this->getCurrentUserPermissions();\n });\n }", "protected function check_permission()\n {\n return true;\n }", "public function canWrite() {\n\t\tif (empty($_SESSION['tokens']['fb'])) return false;\n\t\tif (empty($_SESSION['user']['fb']['permissions'])) return false;\n\t\treturn in_array('publish_actions', $_SESSION['user']['fb']['permissions']);\n\t}", "private function loadPermissions() {\n\tif ($this->permissionsloaded) {return;}\n\t//$mem = DStructMemCache::getInstance();\n\t//if (!$this->permissions = $mem->get(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()))) {\n\t\t$this->permissions = $this->activecontainer->permissions();\n\t//\t$mem->set(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()), $this->permissions);\n\t//}\n\t$this->permissionsloaded = true;\n}", "static function getPermissions() {\n if(self::$permissions === false) {\n self::$permissions = new NamedList(array(\n\n ));\n\n EventsManager::trigger('on_system_permissions', array(&self::$permissions));\n } // if\n\n return self::$permissions;\n }", "protected function getCurrentPermission() {}", "public function syncPermissions(): void {\n\t\t$FinalPermissions = discover_permissions( false );\n\t\t$RolesExists = Permission::query()->whereIn( 'name', $FinalPermissions )->get();\n\t\tif ( $RolesExists->count() > 0 ) {\n\t\t\t$FinalPermissionsCollection = collect( $FinalPermissions )->filter( static function ( $item ) use ( $RolesExists ) {\n\t\t\t\treturn ! $RolesExists->contains( 'name', '=', $item );\n\t\t\t} );\n\t\t\t$CreateRoles = [];\n\t\t\tforeach ( $FinalPermissionsCollection as $finalPermission ) {\n\t\t\t\t$CreateRoles[] = [\n\t\t\t\t\t'name' => $finalPermission,\n\t\t\t\t\t'guard_name' => 'admin',\n\t\t\t\t\t'updated_at' => Carbon::now(),\n\t\t\t\t\t'created_at' => Carbon::now(),\n\t\t\t\t];\n\t\t\t}\n\t\t\tif ( ! empty( $CreateRoles ) ) {\n\t\t\t\tPermission::query()->insert( $CreateRoles );\n\t\t\t}\n\t\t} else {\n\t\t\t$CreateRoles = [];\n\t\t\tforeach ( $FinalPermissions as $finalPermission ) {\n\t\t\t\t$CreateRoles[] = [\n\t\t\t\t\t'name' => $finalPermission,\n\t\t\t\t\t'guard_name' => 'admin',\n\t\t\t\t\t'updated_at' => Carbon::now(),\n\t\t\t\t\t'created_at' => Carbon::now(),\n\t\t\t\t];\n\t\t\t}\n\t\t\tPermission::query()->insert( $CreateRoles );\n\t\t}\n\t}", "public function cachePermissions()\n\t{\n\t\t$this->userPermissions = $this->userPermissions()->get(); // refresh directly applied permissions\n\t\t$this->roles = $this->roles()->get(); // refresh roles\n\n\t\t$this->permissions = []; // clear permissions array in case it has already been populated\n\n\t\t$permissions = $this->getPermissions(true); // get permissions array and ignore currently cached permissions set\n\n\t\tif (!empty($permissions))\n\t\t\t$permissions = array_values($permissions);\n\t\telse\n\t\t\t$permissions = null;\n\n\t\t$data = ['permissions' => $permissions];\n\n\t\tif ($this->cachedPermissionsRecord)\n\t\t\t$this->cachedPermissionsRecord->update($data);\n\t\telse\n\t\t\t$this->cachedPermissionsRecord()->save(new CachedPermissionsRecord)->update($data);\n\t}", "public function doesCheckModifyAccessListHookGetsCalled() {}", "protected function addPermission(): bool\n {\n $retorno = true;\n\n $data = $this->getQueryBuilder()\n ->select('DISTINCT fk_funcionario')\n ->from('acceso')\n ->where('estado=1')\n ->andWhere('tipo_relacion=:tipo_relacion')\n ->andWhere('id_relacion=:id_relacion')\n ->andWhere('fk_funcionario<>:fk_funcionario')\n ->setParameters([\n ':tipo_relacion' => Acceso::TIPO_SERIE_DEPENDENCIA,\n ':id_relacion' => $this->fk_serie_dependencia,\n ':fk_funcionario' => $this->fk_responsable\n ], [\n ':tipo_relacion' => Type::INTEGER,\n ':id_relacion' => Type::INTEGER,\n ':fk_funcionario' => Type::INTEGER,\n ])\n ->execute()->fetchAll();\n\n if ($data) {\n foreach ($data as $row) {\n if (!ExpedientePermiso::newRecord([\n 'fk_funcionario' => $row['fk_funcionario'],\n 'fk_expediente' => $this->getPK(),\n 'resposable' => 0\n ])) {\n $retorno = false;\n break;\n }\n }\n }\n\n return $retorno;\n }", "public function hasUsageRights() {}", "public function permissionInUse(string $permission): bool;", "public function hasAccess() {\n return $this->_has(16);\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new Data Scrubber Filter Attribute?\n $p['add'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Delete an existing Data Scrubber Filter Attribute?\n $p['delete'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['edit'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // View all existing Data Scrubber Filter Attribute?\n $p['index'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX \n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Data Scrubber Filter Attribute?\n $p['view'] = $roles['cmadmin'] || $roles['coadmin'];\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }", "function set_can_create_user ($permission)\r\n {\r\n $_SESSION[\"can_create_user\"] = $permission;\r\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(\n Templates::ADMIN_RESOURCE_SAVE\n );\n }", "function check_permission()\n\t{\n\t\t$CFG = $this->config->item('permission_modify_configure');\n\t\tif( ! addPermission( $CFG[\"sector\"][\"add\"] ) )\n\t\t{\n\t\t\t$this->form_validation->set_message('check_permission', _e('access denied'));\n\t\t\treturn false;\t\t\t\t\n\t\t}\n\t}", "protected function _initPermissions () {\r\n\r\n\t\t$bFreshData = false;\r\n\r\n\t\tif (self::$_bUseCache) {\r\n\t\t\t$oCacheManager = Kwgl_Cache::getManager();\r\n\t\t\t$oAclCache = $oCacheManager->getCache('acl');\r\n\r\n\t\t\tif (($aPermissionListing = $oAclCache->load(self::CACHE_IDENTIFIER_PERMISSIONS)) === false) {\r\n\t\t\t\t// Not Cached or Expired\r\n\r\n\t\t\t\t$bFreshData = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$bFreshData = true;\r\n\t\t}\r\n\r\n\t\tif ($bFreshData) {\r\n\t\t\t// Get Privileges from the Database\r\n\t\t\t$oDaoRoleResourcePrivilege = Kwgl_Db_Table::factory('System_Role_Resource_Privilege');\r\n\t\t\t//$aPermissionListing = $oDaoRoleResource->fetchAll();\r\n\t\t\t$aPermissionListing = $oDaoRoleResourcePrivilege->getPermissions();\r\n\r\n\t\t\tif (self::$_bUseCache) {\r\n\t\t\t\t$oAclCache->save($aPermissionListing, self::CACHE_IDENTIFIER_PERMISSIONS);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tforeach ($aPermissionListing as $aPermissionDetail) {\r\n\t\t\t$sRoleName = $aPermissionDetail['role_name'];\r\n\t\t\t$sResourceName = $aPermissionDetail['resource_name'];\r\n\t\t\t$sPrivilegeName = null;\r\n\t\t\tif (!is_null($aPermissionDetail['privilege_name'])) {\r\n\t\t\t\t$sPrivilegeName = $aPermissionDetail['privilege_name'];\r\n\t\t\t}\r\n\t\t\t$sPermissionType = $aPermissionDetail['permission'];\r\n\r\n\t\t\t// Check the Permission to see if you should allow or deny the Resource/Privilege to the Role\r\n\t\t\tswitch ($sPermissionType) {\r\n\t\t\t\tcase self::PERMISSION_TYPE_ALLOW:\r\n\t\t\t\t\t$this->allow($sRoleName, $sResourceName, $sPrivilegeName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase self::PERMISSION_TYPE_DENY:\r\n\t\t\t\t\t$this->deny($sRoleName, $sResourceName, $sPrivilegeName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Add a new Match Server Attribute?\n $p['add'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing Match Server Attribute?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Match Server Attribute?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n\n // View all existing Match Server Attributes?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Match Server Attribute?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n\n $this->set('permissions', $p);\n return $p[$this->action];\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Accept an OAuth callback?\n $p['callback'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing SalesforceSource?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing SalesforceSource?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing SalesforceSources?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View API limits?\n $p['limits'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing SalesforceSource?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }", "function set_can_create_list ($permission)\r\n {\r\n $_SESSION[\"can_create_list\"] = $permission;\r\n }", "public static function synchronizelPermission(): bool\n {\n if (self::allPermission()) {\n return true;\n } else {\n return false;\n }\n }", "public function save()\n\t{\n\t\tparent::save();\n\t\t\n\t\tif ( $this instanceof \\IPS\\Node\\Permissions and $this->_permissions !== NULL and $this->_permissions != $this->_originalPermissions )\n\t\t{\n\t\t\tif ( !isset( $this->_permissions['perm_id'] ) )\n\t\t\t{\n\t\t\t\tforeach ( array( 'app' => static::$permApp, 'perm_type' => static::$permType, 'perm_type_id' => $this->_id ) as $k => $v )\n\t\t\t\t{\n\t\t\t\t\tif ( !isset( $this->_permissions[ $k ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_permissions[ $k ] = $v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\\IPS\\Db::i()->replace( 'core_permission_index', $this->_permissions );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\\IPS\\Db::i()->update( 'core_permission_index', $this->_permissions, array( 'perm_id=?', $this->_permissions['perm_id'] ) );\n\t\t\t}\n\t\t}\n\t}", "private function savePermissions()\n {\n $permissionString = \"\";\n foreach ($this->permissions as $permission => $status) {\n if ($status) {\n $permissionString .= $permission . \",\";\n }\n }\n\n if ($this->entityType === \"user\") {\n $this->permissionDb->updatePermissionsForUser($this->entity->getId(), $permissionString);\n } elseif ($this->entityType == \"rank\") {\n $this->permissionDb->updatePermissionsForRank($this->entity->getId(), $permissionString);\n } elseif ($this->entityType == \"apiKey\") {\n $this->permissionDb->updatePermissionsForApiKey($this->entity->getId(), $permissionString);\n } else {\n throw new Exception\\Exception(\"Invalid entityType '$this->entityType'\");\n }\n }", "function hasWriteAccess() {\r\n\t\treturn (\r\n\t\t\t\t$this->annonce->associationID == $this->extendedProfile->userID ||\r\n\t\t\t\t$this->extendedProfile instanceof ProfileNiceBenevolat);\r\n\t}", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function userHasCreatePermission(){\n//\t\tif(\\GO\\Base\\Model\\Acl::hasPermission($this->getPermissionLevel(),\\GO\\Base\\Model\\Acl::CREATE_PERMISSION)){\n//\t\t\treturn true;\n//\t\t}else \n\t\tif(\\GO::modules()->isInstalled('freebusypermissions')){\n\t\t\treturn \\GO\\Freebusypermissions\\FreebusypermissionsModule::hasFreebusyAccess(\\GO::user()->id, $this->user_id);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function registerPermissions()\n {\n return [];\n }", "public function registerPermissions()\n {\n return [];\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Pronko_TaskManagement::TaskManagement_save');\n }", "public function checkPermissions();", "public function doesCheckModifyAccessListHookModifyAccessAllowed() {}", "public function hasAccess(){\n \treturn $this->hasAccess;\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Add a new Vetting Step?\n $p['add'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing Vetting Step?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Vetting Step?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing Vetting Steps?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Vetting Step's order?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX\n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Vetting Step?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }", "public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function canManagePermissions()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn ( static::$permApp !== NULL and static::$permType !== NULL and static::restrictionCheck( 'permissions' ) );\n\t}", "private function fetchPermissions(): void\n {\n try {\n $clientPermissions = (new HomeCareApi)->permissions($this->client->agencyId, $this->client->patientContactId, $this->client->id);\n\n $this->isPayor = $clientPermissions->isPayor ?? false;\n $this->isAgencyBankAccountSetup = $clientPermissions->isAgencyBankAccountSetup ?? false;\n $this->canViewDocumentation = $clientPermissions->familyViewDocumentationAccess ?? false;\n\n } catch (Exception $e) {\n $this->isPayor = false;\n $this->isAgencyBankAccountSetup = false;\n $this->canViewDocumentation = false;\n\n Log::channel('teams')->error($e->getMessage());\n Log::channel('teams')->info('Can not obtain client permissions, invoicing disabled');\n }\n }", "function custom_permissions() {\n\t\tif ($this->dx_auth->is_logged_in()) {\n\t\t\techo 'My role: '.$this->dx_auth->get_role_name().'<br/>';\n\t\t\techo 'My permission: <br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth->get_permission_value('edit')) {\n\t\t\t\techo 'Edit is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Edit is not allowed';\n\t\t\t}\n\t\t\t\n\t\t\techo '<br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('delete') != NULL AND $this->dx_auth->get_permission_value('delete')) {\n\t\t\t\techo 'Delete is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Delete is not allowed';\n\t\t\t}\n\t\t}\n\t}", "function hook_permission_check($data) {\n\t\treturn false;\n\t}", "public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin) {\n\t\t\treturn;\n\t\t}\n\n\t\t// TODO\n\t}", "public function hasAccess(): bool;", "public function testUpdatePermissionSet()\n {\n }", "public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }", "protected function buildSetterPermission() {\n }", "protected function _hasModPermission(){\n global $auth;\n return $auth->acl_get('m_inttree');\n }", "private function setUser() {\n if (Request::has(\"include-user-read\") && Request::input(\"include-user-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-user-write\") && Request::input(\"include-user-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-user-execute\") && Request::input(\"include-user-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }", "public function has($name) {\n\t\t\n\t\tif($name == 'page-add' || $name == 'page-create') return true; // runtime only permissions\n\t\t\n\t\tif(empty($this->permissionNames)) {\n\n\t\t\t$cache = $this->wire('cache');\n\t\t\t$names = $cache->get(self::cacheName);\n\n\t\t\tif(empty($names)) {\n\t\t\t\t$names = array();\n\t\t\t\tforeach($this as $permission) {\n\t\t\t\t\t$names[$permission->name] = $permission->id;\n\t\t\t\t}\n\t\t\t\t$cache->save(self::cacheName, $names, WireCache::expireNever);\n\t\t\t}\n\n\t\t\t$this->permissionNames = $names;\n\t\t}\n\t\t\t\n\t\treturn isset($this->permissionNames[$name]);\n\t}", "public function can_write () {\r\n\r\n return $this->permissions[\"W\"] ? true : false;\r\n\r\n }", "function check_permission()\n\t{\n\t\t$CFG = $this->config->item('language_configure');\n\t\tif( ! addPermission( $CFG[\"sector\"][\"add\"] ) )\n\t\t{\n\t\t\t$this->form_validation->set_message('check_permission', _e('access denied'));\n\t\t\treturn false;\t\t\t\t\n\t\t}\n\t}", "public function permissions()\n {\n return $this->permissions;\n }", "public function & GetPermissions ();", "public function restore_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function cachedPermissions()\n {\n return Cache::remember(\n $this->getCachePrefix(),\n config('permissionsHandler.cacheExpiration'),\n function () {\n return $this->permissions;\n }\n );\n }", "public function getPermissions() {}", "public function getPermissions() {}", "public function checkPermissions() {\r\n\t\treturn $this->modx->hasPermission('edit_document');\r\n\t}", "public static function permissions(): array\n {\n return [];\n }", "protected function getPermission(){\n if(Session::getKey(\"loggedIn\")):\n $userPermissions = array();\n $userPermission = Session::getKey(\"level\");\n if($userPermission[0]) { // tiene permiso para crear\n $userPermissions[] = \"create\";\n }\n if($userPermission[1]) { // tiene permiso para crear\n $userPermissions[] = \"read\";\n }\n if($userPermission[2]) { // tiene permiso para crear\n $userPermissions[] = \"update\";\n }\n if($userPermission[3]) { // tiene permiso para crear\n $userPermissions[] = \"delete\";\n }\n return $userPermissions; \n else:\n return false;\n endif;\n }", "private static function allPermission()\n {\n $status = false;\n self::$ignore_classes = explode(\",\", config('spatie-permission-generate.ignore_classes_files') ?? '');\n self::$ignore_methods_and_functions = explode(\",\", config('spatie-permission-generate.ignore_methods_and_functions') ?? '');\n self::$controller_classes_suffixes = explode(\",\", config('spatie-permission-generate.controller_classes_suffixes') ?? 'Controller');\n self::$default_guard = config('spatie-permission-generate.default_guard');\n\n foreach (self::classList() as $class_item) {\n\n $path = base_path(config('spatie-permission-generate.controllers_root_path'));\n $path = explode('/', $path);\n $path = $path[count($path) - 1];\n\n\n $class = explode($path . '\\\\', $class_item);\n $class = $class[count($class) - 1];\n if (\n !in_array($class, self::$ignore_classes ?? [])\n ) {\n\n $methods = self::get_this_class_methods($class_item);\n foreach ($methods as $method_name) {\n if (\n !in_array($method_name, self::$ignore_methods_and_functions) &&\n substr($method_name, 0, 3) != \"___\" // Para egnorar methods que iniciam cm ___\n ) {\n $class_name = '';\n foreach (self::$controller_classes_suffixes as $suffix) {\n $class_name = str_replace($suffix, '', $class);\n }\n\n $permission_name = strtolower(str_replace('\\\\', '-', $class_name . '-' . $method_name));\n if (!Permission::where('name', $permission_name)->first()) {\n $permission = Permission::create([\n 'name' => $permission_name,\n 'guard_name' => self::$default_guard,\n ]);\n if ($permission) {\n $status = true;\n }\n }\n }\n }\n }\n }\n\n\n return $status;\n }", "public static function isAllowedWrite(): bool\n {\n if (!isset(self::$definition)) {\n self::$definition = Splash::object(\"Order\")->description();\n }\n if (is_array(self::$definition) && !empty(self::$definition[\"allow_push_updated\"])) {\n return true;\n }\n\n return false;\n }", "public function create()\n\t{\n\t\t//Permissions are created via code\n\t}", "public function run()\n {\n Permission::insert(config('permissions', true));\n }", "public function hasAccess($permission);", "function addPermissions(& $obj, & $permissionsElement, $type, $permissionsArray) {\n\t\t$hasPerms = FALSE;\n\t\t$element =& $this->_document->createElement($type.'_permission');\n\t\t\n\t\tforeach ($permissionsArray as $editorName => $array) {\n\t\t\t\n\t\t\t// if they have permission here, create an entry for them.\n\t\t\tif ($this->hasPermission($permissionsArray, $editorName, $type) && !$obj->getField(\"l%$editorName%\".$type)) {\n\t\t\t\t$agent =& $this->_document->createElement('agent');\n\t\t\t\t$agent->appendChild($this->_document->createTextNode($editorName));\n\t\t\t\t$element->appendChild($agent);\n\t\t\t\t$hasPerms = TRUE;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($hasPerms)\n\t\t\t$permissionsElement->appendChild($element);\n\t\t\n\t\treturn $hasPerms;\n\t}", "function hasPermission($perm)\n {\n switch ($perm) {\n case Horde_Perms::EDIT: return false;\n case Horde_Perms::DELETE: return false;\n default: return true;\n }\n }", "function set_is_admin ($permission)\r\n {\r\n $_SESSION[\"is_admin\"] = $permission;\r\n }", "public function _isAllowed()\n {\n return $this->_authorization->isAllowed('Aitoc_OrdersExportImport::save');\n }", "public function permissions() {\n\t$this->loadPermissions();\n\treturn $this->permissions;\n}", "public function getDirectoryPermissionStatus()\n {\n $ok = true;\n try {\n $mageFile = new Varien_Io_File();\n $mageFile->checkAndCreateFolder(Mage::getBaseDir(Emv_Core_Helper_Data::BASE_CONTAINER));\n $mageFile->checkAndCreateFolder(\n Mage::getBaseDir(Emv_Core_Helper_Data::BASE_CONTAINER)\n . DS . Emv_Core_Helper_Data::BASE_WORKING_DIR\n );\n } catch (Exception $e) {\n $ok = false;\n }\n\n $message = '';\n if ($ok) {\n $image = $this->_getTickImageLink();\n $message = Mage::helper('emvcore')->__(\n '<span class=\"icon-status\">%s</span> Write permission is correctly set to <strong>%s</strong>.',\n $image,\n Mage::getBaseDir(Emv_Core_Helper_Data::BASE_CONTAINER)\n );\n } else {\n $image = $this->_getUnTickImageLink();\n $message = Mage::helper('emvcore')->__(\n '<span class=\"icon-status\">%s</span> Write permission is not correctly set to <strong>%s</strong>.',\n $image,\n Mage::getBaseDir(Emv_Core_Helper_Data::BASE_CONTAINER)\n );\n }\n return $message;\n }", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "function check_permission()\r\n {\r\n // Ensure the user logs in\r\n require_login($this->course->id);\r\n if (isguestuser()) error(get_string('noguestaccess', 'sloodle'));\r\n add_to_log($this->course->id, 'course', 'view sloodle data', '', \"{$this->course->id}\");\r\n\r\n // Ensure the user is allowed to update information on this course\r\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\r\n require_capability('moodle/course:update', $this->course_context);\r\n }", "public function authorize()\n {\n return $this->permissionGuard()->allowsCreate($this->newModelInstance());\n }", "public function cachedPermissions()\n {\n $rolePrimaryKey = $this->primaryKey;\n $cacheKey = 'guardian_permissions_for_role_' . $this->$rolePrimaryKey;\n if (Cache::getStore() instanceof TaggableStore) {\n return Cache::tags(Config::get('guardian.permission_role_table'))->remember($cacheKey, Config::get('cache.ttl', 60), function () {\n return $this->perms()->get();\n });\n } else {\n return $this->perms()->get();\n }\n }" ]
[ "0.6599483", "0.65391207", "0.65337753", "0.65207773", "0.64220166", "0.6342716", "0.6252472", "0.6203349", "0.619755", "0.619755", "0.617585", "0.617585", "0.617585", "0.617585", "0.617585", "0.61547047", "0.614374", "0.6138273", "0.60604817", "0.60340583", "0.601619", "0.601188", "0.59919673", "0.5940859", "0.5930516", "0.58795685", "0.587307", "0.58658695", "0.58616257", "0.585648", "0.5850892", "0.5843559", "0.5842023", "0.5832358", "0.58317435", "0.58206314", "0.5820279", "0.5814886", "0.58098006", "0.58023095", "0.5785788", "0.5778176", "0.5775029", "0.57743603", "0.5770711", "0.57615066", "0.5760978", "0.5758137", "0.5755121", "0.5755121", "0.5754675", "0.57458776", "0.5743094", "0.57414085", "0.5735202", "0.5732124", "0.5709285", "0.5676052", "0.56661826", "0.56656253", "0.56615895", "0.5658186", "0.56522465", "0.56379557", "0.5627725", "0.5609585", "0.5609448", "0.56062", "0.55906266", "0.5582962", "0.5573785", "0.55722696", "0.55690396", "0.5560162", "0.5556211", "0.5556211", "0.5556045", "0.55492353", "0.5533178", "0.5513904", "0.5511144", "0.5508517", "0.5495498", "0.5492038", "0.54912394", "0.5488863", "0.54787093", "0.5472572", "0.54723006", "0.5463695", "0.5457633", "0.5457633", "0.5457633", "0.5457582", "0.5457582", "0.545723", "0.545723", "0.545723", "0.545133", "0.5450994", "0.5445726" ]
0.0
-1
Gets information about whether sales were recorded.
public function get_recorded_sales( $order ) { $order_id = WC_Order_Factory::get_order_id( $order ); return wc_string_to_bool( get_post_meta( $order_id, '_recorded_sales', true ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIsSale()\n {\n return $this->get(self::_IS_SALE);\n }", "protected function _usedInSales()\n {\n $rowset = $this->findDependentRowset('\\Ppb\\Db\\Table\\Sales');\n if (count($rowset) > 0) {\n return true;\n }\n\n return false;\n }", "public function getSalesDatafields()\n {\n return array_filter($this->contactDatafields, function ($array) {\n return isset($array['context']) && $array['context'] === 'sales';\n });\n }", "public function is_on_sale() {\n\t\t\n\t\t$time = current_time('timestamp');\n\n\t\t// Check if the sale is still in range (if we have a range)\n\t\tif ( ! empty( $this->sale_price_dates_from ) && ! empty( $this->sale_price_dates_to ) ) {\n\t\t\tif ( $this->sale_price_dates_from\t<= $time &&\n\t\t\t\t $this->sale_price_dates_to\t\t>= $time &&\n\t\t\t\t $this->sale_price) {\n\t\t\t\t \n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t// Otherwise if we have a sale price\n\t\tif ( empty( $this->sale_price_dates_to ) && $this->sale_price ) return true;\n\n\t\t// Just incase return false\n\t\treturn false;\n\t}", "public function getRevenueEnabled()\n {\n return $this->helper->trackRevenue();\n }", "public function issetDocumentTotals(): bool\n {\n return isset($this->documentTotals);\n }", "public function hasIsForSale()\n {\n return $this->is_for_sale !== null;\n }", "public function hasSoldCount(){\n return $this->_has(10);\n }", "public function getReportingEnabled()\n {\n return $this->reporting_enabled;\n }", "public function isSaleable()\n {\n $saleable = 0;\n if ($this->getSelections()) {\n foreach ($this->getSelections() as $selection) {\n if ($selection->isSaleable()) {\n $saleable++;\n }\n }\n return (bool)$saleable;\n }\n else {\n return false;\n }\n }", "public function getSold()\n {\n return $this->sold;\n }", "public function isHasRecord(): bool;", "public function hasRecord();", "public function getHasDetailsToBookProperty(){\n return $this->state['service'] && $this->state['employee'] && $this->state['time'];\n \n }", "public function hasSummaries() {\n return $this->_has(1);\n }", "public function hasSummaries() {\n return $this->_has(1);\n }", "public function hasSummaries() {\n return $this->_has(1);\n }", "public function getDetailedReportName()\n\t{\n\t\treturn \"Outstanding Sales\";\n\t}", "public function hasRecord() {}", "public function set_recorded_sales( $order, $set ) {\n\t\t$order_id = WC_Order_Factory::get_order_id( $order );\n\n\t\tupdate_post_meta( $order_id, '_recorded_sales', wc_bool_to_string( $set ) );\n\t}", "public function hasRecordsToExport()\n\t{\n\t\t$record_collection = $this->getUnexportedRecords();\n\t\tif (count($record_collection)) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function isHistorical()\n {\n return $this->isHistorical;\n }", "public function isAnalyticsEnabled()\n {\n return $this->boolValue('trace.analytics.enabled', false);\n }", "function is_ordersaleshistory($ordn, $debug = false) {\n\t\t$q = (new QueryBuilder())->table('saleshist');\n\t\t$q->field('COUNT(*)');\n\t\t$q->where('orderno', $ordn);\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\treturn $sql->fetchColumn();\n\t\t}\n\t}", "public function hasStore(): bool;", "public function getRentalTransactionEvents()\n {\n if (isset($this->list['RentalTransaction'])) {\n return $this->list['RentalTransaction'];\n } else {\n return false;\n }\n }", "public function IsForSale() {\n\treturn ($this->QtyInStock() > 0) || ($this->QtyAvailable() > 0);\n }", "public function getSalesItem()\n {\n return $this->salesItem;\n }", "public function getSales($period)\n{\n\tif($period == \"week\")\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM Purchases WHERE PurchasedTime > DATE_SUB(NOW(), INTERVAL 1 WEEK)\");\n\t}\n\telse if($period == \"month\")\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM Purchases WHERE PurchasedTime > DATE_SUB(NOW(), INTERVAL 1 MONTH)\");\n\t}\n\telse if($period == \"year\")\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM Purchases WHERE PurchasedTime > DATE_SUB(NOW(), INTERVAL 1 YEAR)\");\n\t}\n\telse\n\t{\t\n\t\t$query = $this->db->query(\"SELECT * FROM Purchases\");\n\t}\n\t\n\treturn $query->num_rows();\n}", "public function hasStudySummaries() {\n return $this->_has(13);\n }", "public function show(Sales $sales)\n {\n //\n }", "function getRecentSale($idSale){\n global $db;\n \n $stmt=$db->prepare(\"SELECT * FROM sales WHERE idSale = :idSale\");\n \n $binds = array(\n \":idSale\"=>$idSale\n );\n \n $results=[];\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n else{\n $results = false;\n }\n return $results;\n }", "public function hasIsResell(){\n return $this->_has(7);\n }", "protected function _isOnSale($product) {\r\n $from = strtotime ( $product->getData ( 'special_from_date' ) );\r\n $to = strtotime ( $product->getData ( 'special_to_date' ) );\r\n return $this->_checkDate ( $from, $to );\r\n }", "public function GetSales(GetSales $parameters)\n {\n return $this->__soapCall('GetSales', array($parameters));\n }", "public function isInvoiced() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->invoiceDate) ? false: true;\r\n\t}", "public function hasStudySummaries() {\n return $this->_has(18);\n }", "static public function GetGETSaveInSent() {\n if (isset(self::$saveInSent))\n return self::$saveInSent;\n else\n return true;\n }", "public function getStores()\n {\n return $this->hasData('stores')\n ? $this->getData('stores')\n : $this->getData('store_id');\n }", "public function is_onreview() {\n $order = SalesOrder::load($this->orderno);\n\t\t\treturn $order->is_onreview();\n }", "public function index()\n\t{\n\t\treturn $this->response(Sales::all());\n\t}", "public function existReturned(){\r\n $docs=ClientSDocs::where('projectclientservices_id',$this->id)->where('file_id',-1) ->get();\r\n if($docs!=null){\r\n foreach($docs as $doc)\r\n if($doc->signdate != \"\")\r\n return true;\r\n }\r\n return false;\r\n }", "public function hasSavemap(){\n return $this->_has(20);\n }", "public function isHasResults();", "public static function getMonthlySales()\n\t{\n\t\tTools::displayAsDeprecated();\n\t\t$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('\n\t\tSELECT SUM(`total_paid`) as nb\n\t\tFROM `'._DB_PREFIX_.'orders`\n\t\tWHERE MONTH(`date_add`) = MONTH(NOW())\n\t\tAND YEAR(`date_add`) = YEAR(NOW())');\n\n\t\treturn isset($result['nb']) ? $result['nb'] : 0;\n\t}", "public function getSalesProperty()\n {\n $min = $this->periodDates['min'];\n $max = $this->periodDates['max'];\n $format = 'Y-m-d H:i:s';\n $result = [];\n $data = [];\n\n if ($this->periodCategory === 'all') {\n $data = DB::connection('carmu')\n ->table('sale')\n ->where('sale_date', '>=', $min->format($format))\n ->where('sale_date', '<=', $max->format($format))\n ->orderBy('sale_id')\n ->orderBy('sale_date')\n ->get();\n } else {\n $data = DB::connection('carmu')\n ->table('sale as t1')\n ->join('sale_has_category as t2', 't1.sale_id', '=', 't2.sale_id')\n ->where('t2.category_id', $this->periodCategory)\n ->where('sale_date', '>=', $min->format($format))\n ->where('sale_date', '<=', $max->format($format))\n ->select('t1.*')\n ->get();\n }\n\n foreach ($data as $sale) {\n $result[] = [\n 'id' => $sale->sale_id,\n 'date' => Carbon::createFromFormat('Y-m-d H:i:s', $sale->sale_date)->format('d-m-Y'),\n 'description' => $sale->description,\n 'amount' => floatval($sale->amount)\n ];\n }\n\n return $result;\n }", "public function isReported()\n\t{\n\t\tif ($this->get('reports', -1) > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t// Reports hasn't been set\n\t\tif ($this->get('reports', -1) == -1)\n\t\t{\n\t\t\tif (is_file(Component::path('com_support') . DS . 'models' . DS . 'report.php'))\n\t\t\t{\n\t\t\t\tinclude_once Component::path('com_support') . DS . 'models' . DS . 'report.php';\n\n\t\t\t\t$val = \\Components\\Support\\Models\\Report::all()\n\t\t\t\t\t->whereEquals('referenceid', $this->get('id'))\n\t\t\t\t\t->whereEquals('category', 'pubreview')\n\t\t\t\t\t->total();\n\n\t\t\t\t$this->set('reports', $val);\n\n\t\t\t\tif ($this->get('reports') > 0)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function getRecordInformation() {}", "protected function _getItemsData()\n {\n $data = array();\n $status = $this->_getCount();\n if (isset($status['yes']) && $status['yes'] > 0) {\n $data[] = array(\n 'label' => Mage::helper('vs7_saleattribute')->__('Sale'),\n 'value' => 1,\n 'count' => isset($status['yes']) ? $status['yes'] : 0,\n );\n }\n\n return $data;\n }", "public function get_booked() {\n return $this->booked;\n }", "public function hasScoreRecordList(){\n return $this->_has(2);\n }", "public function getSalesrep()\n {\n return Mage::registry('fvets_salesrep');\n }", "public function Get_Invoice_Value_Details($sales){\n $sql = \"SELECT `sales_details`.*,\n `medicine`.*\n FROM `sales_details`\n LEFT JOIN `medicine` ON `sales_details`.`mid`=`medicine`.`product_id`\n WHERE `sales_details`.`sale_id`='$sales'\"; \n $query = $this->db->query($sql);\n $result = $query->result();\n return $result;\n\t}", "public function hasRecruitment() {\n return $this->_has(4);\n }", "public function getShipmentEvents()\n {\n if (isset($this->list['Shipment'])) {\n return $this->list['Shipment'];\n } else {\n return false;\n }\n }", "public function tabelsales()\n {\n return DB::table('tbl_sales')->get();\n }", "public function getSellingStatus()\n {\n return $this->sellingStatus;\n }", "public function getSaleStatisticsProperty()\n {\n $minSale = 0;\n $maxSale = 0;\n $total = 0;\n $first = true;\n\n foreach ($this->sales as $sale) {\n $amount = $sale['amount'];\n if ($first) {\n $minSale = $amount;\n $maxSale = $amount;\n $first = false;\n } else {\n $minSale = $minSale <= $amount ? $minSale : $amount;\n $maxSale = $maxSale >= $amount ? $maxSale : $amount;\n }\n $total += $amount;\n }\n\n return [\n 'min' => $minSale,\n 'max' => $maxSale,\n 'total' => $total\n ];\n }", "public function isReport()\n {\n return $this->getName() === 'report';\n }", "function has_staffs() {\n\treturn Registry::get('total_staffs', 0) > 0;\n}", "public function isRecording() {\r\n return $this->mockState instanceof RecordState;\r\n }", "public function isTrackingNrResponse()\n {\n return $this->_bIsTrackingResponse;\n }", "public function isSavable(): bool\n {\n return true;\n }", "public function getSalesTax()\r\n {\r\n return $this->sales_tax;\r\n }", "function fetch_daily_sales_report(){\n \t\t$this->db->select('products.PRODUCT, SUM(sales.QUANTITY_SOLD) SALES, products.COST_PRICE, products.SALES_PRICE, sales.SALES_DATE');\n \t\t$this->db->from('sales');\n \t\t$this->db->join('products', 'products.PRODUCT_ID=sales.PRODUCT_ID', 'left');\n \t\t$this->db->where('sales.SALES_DATE', date('Y-m-d'));\n \t\t$this->db->where('sales.STATUS','Confirmed');\n \t\t$this->db->group_by('sales.PRODUCT_ID');\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}", "public function getSsalesDetails($id) {\n\t\n $registry = Zend_Registry::getInstance();\n\t\t$DB = $registry['DB'];\n $sql = \"SELECT * FROM `tbl_sales_commission` as sc WHERE sc.`deleted` = 0 AND sc.sales_id_prime = $id \";\n \t\t$result = $DB->fetchAssoc($sql);\n\t\treturn $result;\n\t\t\n }", "public function getHasdocuments()\n {\n return $this->hasdocuments;\n }", "function sales_report($mode, $startDate = 0, $endDate = 0, $sort = 0, $statusFilter = 0, $filter = 0, $details, $ordersIn, $salesConsultant) {\n // if set then both have to be valid startDate and endDate\n $this->mode = $mode;\n $this->tax_include = DISPLAY_PRICE_WITH_TAX;\n\t $this->details = $details;\n\t $this->ordersIn = $ordersIn;\n\t $this->salesConsultant = $salesConsultant;\n\n //$this->statusFilter = $statusFilter;\n\t $this->statusFilter = \"\";\n\t if(!empty($statusFilter) || $statusFilter!=0) {\n\t \t$this->statusFilter = explode(\"_\",$statusFilter);\n\t }\n \n // get date of first sale\n $firstQuery = tep_db_query(\"select UNIX_TIMESTAMP(min(date_purchased)) as first FROM \" . TABLE_ORDERS);\n $first = tep_db_fetch_array($firstQuery);\n $this->globalStartDate = mktime(0, 0, 0, date(\"m\", $first['first']), date(\"d\", $first['first']), date(\"Y\", $first['first']));\n \n $statusQuery = tep_db_query(\"select * from orders_status\");\n $i = 0;\n while ($outResp = tep_db_fetch_array($statusQuery)) {\n $status[$i] = $outResp;\n $i++;\n }\n\t $this->status = $status;\n \n if ($startDate == 0 or $startDate < $this->globalStartDate) {\n // set startDate to globalStartDate\n $this->startDate = $this->globalStartDate;\n } else {\n $this->startDate = $startDate;\n }\n if ($this->startDate > mktime(0, 0, 0, date(\"m\"), date(\"d\"), date(\"Y\"))) {\n $this->startDate = mktime(0, 0, 0, date(\"m\"), date(\"d\"), date(\"Y\"));\n }\n\n if ($endDate > mktime(0, 0, 0, date(\"m\"), date(\"d\") + 1, date(\"Y\"))) {\n // set endDate to tomorrow\n $this->endDate = mktime(0, 0, 0, date(\"m\"), date(\"d\") + 1, date(\"Y\"));\n } else {\n $this->endDate = $endDate;\n }\n if ($this->endDate < $this->startDate + 24 * 60 * 60) {\n $this->endDate = $this->startDate + 24 * 60 * 60;\n }\n\n $this->actDate = $this->startDate;\n\t \n\t \n\t // query for order count\n\t $this->queryOrderCnt = \"SELECT count(o.orders_id) as order_cnt FROM \" . TABLE_ORDERS . \" o\";\n\t \n\t //this is to check sales consultant based report\t\t \n\t if($this->ordersIn == 1) {\n\t \t\t\n\t\t\t$this->queryItemCnt_2 = \"SELECT p.products_model, op.products_quantity, (op.final_price*op.products_quantity) as psum, o.date_purchased FROM \" . TABLE_ORDERS . \" o JOIN \" . TABLE_ORDERS_PRODUCTS . \" op ON o.orders_id = op.orders_id JOIN \".TABLE_PRODUCTS .\"p ON op.products_id = p.products_id \";\n\t\t\t\n\t\t\t$this->queryShipping = \"SELECT ot.value as shipping, o.date_purchased FROM orders o LEFT JOIN orders_total ot ON (ot.orders_id = o.orders_id AND ot.class='ot_shipping') \";\n\t\t\t$this->queryGstTotal = \"SELECT ot.value as gst_total FROM orders o LEFT JOIN orders_total ot ON (ot.orders_id = o.orders_id AND ot.class='ot_gst_total') \";\n\t\t\t$this->queryDiscountTotal = \"SELECT ot.value as discount_total FROM orders o LEFT JOIN orders_total ot ON (ot.orders_id = o.orders_id AND (ot.class = 'ot_customer_discount' OR ot.class='ot_gv')) \";\t\t\t\n\t\t\t$this->querySubtotal = \"SELECT ot.value as subtotal, o.date_purchased, o.last_modified FROM orders o LEFT JOIN orders_total ot ON (ot.orders_id = o.orders_id AND (ot.class = 'ot_grand_subtotal' OR ot.class='ot_subtotal')) \";\n\t\t\t$this->queryOrderProCostCnt = \"SELECT SUM(opc.labour_cost*opc.products_quantity) as pcl_cost, SUM(opc.overhead_cost*opc.products_quantity) as pco_cost, SUM(opc.material_cost*opc.products_quantity) as pcm_cost, count(distinct(o.orders_id)) FROM orders_products_costs opc LEFT JOIN orders o ON opc.orders_id = o.orders_id \";\n\t\t\t\n\t\t\t\n\t\t\t$this->queryItemCnt = \"SELECT pd.products_tax_class_id, pd.products_model, o.orders_id,o.customers_id, o.customers_name, o.customers_company, o.purchase_number, o.last_modified, \to.date_purchased, o.orders_status, o.order_assigned_to, a.entry_company_tax_id as customer_number, op.products_id as pid, op.orders_products_id, op.products_quantity, op.final_price, op.products_name as pname, sum(op.products_quantity) as pquant, sum(op.final_price * op.products_quantity) as psum, op.products_tax as ptax, count(distinct(o.orders_id)) FROM orders o JOIN orders_products op ON op.orders_id = o.orders_id LEFT JOIN products pd ON pd.products_id = op.products_id LEFT JOIN address_book a ON a.customers_id = o.customers_id \";\t\t\t\t\t\t\n\t\t\t$this->queryAttr = \"SELECT count(op.products_id) as attr_cnt, o.orders_id, opa.orders_products_id, opa.products_options, opa.products_options_values, opa.options_values_price, opa.price_prefix from orders_products_attributes opa LEFT JOIN orders o ON opa.orders_id = o.orders_id LEFT JOIN orders_products op ON op.orders_products_id = opa.orders_products_id \";\n\t\t\t\t\t\t\n\t\t\t$this->queryProCost_2 = \"select opc.*, o.date_purchased from orders_products_costs opc LEFT JOIN orders o ON opc.orders_id = o.orders_id \";\n\t\t\t$this->queryProCost = \"select pc.categories_id, opc.* from products_to_categories pc, orders_products_costs opc where pc.products_id=opc.products_id and opc.orders_id IN \";\t\t\t\t\t \n\t\t\t\n\t } else {\n\t \t\t\t \t\t\t\t \n\t\t\t // query for shipping\n\t\t\t $this->queryShipping = \"SELECT ot.value as shipping, o.date_purchased, o.customers_id FROM \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_TOTAL . \" ot WHERE ot.orders_id = o.orders_id AND ot.class = 'ot_shipping'\";\t\t\t \n\t\t\t // query for GST total\n\t\t\t $this->queryGstTotal = \"SELECT ot.value as gst_total FROM \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_TOTAL . \" ot WHERE ot.orders_id = o.orders_id AND ot.class = 'ot_gst_total'\";\n\t\t\t //query for discount\n\t\t\t $this->queryDiscountTotal = \"SELECT ot.value as discount_total FROM \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_TOTAL . \" ot WHERE ot.orders_id = o.orders_id AND (ot.class = 'ot_customer_discount' OR ot.class='ot_gv')\";\t\t\t \n\t\t\t //query for subtotal\n\t\t\t $this->querySubtotal = \"SELECT ot.value as subtotal, o.date_purchased, o.last_modified, o.customers_id, a.entry_zone_id FROM orders o, orders_total ot, address_book a WHERE ot.orders_id = o.orders_id AND (ot.class = 'ot_grand_subtotal' OR ot.class='ot_subtotal') AND o.customers_id = a.customers_id \";\n\t\t\t \n\t\t\t //products count query\t\t\t \n\t\t\t $this->queryOrderProCostCnt = \"SELECT (opc.labour_cost*opc.products_quantity) as pcl_cost, (opc.overhead_cost*opc.products_quantity) as pco_cost, (opc.material_cost*opc.products_quantity) as pcm_cost, o.date_purchased, o.customers_id FROM orders_products_costs opc, orders o WHERE opc.orders_id=o.orders_id \";\n\t\t\t \n\t\t\t \n\t\t\t $this->queryItemCnt_2 = \"SELECT p.products_model, op.products_quantity, (op.final_price*op.products_quantity) as psum, o.date_purchased FROM \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_PRODUCTS . \" op, \" . TABLE_PRODUCTS . \" p WHERE o.orders_id = op.orders_id AND op.products_id = p.products_id \";\n\t\t\t \n\t\t\t //Orders products query \n\t\t\t $this->queryItemCnt = \"SELECT pd.products_tax_class_id, pd.products_model, o.orders_id,o.customers_id, o.customers_name, o.customers_company, \n\t\t\t\t\t\t\t\t\t\to.purchase_number, o.last_modified, o.date_purchased, \n\t\t\t\t\t\t\t\t\t\to.orders_status, o.order_assigned_to, a.entry_company_tax_id as customer_number, op.products_id as pid, \n\t\t\t\t\t\t\t\t\t\top.orders_products_id, op.products_quantity, op.final_price, op.products_name as pname, sum(op.products_quantity) as pquant, \n\t\t\t\t\t\t\t\t\t\tsum(op.final_price * op.products_quantity) as psum, op.products_tax as ptax FROM \" . TABLE_ORDERS . \" o, \n\t\t\t\t\t\t\t\t\t\t\" . TABLE_ORDERS_PRODUCTS . \" op, \" . TABLE_ADDRESS_BOOK . \" a, \" . TABLE_PRODUCTS . \" pd \n\t\t\t\t\t\t\t\t\t\tWHERE o.orders_id = op.orders_id and o.customers_id = a.customers_id and op.products_id = pd.products_id\";\n\t\t\t // query for attributes\n\t\t\t $this->queryAttr = \"SELECT count(op.products_id) as attr_cnt, o.orders_id, opa.orders_products_id, opa.products_options, opa.products_options_values, opa.options_values_price, opa.price_prefix from \" . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . \" opa, \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_PRODUCTS . \" op WHERE o.orders_id = opa.orders_id AND op.orders_products_id = opa.orders_products_id\";\t\n\t\t\t \t\t\t\t\n\t\t\t //products cost\n\t\t\t $this->queryProCost = \"select pc.categories_id, opc.* from products_to_categories pc, orders_products_costs opc where pc.products_id=opc.products_id and opc.orders_id IN \";\t\t\t \n\t\t\t $this->queryProCost_2 = \"select opc.*, o.date_purchased from orders_products_costs opc, orders o where opc.orders_id=o.orders_id \";\t\t\t\t \n\t\n\t}\n\t\n\t\n switch ($sort) {\n case '0':\n //$this->sortString = \" \"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc \";\n break;\n case '1':\n //$this->sortString = \" order by pname asc \"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc, pname asc \";\n break;\n case '2':\n //$this->sortString = \" order by pname desc\"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc, pname desc\";\n break;\n case '3':\n //$this->sortString = \" order by pquant asc, pname asc\"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc, pquant asc, pname asc\";\n break;\n case '4':\n //$this->sortString = \" order by pquant desc, pname asc\";\n\t\t //$this->sortString = \" order by pid desc, pname asc\"; //modified Aug 18, 2010\n $this->sortString = \" order by o.orders_id desc, pid desc, pname asc\";\n break;\n case '5':\n\t\t //$this->sortString = \" order by psum asc, pname asc\"; //modified Aug 18, 2010\n $this->sortString = \" order by o.orders_id desc, psum asc, pname asc\";\n break;\n case '6':\n //$this->sortString = \" order by psum desc, pname asc\"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc, psum desc, pname asc\";\n break;\n }\n\n }", "public function hasProductInfos(){\n return $this->_has(1);\n }", "public function hasStudySummaries() {\n return $this->_has(4);\n }", "public function getSaveDoc(): bool\n {\n return $this->saveDoc;\n }", "function sales_report_day_staff($report){\n \t\t$this->db->select('products.PRODUCT, products.COST_PRICE, products.SALES_PRICE, sales.SALES_DATE, sales.ORDER_NO, sales.QUANTITY_SOLD, staff.NAME, sales.STATUS');\n \t\t$this->db->from('sales');\n \t\t$this->db->join('products', 'products.PRODUCT_ID=sales.PRODUCT_ID', 'left');\n \t\t$this->db->join('staff', 'sales.STAFF_ID=staff.STAFF_ID', 'left');\n\n \t\tif($report['SALES_DATE']==\"\" and isset($report['MONTH'])){\n \t\t\t$this->db->where('MONTH(sales.SALES_DATE)', $report['MONTH']);\n \t\t\t$this->db->where('YEAR(sales.SALES_DATE)', date('Y'));\n \t\t}\n \t\telseif(isset($report['SALES_DATE']) and $report['MONTH']==\"\"){\n \t\t\t$this->db->where('sales.SALES_DATE', $report['SALES_DATE']);\n \t\t}\n \t\telse{\n \t\t\t$this->db->where('sales.SALES_DATE', date('Y-m-d'));\n \t\t}\n \t\t$this->db->where('sales.STAFF_ID', $report['STAFF_ID']);\n \t\t$this->db->where('sales.STATUS', 'Confirmed');\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}", "public function returns()\n {\n return $this->hasMany(SaleReturn::class, 'sale_id');\n }", "public function getSellDetails()\n {\n if (request()->ajax()) {\n $start = request()->start;\n $end = request()->end;\n $business_id = request()->session()->get('user.business_id');\n\n $sell_details = $this->transactionUtil->getSellTotals($business_id, $start, $end);\n \n return $sell_details;\n }\n }", "public function hasTransactions();", "public function isSent()\r\n {\r\n return $this->sent;\r\n }", "public function Get_Invoice_Value($sales){\n $sql = \"SELECT `sales`.*,\n `customer`.*\n FROM `sales`\n LEFT JOIN `customer` ON `sales`.`cus_id`=`customer`.`c_id`\n WHERE `sales`.`sale_id`='$sales'\";\n $query = $this->db->query($sql);\n $result = $query->row();\n return $result;\n\t}", "public function getSaleInfoForApp($sale){\n $saleInfo = array(\n 'saleId'=>$sale->saleId,\n 'name'=>$sale->name,\n 'rebate'=>0,\n 'thumbnail'=>CyImgUtil::getImgUrl($sale->thumbnailKey),\n 'startTime'=>$sale->startTime,\n 'endTime'=>$sale->endTime,\n );\n $saleInfo['isNeedLogin'] = false;\n $assistSale = $this->getAssistSale($sale->saleId);\n if(empty($assistSale)){\n $saleInfo['img'] = null;\n }else{\n $saleInfo['img'] = CyImgUtil::getImgUrl($assistSale->thumbImg);\n }\n $summarys = SaleService::getInstance()->getSaleSummary($sale->saleId);\n $saleInfo['summary'] = $summarys[array_rand($summarys)]['summary'];\n $saleInfo['type'] = '组团活动';\n return $saleInfo; \n }", "public function isRetrieved()\n {\n return $this->retrieved;\n }", "public function getQueryInsightsEnabled()\n {\n return $this->query_insights_enabled;\n }", "function is_recording()\n {\n return is_recording();\n }", "public function getAllSales()\n {\n return $this->join('customers','sales.customer_id','=','customers.id')\n ->select('sales.*','customers.name as customer')\n ->get();\n }", "public function getSaleData($conditions,$fields) {\t\r\n return $this->find('all', array('fields' => $fields,'conditions'=>$conditions));\r\n }", "public function TotalSale() {\n\treturn $this->nTotSale;\n }", "public function show_record() {\n return $this->show_record;\n }", "public function hasResults();", "public function checkSales (Request $request)\n {\n // echo $request;exit();\n $sales = Employee::where('nama', $request->sales)->count();\n\n return Response::json($sales);\n }", "public function getAllSalesMan(){\n\t\t$sql = \"SELECT * FROM vendedor\";\n\t\treturn $this->Model->getData($sql);\n\t}", "public function sales()\n {\n return $this->hasMany(Sale::class);\n }", "public function hasDataCollectionEventSummaries() {\n return $this->_has(3);\n }", "public function details()\n {\n return $this->hasMany(SaleDetails::class, 'sale_id');\n }", "public function hasDatas(){\n return $this->_has(5);\n }", "public function getSoldItems() {\n //$filter = 'LastHour';\n $filter = 'Last45Days';\n //$filter = 'SaleCompleted';\n $response = $this->trademe->get('MyTradeMe/SoldItems/'.$filter);\n\n if ($response->is_ok()) {\n return $response->List->SoldItem;\n }\n // error\n $this->tragentoLog(array(),$response->error_message(),'get_sold_items_error');\n return false;\n }", "public function canStoreEnabled();", "public function saved()\n\t{\t\n\t\treturn $this->_saved;\n\t}", "private function _getTicketsReferentSales()\n {\n $this->loadModel('Users');\n $users = $this->Users->find('all')->toArray();\n $data = [];\n\n foreach ($users as $user) {\n $count = $this->Tickets->find('all')->where(['paid' => 1, 'user_code' => $user->code])->count();\n\n if($count > 0) {\n $data[] = [\n 'label' => $user->firstname . ' ' . $user->lastname,\n 'value' => $this->Tickets->find('all')->where(['paid' => 1, 'user_code' => $user->code])->count()\n ];\n }\n }\n\n return $data;\n }", "public function isHistorical(): bool\n {\n return self::ISO_STATUS_HISTORICAL === $this->isoStatus;\n }", "public function sales(Request $request)\n {\n $data = $this->reportService->generateSalesReport($request->get('store'), $request->get('start'), $request->get('end'), $request->get('type'));\n $filters = [\n 'start' => $request->input('start'),\n 'end' => $request->input('end'),\n 'store' => $request->input('store'),\n 'type' => $request->get('type')\n ];\n if ($filters['type'] == 'minimal') {\n return view('backend.store.report.sales.minimal', compact('data','filters'));\n } else {\n return view('backend.store.report.sales.detailed', compact('data','filters'));\n }\n }", "public function hasBeenSent()\n {\n return $this->status === 'sent';\n }", "public function persisted()\n {\n return $this->_persisted;\n }" ]
[ "0.7109092", "0.6155453", "0.58900994", "0.5883582", "0.5689826", "0.5629183", "0.56205225", "0.5516286", "0.5515808", "0.5499032", "0.54642534", "0.54320824", "0.5405701", "0.5402275", "0.539143", "0.539143", "0.539143", "0.53853106", "0.5380972", "0.5291191", "0.52767235", "0.5272424", "0.52407086", "0.52302325", "0.5198848", "0.5195021", "0.51738495", "0.51621884", "0.51442254", "0.5117861", "0.51012355", "0.50968015", "0.50938034", "0.50709087", "0.5060712", "0.5055765", "0.50416046", "0.503881", "0.5037756", "0.50260717", "0.5012874", "0.5001259", "0.49976885", "0.49964452", "0.49960586", "0.49915078", "0.4991408", "0.498064", "0.4980374", "0.49742058", "0.49732652", "0.49728572", "0.49666363", "0.49547538", "0.49499664", "0.49498525", "0.49487215", "0.49452463", "0.49428117", "0.4942405", "0.4942155", "0.49324402", "0.49313974", "0.49299148", "0.4928321", "0.49251276", "0.49205416", "0.49170077", "0.4914826", "0.49137825", "0.49008757", "0.4898153", "0.48962072", "0.48961866", "0.48953903", "0.48919064", "0.4888981", "0.4887964", "0.48877305", "0.4875657", "0.48718834", "0.48716018", "0.48677123", "0.4864648", "0.48636943", "0.4863202", "0.4862584", "0.48614714", "0.4859118", "0.485274", "0.48490107", "0.48484853", "0.48471832", "0.4836234", "0.48314783", "0.48306468", "0.4821618", "0.48110852", "0.48089537", "0.4804786" ]
0.68620837
1
Stores information about whether sales were recorded.
public function set_recorded_sales( $order, $set ) { $order_id = WC_Order_Factory::get_order_id( $order ); update_post_meta( $order_id, '_recorded_sales', wc_bool_to_string( $set ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _usedInSales()\n {\n $rowset = $this->findDependentRowset('\\Ppb\\Db\\Table\\Sales');\n if (count($rowset) > 0) {\n return true;\n }\n\n return false;\n }", "public function getIsSale()\n {\n return $this->get(self::_IS_SALE);\n }", "public function get_recorded_sales( $order ) {\n\t\t$order_id = WC_Order_Factory::get_order_id( $order );\n\n\t\treturn wc_string_to_bool( get_post_meta( $order_id, '_recorded_sales', true ) );\n\t}", "public function issetDocumentTotals(): bool\n {\n return isset($this->documentTotals);\n }", "public function save(): bool\n {\n $data = [\n 'date' => $this->getDate(),\n 'type' => $this->getType(),\n 'recorded' => $this->getRecorded(),\n 'route' => $this->getRoute(),\n 'place' => $this->getPlace(),\n 'mileage' => $this->getMileage(),\n 'place_manual' => $this->getPlaceManual(),\n 'description' => $this->getDescription()\n ];\n if ($this->getId()) {\n if ((new db\\Update('event', $data, $this->getId()))->run() !== false) {\n return true;\n }\n } else {\n if ($newId = (new db\\Insert('event', $data))->run()) {\n $this->setId($newId);\n return true;\n }\n }\n return false;\n }", "protected function saveSeries($series_arr){\n return true;\n }", "public function canStoreEnabled();", "public function is_on_sale() {\n\t\t\n\t\t$time = current_time('timestamp');\n\n\t\t// Check if the sale is still in range (if we have a range)\n\t\tif ( ! empty( $this->sale_price_dates_from ) && ! empty( $this->sale_price_dates_to ) ) {\n\t\t\tif ( $this->sale_price_dates_from\t<= $time &&\n\t\t\t\t $this->sale_price_dates_to\t\t>= $time &&\n\t\t\t\t $this->sale_price) {\n\t\t\t\t \n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t// Otherwise if we have a sale price\n\t\tif ( empty( $this->sale_price_dates_to ) && $this->sale_price ) return true;\n\n\t\t// Just incase return false\n\t\treturn false;\n\t}", "public function storeDataInSession() {\n\t\t$_SESSION['Order__id'] = $this->insertedOrderId;\n\t\t$_SESSION['transactionAmount'] = $this->totalPrice;\n\t}", "public function stores();", "public function hasIsForSale()\n {\n return $this->is_for_sale !== null;\n }", "public function isSavable(): bool\n {\n return true;\n }", "public function save()\n {\n $this->save_meta_value('_sim_service_price', $this->service_price);\n $this->save_meta_value('_sim_service_price_registered', $this->service_price_registered);\n $this->save_meta_value('_sim_service_hide_price', $this->service_hide_price);\n }", "public function store()\n\t{\n\t\treturn false;\n\t}", "public function store()\n\t {\n\t //\n\t }", "public function incrementSales() {\n $this->sales = ($this->getSales() + 1);\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function beforeSave()\n\t{\n\t\t//Set null for empty field in table\n\t\tif($this->sale_date=='') $this->sale_date = NULL;\n\t\tif($this->next_sale_date=='') $this->next_sale_date = NULL;\n\t\treturn true;\n\t}", "public function hasStore(): bool;", "public function store() {\n $logData = \"=========================================\\n\";\n $logData .= \"Date Time: \".$this->record_date.\"\\n\";\n $logData .= $this->title.\" (\".$this->type.\") \\n\";\n if(!empty($this->data)) {\n $logData .= var_export($this->data, true).\"\\n\";\n }\n \n file_put_contents($this->file, $logData, FILE_APPEND);\n \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 isPersisted() {}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\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.58730555", "0.58640033", "0.58562464", "0.5642739", "0.5597903", "0.55825937", "0.5558339", "0.55536526", "0.5460907", "0.54557705", "0.5451143", "0.53999597", "0.53785414", "0.5346163", "0.5340376", "0.5324606", "0.5320683", "0.52861744", "0.5274085", "0.5254822", "0.52479726", "0.52479726", "0.52479726", "0.52440935", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781", "0.5236781" ]
0.62095183
0
Gets information about whether coupon counts were updated.
public function get_recorded_coupon_usage_counts( $order ) { $order_id = WC_Order_Factory::get_order_id( $order ); return wc_string_to_bool( get_post_meta( $order_id, '_recorded_coupon_usage_counts', true ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUpdateStatus() {\n return $this->_statusManager->getStatus ();\n }", "public function updateCount() {\n $query = $this->connection->select($this->mapTable);\n $query->addExpression('COUNT(*)', 'count');\n $query->condition('needs_update', MigrateMap::STATUS_NEEDS_UPDATE);\n $count = $query->execute()->fetchField();\n return $count;\n }", "private function getUsedCoupons()\n\t{\n\t\t$db = $this->getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select('coupon_id, count(*) as num')\n\t\t\t->from('#__conferenceplus_coupons_inuse')\n\t\t\t->where($db->qn('ticket_id') . ' <> 0')\n\t\t\t->where($db->qn('payment_id') . ' <> 0')\n\t\t\t->group('coupon_id');\n\n\t\t$db->setQuery($query);\n\n\t\treturn $db->loadObjectList('coupon_id');\n\n\t}", "protected function getRemainingUpdatesStatus() {}", "public function hasCoupon()\n {\n return (bool)$this->coupon_id;\n }", "public function hasCounts(){\n return $this->_has(6);\n }", "function count( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Count;\n }", "public function hasUpdates();", "public function getIsUpdated()\n {\n return $this->isUpdated;\n }", "public function getCount() {\n return $this->getFlagCount();\n }", "public function getUpdateFrequency()\n {\n return Mage::getStoreConfig(self::XML_PATH_UPDATE_FREQUENCY);\n }", "public static function getUpdateStatus()\n {\n /* get the command */\n $command = self::getUpdateCommand();\n\n /* execute command */\n return self::executeCommand($command['command'], $command['statusMessages'], $command['hints']);\n }", "public function beenUpdated()\n {\n return count($this->updatePlan) > 0;\n }", "public function getUpdated(): int\n {\n return $this->updated;\n }", "public function getShouldUpdate() {\n if (!$this->isReady()) {\n return false;\n }\n\n switch ($this->class) {\n case Source::CLASS_DATA:\n return (time() - $this->lastUpdated) > $this->source->getFrequency();\n break;\n case Source::CLASS_SENSOR:\n return false;\n break;\n }\n }", "public function hasCount() {\n return $this->_has(1);\n }", "public function hasCount() {\n return $this->_has(2);\n }", "function check_changes(){\n\t\t$result = $this->db->query('SELECT counting FROM news WHERE id=1');\n\t\tif($result = $result->fetch_object()){\n\t\t\treturn $result->counting;\n\t\t}\n\t\treturn 0;\n\t}", "public function getRedemptionsCount(\\Pley\\Entity\\Coupon\\Coupon $coupon)\n {\n $prepSql = \"SELECT COUNT(*) FROM `{$this->_tableName}` WHERE `coupon_id` = ?;\";\n $pstmt = $this->_prepare($prepSql);\n $bindings = [\n $coupon->getId()\n ];\n $pstmt->execute($bindings);\n $count = $pstmt->fetchColumn();\n $pstmt->closeCursor();\n return $count;\n }", "public function getCount()\n {\n return $this->sync->getCount();\n }", "public function discounts()\n {\n $discount = 0;\n foreach ($this->coupons as $coupon) {\n $discount += $coupon->getDiscountApplied($this);\n }\n return $discount;\n }", "function getMembersCount($coupon_id)\n {\n $queryString = \"select count(*) as count from coupons_purchase where couponid='$coupon_id' and Coupon_amount_Status='T' \";\n\t//$queryString = \"select count(*) as count from coupons_purchase where couponid='$coupon_id'\"; \n $result = mysql_query($queryString);\n $row = mysql_fetch_object($result);\n return $row->count;\n }", "public function updated() {\n\t\tif (!$this->connection) return 0;\n\t\treturn @pg_affected_rows($this->connection);\n\t}", "public function hasCount(){\n return $this->_has(2);\n }", "public function hasCount() {\n return $this->_has(3);\n }", "function apc_cache_click_updates_count() {\n\t$count = 0;\n\tif(apc_exists(APC_CACHE_CLICK_INDEX)) {\n\t\t$clickindex = apc_fetch(APC_CACHE_CLICK_INDEX);\n\t\t$count = count($clickindex);\n\t}\n\treturn $count;\n}", "public function isUpdated() {}", "public function countObservers() : int\n {\n\n return \\count( $this->_observers );\n\n }", "protected function getUsedCoupon()\n {\n return $this->booking->usedCoupon;\n }", "public function getCustomerInfoCount()\n {\n return $this->count(self::customer_info);\n }", "public function count()\n {\n return $this->backgroundCheck\n ->count();\n }", "private function getTempUsedCoupons()\n\t{\n\t\t$db = $this->getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select('coupon_id, count(*) as num')\n\t\t\t->from('#__conferenceplus_coupons_inuse')\n\t\t\t->where($db->qn('ticket_id') . ' <> 0')\n\t\t\t->where($db->qn('payment_id') . ' = 0')\n\t\t\t->group('coupon_id');\n\n\t\t$db->setQuery($query);\n\n\t\treturn $db->loadObjectList('coupon_id');\n\n\t}", "public function hasCount(){\n return $this->_has(3);\n }", "public function hasLastUpdate() {\n return $this->_has(2);\n }", "function isUpdating()\r\n {\r\n return $this->_updatecounter != 0;\r\n }", "public function hasCount() {\n return $this->_has(4);\n }", "public function hasTotalCount() {\n return $this->_has(3);\n }", "public function hasTotalCount() {\n return $this->_has(3);\n }", "public function get_coupon_notices() {\n\t\t\treturn apply_filters( 'wc_sc_coupon_notices', $this->coupon_notices );\n\t\t}", "public function getStatistics()\n\t{\n\t\treturn $this->counter;\n\t}", "public function hasUpdate();", "public function hasSoldCount(){\n return $this->_has(10);\n }", "public function get_coupon_discount_totals() {\n\t\treturn (array) $this->coupon_discount_totals;\n\t}", "public function hasMoneycount(){\n return $this->_has(4);\n }", "public function hasCount(){\n return $this->_has(13);\n }", "public function hasChangedEntries();", "public function getUpdated()\n {\n return $this->getState()->getUpdated();\n }", "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 }", "public function isCount(): bool\n {\n return $this->isCount;\n }", "public function getNotificationCount()\n\t{\n\t\treturn $this->Database->prepare(\"SELECT COUNT(*) as count FROM tl_nc_notifications\")->execute()->next()->count;\n\t}", "private function getCount()\n {\n $bd = Core::getBdd()->getDb();\n $u_insc_c = \"SELECT DISTINCT COUNT(u.id) as c FROM c_user u\";\n $insc = 0 + $bd->query($u_insc_c)->fetchObject()->c;\n return ($insc);\n }", "public function getCount() {\n \treturn $this->count();\n }", "public function countNew()\n\t{\n\t\treturn App::getDb()->fetchColumn(\"\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM feedback\n\t\t\tWHERE status = 'new'\n\t\t\");\n\t}", "public function actionGetnotifycount()\n\t{\n\t\techo CJSON::encode(array(\n\t\t\t 'status'=>'success',\n\t\t\t 'values'=>Yii::app()->user->getState(\"notify_count\")\n\t\t));\n\t\tYii::app()->end();\n\t}", "public function getCount()\n {\n if (isset($this->count)) {\n return $this->count;\n } else {\n return false;\n }\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated() \n\t{\n\t\treturn $this->updated;\n\t}", "public function getAddCouponInfo()\n {\n $sql = \"SELECT * FROM casino_coupon_add \";\n return $this->_rdb->fetchAll($sql);\n }", "public function count()\n {\n return count($this->_cache);\n }", "public function countAjax()\n\t{\n\t\treturn $this->wishlist->items()->count();\n\t}", "public function get_update_availability()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $payload = $this->request('CheckForUpdate');\n\n if (preg_match('/' . self::CONSTANT_DO_UPDATE . 'true/i', $payload))\n return TRUE;\n else\n return FALSE;\n }", "function isUpdated() {\n\t\treturn $this->_Updated;\n\t}", "public function getAffectedItemsCount() {}", "function getCouponStatus($coupon_code)\n\t{\n\t\t \n\t\t$this->db->select('*');\n\t\t$this->db->from('coupon');\n\t\t$this->db->where('identification_code',$coupon_code);\n\t\t$query = $this->db->get();\n\t\tif($query->num_rows() > 0){\n\t\t$coupon_row = $query->row();\n\t\treturn $coupon_row->verification_status;\n\t\t}else{\n\t\treturn 1;\n\t\t}\t\t \t\n\t}", "public function count(): int\n {\n return iterator_count($this->getItemsWithChanges());\n }", "public function getOperationsCount()\n {\n return $this->count(self::_OPERATIONS);\n }", "public function getChangeCount()\n {\n if (!isset($this->_changes)) {\n $this->getChanges();\n }\n\n return count($this->_changes);\n }", "public function getStatus()\n {\n return $this->query('mnsync status');\n }", "public function getCurrentGoodsCount()\n {\n return $this->count(self::_CURRENT_GOODS);\n }", "public function count() {\n\t\treturn $this->field('Cart.order_item_count', $this->cartConditions());\n\t}", "public function Fetch_Adjustment_Count()\n\t{\n\t\t$ext_status = Search_Status_Map('pending::external_collections::*root', $this->getStatusMap());\n\n\t\t$query = \"\n\t\t\tSELECT COUNT(*) count\n\t\t\tFROM ext_corrections ec\n\t\t\t \tJOIN application a USING(application_id)\n\t\t\t \tJOIN ext_collections USING(application_id)\n\t\t\t \tJOIN ext_collections_batch AS ecb USING(ext_collections_batch_id)\n\t\t\";\n\t\t$count = $this->db->querySingleValue($query);\n\t\treturn (int)$count;\n\t}", "public function getNumRowsAffected(){\n\t\treturn $this->instance->getNumRowsAffected();\n\t}", "public function handbks_object_counts_update() {\n $this->db->query(\"call handbks_object_counts_update();\");\n }", "public function getOrderTrackingCount()\n {\n return $this->count(self::order_tracking);\n }", "public function getCachedStatusesCountAttribute(): int\n {\n return Cache::remember($this->cacheKey().':statuses_count', 10, function () {\n return $this->statuses()->count();\n });\n }", "public function hasObservers() : bool\n {\n\n return 0 < $this->countObservers();\n\n }", "public function getServerInfoCount()\n {\n return $this->count(self::_SERVER_INFO);\n }", "public function hasAlreadyUsedUpMoney()\n {\n return !! Timestamp :: build( $this ) -> getChargingStatusTimestamp( OrderStatusEnum :: USED_UP );\n }", "public function get_applied_coupons() {\n\t\treturn (array) $this->applied_coupons;\n\t}", "public function getStatus() {\n\t\tif(!$this->server) {\n\t\t\treturn false;\n\t\t}\n\t\tif(!$this->status_new) {\n\t\t\t$this->update();\n\t\t}\n\t\treturn $this->status_new;\n\t}", "public function getUsage($coupon_id)\r\n {\r\n return $this->__getUsage($coupon_id);\r\n }", "public function check_scheduled_coupon_actions() {\n\n\t\t\tcheck_ajax_referer( 'wc-sc-check-coupon-scheduled-actions', 'security' );\n\n\t\t\t$coupon_id = ( ! empty( $_POST['coupon_id'] ) ) ? wc_clean( wp_unslash( $_POST['coupon_id'] ) ) : ''; // phpcs:ignore\n\n\t\t\t$response = array(\n\t\t\t\t'has_scheduled_actions' => 'no',\n\t\t\t);\n\n\t\t\tif ( ! empty( $coupon_id ) ) {\n\t\t\t\t$coupon = new WC_Coupon( $coupon_id );\n\t\t\t\tif ( is_a( $coupon, 'WC_Coupon' ) ) {\n\t\t\t\t\t$scheduled_actions_ids = get_post_meta( $coupon_id, 'wc_sc_scheduled_actions_ids', true );\n\t\t\t\t\tif ( is_array( $scheduled_actions_ids ) && ! empty( $scheduled_actions_ids ) ) {\n\t\t\t\t\t\t$response['has_scheduled_actions'] = 'yes';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twp_send_json( $response );\n\t\t}", "public function countPending()\n {\n return $this->backgroundCheck\n ->where('admin_status', '=', UserBackgroundCheck::ADMIN_STATUS_PENDING)\n ->count();\n }", "static function countNotifications(){\n return PDOQueries::count_notifications(Log::get_id());\n }", "public function affected()\n {\n return $this->affected;\n }", "function count()\n\t{\n\t\treturn count($this->getGoods());\n//\t\treturn count($this->getSESSION()[$this->sessionsGoodsKey]);\n\t}", "public function trackChanges()\n {\n \n if (!isset(static::$cols['m_version'] ))\n return false;\n\n return static::$trackChanges;\n\n }", "public function getCount() {\n\t\treturn count($_COOKIE);\n\t}", "public function getItemInfoCount()\n {\n return $this->count(self::_ITEM_INFO);\n }", "function get_applied_coupons() {\n\t\t\treturn (array) $this->applied_coupons;\n\t\t}", "public function getCount() {\r\n return $this->count;\r\n }", "public function woocommerce_reports_coupons_overview_coupons_by_count($coupons) {\n\t}" ]
[ "0.60697585", "0.599692", "0.59308976", "0.58637315", "0.5819856", "0.5780992", "0.5757495", "0.57232416", "0.5704794", "0.5674301", "0.5669532", "0.565828", "0.5649949", "0.5645605", "0.5632201", "0.5618765", "0.5609321", "0.5582324", "0.55781025", "0.55657196", "0.5561508", "0.5561247", "0.5553626", "0.55459553", "0.55246896", "0.5515583", "0.55107284", "0.5505948", "0.5503469", "0.5496734", "0.5496122", "0.5492303", "0.54870105", "0.5486293", "0.5457217", "0.5443365", "0.5432139", "0.5432139", "0.53984225", "0.53957134", "0.539234", "0.53807044", "0.5379655", "0.53752947", "0.53660697", "0.53444517", "0.5343576", "0.5337896", "0.5337271", "0.533035", "0.5320782", "0.53183556", "0.5318102", "0.53135806", "0.53097045", "0.53071594", "0.53071594", "0.53071594", "0.53071594", "0.53071594", "0.53071594", "0.53071594", "0.53071594", "0.53071594", "0.5299848", "0.5297451", "0.52885157", "0.5282525", "0.5273149", "0.5272138", "0.52661663", "0.5258129", "0.5256787", "0.5243921", "0.5243057", "0.5239747", "0.52356905", "0.5235361", "0.5228458", "0.5213339", "0.5206887", "0.520061", "0.51979566", "0.51970035", "0.5194871", "0.519257", "0.519121", "0.5181735", "0.517641", "0.5172561", "0.51666665", "0.51621175", "0.51586694", "0.51557314", "0.51444924", "0.5137578", "0.51123345", "0.511221", "0.5109502", "0.5107033" ]
0.63915557
0
Stores information about whether coupon counts were updated.
public function set_recorded_coupon_usage_counts( $order, $set ) { $order_id = WC_Order_Factory::get_order_id( $order ); update_post_meta( $order_id, '_recorded_coupon_usage_counts', wc_bool_to_string( $set ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_recorded_coupon_usage_counts( $order ) {\n\t\t$order_id = WC_Order_Factory::get_order_id( $order );\n\n\t\treturn wc_string_to_bool( get_post_meta( $order_id, '_recorded_coupon_usage_counts', true ) );\n\t}", "public function handbks_object_counts_update() {\n $this->db->query(\"call handbks_object_counts_update();\");\n }", "public function syncCoupon(): void\n {\n $stripeCoupon = $this->asStripeCoupon();\n\n $this->valid = $stripeCoupon->valid;\n\n $this->times_redeemed = $stripeCoupon->times_redeemed;\n\n $this->save();\n }", "public function updateCount() {\n $query = $this->connection->select($this->mapTable);\n $query->addExpression('COUNT(*)', 'count');\n $query->condition('needs_update', MigrateMap::STATUS_NEEDS_UPDATE);\n $count = $query->execute()->fetchField();\n return $count;\n }", "function count( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Count;\n }", "public function hold_applied_coupon( $coupons_args = array() ) {\n\n\t\t\t$user_id = get_current_user_id();\n\t\t\t$saved_status = array();\n\n\t\t\tif ( 0 === $user_id ) {\n\t\t\t\t$saved_status = $this->save_applied_coupon_in_cookie( $coupons_args );\n\t\t\t} else {\n\t\t\t\t$saved_status = $this->save_applied_coupon_in_account( $coupons_args, $user_id );\n\t\t\t}\n\n\t\t\tif ( ! empty( $saved_status ) ) {\n\t\t\t\tforeach ( $coupons_args as $coupon_args ) {\n\t\t\t\t\t$coupon_code = $coupon_args['coupon-code'];\n\t\t\t\t\t$save_status = isset( $saved_status[ $coupon_code ] ) ? $saved_status[ $coupon_code ] : '';\n\t\t\t\t\tif ( 'saved' === $save_status ) {\n\t\t\t\t\t\t/* translators: %s: $coupon_code coupon code */\n\t\t\t\t\t\t$notice = sprintf( __( 'Coupon code \"%s\" applied successfully. Please add some products to the cart to see the discount.', 'woocommerce-smart-coupons' ), $coupon_code );\n\t\t\t\t\t\t$this->set_coupon_notices( $notice, 'success' );\n\t\t\t\t\t} elseif ( 'already_saved' === $save_status ) {\n\t\t\t\t\t\t/* translators: %s: $coupon_code coupon code */\n\t\t\t\t\t\t$notice = sprintf( __( 'Coupon code \"%s\" already applied! Please add some products to the cart to see the discount.', 'woocommerce-smart-coupons' ), $coupon_code );\n\t\t\t\t\t\t$this->set_coupon_notices( $notice, 'error' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "public function isUpdated() {}", "public function updateCount() {\n $sql = \"UPDATE goCount SET count = count + 1 WHERE 1\";\n\n if (self::$conn->query($sql) === FALSE) {\n echo \"Error updating count record: \" . self::$conn->error;\n }\n }", "public static function update_store_count( $post_ID , $post = null ){\r\n if ( ! $post ) {\r\n $post = get_post( $post_ID );\r\n }\r\n\r\n $post_type = get_post_type( $post ) ;\r\n if ( $post_type != 'coupon' ) {\r\n return ;\r\n }\r\n\r\n $types = apply_filters( 'store_count_coupons_types', array(\r\n 'code',\r\n 'sale',\r\n 'print',\r\n ) );\r\n\r\n $ids = false;\r\n $stores = get_the_terms( $post_ID, 'coupon_store' );\r\n\r\n if ( $stores ) {\r\n $ids = wp_list_pluck( $stores, 'term_id');\r\n\r\n foreach ( $ids as $id ) {\r\n\r\n foreach ( $types as $c_type ) {\r\n $args = array(\r\n 'post_type' => 'coupon',\r\n 'meta_key' => '_wpc_coupon_type',\r\n 'meta_value' => $c_type,\r\n 'meta_compare' => '=',\r\n 'tax_query' => array(\r\n 'relation' => 'AND',\r\n array(\r\n 'taxonomy' => 'coupon_store',\r\n 'field' => 'term_id',\r\n 'terms' => array($id),\r\n ),\r\n ),\r\n );\r\n $query = new WP_Query($args);\r\n update_term_meta($id, '_wpc_coupon_' . $c_type, $query->found_posts);\r\n }\r\n }\r\n\r\n }\r\n\r\n update_post_meta( $post_ID, '_wpc_store', $ids );\r\n }", "public function updateCommentCount()\n {\n $this->comment_count = $this->comments()->count();\n\n $this->save();\n }", "public function hasCoupon()\n {\n return (bool)$this->coupon_id;\n }", "private function logCouponUsage(int $customerID, int $orderID, int $couponID) :bool\n {\n $couponTimeout = COUPON_CODE_TIMEOUT;\n $couponExpireOn = strtotime(\"+$couponTimeout second\");\n\n $query = \"INSERT INTO customer_coupon_log(\n\t\t \tcustomer_id,\n\t\t \tcoupon_id,\n\t\t \tcustomer_order_id,\n\t\t \tcustomer_coupon_expire_on\n\t\t ) VALUES (\n\t\t \t:customer_id,\n :coupon_id,\n :order_id,\n :expire_on\n )\";\n \n if (!$this->query($query, array(\n \"customer_id\" => $customerID,\n \"coupon_id\" => $couponID,\n \"order_id\" => $orderID,\n \"expire_on\" => $couponExpireOn\n ))) {\n $this->logger::warning(\"Query failed while trying to add (INSERT) coupon log of the coupon ($couponID) for the order ($orderID) by the customer ($customerID)\");\n $this->setError(\"QUERY_FAILED\");\n return false;\n }\n\n $this->redis->set(CUSTOMER_APPLIED_COUPON . \"$customerID:$couponID\", $orderID);\n $this->redis->expire(CUSTOMER_APPLIED_COUPON . \"$customerID:$couponID\", COUPON_CODE_TIMEOUT);\n\n return true;\n }", "public function cacheNewSpotCount()\n {\n $statisticsUpdate = [];\n\n /*\n * Update the filter counts for the users.\n *\n * Basically it compares the lasthit of the session with the lastupdate\n * of the filters. If lasthit>lastupdate, it will store the lastupdate as\n * last counters read, hence we need to do it here and not at the end.\n */\n $this->_userFilterCountDao->updateCurrentFilterCounts();\n\n /*\n * First we want a unique list of all currently\n * created filter combinations so we can determine\n * its' spotcount\n */\n $filterList = $this->_userFilterDao->getUniqueFilterCombinations();\n\n /* We add a dummy entry for 'all new spots' */\n $filterList[] = ['id' => 9999, 'userid' => -1, 'filtertype' => 'dummyfilter',\n 'title' => 'NewSpots', 'icon' => '', 'torder' => 0, 'tparent' => 0,\n 'tree' => '', 'valuelist' => 'New:0', 'sorton' => '', 'sortorder' => '', ];\n\n /*\n * Now get the current number of spotcounts for all\n * filters. This allows us to add to the current number\n * which is a lot faster than just asking for the complete\n * count\n */\n $cachedList = $this->_userFilterCountDao->getCachedFilterCount(-1);\n\n /*\n * Loop throug each unique filter and try to calculate the\n * total amount of spots\n */\n foreach ($filterList as $filter) {\n // Reset the PHP timeout timer\n set_time_limit(960);\n\n // Calculate the filter hash\n if (is_null($filter['valuelist'])) {\n $filter['valuelist'] = 'NULL';\n }\n $filter['filterhash'] = sha1($filter['tree'].'|'.urldecode($filter['valuelist']));\n $filter['userid'] = -1;\n\n //echo 'Calculating hash for: \"' . $filter['tree'] . '|' . $filter['valuelist'] . '\"' . PHP_EOL;\n //echo ' ==> ' . $filter['filterhash'] . PHP_EOL;\n\n // Check to see if this hash is already in the database\n if (isset($cachedList[$filter['filterhash']])) {\n $filter['lastupdate'] = $cachedList[$filter['filterhash']]['lastupdate'];\n $filter['lastvisitspotcount'] = $cachedList[$filter['filterhash']]['currentspotcount'];\n $filter['currentspotcount'] = $cachedList[$filter['filterhash']]['currentspotcount'];\n } else {\n // Apparently a totally new filter\n $filter['lastupdate'] = 0;\n $filter['lastvisitspotcount'] = 0;\n $filter['currentspotcount'] = 0;\n } // else\n\n /*\n * Now we have to simulate a search. Because we want to\n * utilize existing infrastructure, we convert the filter to\n * a format which can be used in this system\n */\n $strFilter = '&amp;search[tree]='.$filter['tree'];\n if (is_null($filter['valuelist'])) {\n $filter['valuelist'] = 'NULL';\n }\n $valueArray = explode('&', $filter['valuelist']);\n if (!empty($valueArray)) {\n foreach ($valueArray as $value) {\n $strFilter .= '&amp;search[value][]='.$value;\n } // foreach\n } // if\n\n /*\n * Now we will artifficially add the 'stamp' column to the\n * list of parameters. Basically this tells the query\n * system to only query for spots newer than the last\n * update of the filter\n */\n $strFilter .= '&amp;search[value][]=stamp:>:'.$filter['lastupdate'];\n\n // Now parse it to an array as we would get when called from a webpage\n parse_str(html_entity_decode($strFilter), $query_params);\n\n /*\n * Create a fake session\n */\n $userSession = [];\n $userSession['user'] = ['lastread' => $filter['lastupdate']];\n $userSession['user']['prefs'] = ['auto_markasread' => false];\n\n /*\n * And convert the parsed system to an SQL statement and actually run it\n */\n $parsedSearch = $this->_queryParser->filterToQuery($query_params['search'], [], $userSession, []);\n $spotCount = $this->_spotDao->getSpotCount($parsedSearch['filter']);\n\n /*\n * Because we only ask for new spots, just increase the current\n * amount of spots. This has a slight chance of sometimes missing\n * a spot but it's sufficiently accurate for this kind of importance\n */\n $filter['currentspotcount'] += $spotCount;\n\n $this->_userFilterCountDao->setCachedFilterCount(-1, [$filter['filterhash'] => $filter]);\n\n /*\n * Now determine the users wich actually have this filter\n */\n $usersWithThisFilter = $this->_userFilterDao->getUsersForFilter($filter['tree'], $filter['valuelist']);\n foreach ($usersWithThisFilter as $thisFilter) {\n $statisticsUpdate[$thisFilter['userid']][] = ['title' => $thisFilter['title'],\n 'newcount' => $spotCount,\n 'enablenotify' => $thisFilter['enablenotify'], ];\n } // foreach\n } // foreach\n\n /*\n * We want to make sure all filtercounts are available for all\n * users, hence we make sure all these records do exist\n */\n $this->_userFilterCountDao->createFilterCountsForEveryone();\n\n return $statisticsUpdate;\n }", "public function save_applied_coupon_in_cookie( $coupons_args = array() ) {\n\n\t\t\t$saved_status = array(); // Variable to store whether coupons saved/already saved in cookie.\n\n\t\t\tif ( ! empty( $coupons_args ) ) {\n\n\t\t\t\tif ( empty( $_COOKIE['sc_applied_coupon_profile_id'] ) ) {\n\t\t\t\t\t$unique_id = $this->generate_unique_id();\n\t\t\t\t} else {\n\t\t\t\t\t$unique_id = wc_clean( wp_unslash( $_COOKIE['sc_applied_coupon_profile_id'] ) ); // phpcs:ignore\n\t\t\t\t}\n\n\t\t\t\t$applied_coupons = get_option( 'sc_applied_coupon_profile_' . $unique_id, array() );\n\n\t\t\t\tforeach ( $coupons_args as $coupon_args ) {\n\t\t\t\t\t$coupon_code = isset( $coupon_args['coupon-code'] ) ? $coupon_args['coupon-code'] : '';\n\t\t\t\t\tif ( ! in_array( $coupon_code, $applied_coupons, true ) ) {\n\t\t\t\t\t\t$applied_coupons[] = $coupon_code;\n\t\t\t\t\t\t$saved_status[ $coupon_code ] = 'saved';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$saved_status[ $coupon_code ] = 'already_saved';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tupdate_option( 'sc_applied_coupon_profile_' . $unique_id, $applied_coupons, 'no' );\n\t\t\t\twc_setcookie( 'sc_applied_coupon_profile_id', $unique_id, $this->get_cookie_life() );\n\t\t\t}\n\n\t\t\treturn $saved_status;\n\n\t\t}", "function apc_cache_click_updates_count() {\n\t$count = 0;\n\tif(apc_exists(APC_CACHE_CLICK_INDEX)) {\n\t\t$clickindex = apc_fetch(APC_CACHE_CLICK_INDEX);\n\t\t$count = count($clickindex);\n\t}\n\treturn $count;\n}", "public function hasUpdates();", "private function updateCountsComment()\n {\n $this->commentManager->updateCommentsCount();\n }", "protected function afterSave()\n {\n if($this->isNewRecord && $this->status==Comment::STATUS_APPROVED)\n Post::model()->updateCounters(array('commentCount'=>1), \"id={$this->postId}\");\n }", "public function getUpdateFrequency()\n {\n return Mage::getStoreConfig(self::XML_PATH_UPDATE_FREQUENCY);\n }", "protected function onUpdated()\n {\n return true;\n }", "public function updatePositiveCount() {\n\n\t}", "public function save_follow_count() {\n\t\t// Networks that do not have count data still need an integer.\n\t\tif ( empty( $this->follow_count) ) {\n\t\t\t$this->follow_count = 0;\n\t\t}\n\n\t\tSWFW_Utility::update_network_count( $this->key, $this->follow_count );\n\t}", "public function modify() {\n\t\t$cart = D('ShoppingCart');\n\t\t// call a method in shopping cart model\n\t\t// decide by return value to give different hint\n\t\tif ($cart->modifyCount($this->_session('uid'), $_POST['good_id'], $_POST['good_count'], $_POST['add'])) {\n\t\t\t$this->success('Modification succeeded!');\n\t\t} else {\n\t\t\t$this->error('Modification failed!');\n\t\t}\n\t}", "public function updateLikesCount()\n {\n $totals = Db::table('rainlab_forum_likes as r')\n ->select(Db::raw('sum(r.like) as likes, sum(r.unlike) as unlikes'))\n ->wherePostId($this->id)\n ->first();\n\n $this->count_likes = $totals->likes;\n $this->count_unlikes = $totals->unlikes;\n $this->save();\n }", "public function hasUpdate();", "public function hasCounts(){\n return $this->_has(6);\n }", "function isUpdating()\r\n {\r\n return $this->_updatecounter != 0;\r\n }", "private function incrementFavoriteCount()\n\t{\n\t\t$counter = $this->favoriteCounter()->first();\n\n\t\tif($counter) {\n\t\t\t$counter->count++;\n\t\t\t$counter->save();\n\t\t} else {\n\t\t\t$counter = new FavoriteCounter;\n\t\t\t$counter->count = 1;\n\t\t\t$this->favoriteCounter()->save($counter);\n\t\t}\n\t}", "public function update_variables(){\n\n // Update parent objects first\n //$this->robot->update_variables();\n\n // Calculate this ability's count variables\n //$this->counters['thing'] = count($this->robot_stuff);\n\n // Return true on success\n return true;\n\n }", "function wp_update_network_user_counts() {\n\tglobal $wpdb;\n\n\t$count = $wpdb->get_var( \"SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'\" );\n\tupdate_site_option( 'user_count', $count );\n}", "private function incrementFavoriteCount()\n {\n $counter = $this->favoriteCounter()->first();\n\n if ($counter) {\n $counter->count++;\n $counter->save();\n } else {\n $counter = new FavoriteCounter;\n $counter->count = 1;\n $this->favoriteCounter()->save($counter);\n }\n }", "public function countStored(): int;", "function manageMembers($coupon_id)\n {\n $queryString = \"select count(*) as count from coupon_members where coupon_id='$coupon_id'\";\n $member_count = mysql_query($querystring);\n }", "protected function getRemainingUpdatesStatus() {}", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n $this->setTotalAmounts();\n }", "function carton_processing_order_count() {\n\tif ( false === ( $order_count = get_transient( 'carton_processing_order_count' ) ) ) {\n\t\t$order_statuses = get_terms( 'shop_order_status' );\n\t $order_count = false;\n\t foreach ( $order_statuses as $status ) {\n\t if( $status->slug === 'processing' ) {\n\t $order_count += $status->count;\n\t break;\n\t }\n\t }\n\t $order_count = apply_filters( 'carton_admin_menu_count', intval( $order_count ) );\n\t\tset_transient( 'carton_processing_order_count', $order_count );\n\t}\n\n\treturn $order_count;\n}", "public function countObservers() : int\n {\n\n return \\count( $this->_observers );\n\n }", "public function updateCreditStatus()\n {\n $return = false;\n $updateQuery = \"update users set deposit_status='LIVE' where id='\" .\n $this->_user['id'] . \"' AND brand='\" . $this->_session['brand'] . \"'\";\n if(mysql_query($updateQuery)) {\n $return = true;\n }\n return $return;\n }", "function log_update($type) {\n $this->updates_counter[$type] += 1;\n }", "public function setCoupon($coupon)\n {\n if ($coupon->value > 0) {\n $this->coupon['value'] = $coupon->value;\n }\n elseif ($coupon->discount > 0) {\n $this->coupon['percent'] = $coupon->discount;\n }\n session(['coupon' => $coupon]);\n }", "protected function _setCount()\n\t{\n\t\t$cacheKey = 'toolbar_count_' . $this->getSubject()->model->alias . '_user_' . AuthComponent::user('id');\n\n\t\tif (($count = Cache::read($cacheKey, 'trash_settings')) === false) {\n\t\t\t$Filter = $this->_listener('Trash')->initTrashFilter();\n\n\t\t\t// lets attach all listeners that changes output (this should be made more dry)\n\t\t\t// check if VisualisationListener is used in current Crud\n\t\t\tif ($this->_crud()->config('listeners.Visualisation') !== null) {\n\t\t\t\t$this->_listener('Visualisation')->attachListener($Filter);\n\t\t\t}\n\n\t\t\t$this->_listener('Trash')->attachListener($Filter);\n\n\t\t\t$count = $Filter->filter('count');\n\t\t\tunset($Filter);\n\n\t\t\tCache::write($cacheKey, $count, 'trash_settings');\n\t\t}\n\t\t\n\t\t$this->_count = $count;\n\t}", "public function postInsert($event)\n {\n $event->getInvoker()->getCheckInSpot()->upCheckInCount();\n }", "public function hasChangedEntries();", "protected function items_counter() {\n\t\t$output = '';\n\n\t\t$new = get_option( 'appthemes_addons_mp_new_items_counter' );\n\t\t$upd = get_option( 'appthemes_addons_mp_updated_items_counter' );\n\n\t\t$new = ! empty( $new ) ? count( $new ) : 0;\n\t\t$upd = ! empty( $upd ) ? count( $upd ) : 0;\n\n\t\t$counter = $new + $upd;\n\n\t\tif ( $counter ) {\n\t\t\t$output = ' <span class=\"update-plugins count-' . $counter . '\"><span class=\"plugin-count\" aria-hidden=\"true\">' . $counter . '</span></span>';\n\t\t}\n\n\t\treturn $output;\n\t}", "function _setCounter()\n {\n\t\t$counter = $this->get( 'session.counter', 0 );\n\t\t++$counter;\n\n\t\t$this->set( 'session.counter', $counter );\n \treturn true;\n }", "public function beenUpdated()\n {\n return count($this->updatePlan) > 0;\n }", "public function update()\n {\n $r = false;\n $vars = $this->container->getSiteInstance()->getVariables();\n if (!$vars->hasKey('facebook_number_of_likes')) {\n $r = true;\n }\n if ($vars->getValue('facebook_number_of_likes') != ($n = $this->getRemoteNumberOfLikes())) {\n $r = true;\n $vars->setValue('facebook_number_of_likes', $n);\n }\n if ($this->initializeIdList() && ($l = $this->getRemoteIdList()) != $this->id_list) {\n $r = true;\n $this->initializeIdList($l);\n }\n\n $status = $this->getStatus();\n while ($status != null) {\n if ($status->update()) {\n $r = true;\n }\n\n $status = $status->getNextStatus();\n }\n\n return $r;\n }", "protected function getUsedCoupon()\n {\n return $this->booking->usedCoupon;\n }", "private function getUsedCoupons()\n\t{\n\t\t$db = $this->getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select('coupon_id, count(*) as num')\n\t\t\t->from('#__conferenceplus_coupons_inuse')\n\t\t\t->where($db->qn('ticket_id') . ' <> 0')\n\t\t\t->where($db->qn('payment_id') . ' <> 0')\n\t\t\t->group('coupon_id');\n\n\t\t$db->setQuery($query);\n\n\t\treturn $db->loadObjectList('coupon_id');\n\n\t}", "protected function updateCounter($event)\n\t{\n\t\tif (!array_key_exists($event, $this->counter))\n\t\t\t$this->counter[$event] = 0;\n\n\t\t$this->counter[$event]++;\n\t}", "public function afterSave()\n {\n $savedItem = $this->attributes;\n $idSaved = $savedItem['id'];\n $post = post();\n if (empty($post['category']) && empty($post['product'])) {\n self::applyForAll($idSaved);\n } else {\n self::saveCategoryCoupon($post, $idSaved);\n self::saveProductCoupon($post, $idSaved);\n self::where('id', $idSaved)->update(['is_for_all'=>self::IS_NOT_FOR_ALL]);\n }\n $post = post();\n Event::fire('ideas.shop.save_coupon', [$savedItem, $post]);\n }", "public function updateIndexState() {\n $query = $this->database->select('help_search_items', 'hsi');\n $query->addExpression('COUNT(DISTINCT(hsi.sid))');\n $query->leftJoin('search_dataset', 'sd', 'hsi.sid = sd.sid AND sd.type = :type', [':type' => $this->getType()]);\n $query->isNull('sd.sid');\n $never_indexed = $query->execute()->fetchField();\n $this->state->set('help_search_unindexed_count', $never_indexed);\n }", "public function trackChanges()\n {\n \n if (!isset(static::$cols['m_version'] ))\n return false;\n\n return static::$trackChanges;\n\n }", "protected function _updateStatus()\n {\n $this->_writeStatusFile(\n array(\n 'time' => time(),\n 'done' => ($this->_currentItemCount == $this->_totalFeedItems),\n 'count' => $this->_currentItemCount,\n 'total' => $this->_totalFeedItems,\n 'message' => \"Importing content. Item \" . $this->_currentItemCount\n . \" of \" . $this->_totalFeedItems . \".\"\n )\n );\n }", "public function hasAlreadyUsedUpMoney()\n {\n return !! Timestamp :: build( $this ) -> getChargingStatusTimestamp( OrderStatusEnum :: USED_UP );\n }", "public function isCount(): bool\n {\n return $this->isCount;\n }", "public function countNewStates()\n {\n if ($this->isNonexistent) return 0;\n\n if (!is_null($this->countNewStates)) return $this->countNewStates;\n\n return $this->countNewStates = FeedbackState::find()->where([\n 'feedback_id' => $this->id,\n 'is_handled' => false\n ])->count();\n }", "public function hasCount(){\n return $this->_has(2);\n }", "public function update(Request $request, $id)\n {\n // if(count(Coupon::where('id', '!=' , $id)->where('code', $request->coupon_code)->get()) > 0){\n // flash(translate('Coupon already exist for this coupon code'))->error();\n // return back();\n // }\n\n // $coupon = Coupon::findOrFail($id);\n // if ($request->coupon_type == \"product_base\") {\n // $coupon->type = $request->coupon_type;\n // $coupon->code = $request->coupon_code;\n // $coupon->discount = $request->discount;\n // $coupon->discount_type = $request->discount_type;\n // $date_var = explode(\" - \", $request->date_range);\n // $coupon->start_date = strtotime($date_var[0]);\n // $coupon->end_date = strtotime( $date_var[1]);\n // $cupon_details = array();\n // foreach($request->product_ids as $product_id) {\n // $data['product_id'] = $product_id;\n // array_push($cupon_details, $data);\n // }\n // $coupon->details = json_encode($cupon_details);\n // if ($coupon->save()) {\n // flash(translate('Coupon has been saved successfully'))->success();\n // return redirect()->route('coupon.index');\n // }\n // else{\n // flash(translate('Something went wrong'))->danger();\n // return back();\n // }\n // }\n // elseif ($request->coupon_type == \"cart_base\") {\n // $coupon->type = $request->coupon_type;\n // $coupon->code = $request->coupon_code;\n // $coupon->discount = $request->discount;\n // $coupon->discount_type = $request->discount_type;\n // $date_var = explode(\" - \", $request->date_range);\n // $coupon->start_date = strtotime($date_var[0]);\n // $coupon->end_date = strtotime( $date_var[1]);\n // $data = array();\n // $data['min_buy'] = $request->min_buy;\n // $data['max_discount'] = $request->max_discount;\n // $coupon->details = json_encode($data);\n // if ($coupon->save()) {\n // flash(translate('Coupon has been saved successfully'))->success();\n // return redirect()->route('coupon.index');\n // }\n // else{\n // flash(translate('Something went wrong'))->danger();\n // return back();\n // }\n // }\n }", "public function Hpc()\r\n{\r\n$objConfig=new Config();//Connects database\r\n$Available=false;\r\n$rowCommitted=0;\r\n$colUpdated=0;\r\n$updateList=\"\";\r\n$sql=\" select count(*) from hpc\";\r\n$result=mysql_query($sql);\r\n$row=mysql_fetch_array($result);\r\nif (strlen($row[0])>0)\r\n$this->recordCount=$row[0];\r\nelse\r\n$this->recordCount=0;\r\n$this->condString=\"1=1\";\r\n}", "public static function update_store_data( $post_ID, $post = null, $update = null ){\r\n\r\n // Get post if not exists\r\n if ( ! $post ) {\r\n $post = get_post( $post_ID );\r\n }\r\n\r\n if ( 'coupon' != get_post_type( $post ) ) {\r\n return ;\r\n }\r\n\r\n /**\r\n * Update tracking data\r\n */\r\n $percent = get_post_meta( $post_ID, '_wpc_percent_success', true );\r\n if ( empty( $percent ) || $percent == '' ){\r\n update_post_meta( $post_ID, '_wpc_percent_success', 100 );\r\n }\r\n\r\n $meta = get_post_custom( $post_ID );\r\n\r\n if ( ! isset ( $meta[ '_wpc_used' ] ) ) {\r\n update_post_meta( $post_ID, '_wpc_used', 0 );\r\n }\r\n\r\n if ( ! isset ( $meta[ '_wpc_today' ] ) ) {\r\n update_post_meta( $post_ID, '_wpc_today', '' );\r\n }\r\n\r\n if ( ! isset ( $meta[ '_wpc_vote_up' ] ) ) {\r\n update_post_meta( $post_ID, '_wpc_vote_up', 0 );\r\n }\r\n\r\n if ( ! isset ( $meta[ '_wpc_vote_down' ] ) ) {\r\n update_post_meta( $post_ID, '_wpc_vote_down', 0 );\r\n }\r\n\r\n if ( ! isset ( $meta[ '_wpc_expires' ] ) ) {\r\n update_post_meta( $post_ID, '_wpc_expires', '' );\r\n }\r\n\r\n }", "function update_couponCode(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "function putCount() {\n $datei = fopen(dirname(__FILE__) . DIRECTORY_SEPARATOR .\"countlog.data\", \"r\");\n $count = fgets($datei, 1000);\n fclose($datei);\n // Opens countlog.data to change new hit number\n $datei = fopen(dirname(__FILE__) . DIRECTORY_SEPARATOR .\"countlog.data\", \"w\");\n fwrite($datei, $count + 1);\n fclose($datei);\n return true;\n }", "public function hasCount(){\n return $this->_has(3);\n }", "public function hasChanges () {\n return !!$this->dirty;\n }", "protected function storeActive()\n\t{\n\t\t$storePublished = new \\DateTime($this->store['published_at']);\n\t\t$storeBumped = new \\DateTime($this->store['last_bump']);\n\t\t$interval = $storePublished->diff($storeBumped);\n\t\t$interval = $interval->days;\n\t\t\n\t\tforeach ($this->config->data()['storeActive'] as $key => $value) {\n\t\t\tif ($interval <= $key) {\n\t\t\t\t$this->score += $value;\n\t\t\t}\n\t\t}\n\t}", "public function actionRemovenotifycount()\n\t{\n\t\t$time=new CTimestamp;\n\t\t$value=$time->getDate();\n\t\t$uid = Yii::app()->user->id;\n\t\tUsers::model()->updateNotificationDate($uid,$value[0]);\n\t\tYii::app()->user->setState(\"notify_readdate\",$value[0]);\n\t\tYii::app()->user->setState(\"notify_count\",'');\n\t\techo CJSON::encode(array(\n\t\t\t 'status'=>'success',\n\t\t\t 'values'=>''\n\t\t));\n\t\tYii::app()->end();\n\t}", "public function updateStatus()\n\t\t{\n\t\t\t$thingdom = $this->getThingdom();\n\n\t\t\tif(!$thingdom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$page_count = wp_count_posts('page')->publish;\n\t\t\t$post_count = wp_count_posts()->publish;\n\t\t\t$comment_count = wp_count_comments()->approved;\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\t$thing->status('page_count', $page_count);\n\t\t\t$thing->status('post_count', $post_count);\n\t\t\t$thing->status('comment_count', $comment_count);\n\t\t}", "public function getUpdateStatus() {\n return $this->_statusManager->getStatus ();\n }", "protected function onUpdating()\n {\n return $this->isDataOnUpdateValid();\n }", "public function update_status();", "public function hasCount() {\n return $this->_has(2);\n }", "public function hasCount() {\n return $this->_has(1);\n }", "public function update(StoreCouponsRequest $request, Coupon $coupon)\n {\n //\n $coupon->code = $request->code;\n $coupon->expirationdate = $request->expirationdate;\n $coupon->discount = $request->discount;\n\n $coupon->save();\n\n return redirect()->route('coupons.index')->with('message', 'Coupon geupdate');\n }", "function setCount( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Count = $value;\n setType( $this->Count, \"integer\" );\n }", "function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}", "public function hasCount(){\n return $this->_has(13);\n }", "public function getAddCouponInfo()\n {\n $sql = \"SELECT * FROM casino_coupon_add \";\n return $this->_rdb->fetchAll($sql);\n }", "public function woocommerce_reports_coupons_overview_coupons_by_count($coupons) {\n\t}", "public function hasCount() {\n return $this->_has(3);\n }", "function update_post_counts($response){\r\n \t$count_key = 'post_views_count';\r\n \t$success = 0;\r\n \t$failure = 0;\r\n \tforeach ($response as $item){\r\n\t \t$post_id = $item[\"post_id\"];\r\n\t \tif(update_post_meta($post_id, $count_key, $item[\"views\"])) {\r\n\t \t\t$success++;\r\n\t \t} else {\r\n\t \t\t$failure++;\r\n\t \t}\r\n\t\t}\r\n\r\n\t\treturn array('success' => $success, 'failure' => $failure);\r\n\t}", "public function discounts()\n {\n $discount = 0;\n foreach ($this->coupons as $coupon) {\n $discount += $coupon->getDiscountApplied($this);\n }\n return $discount;\n }", "public function update(User $user, Coupon $coupon)\n {\n return $user->isAdmin();\n }", "function updateHitCount($short_url_id){\n\t\t$this->query('UPDATE short_urls SET hit_count = hit_count + 1, modified = NOW() WHERE id='.$short_url_id);\n\t}", "public function UpdateCustomerNotificationStatus()\n {\n if (isset($this->request->type) && ($this->request->type == \"on\")) {\n $customer_id = $this->authUser->id;\n $notificationStatus = $this->_customer->where('id', $customer_id)->update([ 'notification_status' => 1 ]);\n } elseif (isset($this->request->type) && ($this->request->type == \"off\")) {\n $customer_id = $this->authUser->id;\n $notificationStatus = $this->_customer->where('id', $customer_id)->update([ 'notification_status' => 0 ]);\n }\n return $notificationStatus;\n }", "public function getCount() {\n return $this->getFlagCount();\n }", "public function update_variables(){\n\n // Calculate this battle's count variables\n $perside_max = 0;\n if (!empty($this->values['players'])){\n foreach ($this->values['players'] AS $id => $player){\n $max = $player['counters']['robots_total'];\n if ($max > $perside_max){ $perside_max = $max; }\n }\n }\n $this->counters['robots_perside_max'] = $perside_max;\n\n // Define whether we're allowed to use experience or not\n $this->flags['allow_experience_points'] = true;\n if (!empty($this->flags['player_battle'])\n || !empty($this->flags['challenge_battle'])){\n $this->flags['allow_experience_points'] = false;\n }\n\n // Return true on success\n return true;\n\n }", "function getMembersCount($coupon_id)\n {\n $queryString = \"select count(*) as count from coupons_purchase where couponid='$coupon_id' and Coupon_amount_Status='T' \";\n\t//$queryString = \"select count(*) as count from coupons_purchase where couponid='$coupon_id'\"; \n $result = mysql_query($queryString);\n $row = mysql_fetch_object($result);\n return $row->count;\n }", "public function hasSoldCount(){\n return $this->_has(10);\n }", "public function store(Request $request)\n {\n $data = $request->all();\n //echo \"<pre>\"; print_r($data);die();\n\n\n $coupon = new Coupon;\n $coupon->coupon_code = $data['coupon_code'];\n $coupon->amount = $data['amount'];\n $coupon->amount_type = $data['amount_type'];\n\n\n if(!empty($data['status'])){\n $coupon->status = $data['status'];\n }\n\n\n\n $coupon->expiry_date = date($data['expiry_date']);\n\n\n\n $couponsCode = DB::table('coupons')->where(['coupon_code' => $data['coupon_code']])->count();\n //print_r($countProducts);\n //die();\n\n if($couponsCode>0){\n Toastr::error('Coupons already exist in Cart!','Errors');\n return redirect()->back();\n }\n\n\n $coupon->save();\n\n //Toastr::success('Coupon code update attributes successfully','Success');\n Toastr::success('Create Coupon code successfully !','Success');\n return redirect()->route('admin.coupons.index');\n\n }", "public function getShouldUpdate() {\n if (!$this->isReady()) {\n return false;\n }\n\n switch ($this->class) {\n case Source::CLASS_DATA:\n return (time() - $this->lastUpdated) > $this->source->getFrequency();\n break;\n case Source::CLASS_SENSOR:\n return false;\n break;\n }\n }", "public function hasLastUpdate() {\n return $this->_has(2);\n }", "public function count() {\n\t\treturn count($this->store);\n\t}", "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 }", "public function hasMoneycount(){\n return $this->_has(4);\n }", "function register_changes(){\n\t\t$this->db->query('UPDATE news SET counting = counting + 1 WHERE id=1');\n\t}", "public function getCount() {\n\t\treturn count($_COOKIE);\n\t}", "public function hasTotalCount() {\n return $this->_has(3);\n }", "public function hasTotalCount() {\n return $this->_has(3);\n }", "public function getCachedStatusesCountAttribute(): int\n {\n return Cache::remember($this->cacheKey().':statuses_count', 10, function () {\n return $this->statuses()->count();\n });\n }" ]
[ "0.5816421", "0.57590395", "0.56576604", "0.5510146", "0.54752237", "0.54641944", "0.54360294", "0.54211557", "0.54079664", "0.538146", "0.53621256", "0.5336472", "0.5327004", "0.5316119", "0.52745366", "0.52515197", "0.52458775", "0.52457744", "0.524206", "0.52282023", "0.5221475", "0.52200055", "0.521339", "0.5193589", "0.5191216", "0.51886237", "0.51679105", "0.5121214", "0.5112355", "0.510114", "0.5098519", "0.5097223", "0.5089042", "0.5075671", "0.50736696", "0.50706285", "0.50676316", "0.5036954", "0.5034073", "0.5025463", "0.5024534", "0.50238264", "0.50158906", "0.5009401", "0.50005305", "0.49948078", "0.49938968", "0.4992709", "0.4992054", "0.49849382", "0.49828595", "0.497596", "0.4969962", "0.4967572", "0.49659598", "0.49634385", "0.4952704", "0.49524498", "0.4951067", "0.4947179", "0.49471003", "0.49392146", "0.49377662", "0.4937405", "0.4922052", "0.49200442", "0.49166408", "0.4914695", "0.49026108", "0.49010447", "0.48894647", "0.48890367", "0.48823652", "0.4880019", "0.48752037", "0.48737502", "0.48690912", "0.48689654", "0.4867423", "0.48673207", "0.48668963", "0.4858182", "0.48540458", "0.48513404", "0.4850518", "0.4848787", "0.48474592", "0.48461056", "0.48367012", "0.48341456", "0.48327944", "0.48269427", "0.48216274", "0.48201016", "0.48183885", "0.4811667", "0.48081493", "0.48066097", "0.48066097", "0.4805116" ]
0.5947093
0
Gets information about whether stock was reduced.
public function get_stock_reduced( $order ) { $order_id = WC_Order_Factory::get_order_id( $order ); return wc_string_to_bool( get_post_meta( $order_id, '_order_stock_reduced', true ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function IsReduced()\n {\n return (bool) $this->getTotalReduction();\n }", "public function inStock()\n {\n return $this->stockCount() > 0;\n }", "public function getQuantite_stock()\r\n {\r\n return $this->quantite_stock;\r\n }", "public function getSold()\n {\n return $this->sold;\n }", "public function hasIsResell(){\n return $this->_has(7);\n }", "public function checkStock()\n {\n if ($this->qty > ($this->beer->stock - $this->beer->requested_stock)){\n return false;\n }\n\n return true;\n }", "public function getStockInfo() {\n //Fetch the product model \n $product = $this->getProduct();\n\n //Get the quantity from the product model \n $stock = $this->stockRegistry->getStockItem($product->getId());\n\n //Retun stock quantity here \n return $stock->getQty();\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getQuantitySold()\n {\n return $this->quantitySold;\n }", "public function getProductStock()\n {\n /** @var \\Magento\\CatalogInventory\\Model\\Stock\\ItemArray $stockItem */\n $stockItem = $this->stockRegistry->getStockItem(\n $this->getCurrentProduct()->getId(),\n $this->getCurrentProduct()->getStore()->getWebsiteId()\n );\n if ($stockItem->getManageStock() == 0) {\n return 1;\n }\n\n $qty = round($stockItem->getQty());\n if ($qty < 1) {\n if ($stockItem->getBackorders() == 1) {\n return 1;\n }\n\n if ($stockItem->getIsInStock()) {\n return '';\n }\n }\n return $qty;\n }", "function check_cart_item_stock() {\n\t\t\t$error = new WP_Error();\n\t\t\tforeach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t$_deals = $values['data'];\n\t\t\t\tif ($_deals->managing_stock()) :\n\t\t\t\t\tif ($_deals->is_in_stock() && $_deals->has_enough_stock( $values['quantity'] )) :\n\t\t\t\t\t\t// :)\n\t\t\t\t\telse :\n\t\t\t\t\t\t$error->add( 'out-of-stock', sprintf(__('Sorry, we do not have enough \"%s\" in stock to fulfill your order (%s in stock). Please edit your cart and try again. We apologise for any inconvenience caused.', 'cmdeals'), $_deals->get_title(), $_deals->_stock ) );\n\t\t\t\t\t\treturn $error;\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\treturn true;\n\t\t}", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "function reduceStockLevel($connection,$data){\n\t$subsales = array();\n\tforeach ($data->sales as $subsaledata){\n\t\tarray_push($subsales, $subsaledata);\n\t} \n\n\tfor($i = 0; $i < count($subsales); $i++){\n\t\t$this_stock_quantity = $subsales[$i]->quantity;\n\t\t$this_stock_id = $subsales[$i]->stock_id;\n\t\t$old_quantity = getStockquantity($this_stock_id,$connection);\n\t\t$new_quantity = $old_quantity - $this_stock_quantity;\n\t\tsetStockQuantity($this_stock_id,$new_quantity,$connection);\n\t}\n\treturn true;\n}", "public function getRevenueEnabled()\n {\n return $this->helper->trackRevenue();\n }", "public function stock()\n {\n if($this->quantity <= 5)\n {\n return \"Low Stock\";\n }\n\n return \"In Stock\";\n\n }", "public function getInStockAttribute()\n {\n return $this->quantity > 0;\n }", "private function getStock()\n {\n $article = oxNew('oxArticle');\n $article->load($this->testArticleId);\n return $article->oxarticles__oxstock->value;\n }", "function tep_check_stock($products_id, $products_quantity) {\n $stock_left = tep_get_products_stock($products_id) - $products_quantity;\n $out_of_stock = '';\n\n if ($stock_left < 0) {\n $out_of_stock = '<span class=\"markProductOutOfStock\">' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '</span>';\n }\n\n return $out_of_stock;\n }", "function hasStock() {\n \t$this->load_articles();\n \tforeach ( $this->articles as $articleObj ) {\n \t\tif ( $articleObj->getStock() > 0 ) {\n \t\t\treturn true;\n \t\t} \n \t}\n \treturn false;\n }", "public function isInStock()\n {\n return $this->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_ENABLED;\n }", "public function getReproductionStatus()\n {\n return $this->velos_reproduction_status;\n }", "public function hasRedsys(){\n return $this->_has(1);\n }", "public function getStock()\n {\n return $this->Stock;\n }", "function is_out_of_stock() {\n\t\tglobal $post;\n\t\t$post_id = $post->ID;\n\t\t$stock_status = get_post_meta($post_id, '_stock_status',true);\n\t\t\n\t\tif ($stock_status == 'outofstock') {\n\t\treturn true;\n\t\t} else {\n\t\treturn false;\n\t\t}\n\t}", "function is_in_stock() {\n\t\tif ($this->managing_stock()) :\n\t\t\tif (!$this->backorders_allowed()) :\n\t\t\t\tif ($this->stock==0 || $this->stock<0) :\n\t\t\t\t\treturn false;\n\t\t\t\telse :\n\t\t\t\t\tif ($this->data['stock_status']=='instock') return true;\n\t\t\t\t\treturn false;\n\t\t\t\tendif;\n\t\t\telse :\n\t\t\t\tif ($this->data['stock_status']=='instock') return true;\n\t\t\t\treturn false;\n\t\t\tendif;\n\t\tendif;\n\t\treturn true;\n\t}", "public function getPurchaseQuantitySold() {\n return $this->purchaseQuantitySold;\n }", "public function getQuantityInStock()\n\t{\n\t\treturn $this->getKeyValue('quantity_in_stock'); \n\n\t}", "public function isOutOfStock(){\n\t\treturn FALSE;\n\t}", "public function getStock(): int\n {\n return $this->stock;\n }", "public function out_of_stock_count(){\n\n\t\t$this->db->select(\"\n\t\t\t\ta.product_name,\n\t\t\t\ta.unit,\n\t\t\t\ta.product_id,\n\t\t\t\ta.price,\n\t\t\t\ta.supplier_price,\n\t\t\t\ta.product_model,\n\t\t\t\tc.category_name,\n\t\t\t\tsum(d.quantity) as totalSalesQnty,\n\t\t\t\tsum(b.quantity) as totalPurchaseQnty,\n\t\t\t\te.purchase_date as purchase_date,\n\t\t\t\te.purchase_id,\n\t\t\t\t(sum(b.quantity) - sum(d.quantity)) as stock\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id','left');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('invoice_details d','d.product_id = a.product_id','left');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id','left');\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->having('stock < 10', null, false);\n\t\t$this->db->having('totalPurchaseQnty < 10', null, false);\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "public function hasSoldCount(){\n return $this->_has(10);\n }", "public function getCarStatusSoldExpire(){\r\n\t\tif($this->getCarStatusValue()==2){\r\n\t\t\tif($this->getCarStatusInterval()>30){\r\n\t\t\t\treturn true;\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\t}", "public function get_error(){return $this->stock_error;}", "public function hasQuantity(): bool;", "public function getRemovedQuantity()\n {\n return $this->removedQuantity;\n }", "public function getUnitsconsumed()\n {\n return $this->unitsconsumed;\n }", "public function isRemoved() : bool\n {\n return $this->trashed();\n }", "function reduce_stock( $by = 1 ) {\n\t\tif ($this->managing_stock()) :\n\t\t\t$reduce_to = $this->stock - $by;\n\t\t\tupdate_post_meta($this->id, 'stock', $reduce_to);\n\t\t\treturn $reduce_to;\n\t\tendif;\n\t}", "public function hasActdiscount(){\n return $this->_has(34);\n }", "function managing_stock() {\n\t\tif (get_option('woocommerce_manage_stock')=='yes') :\n\t\t\tif (isset($this->data['manage_stock']) && $this->data['manage_stock']=='yes') return true;\n\t\tendif;\n\t\treturn false;\n\t}", "public function getTotalSoldValue()\n {\n return $this->totalSoldValue;\n }", "public function getResBookDesigQuantity()\n {\n return $this->resBookDesigQuantity;\n }", "private function getStockStatus() {\n $ss = $this->wooData->getStockStatus();\n if (!$ss) return null;\n\n $options = WooCommerceSettings::getStockStatusOptionsForSelect();\n\n return Utils::array_get($options, $ss, null);\n }", "protected function QtyInStock() {\n\treturn $this->GetFieldValue('QtyInStock');\n }", "public function hasAlreadyUsedUpMoney()\n {\n return !! Timestamp :: build( $this ) -> getChargingStatusTimestamp( OrderStatusEnum :: USED_UP );\n }", "public function isRedelivered()\n {\n return (bool) $this->message->delivery_info['redelivered'];\n }", "public function getNotifyStockQty()\n {\n return (int) Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_NOTIFY_STOCK_QTY);\n }", "public function get_stock_status( $product ) {\n\n\t\t\tif ( ! $product ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$stock_status = wc_get_stock_html( $product );\n\n\t\t\tif ( ! empty( $stock_status ) ) {\n\t\t\t\t$stock_status = sprintf(\n\t\t\t\t\t'<span class=\"jet-cw-stock-status\">%s</span>',\n\t\t\t\t\t$stock_status\n\t\t\t\t);\n\n\t\t\t\treturn apply_filters( 'jet-cw/template-functions/stock-status', $stock_status );\n\t\t\t}\n\n\t\t}", "public function hasRetreatdf(){\r\n return $this->_has(29);\r\n }", "public function closeReason() {\n if ($this->histories()->whereType(10)->exists()) {\n return $this->histories()\n ->whereType(10)->orderBy('created_at', 'desc')\n ->first()->text;\n } else {\n return false;\n }\n }", "public function removed() {\n\t\treturn $this->_isRemoved;\n\t}", "public function verifica_stock($cod, $sede)\n\t\t{ \n\t\t\t$this->load->database();\n\t\t\t$sql = 'select stock_real from stock where id_insumo= '.$cod.' and id_sede= '.$sede;\n\t\t\t$consulta=$this->db->query($sql);\n\t\t\t$nombre=$consulta->row();\n\t\t\tif ($nombre == NULL)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telseif ($nombre->stock_real > \"0\")\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t\t \n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}", "public function hasCriticalEffectdf(){\r\n return $this->_has(12);\r\n }", "public function getRetrochargeEvents()\n {\n if (isset($this->list['Retrocharge'])) {\n return $this->list['Retrocharge'];\n } else {\n return false;\n }\n }", "public function isIronCostReduction(): bool {\n return $this->value === self::IRON_COST_REDUCTION;\n }", "public function getStock();", "public function hasCriticalEffectdf(){\r\n return $this->_has(15);\r\n }", "public function hasCriticalEffect(){\r\n return $this->_has(14);\r\n }", "function it_exchange_get_number_of_recovered_abandon_carts() {\n\t$carts = it_exchange_get_abandoned_carts( array( 'cart_status' => 'recovered' ) );\n\treturn count( $carts );\n}", "public function hasCriticalDf(){\r\n return $this->_has(10);\r\n }", "public function isUnitCostReduction(): bool {\n return $this->value === self::KINGDOM_UNIT_COST_REDUCTION;\n }", "public function getManageStock()\n {\n return (int) Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MANAGE_STOCK);\n }", "public function nStatus(){\n\t\t$database = new Database();\n\t\t$n_status = 0;\n\t\t$holder_stocks = new HolderStocks($this->sh_id);\n\t\t$cur_price =0; \n\t\t$base_price = 0;\n\t\t$holder_stocks->holder_stocks;\n\t\tforeach ($holder_stocks->holder_stocks as $stock) {\n\t\t\t$cur_price = $cur_price + $stock['s_qty']*Stock::getCurPrice($stock['sc_id']) ;\n\t\t\t$base_price += $stock['s_qty']*$stock['pur_price'];\n\t\t}\n\t\tif($cur_price > $base_price){\n\t\t\t$n_status = (float) ((float)$cur_price)/(float)$base_price ;\n\t\t\t$n_status =$n_status -1.0;\n\t\t}elseif($cur_price < $base_price){\n\t\t\t$n_status = (float) ((float)$cur_price)/(float)$base_price ;\n\t\t\t$n_status = 1.0 - $n_status;\n\t\t}else{\n\t\t\t$n_status =0.0;\n\t\t}\n\t\t$n_status *= 100.0;\n\t\tif(isset($this->sh_id)){\n\t\t$query = \"UPDATE \"\t.self::$table;\n\t\t$query .=\" SET n_status = \".$n_status;\n\t\t$query .=\" WHERE id=\".$this->sh_id;\n\t\t$run = $database->query($query);\n\t\tif($run){\n\t\t\t$this->n_status = $n_status;\n\t\t\treturn $n_status;\n\t\t}else{\n\t\t\treturn $n_status;\n\t\t}\n\t\t}\t\n\t}", "protected function QtyAvailable() {\n\t//throw new exception('Call CountForSale() instead of QtyAvailable().');\t// 2018-02-17\n\treturn $this->GetFieldValue('CountForSale');\t\t\t\t\t// 2018-04-18 was QtyAvail\n }", "public function isDiscounted()\n\t{\n\t\treturn $this->discounted;\n\t}", "public function getIsAlwaysInStock($variation_id);", "public function stockCount()\n {\n return $this->variations->sum(function ($variation) {\n return $variation->stockCount();\n });\n }", "public function hasDefense(){\r\n return $this->_has(6);\r\n }", "public function getIsStockManaged($variation_id);", "public function isCatalogOutOfStockVisible()\n {\n return (\n $this->isCatalogInformationVisible() && Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_OUT_OF_STOCK)\n ) ? true : false;\n }", "public function hasRemovedate(){\n return $this->_has(30);\n }", "public function cleanProductCacheOnStockChange(Varien_Event_Observer $observer) {\n /**\n * @var $engine Brim_PageCache_Model_Engine\n * @var $stockItem Mage_CatalogInventory_Model_Stock_Item\n * @var $productRelation Mage_Catalog_Model_Resource_Product_Relation\n * @var $writeConnection Varien_Db_Adapter_Interface\n */\n $engine = Mage::getSingleton('brim_pagecache/engine');\n if (!$engine->isEnabled()) {\n return;\n }\n\n\n $stockItem = $observer->getEvent()->getItem();\n\n $engine->devDebug(__METHOD__);\n $engine->devDebug($stockItem->getOrigData());\n $engine->devDebug($stockItem->getData());\n\n // Original data is empty when called from the checkout and is only called when the stock status changes.\n if ($stockItem->getOrigData() == null\n || $stockItem->getData('is_in_stock') != $stockItem->getOrigData('is_in_stock')) {\n // stock status has changed\n $tags = $this->_findRelatedProductTags($stockItem->getProductId());\n $engine->devDebug($tags);\n\n Mage::app()->getCacheInstance()->clean($tags);\n }\n\n return;\n }", "public function hasDiscount(){\n return $this->_has(9);\n }", "public function getQtyReturned() {\n return $this->item->getQtyReturned();\n }", "public function hasOldPrice(){\n return $this->_has(17);\n }", "public function set_stock_reduced( $order, $set ) {\n\t\t$order_id = WC_Order_Factory::get_order_id( $order );\n\n\t\tupdate_post_meta( $order_id, '_order_stock_reduced', wc_bool_to_string( $set ) );\n\t}", "public function hasPopulations() {\n return $this->_has(22);\n }", "public function hasCritical(){\r\n return $this->_has(9);\r\n }", "public function hasHandstatus(){\n return $this->_has(7);\n }", "public function getConsumed()\n {\n return $this->consumed;\n }", "public function hasCritical(){\r\n return $this->_has(12);\r\n }", "protected function hasRemainingDiscount()\n {\n return !$this->limited || $this->remaining > 0;\n }", "function checkStocksAvailability($data,$connection){\n\t$subsales = array();\n\t$error_message = '';\n\n\tforeach ($data->sales as $subsaledata){\n\t\tarray_push($subsales, $subsaledata);\n\t} \n\n\n\n\tfor($i = 0; $i < count($subsales); $i++){\n\t\t$this_stock_quantity = $subsales[$i]->quantity;\n\t\t$this_stock_id = $subsales[$i]->stock_id;\n\t\t$old_quantity = getStockquantity($this_stock_id,$connection);\n\n\t\tif ($old_quantity < $this_stock_quantity){\n\t\t\t$error_message .= sprintf(\"Eroor! There are only %d %s in stock \\n\", \n\t\t\t\t$old_quantity, getStockDescription($this_stock_id,$connection));\n\t\t}\n\t\t\n\t}\n\n\tif($error_message == ''){\n\t\t// means all stock quantity are needed\n\t\treturn '';\n\t}else {\n\t\treturn $error_message;\n\t}\n}", "public function hasCriticalEffect(){\r\n return $this->_has(11);\r\n }", "public function hasSilencedf(){\r\n return $this->_has(30);\r\n }", "protected function _fcpoCheckReduceBefore() \n {\n $oConfig = $this->_oFcpoHelper->fcpoGetConfig();\n $sPaymentId = $this->oxorder__oxpaymenttype->value;\n $blReduceStockBefore = !(bool) $oConfig->getConfigParam('blFCPOReduceStock');\n $blIsRedirectPayment = fcPayOnePayment::fcIsPayOneRedirectType($sPaymentId);\n\n if ($blReduceStockBefore && $blIsRedirectPayment) {\n $aOrderArticles = $this->getOrderArticles();\n foreach ($aOrderArticles as $oOrderArticle) {\n $oOrderArticle->updateArticleStock($oOrderArticle->oxorderarticles__oxamount->value * (-1), $oConfig->getConfigParam('blAllowNegativeStock'));\n }\n }\n }", "public function getIdstock()\r\n {\r\n return $this->idstock;\r\n }", "public function getLost()\n {\n return $this->lost;\n }", "public static function getRecoveredStatus(){\n\t\treturn self::getStatus( 'recovered' );\n\t}", "public function getIsDepositSufficient()\n {\n return $this->isDepositSufficient;\n }", "public function getQuantite()\n {\n return $this->quantite;\n }", "public function hasRebuilt() {\n return $this->rebuilt;\n }", "public function getClosed()\n {\n return $this->closed;\n }", "public function getClosed()\n {\n return $this->closed;\n }", "private function CheckStockLevels()\n\t{\n\t\t$quote = getCustomerQuote();\n\t\t$items = $quote->getItems();\n\n\t\tforeach($items as $item) {\n\t\t\tif($item->getProductId() && !$item->checkStockLevel()) {\n\t\t\t\t$outOfStock = $item->getName();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($outOfStock)) {\n\t\t\tFlashMessage(sprintf(getLang('CheckoutInvLevelBelowOrderQty'), $outOfStock), MSG_ERROR, 'cart.php');\n\t\t}\n\t}" ]
[ "0.6422627", "0.59472054", "0.582819", "0.5803821", "0.5723443", "0.57084095", "0.56384313", "0.56364375", "0.56364375", "0.56364375", "0.56364375", "0.56364375", "0.5621274", "0.56175375", "0.5582235", "0.5565467", "0.5565467", "0.5563948", "0.5550475", "0.5529332", "0.55263036", "0.55169773", "0.55077", "0.5500298", "0.5497338", "0.54314405", "0.54228", "0.5415243", "0.54039025", "0.5399415", "0.5381947", "0.53288215", "0.5323527", "0.53162986", "0.5296365", "0.52800727", "0.52763987", "0.52750254", "0.52717274", "0.52690744", "0.5258522", "0.5239917", "0.5170805", "0.51422995", "0.51383764", "0.5135735", "0.51326096", "0.5115522", "0.5105225", "0.51050764", "0.5104331", "0.509706", "0.50771636", "0.5074589", "0.50734496", "0.50474334", "0.5027434", "0.50255984", "0.50063556", "0.4999918", "0.4996394", "0.49934763", "0.498487", "0.49847895", "0.4983921", "0.49826837", "0.4975678", "0.49750713", "0.49739724", "0.49715227", "0.4967042", "0.49539286", "0.49521816", "0.4951702", "0.49453175", "0.49376634", "0.49311092", "0.49242213", "0.4920743", "0.49194363", "0.4895751", "0.48954177", "0.4885562", "0.48780608", "0.48752755", "0.486553", "0.48643917", "0.48606652", "0.48588184", "0.48558822", "0.48463383", "0.4845293", "0.48413762", "0.48352578", "0.48273027", "0.482194", "0.48191696", "0.48139116", "0.48139116", "0.48119926" ]
0.6976673
0
Stores information about whether stock was reduced.
public function set_stock_reduced( $order, $set ) { $order_id = WC_Order_Factory::get_order_id( $order ); update_post_meta( $order_id, '_order_stock_reduced', wc_bool_to_string( $set ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_stock_reduced( $order ) {\n\t\t$order_id = WC_Order_Factory::get_order_id( $order );\n\n\t\treturn wc_string_to_bool( get_post_meta( $order_id, '_order_stock_reduced', true ) );\n\t}", "public function inStock()\n {\n return $this->stockCount() > 0;\n }", "public function checkStock()\n {\n if ($this->qty > ($this->beer->stock - $this->beer->requested_stock)){\n return false;\n }\n\n return true;\n }", "function reduceStockLevel($connection,$data){\n\t$subsales = array();\n\tforeach ($data->sales as $subsaledata){\n\t\tarray_push($subsales, $subsaledata);\n\t} \n\n\tfor($i = 0; $i < count($subsales); $i++){\n\t\t$this_stock_quantity = $subsales[$i]->quantity;\n\t\t$this_stock_id = $subsales[$i]->stock_id;\n\t\t$old_quantity = getStockquantity($this_stock_id,$connection);\n\t\t$new_quantity = $old_quantity - $this_stock_quantity;\n\t\tsetStockQuantity($this_stock_id,$new_quantity,$connection);\n\t}\n\treturn true;\n}", "function managing_stock() {\n\t\tif (get_option('woocommerce_manage_stock')=='yes') :\n\t\t\tif (isset($this->data['manage_stock']) && $this->data['manage_stock']=='yes') return true;\n\t\tendif;\n\t\treturn false;\n\t}", "function check_cart_item_stock() {\n\t\t\t$error = new WP_Error();\n\t\t\tforeach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t$_deals = $values['data'];\n\t\t\t\tif ($_deals->managing_stock()) :\n\t\t\t\t\tif ($_deals->is_in_stock() && $_deals->has_enough_stock( $values['quantity'] )) :\n\t\t\t\t\t\t// :)\n\t\t\t\t\telse :\n\t\t\t\t\t\t$error->add( 'out-of-stock', sprintf(__('Sorry, we do not have enough \"%s\" in stock to fulfill your order (%s in stock). Please edit your cart and try again. We apologise for any inconvenience caused.', 'cmdeals'), $_deals->get_title(), $_deals->_stock ) );\n\t\t\t\t\t\treturn $error;\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\treturn true;\n\t\t}", "public function IsReduced()\n {\n return (bool) $this->getTotalReduction();\n }", "public function getQuantite_stock()\r\n {\r\n return $this->quantite_stock;\r\n }", "public function cleanProductCacheOnStockChange(Varien_Event_Observer $observer) {\n /**\n * @var $engine Brim_PageCache_Model_Engine\n * @var $stockItem Mage_CatalogInventory_Model_Stock_Item\n * @var $productRelation Mage_Catalog_Model_Resource_Product_Relation\n * @var $writeConnection Varien_Db_Adapter_Interface\n */\n $engine = Mage::getSingleton('brim_pagecache/engine');\n if (!$engine->isEnabled()) {\n return;\n }\n\n\n $stockItem = $observer->getEvent()->getItem();\n\n $engine->devDebug(__METHOD__);\n $engine->devDebug($stockItem->getOrigData());\n $engine->devDebug($stockItem->getData());\n\n // Original data is empty when called from the checkout and is only called when the stock status changes.\n if ($stockItem->getOrigData() == null\n || $stockItem->getData('is_in_stock') != $stockItem->getOrigData('is_in_stock')) {\n // stock status has changed\n $tags = $this->_findRelatedProductTags($stockItem->getProductId());\n $engine->devDebug($tags);\n\n Mage::app()->getCacheInstance()->clean($tags);\n }\n\n return;\n }", "function is_in_stock() {\n\t\tif ($this->managing_stock()) :\n\t\t\tif (!$this->backorders_allowed()) :\n\t\t\t\tif ($this->stock==0 || $this->stock<0) :\n\t\t\t\t\treturn false;\n\t\t\t\telse :\n\t\t\t\t\tif ($this->data['stock_status']=='instock') return true;\n\t\t\t\t\treturn false;\n\t\t\t\tendif;\n\t\t\telse :\n\t\t\t\tif ($this->data['stock_status']=='instock') return true;\n\t\t\t\treturn false;\n\t\t\tendif;\n\t\tendif;\n\t\treturn true;\n\t}", "protected function _fcpoCheckReduceBefore() \n {\n $oConfig = $this->_oFcpoHelper->fcpoGetConfig();\n $sPaymentId = $this->oxorder__oxpaymenttype->value;\n $blReduceStockBefore = !(bool) $oConfig->getConfigParam('blFCPOReduceStock');\n $blIsRedirectPayment = fcPayOnePayment::fcIsPayOneRedirectType($sPaymentId);\n\n if ($blReduceStockBefore && $blIsRedirectPayment) {\n $aOrderArticles = $this->getOrderArticles();\n foreach ($aOrderArticles as $oOrderArticle) {\n $oOrderArticle->updateArticleStock($oOrderArticle->oxorderarticles__oxamount->value * (-1), $oConfig->getConfigParam('blAllowNegativeStock'));\n }\n }\n }", "public function isOutOfStock(){\n\t\treturn FALSE;\n\t}", "function hasStock() {\n \t$this->load_articles();\n \tforeach ( $this->articles as $articleObj ) {\n \t\tif ( $articleObj->getStock() > 0 ) {\n \t\t\treturn true;\n \t\t} \n \t}\n \treturn false;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "function tep_check_stock($products_id, $products_quantity) {\n $stock_left = tep_get_products_stock($products_id) - $products_quantity;\n $out_of_stock = '';\n\n if ($stock_left < 0) {\n $out_of_stock = '<span class=\"markProductOutOfStock\">' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '</span>';\n }\n\n return $out_of_stock;\n }", "public function isInStock()\n {\n return $this->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_ENABLED;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "function is_out_of_stock() {\n\t\tglobal $post;\n\t\t$post_id = $post->ID;\n\t\t$stock_status = get_post_meta($post_id, '_stock_status',true);\n\t\t\n\t\tif ($stock_status == 'outofstock') {\n\t\treturn true;\n\t\t} else {\n\t\treturn false;\n\t\t}\n\t}", "function wwt_perform_consignment_stocks_increase($status, $order) {\r\n $shippingMethod = get_shipping_method_with_id($order);\r\n $consignmentStocks = WWT_ConsignmentEntity::get_all();\r\n\r\n foreach ($consignmentStocks as $consignment) {\r\n $consignmentStockShippingMethods = explode(FIELDS_SEPARATOR, $consignment->paymentMethods);\r\n\r\n if (in_array($shippingMethod, $consignmentStockShippingMethods)) {\r\n $order->add_order_note(sprintf(__('Goods were taken from consignment stock [%s]. No main warehouse changes.', 'medinatur_v3'), $consignment->name));\r\n\r\n $products = $order->get_items();\r\n\r\n foreach ($products as $product) {\r\n $itemStockReduced = $product->get_meta( WWT_STOCK_REDUCED_FLAG, true );\r\n\r\n if (!$itemStockReduced) {\r\n $quantity = $product->get_quantity();\r\n $productId = $product->get_product_id();\r\n WWT_ConsignmentEntity::update_product($consignment->id, $productId, -$quantity);\r\n $logEntry = new WWT_ConsignmentLogEntity($consignment->id, NULL, $productId, -$quantity, sprintf(__('Amout reduced because of change in order %d.', 'woocommerce-warehouse-transactions'), $order->id), $order->id);\r\n $logEntry->save();\r\n $product->add_meta_data( WWT_STOCK_REDUCED_FLAG, $quantity, true );\r\n $product->save();\r\n }\r\n }\r\n\r\n $status = false;\r\n }\r\n }\r\n\r\n return $status;\r\n}", "public function getInStockAttribute()\n {\n return $this->quantity > 0;\n }", "public function getQuantityInStock()\n\t{\n\t\treturn $this->getKeyValue('quantity_in_stock'); \n\n\t}", "public function stock()\n {\n if($this->quantity <= 5)\n {\n return \"Low Stock\";\n }\n\n return \"In Stock\";\n\n }", "public function updateStock(array $stock) {\n\t\t$saved = true;\n\t\tforeach ($stock as $k => $v) {\n\t\t\tif (!empty($v[$this->ShopBranchStockLog->alias])) {\n\t\t\t\t$v = $v[$this->ShopBranchStockLog->alias];\n\t\t\t}\n\t\t\t$saved = $saved && $this->updateAll(\n\t\t\t\tarray($this->alias . '.stock' => $this->find('totalProductStock', $v) + $v['change']),\n\t\t\t\tarray(\n\t\t\t\t\t$this->alias . '.shop_branch_id' => $v['shop_branch_id'],\n\t\t\t\t\t$this->alias . '.shop_product_variant_id' => $v['shop_product_variant_id'],\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $saved;\n\t}", "public function getStock(): int\n {\n return $this->stock;\n }", "public function getSold()\n {\n return $this->sold;\n }", "public function getStock()\n {\n return $this->Stock;\n }", "public function get_error(){return $this->stock_error;}", "public function getStockInfo() {\n //Fetch the product model \n $product = $this->getProduct();\n\n //Get the quantity from the product model \n $stock = $this->stockRegistry->getStockItem($product->getId());\n\n //Retun stock quantity here \n return $stock->getQty();\n }", "public function hasIsResell(){\n return $this->_has(7);\n }", "public function validateProductStock($productCart)\n {\n $productStock = $productCart->qty;\n\n $prodCartsSum = Cart::where('user_id', $productCart->user_id)\n ->where('id', '!=', $productCart->id)\n ->where('product_id', $productCart->product_id)\n ->get()->sum('qty');\n\n $prodStock = Product::find($productCart->product_id)->stock;\n $stock_qty = ($prodStock - $prodCartsSum) > 0 ? $prodStock - $prodCartsSum : 0;\n $qty = $productCart->qty >= $stock_qty ? $stock_qty : $productCart->qty;\n\n $productCart->update(['stock_qty' => $stock_qty, 'qty' => $qty]);\n }", "function reduce_stock( $by = 1 ) {\n\t\tif ($this->managing_stock()) :\n\t\t\t$reduce_to = $this->stock - $by;\n\t\t\tupdate_post_meta($this->id, 'stock', $reduce_to);\n\t\t\treturn $reduce_to;\n\t\tendif;\n\t}", "function reduceAddedByCouponsValueIfQuantityIsLess() {\r\n\t\tif(is_array($this->basket->basket_items)){\r\n\t\t\tforeach($this->basket->basket_items as $articleUid => $item) {\r\n\t\t\t\tif(is_array($item->tx_commercecoupons_addedbycouponid)) {\r\n\t\t\t\t\t#debug($item);\r\n\t\t\t\t}\r\n\t\t\t\tif(is_array($item->tx_commercecoupons_addedbycouponid) && count($item->tx_commercecoupons_addedbycouponid)>$item->quantity) {\r\n\t\t\t\t\t$new_addedByCoupons_value = $this->getFirstItemsOfArray($item->tx_commercecoupons_addedbycouponid, $item->quantity);\r\n\t\t\t\t\t$old_addedByCoupons_value = $item->tx_commercecoupons_addedbycouponid;\r\n\t\t\t\t\tif(is_array($this->basket->basket_items[$articleUid]->tx_commercecoupons_relatedcoupon)) {\r\n\r\n\t\t\t\t\t\t$removedItems = array_diff($old_addedByCoupons_value,$new_addedByCoupons_value);\r\n\t\t\t\t\t\t$this->removeItemsByValue($this->basket->basket_items[$articleUid]->tx_commercecoupons_relatedcoupon,$removedItems);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->basket->basket_items[$articleUid]->tx_commercecoupons_addedbycouponid = $new_addedByCoupons_value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function removeStock(array $stock) {\n\t\t$stock = $this->_normaliseStock($stock, false);\n\t\t$this->ShopBranchStockLog->create();\n\t\tif (!$this->ShopBranchStockLog->saveAll($stock)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->updateStock($stock);\n\t}", "public function getQuantitySold()\n {\n return $this->quantitySold;\n }", "public function modify_stock( $by ) {\n\t\tglobal $wpdb;\n\t\t\n\t\t// Only do this if we're updating\n\t\tif ( ! $this->managing_stock() )\n\t\t\treturn false;\n\n\t\t// +- = minus\n\t\t$this->stock = $this->stock + $by;\n\t\t$amount_sold = ( ! empty( $this->stock_sold ) ? $this->stock_sold : 0 ) + $by;\n\n\t\t// Update & return the new value\n\t\tupdate_post_meta( $this->variation_id, 'stock', $this->stock );\n\t\tupdate_post_meta( $this->variation_id, 'stock_sold', $amount_sold );\n\t\t\n\t\tif ( self::get_options()->get_option('jigoshop_notify_no_stock_amount') >= 0\n\t\t\t&& self::get_options()->get_option('jigoshop_notify_no_stock_amount') >= $this->stock\n\t\t\t&& self::get_options()->get_option( 'jigoshop_hide_no_stock_product' ) == 'yes' ) {\n\t\t\t\n\t\t\t$wpdb->update( $wpdb->posts, array( 'post_status' => 'draft' ), array( 'ID' => $this->variation_id ) );\n\t\t\t\n\t\t} else if ( $this->stock > self::get_options()->get_option('jigoshop_notify_no_stock_amount')\n\t\t\t&& get_post_status( $this->variation_id ) == 'draft'\n\t\t\t&& self::get_options()->get_option( 'jigoshop_hide_no_stock_product' ) == 'yes' ) {\n\t\t\t\n\t\t\t$wpdb->update( $wpdb->posts, array( 'post_status' => 'publish' ), array( 'ID' => $this->variation_id ) );\n\t\t}\n\t\t\n\t\treturn $this->stock;\n\t}", "function update_stock($idx, $stock, $qty, $digital)\n{\n global $current_user_id, $config, $db_prefix;\n\n // if manage stock disabled\n if (!$config['cart']['manage_stock']) {\n return true;\n }\n\n // if digital => do NOT decrease stock!\n if ($digital) {\n return true;\n }\n\n // if it is actually out-of-stock (how can someone checkout for out-of-stock items?)\n if (!$stock) {\n sql_query(\"DELETE FROM \".$db_prefix.\"orders WHERE idx = '$idx' LIMIT 1\");\n return false;\n } else {\n // if this is the last stock, delete all un-checked-out orders related to the item\n if ($stock == 1) {\n sql_query(\"DELETE FROM \".$db_prefix.\"orders WHERE idx = '$idx' LIMIT 1\");\n }\n\n // decrease stock condition\n if ($stock < $qty) {\n $qty = $stock;\n }\n sql_query(\"UPDATE \".$db_prefix.\"products SET stock = stock-$qty WHERE idx = '$idx' LIMIT 1\");\n\n return true;\n }\n}", "public function getProductStock()\n {\n /** @var \\Magento\\CatalogInventory\\Model\\Stock\\ItemArray $stockItem */\n $stockItem = $this->stockRegistry->getStockItem(\n $this->getCurrentProduct()->getId(),\n $this->getCurrentProduct()->getStore()->getWebsiteId()\n );\n if ($stockItem->getManageStock() == 0) {\n return 1;\n }\n\n $qty = round($stockItem->getQty());\n if ($qty < 1) {\n if ($stockItem->getBackorders() == 1) {\n return 1;\n }\n\n if ($stockItem->getIsInStock()) {\n return '';\n }\n }\n return $qty;\n }", "protected function sold()\n\t{\n\t\tforeach ($this->config->data()['sold'] as $key => $value) {\n\t\t\tif ($this->store['sold'] >= $key) {\n\t\t\t\t$this->score += $value;\n\t\t\t}\n\t\t}\n\t}", "function _set_stock_info(&$data)\n\t{\n\t\tforeach ($this->cart->contents() as $item)\n\t\t{\n\t\t\t$prod_id = $item['id'];\n\t\t\t$product = $this->database->GetProductById($prod_id);\n\n\t\t\t//Check stock and set stock info\n\t\t\t$data['products'][$item['rowid'].'stock_state'] = $this->_set_stock_state($product, $item);\n\n\t\t\t$data['products'][$prod_id] = $product;\n\t\t}\n\t}", "public function saveMeterReading()\n {\n $current_reading = $this->getMeterCurrentReading();\n if ($current_reading != '') {\n $this->current_reading = $current_reading;\n if ($this->save()) {\n Yii::warning('getMeterCurrentReading: ' . $current_reading);\n return true;\n } else {\n return false;\n }\n }\n }", "public function hasAlreadyUsedUpMoney()\n {\n return !! Timestamp :: build( $this ) -> getChargingStatusTimestamp( OrderStatusEnum :: USED_UP );\n }", "protected function checkStock()\n {\n DB::beginTransaction();\n try{\n foreach ($this->cart as $item){\n $unit = Itens::find($item->id);\n $qtd = !empty($unit->quantity) ? $unit->quantity : $unit->weight;\n\n if($qtd >= $item->qty){\n if(!empty($unit->quantity)){\n $unit->quantity = $unit->quantity - $item->qty;\n }else{\n $unit->weight = $unit->weight - $item->qty;\n }\n $unit->save();\n }\n }\n DB::commit();\n $this->addItensToOrder();\n Session::flash('error', 'INfelizmente não foi possível processar sua compra devido a falta de estoque para um de nossos itens em cotação');\n }catch (Exception $e){\n DB::rollback();\n DebugBar::addException($e);\n }\n\n }", "public function restored(Stock $stock)\n {\n //\n }", "public function saveProductStock(ProductStock $product_stock, $remove_all = true)\n {\n $product_id = $product_stock->getProductId();\n\n if ($remove_all) {\n $this->removeProductStocks($product_id);\n }\n\n $warehouses_amounts = $product_stock->getStockAsArray();\n $empty_warehouse_ids = [];\n\n if (empty($warehouses_amounts)) {\n return false;\n }\n\n foreach ($product_stock->getWarehouses() as $product_warehouse) {\n if (!$product_warehouse->isMarkedToRemove()) {\n continue;\n }\n\n $warehouse_id = $product_warehouse->getWarehouseId();\n unset($warehouses_amounts[$warehouse_id]);\n $empty_warehouse_ids[$warehouse_id] = $warehouse_id;\n }\n\n if (!$remove_all && $empty_warehouse_ids) {\n $this->db->query(\n 'DELETE FROM ?:warehouses_products_amount WHERE product_id = ?i AND warehouse_id IN (?n)',\n $product_id,\n $empty_warehouse_ids\n );\n }\n\n if ($warehouses_amounts) {\n $this->db->replaceInto('warehouses_products_amount', $warehouses_amounts, true);\n }\n\n $this->recalculateDestinationProductsStocksByProductIds([$product_id]);\n\n return true;\n }", "public function getTotalSoldValue()\n {\n return $this->totalSoldValue;\n }", "public function hasQuantity(): bool;", "public function nStatus(){\n\t\t$database = new Database();\n\t\t$n_status = 0;\n\t\t$holder_stocks = new HolderStocks($this->sh_id);\n\t\t$cur_price =0; \n\t\t$base_price = 0;\n\t\t$holder_stocks->holder_stocks;\n\t\tforeach ($holder_stocks->holder_stocks as $stock) {\n\t\t\t$cur_price = $cur_price + $stock['s_qty']*Stock::getCurPrice($stock['sc_id']) ;\n\t\t\t$base_price += $stock['s_qty']*$stock['pur_price'];\n\t\t}\n\t\tif($cur_price > $base_price){\n\t\t\t$n_status = (float) ((float)$cur_price)/(float)$base_price ;\n\t\t\t$n_status =$n_status -1.0;\n\t\t}elseif($cur_price < $base_price){\n\t\t\t$n_status = (float) ((float)$cur_price)/(float)$base_price ;\n\t\t\t$n_status = 1.0 - $n_status;\n\t\t}else{\n\t\t\t$n_status =0.0;\n\t\t}\n\t\t$n_status *= 100.0;\n\t\tif(isset($this->sh_id)){\n\t\t$query = \"UPDATE \"\t.self::$table;\n\t\t$query .=\" SET n_status = \".$n_status;\n\t\t$query .=\" WHERE id=\".$this->sh_id;\n\t\t$run = $database->query($query);\n\t\tif($run){\n\t\t\t$this->n_status = $n_status;\n\t\t\treturn $n_status;\n\t\t}else{\n\t\t\treturn $n_status;\n\t\t}\n\t\t}\t\n\t}", "public function getNotifyStockQty()\n {\n return (int) Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_NOTIFY_STOCK_QTY);\n }", "private function CheckStockLevels()\n\t{\n\t\t$quote = getCustomerQuote();\n\t\t$items = $quote->getItems();\n\n\t\tforeach($items as $item) {\n\t\t\tif($item->getProductId() && !$item->checkStockLevel()) {\n\t\t\t\t$outOfStock = $item->getName();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($outOfStock)) {\n\t\t\tFlashMessage(sprintf(getLang('CheckoutInvLevelBelowOrderQty'), $outOfStock), MSG_ERROR, 'cart.php');\n\t\t}\n\t}", "public function hasStored()\n\t{\n\t\tif( $_SESSION[__CLASS__][$this->questionId] !== null )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "private function fixOutgoingStorageInvoice(): bool\n {\n // get storage department\n $storageDepartment = $this->invoice->outgoingStorageDepartment()->first();\n\n foreach ($this->getInvoiceProducts() as $reclamation) {\n\n // get storage product\n $storageProduct = $this->storageProductStockHandler->getStorageProduct($storageDepartment, $reclamation->products_id);\n\n // product not available\n if (!$storageProduct || $storageProduct->stock_quantity < 1) {\n return false;\n }\n\n // update stock quantity\n $this->storageProductStockHandler->decreaseProductStock($storageProduct, 1);\n }\n\n return true;\n }", "public function getPurchaseQuantitySold() {\n return $this->purchaseQuantitySold;\n }", "function has_enough_stock( $quantity ) {\n\t\t\n\t\tif ($this->backorders_allowed()) return true;\n\t\t\n\t\tif ($this->stock >= $quantity) :\n\t\t\treturn true;\n\t\tendif;\n\t\t\n\t\treturn false;\n\t\t\n\t}", "public function validateStock()\n {\n $valid = true;\n $id_user = $this->session->userdata('id_user');\n $cart = $this->where('id_user', $id_user)->get();\n \n foreach ($cart as $row) {\n $this->table = 'barang';\n $barang = $this->where('id', $row->id_barang)->first(); \n \n if (($barang->qty - $row->qty) < 0) {\n $this->session->set_flashdata(\"qty_cartout_$row->id\", \"Stock hanya ada $barang->qty\");\n $valid = false;\n }\n\n $this->table = 'keranjang_keluar';\n }\n\n return $valid;\n }", "function decreaseStock($quantity)\n {\n global $objDatabase;\n \n $query = \"\n UPDATE \".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_products\n SET stock=stock-$quantity\n WHERE id=$this->id\n AND distribution='delivery'\";\n return (boolean)$objDatabase->Execute($query);\n }", "public function getCarStatusSoldExpire(){\r\n\t\tif($this->getCarStatusValue()==2){\r\n\t\t\tif($this->getCarStatusInterval()>30){\r\n\t\t\t\treturn true;\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\t}", "private function getStock()\n {\n $article = oxNew('oxArticle');\n $article->load($this->testArticleId);\n return $article->oxarticles__oxstock->value;\n }", "function organique_in_stock_indicator() {\n\t\tglobal $post, $product;\n\t\t?>\n\n\t\t<div class=\"in-stock--single-product\">\n\t\t\t<span class=\"dot-stock-<?php echo $product->is_in_stock() ? 'success' : 'danger'; ?>\">&bull;</span>\n\t\t\t<span class=\"stock-<?php echo $product->is_in_stock() ? 'success' : 'danger'; ?>\"><?php echo $product->is_in_stock() ? __( 'In stock' , 'organique_wp' ) : __( 'Out of Stock' , 'organique_wp' ); ?></span>\n\t\t</div>\n\t\t<?php\n\t}", "public function getManageStock()\n {\n return (int) Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MANAGE_STOCK);\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 out_of_stock_count(){\n\n\t\t$this->db->select(\"\n\t\t\t\ta.product_name,\n\t\t\t\ta.unit,\n\t\t\t\ta.product_id,\n\t\t\t\ta.price,\n\t\t\t\ta.supplier_price,\n\t\t\t\ta.product_model,\n\t\t\t\tc.category_name,\n\t\t\t\tsum(d.quantity) as totalSalesQnty,\n\t\t\t\tsum(b.quantity) as totalPurchaseQnty,\n\t\t\t\te.purchase_date as purchase_date,\n\t\t\t\te.purchase_id,\n\t\t\t\t(sum(b.quantity) - sum(d.quantity)) as stock\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id','left');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('invoice_details d','d.product_id = a.product_id','left');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id','left');\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->having('stock < 10', null, false);\n\t\t$this->db->having('totalPurchaseQnty < 10', null, false);\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "public function hasSoldCount(){\n return $this->_has(10);\n }", "protected function QtyInStock() {\n\treturn $this->GetFieldValue('QtyInStock');\n }", "public function beforeSave($isNew){\n if(isset($this->oldAttributes['qty_good']) && $this->qty_good != $this->oldAttributes['qty_good']){\n // The attribute is changed. Do something here...\n $modelIm = MasterItemImDetail::findOne($this->id_item_im);\n \n // add old request to stock\n $modelIm->s_good = $modelIm->s_good + $this->oldAttributes['qty_good'];\n \n // change stock to the new request\n $modelIm->s_good = $modelIm->s_good - $this->qty_good;\n \n $modelIm->save();\n }\n \n if(isset($this->oldAttributes['qty_noot_good']) && $this->qty_noot_good != $this->oldAttributes['qty_noot_good']){\n // The attribute is changed. Do something here...\n $modelIm = MasterItemImDetail::findOne($this->id_item_im);\n \n // add old request to stock\n $modelIm->s_not_good = $modelIm->s_not_good + $this->oldAttributes['qty_noot_good'];\n \n // change stock to the new request\n $modelIm->s_not_good = $modelIm->s_not_good - $this->qty_noot_good;\n \n $modelIm->save();\n }\n \n if(isset($this->oldAttributes['qty_reject']) && $this->qty_reject != $this->oldAttributes['qty_reject']){\n // The attribute is changed. Do something here...\n $modelIm = MasterItemImDetail::findOne($this->id_item_im);\n \n // add old request to stock\n $modelIm->s_reject = $modelIm->s_reject + $this->oldAttributes['qty_reject'];\n \n // change stock to the new request\n $modelIm->s_reject = $modelIm->s_reject - $this->qty_reject;\n \n $modelIm->save();\n }\n \n if(isset($this->oldAttributes['qty_dismantle_good']) && $this->qty_dismantle_good != $this->oldAttributes['qty_dismantle_good']){\n // The attribute is changed. Do something here...\n $modelIm = MasterItemImDetail::findOne($this->id_item_im);\n \n // add old request to stock\n $modelIm->s_good_dismantle = $modelIm->s_good_dismantle + $this->oldAttributes['qty_dismantle_good'];\n \n // change stock to the new request\n $modelIm->s_good_dismantle = $modelIm->s_good_dismantle - $this->qty_dismantle_good;\n \n $modelIm->save();\n }\n \n if(isset($this->oldAttributes['qty_dismantle_ng']) && $this->qty_dismantle_ng != $this->oldAttributes['qty_dismantle_ng']){\n // The attribute is changed. Do something here...\n $modelIm = MasterItemImDetail::findOne($this->id_item_im);\n \n // add old request to stock\n $modelIm->s_not_good_dismantle = $modelIm->s_not_good_dismantle + $this->oldAttributes['qty_dismantle_ng'];\n \n // change stock to the new request\n $modelIm->s_not_good_dismantle = $modelIm->s_not_good_dismantle - $this->qty_dismantle_ng;\n \n $modelIm->save();\n }\n if(isset($this->oldAttributes['qty_good_rec']) && $this->qty_good_rec != $this->oldAttributes['qty_good_rec']){\n // The attribute is changed. Do something here...\n $modelIm = MasterItemImDetail::findOne($this->id_item_im);\n \n // add old request to stock\n $modelIm->s_good_rec = $modelIm->s_good_rec + $this->oldAttributes['qty_good_rec'];\n \n // change stock to the new request\n $modelIm->s_good_rec = $modelIm->s_good_rec - $this->qty_good_rec;\n \n $modelIm->save();\n }\n \n \n return parent::beforeSave($isNew);\n }", "public function productInStock($isInStock) {\r\n if (isset ( $isInStock )) {\r\n return $stock_data ['is_in_stock'] = $isInStock;\r\n } else {\r\n return $stock_data ['is_in_stock'] = 1;\r\n }\r\n }", "public function onOffSetting()\n\t{\n\t\treturn \"eco_stocks_on\";\n\t}", "protected function onRestoring()\n {\n return true;\n }", "public function getIdstock()\r\n {\r\n return $this->idstock;\r\n }", "public function hasOldPrice(){\n return $this->_has(17);\n }", "public function isCatalogBackendNotifyStockQtyVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_BACKEND_NOTIFY_STOCK_QTY);\n }", "public function getReproductionStatus()\n {\n return $this->velos_reproduction_status;\n }", "function stockDecrement($product, $quantity)\n{\n\tinclude 'setup.php';\n\n\tclearstatcache();\n\tif(file_exists($STOCKFILE) && is_readable($STOCKFILE) && filesize($STOCKFILE) > 0)\n\t{\n\t\t$handle = fopen($STOCKFILE, \"r+\");\n\t\tflock($handle, 2);\t// get an exclusive lock\n\n\t\t$stocks = unserialize(fread($handle, filesize($STOCKFILE)));\n\t\tif($stocks == FALSE)\n\t\t{\n\t\t\t$retval = -2;\t// error reading stocks\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(($stocks[$product][instock] - $quantity) < 0)\n\t\t\t{\n\t\t\t\t$retval = -1;\t// not enough available\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$stocks[$product][instock] -= $quantity;\n\t\t\t\t$retval = $stocks[$product][instock];\n\t\t\t\t$stocks[$product][sold] += $quantity;\n\n\t\t\t\trewind($handle);\n\t\t\t\tif(fwrite($handle, serialize($stocks), strlen(serialize($stocks))) == FALSE)\n\t\t\t\t\t$retval = -2;\t// error storing new stock amounts\n\t\t\t}\n\t\t}\n\n\t\tflock($handle, 3);\t// release lock again\n\t\tfclose($handle);\n\t}\n\telse\n\t\t$retval = -1;\n\n\treturn $retval;\n}", "public function afterRestore() : bool\n\t{\n\t\treturn true;\n\t}", "public function verifica_stock($cod, $sede)\n\t\t{ \n\t\t\t$this->load->database();\n\t\t\t$sql = 'select stock_real from stock where id_insumo= '.$cod.' and id_sede= '.$sede;\n\t\t\t$consulta=$this->db->query($sql);\n\t\t\t$nombre=$consulta->row();\n\t\t\tif ($nombre == NULL)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telseif ($nombre->stock_real > \"0\")\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t\t \n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}", "public function getRemovedQuantity()\n {\n return $this->removedQuantity;\n }", "public function updated(Stock $stock)\n {\n $product = Product::find($stock->product_id);\n $cardController = new GlobalCardController();\n $product->count = $cardController->countProduct($stock->product_id);\n $product->save();\n }", "private function exportStoreStock()\n {\n if (!is_numeric($this->getArg(self::EXPORT_STORE_STOCK))) {\n echo $this->usageHelp();\n return;\n }\n\n $file = Mage::getModel('factfinder/export_type_stock')->saveExport($this->getArg(self::EXPORT_STORE_STOCK));\n printf(\"Successfully generated stock export to: %s\\n\", $file);\n }", "function stock_status_check($item_id,$loc_id,$uom,$units=0,$uom_2='',$units_2=0,$calc='-'){\n $this->load->model('Item_stock_model');\n $stock_det = $this->Item_stock_model->get_single_row('',\"location_id = '$loc_id' and item_id = '$item_id'\");\n $available_units= $available_units_2 = 0;\n $update_arr = array();\n if(empty($stock_det)){\n $insert_data = array(\n 'location_id'=>$loc_id,\n 'item_id'=>$item_id,\n 'uom_id'=>$uom,\n 'units_available'=>0,\n 'units_on_order'=>0,\n 'units_on_demand'=>0,\n );\n if($uom_2!=''){\n $insert_data['units_available_2'] = 0;\n $insert_data['uom_id_2'] = $uom_2;\n }\n $this->Item_stock_model->add_db($insert_data);\n $available_units = $units;\n $available_units_2 = $units_2;\n }else{\n if($calc=='+'){\n $available_units = $stock_det['units_available'] + $units;\n $available_units_2 = $stock_det['units_available_2'] + $units_2;\n }else{\n \n $available_units = $stock_det['units_available'] - $units;\n $available_units_2 = $stock_det['units_available_2'] - $units_2;\n }\n }\n $update_arr = array('location_id'=>$loc_id,'item_id'=>$item_id,'new_units_available'=>$available_units,'new_units_available_2'=>$available_units_2);\n \n return $update_arr;\n }", "public function hasActdiscount(){\n return $this->_has(34);\n }", "public function validateSetStock($setCart)\n {\n $setStock = $setCart->qty;\n\n foreach ($setCart->children as $key => $child) {\n if ($child->subproduct_id !== null) {\n $subCartsSum = Cart::where('user_id', $setCart->user_id)\n ->where('id', '!=', $child->id)\n ->where('subproduct_id', $child->subproduct_id)\n ->get()->sum('qty');\n\n $subStock = SubProduct::find($child->subproduct_id)->stoc;\n $stock_qty = ($subStock - $subCartsSum) > 0 ? $subStock - $subCartsSum : 0;\n $qty = ($child->qty > $stock_qty) || ($child->qty === 0) ? $stock_qty : $child->qty;\n\n $child->update(['stock_qty' => $stock_qty, 'qty' => $qty]);\n }else{\n $prodCartsSum = Cart::where('user_id', $setCart->user_id)\n ->where('id', '!=', $child->id)\n ->where('product_id', $child->product_id)\n ->get()->sum('qty');\n\n\n $prodStock = Product::find($child->product_id)->stock;\n $stock_qty = ($prodStock - $prodCartsSum) > 0 ? $prodStock - $prodCartsSum : 0;\n $qty =($child->qty > $stock_qty) || ($child->qty === 0) ? $stock_qty : $child->qty;\n\n $child->update(['stock_qty' => $stock_qty, 'qty' => $qty]);\n }\n }\n\n $stock_qty = $setCart->children->min('stock_qty');\n $qty = ($setCart->qty > $stock_qty) || ($setCart->qty === 0) ? $stock_qty : $setCart->qty;\n\n $setCart->update(['stock_qty' => $stock_qty, 'qty' => $qty]);\n }", "public function testProductStockStatus()\n {\n /** @var StockItemRepository $stockItemRepository */\n $stockItemRepository = $this->objectManager->create(StockItemRepository::class);\n\n /** @var StockRegistryInterface $stockRegistry */\n $stockRegistry = $this->objectManager->create(StockRegistryInterface::class);\n\n $stockItem = $stockRegistry->getStockItemBySku('simple');\n $stockItem->setIsInStock(false);\n $stockItemRepository->save($stockItem);\n $savedStockStatus = (int)$stockItem->getIsInStock();\n\n $dataProvider = $this->objectManager->create(\n ProductDataProvider::class,\n [\n 'name' => 'product_listing_data_source',\n 'primaryFieldName' => 'entity_id',\n 'requestFieldName' => 'id',\n 'addFieldStrategies' => [\n 'quantity_and_stock_status' =>\n $this->objectManager->get(AddQuantityAndStockStatusFieldToCollection::class)\n ]\n ]\n );\n\n $dataProvider->addField(self::$quantityAndStockStatus);\n $data = $dataProvider->getData();\n $dataProviderStockStatus = $data['items'][0][self::$quantityAndStockStatus];\n\n $this->assertEquals($dataProviderStockStatus, $savedStockStatus);\n }", "public function isImported()\n {\n if (isset($this->product['Cost in GBP'])\n && $this->product['Cost in GBP'] < 5\n && isset($this->product['Stock'])\n && $this->product['Stock'] < 10\n ) {\n return false;\n }\n if(isset($this->product['Cost in GBP'])\n && $this->product['Cost in GBP'] > 1000\n ){\n return false;\n }\n return true;\n }", "function soldStock($product_id, $count=1) {\n\t\t\t$product=$this->findById($product_id);\n\t\t\t\n\t\t\tif ($product['Product']['stock']) {\n\t\t\t\t$product['Product']['stock_number']--;\n\t\t\t\t\n\t\t\t\t$this->Save($product);\n\t\t\t}\n\t\t}", "public function stockCount()\n {\n return $this->variations->sum(function ($variation) {\n return $variation->stockCount();\n });\n }", "public function isIronCostReduction(): bool {\n return $this->value === self::IRON_COST_REDUCTION;\n }", "protected function onRestored()\n {\n return true;\n }", "protected function save_cart(){\n $this->cart_contents['total_items'] = $this->cart_contents['cart_total'] = 0;\n foreach ($this->cart_contents as $key => $val){\n if(!is_array($val) OR !isset($val['precio'], $val['qty'])){\n continue;\n }\n $this->cart_contents['cart_total'] += ($val['precio'] * $val['qty']);\n $this->cart_contents['total_items'] += $val['qty'];\n $this->cart_contents[$key]['subtotal'] = ($this->cart_contents[$key]['precio'] * $this->cart_contents[$key]['qty']);\n }\n \n // si el carrito está vacío, lo elimíno de la sesión\n if(count($this->cart_contents) <= 2){\n unset($_SESSION['cart_contents']);\n return FALSE;\n }else{\n $_SESSION['cart_contents'] = $this->cart_contents;\n return TRUE;\n }\n }", "function check_cart_items() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$result = $this->check_cart_item_stock();\n\t\t\tif (is_wp_error($result)) $cmdeals->add_error( $result->get_error_message() );\n\t\t}", "public function test_is_unlimited_stock()\n {\n $product = Product::factory()->create([\n 'stock' => null\n ]);\n\n $this->assertTrue($product->isUnlimitedStock());\n\n $product->stock = 0;\n $this->assertFalse($product->isUnlimitedStock());\n }", "public function getStock();", "public function hasMaxSave(){\n return $this->_has(16);\n }", "public function beforeRestore() : bool\n\t{\n\t\treturn true;\n\t}", "public function getIsStockManaged($variation_id);", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Magestore_InventorySuccess::adjuststock');\n }", "function on_backorder() {\n\t\treturn ($this->_item_availability->available_to_promise <= $this->backorder_quantity);\n\t}" ]
[ "0.6294473", "0.58524686", "0.5749633", "0.57312846", "0.5718415", "0.5688479", "0.5665382", "0.56319994", "0.56208813", "0.5610947", "0.5547729", "0.54927313", "0.54523546", "0.5420415", "0.5420415", "0.5420415", "0.5420415", "0.5420415", "0.5417495", "0.5404762", "0.5400088", "0.5400088", "0.5369969", "0.5356199", "0.53324544", "0.53313226", "0.5313715", "0.5299609", "0.5288357", "0.5286455", "0.52249366", "0.5199418", "0.5182556", "0.5178227", "0.5174443", "0.516465", "0.5160068", "0.5149533", "0.5148064", "0.5117189", "0.50912064", "0.50847614", "0.5066557", "0.5058171", "0.5043163", "0.50386286", "0.50308067", "0.50271034", "0.50105006", "0.49991488", "0.49945644", "0.49875638", "0.4986867", "0.49723223", "0.49580675", "0.49503776", "0.49468237", "0.49356514", "0.49326897", "0.49235314", "0.49181104", "0.49162164", "0.4902166", "0.48970595", "0.48835662", "0.48768666", "0.4858508", "0.4854229", "0.48533064", "0.4847893", "0.48440424", "0.4842496", "0.4835795", "0.4821625", "0.48097527", "0.48029834", "0.4795791", "0.47873598", "0.47870553", "0.47700533", "0.47680742", "0.47661176", "0.4763226", "0.47543514", "0.47486278", "0.47481996", "0.47479144", "0.47464257", "0.4746354", "0.4737017", "0.47348568", "0.47321504", "0.47257167", "0.47185907", "0.47070068", "0.47034526", "0.47020283", "0.46824178", "0.4680487", "0.46784988" ]
0.56972027
5
Get the order type based on Order ID.
public function get_order_type( $order_id ) { return get_post_type( $order_id ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOrderType();", "public function getOrderType()\n {\n return $this->hasOne(OrderType::className(), ['id' => 'order_type_id']);\n }", "public function getOrderType()\n {\n return $this->order_type;\n }", "public function getOrderType()\n {\n return $this->orderType;\n }", "public function getOrdertype()\n {\n return $this->ordertype;\n }", "public function getOrder(string $order_id): \\GDAX\\Types\\Response\\Authenticated\\Order;", "public function getOrdersId($key, $type) {\r\n\t\tif ($type == 'single') {\r\n\t\t\treturn $this->ordersId;\r\n\t\t} else if ($type == 'array') {\r\n\t\t\treturn $this->ordersId [$key];\r\n\t\t} else {\r\n\t\t\techo json_encode(array(\"success\" => false, \"message\" => \"Cannot Identifiy Type String Or Array:getOrdersId ?\"));\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "private function getEntryOrderType()\n {\n return ($this->content)\n ? $this->content->orderType()\n : $this->request->input('extra.order_type');\n }", "public function getOrderType()\n {\n return $this->firstNodeAttribute(\"IDOC/E1EDK01/ZE1EDK01\",'ZAUART', null);\n }", "public function get_order( $order_id ) {\n\t\treturn $this->request( \"orders/{$order_id}\" );\n\t}", "public function getTypeOrder()\n {\n return $this->hasOne(TypeOrder::className(), ['id' => 'type_order_id']);\n }", "private function getOrder($order_id){\r\n\r\n if($this->flow_woocommerce_version_check()){\r\n return new WC_Order($order_id);\r\n }\r\n else{\r\n return wc_get_order($order_id);\r\n }\r\n }", "public function get_message_type($id)\n\t{\n\t\t$sql=\"SELECT * FROM message_type ORDER BY (`message_type_id` = $id) DESC\";\n\t\t$query=$this->db->query($sql);\n\t\treturn $query->result_object();\n\n\t}", "private function getType($id) {\n \n $this->loadTypes();\n \n foreach ($this->types as $type) {\n \n if ($type->getId() === $id) return $type;\n }\n \n return NULL;\n }", "protected function get_type_from_id($id)\n\t{\n\t\treturn $this->types->get($id);\n\t}", "static public function getOrderById($order_id) {\n $order = DB::table('orders')->where('id', $order_id)->get();\n return $order;\n }", "public function getOrderById($id_order)\n {\n return $this->orderRepository->getOrderById($id_order);\n }", "public function get_type()\n {\n return self::$_id;\n }", "protected function findOrder($order_id)\n\t{\n\t\t$order = false;\n\t\tforeach($this->json_object->transactions as $transaction)\n\t\t{\n\t\t\tforeach($transaction->related_resources as $resource)\n\t\t\t{\n\t\t\t\tforeach($resource as $type => $resource_data)\n\t\t\t\t{\n\t\t\t\t\tif($type == 'order' && $resource_data->id == $order_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$order = $resource_data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($order === false)\n\t\t{\n\t\t\t$text = MainFactory::create('PayPalText');\n\t\t\tthrow new Exception($text->get_text('invalid_order_id'));\n\t\t}\n\t\treturn $order;\n\t}", "public function getOrderDataType(): ?string {\n\t\treturn Hash::get($this->_config, 'orderDataType');\n\t}", "protected function GetOrderID() {\n\treturn $this->Value('ID_Order');\n }", "static public function getOrderById($id) {\n $rq = \"SELECT * FROM \" . PREFIX . \"sales.`order` \n WHERE `id` =\" . $id . \" LIMIT 1;\";\n\n $aItem = Sql::Get($rq, 1);\n \n return $aItem[0];\n }", "public function getIdType() {\n\t\treturn $this->id_type;\n\t}", "public function check_order_id()\n {\n // return $NotifController->index();\n $order_id = $this->request->getVar('order_id');\n $typeSearch = $this->request->getVar('tos');\n switch ($typeSearch) {\n case 'hasil':\n return $this->cari_hasil($order_id);\n break;\n case 'registrasi_detail':\n return $this->cari_registrasi_detail($order_id);\n break;\n case 'reschedule':\n return $this->cari_reshcedule($order_id);\n break;\n default:\n # code...\n break;\n }\n }", "public function getIdType()\n {\n return $this->idType;\n }", "public function get_order( $order_id ) {\n\n\t\t$order = parent::get_order( $order_id );\n\n\t\t$order->payment->check_type = ( 'corporate' === SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-check-type' ) ) ? 'C' : 'P';\n\n\t\t$order->payment->customer_id_number = SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-customer-id-number' );\n\t\t$order->payment->customer_id_type = (int) SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-customer-id-type' );\n\n\t\treturn $order;\n\t}", "public function getTypeId()\n {\n return $this->get(self::_TYPE_ID);\n }", "public function getOrderById($order_id)\n {\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.\"orders/$order_id/detail/\");\n $client->setMethod(\\Zend_Http_Client::GET);\n $client->setHeaders([\n 'Content-Type: application/json', \n 'Accept: application/json',\n \"Authorization: Token $this->token\"\n ]);\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $order_data=json_decode($string);\n \n return $order_data;\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos order save helper', [\"Get order error\"=>$e->getMessage()]);\n return false;\n }\n }", "public function getOneOrder($orderId) {\n\n $this->load->model('account/order');\n return $this->model_account_order->getOrder($orderId);\n }", "public function setOrdertype($var)\n {\n GPBUtil::checkInt64($var);\n $this->ordertype = $var;\n\n return $this;\n }", "public function getOrder($id) {\n return Order::fetch($id);\n }", "public function type()\n {\n return $this->belongsTo(OrderType::class);\n }", "public function getOrderById($orderId)\n {\n }", "public function getTypeId()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'typeid'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'typeid'];\n\t\t}\n\t}", "public static function get_order_id() {\n\t\tglobal $order;\n\n\t\tif ( is_a( $order, 'WC_Order' ) ) {\n\t\t\treturn $order->get_id();\n\t\t}\n\n\t\t$order_id = absint( filter_input( INPUT_GET, 'order_id', FILTER_SANITIZE_NUMBER_INT ) );\n\n\t\tif ( $order_id ) {\n\t\t\treturn $order_id;\n\t\t}\n\n\t\treturn null;\n\t}", "public function requested_order_type($order_arr)\n {\n $upfront = FALSE;\n\n foreach ($order_arr['items'] as $item) {\n $upfront = $upfront || (bool)$item['prefer_upfront'];\n }\n return ($upfront == TRUE) ? 'upfront' : 'escrow';\n }", "public static function get($id) {\n // Set the predefined list that can be mapped\n self::$types = [\n 0 => 'Légkondícionáló',\n 1 => 'WC',\n 2 => 'Napelem',\n 3 => 'Kert',\n ];\n\n return (isset(self::$types[$id])) ? self::$types[$id] : ' - ';\n }", "private function getOrder($orderoid){\n $rs = selectQuery('select * from WTSORDER where KOID=\"'.$orderoid.'\"');\n if ($rs->rowcount() == 1){\n $ors = $rs->fetch();\n foreach($ors as $k=>$v){\n\t$order->{$k} = $v;\n }\n } else {\n $order = null;\n XLogs::critical(get_class($this), 'Impossible de trouver la commande ayant pour KOID : '.$orderoid);\n }\n return $order;\n }", "protected function OrderID() {\n\treturn $this->Value('ID_Order');\n }", "public function getOrderType()\n {\n return 'purchase';\n }", "public static function getTypeName($id){\n return Types::findOne($id);\n }", "public function getTypeID() {\n\t\treturn $this->_type_id;\n\t}", "public function getServiceType($id) {\n $dql = \"SELECT s FROM ServiceType s\n WHERE s.id = :id\";\n\n $serviceType = $this->em\n ->createQuery($dql)\n ->setParameter('id', $id)\n ->getSingleResult();\n\n return $serviceType;\n }", "public static function order($orderId) {\n //Return an object with the information about $orderId\n\t\t\treturn self::get(self::order_index() . '/' . $orderId);\n\t\t}", "public function get_message_type_by_id($id)\n\t{\n\t\t$query = $this->db->get_where('message_type', array('message_type_id' => $id));\n\t\treturn $query;\n\t}", "public static function get_product_type($id)\n {\n if (!$product = wc_get_product($id)) {\n return false;\n }\n return $product->product_type;\n }", "public function type($id)\n {\n return $this->where('user_type_id', $id);\n }", "public function getAdType($id)\n {\n $query = \"SELECT ALL FROM adv_type WHERE id = $id\";\n return $this->getQueryData($query, $this->getConnection());\n }", "function get_request_type($id_request_type){\n $this->db->where('id', $id_request_type);\n $query = $this->db->get('type_request');\n return($query->result());\n }", "public function getType_id()\n {\n return $this->type_id;\n }", "function get_operation_type_name_by_id($operation_type_id)\n {\n return $this->operation_type_array[$operation_type_id]['name'];\n }", "public function getTypeId()\n {\n return $this->_getData('type_id');\n }", "function getAutoPolicyType($id)\n\t{\n\t\t$type=mysql_fetch_assoc(mysql_query(\"select coverage_type from \".AUTOPOLICY.\" where id=\".$id));\n\t\tif($type['coverage_type']=='tpl')\n\t\t\t$type='tpl';\n\t\tif($type['coverage_type']=='comp')\n\t\t\t$type='comprehensive';\n\t\treturn $type;\n\t}", "public function getTypeId()\n {\n return $this->type_id;\n }", "public function getTypeId()\n {\n return $this->type_id;\n }", "public function getTypeId()\n {\n return $this->type_id;\n }", "function get_comment_type($comment_id = 0)\n {\n }", "public function getOrderByID($order_id)\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.order_id = :order_id\nORDER BY orders.order_date;\nSQL\n );\n $order->execute(array(':order_id' => $order_id));\n return $order->fetch(\\PDO::FETCH_OBJ);\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "private function selectItemType($id)\n {\n $tables = array(\"desktops\" => \"DS\", \"laptops\" => \"LP\"); //this array stores the names of the tables in database\n\n $prefix = substr($id, 0, 2); //all of the product types have unique prefix\n\n return array_search($prefix, $tables);\n }", "public function getType($id)\n {\n if (null === $id) {\n // The caller might call us using a row from database that contains\n // a strict null, it is useless for us to do any query since null\n // typed messages are valid by the MessageInterface signature\n return null;\n }\n\n if (null === $this->types) {\n $this->loadCache();\n }\n\n if (!isset($this->types[$id])) {\n // Someone may have created it before we loaded the cache\n $this->loadCache();\n\n if (!isset($this->types[$id])) {\n // It seems that the type really does not exists, mark it as\n // being wrong in order to avoid to refresh the cache too often\n // and return a null type\n $this->types[$type] = false;\n }\n }\n\n if (false === $this->types[$id]) {\n return null;\n } else {\n return $this->types[$id];\n }\n }", "public function getTypeForID() {\n\t\treturn self::C_DATATYPE_INTEGER;\n\t}", "static function getOrder(int $OrderID) {\r\n $sqlSelect = \"SELECT * FROM Orders WHERE OrderID = :OrderID\";\r\n //Query\r\n self::$db->query($sqlSelect);\r\n //Bind\r\n self::$db->bind(':OrderID', $OrderID);\r\n //Execute\r\n self::$db->execute();\r\n //Return\r\n return self::$db->singleResult();\r\n }", "public function getById(int $order_id): array;", "public function get_type();", "function getCustomerIDfromOrder($orderID)\n {\n $customerID = null;\n try\n {\n $stmt = $this->db->prepare(\"SELECT CustomerID\n FROM OrderTable\n WHERE OrderID=:orderID\");\n $stmt->bindParam(':orderID', $orderID);\n $stmt->execute();\n $id = $stmt->fetch(PDO::FETCH_ASSOC);\n if ($stmt->rowCount() > 0)\n {\n $customerID = $id['CustomerID'];\n return $customerID;\n }\n else\n {\n return false;\n }\n }\n\n catch(PDOException $e)\n {\n echo $e->getMessage();\n }\n }", "public function get_order_by_id($id) {\n if(!$id) {\n throw new Exception('id should not be empty');\n }\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/orders/$id.json\");\n }", "public function getOrderTypes() {\n // Load the list items.\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n // Select the required fields from the table.\n $query->select('o.id as id, o.value as value');\n $query->from('#__sdi_sys_ordertype AS o');\n $query->where('o.state = 1');\n $query->order('o.ordering');\n $query->group('o.ordering');\n $query->group('o.id');\n $query->group('o.value');\n\n try {\n $items = $this->_getList($query);\n } catch (RuntimeException $e) {\n $this->setError($e->getMessage());\n return false;\n }\n return $items;\n }", "public static function getOrderID($_cID) {\n global $lC_Database;\n\n $Qorder = $lC_Database->query('select orders_id from :table_orders where customers_id = :customers_id order by date_purchased desc limit 1');\n $Qorder->bindTable(':table_orders', TABLE_ORDERS);\n $Qorder->bindInt(':customers_id', $_cID);\n $Qorder->execute();\n \n $oID = $Qorder->valueInt('orders_id');\n\n $Qorder->freeResult();\n \n return $oID;\n }", "public function getOrderid() {\n\t\treturn $this->orderid;\n\t}", "public function get_order($order_id)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->where('orders.order_status = order_status.order_status_id AND users.user_id = orders.user_id AND orders.order_id = '.$order_id);\n\t\t$query = $this->db->get('orders, order_status, users');\n\t\t\n\t\treturn $query;\n\t}", "public function get_job_type_by_id($id){\n\t\t$query = $this->db->get_where('xx_job_type', array('id' => $id));\n\t\treturn $result = $query->row_array();\n\t}", "public function getOrder($id)\n {\n $db = new Mysqli();\n $db->connect('localhost', 'root', 111111, 'nn_pay');\n $data = $db->query(\"select * from nns_pay_order where nns_id = '{$id}' limit 1\");\n Register::set('nn_pay_db', $db);\n\n return $data[0];\n }", "public function getType()\n {\n return $this->type()->getID();\n }", "public static function getPaymentMethod($_oID) {\n global $lC_Database;\n\n $QorderPayment = $lC_Database->query('select payment_method from :table_orders where orders_id = :orders_id');\n $QorderPayment->bindTable(':table_orders', TABLE_ORDERS);\n $QorderPayment->bindInt(':orders_id', $_oID);\n $QorderPayment->execute();\n \n $payment_method = $QorderPayment->value('payment_method');\n\n $QorderPayment->freeResult();\n \n return $payment_method;\n }", "public function getTypeId()\n {\n return $this->typeId;\n }", "public static function getType($recordId)\n\t{\n\t\t$metadata = Functions::getCRMRecordMetadata($recordId);\n\t\treturn $metadata ? $metadata['setype'] : null;\n\t}", "public function get_order_id() {\n $order_id = $this->order_id;\n return !!$order_id ? $order_id : 0;\n }", "public function fetchFieldTypeFromID($id){\n\t\t\treturn Symphony::Database()->fetchVar('type', 0, \"SELECT `type` FROM `tbl_fields` WHERE `id` = '$id' LIMIT 1\");\n\t\t}", "public function getOrderNumber($id) {\n //setup variables\n $this->id = $id;\n $seed = $this->field('order_seed');\n $created = $this->field('created');\n if (!$seed || !$created) {\n return false;\n }\n $codedNumber = $this->getCodedNumber($seed, $created);\n return $codedNumber;\n }", "private function getOrderById(int $orderId): OrderInterface\n {\n return $this->orderRepository->get($orderId);\n }", "public function form_order_type() {\n\t\tglobal $current_user;\n\n\t\tget_currentuserinfo();\n\n\t\t$data = array();\n\n\t\tif ( !isset( $_REQUEST['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'visual-form-builder-pro' !== $_REQUEST['page'] )\n\t\t\treturn;\n\n\t\tif ( isset( $_REQUEST['mode'] ) ) :\n\t\t\t$user_id = $current_user->ID;\n\n\t\t\t$type = get_user_meta( $user_id, 'vfb-form-order-type', true );\n\n\t\t\t$meta_value = ( in_array( $_REQUEST['mode'], array( 'order', 'list' ) ) ) ? esc_html( $_REQUEST['mode'] ) : '';\n\t\t\tupdate_user_meta( $user_id, 'vfb-form-order-type', $meta_value );\n\n\t\tendif;\n\t}", "function getType($id)\n\t{\n\t\tif (empty($id)) //safe because we never use 0 as an id\n\t\t{\n\t\t\t$currentID = $this->getID();\n\t\t\tif (empty($currentID)) return false;\n\t\t\t$id = $currentID;\n\t\t}\n\t\t$result = $this->find('first', array(\n\t\t\t'conditions' => array('id' => $id),\n\t\t\t'fields' => array('ans_type')\n\t\t));\n\t\tif (empty($result)) return false;\n\t\treturn $result['Answer']['ans_type'];\n\t}", "public function getOrderById($id){\n $this->db->query(\"SELECT * FROM orders WHERE id = :id\");\n\n $this->db->bind(':id', $id);\n \n $row = $this->db->single();\n\n return $row;\n }", "public static function fetchFieldTypeFromID($id)\n {\n return Symphony::Database()->fetchVar('type', 0, sprintf(\"\n SELECT `type` FROM `tbl_fields` WHERE `id` = %d LIMIT 1\",\n $id\n ));\n }", "private function getAddressIdByType(OrderInterface $order, string $type): int\n {\n return $type === AddressType::TYPE_BILLING\n ? (int)$order->getBillingAddressId()\n : (int)$order->getShippingAddressId();\n }", "function getOrderDetails($id)\n {\n }", "public function getById($id)\n {\n $response = $this->get(\"v1/billing-types/$id\");\n $body = $this->decodeJson($response->getBody()->getContents());\n return $this->loadEntity($body->data);\n }", "public static function get_revision_type( $id ) {\n\t\tglobal $wpdb;\n\t\t$sql = \"SELECT type FROM {$wpdb->base_prefix}pp_revisions WHERE id = $id\";\n\n\t\treturn $wpdb->get_var( $sql );\n\t}", "public static function _getDatatypeForId($id)\n\t{\n\t\tswitch($id)\n\t\t{\n\t\t\tcase 'id':\n\t\t\t\treturn ilDataCollectionDatatype::INPUTFORMAT_NUMBER;\n\t\t\tcase 'owner';\n\t\t\t\treturn ilDataCollectionDatatype::INPUTFORMAT_TEXT;\n\t\t\tcase 'create_date':\n\t\t\t\treturn ilDataCollectionDatatype::INPUTFORMAT_DATETIME;\n\t\t\tcase 'last_edit_by':\n\t\t\t\treturn ilDataCollectionDatatype::INPUTFORMAT_TEXT;\n\t\t\tcase 'table_id':\n\t\t\t\treturn ilDataCollectionDatatype::INPUTFORMAT_NUMBER;\n\t\t\tcase 'last_update':\n\t\t\t\treturn ilDataCollectionDatatype::INPUTFORMAT_DATETIME;\n\t\t}\n\t\treturn NULL;\n\t}", "function getSelectedOrder($orderId) {\n try {\n // get DB connection\n $db = new DbOperation();\n $orders = $db->getSelectedOrder ($orderId);\n if ( $orders != null ) {\n echo '{\"gotOrder\":' . json_encode ( $orders ) . '}';\n } else {\n echo '{\"error\":{\"text\":' . \"Failed to get orders data\" . '}}';\n }\n } catch ( Exception $e ) {\n echo '{\"error\":{\"text\":' . $e->getMessage () . '}}';\n }\n}", "public function wrapOrder($id_order)\n {\n $order = new Order((int) $id_order);\n\n if (Validate::isLoadedObject($order)) {\n return [\n 'id' => $id_order,\n 'affiliation' => Shop::isFeatureActive() ? $this->context->shop->name : Configuration::get('PS_SHOP_NAME'),\n 'revenue' => $order->total_paid,\n 'shipping' => $order->total_shipping,\n 'tax' => $order->total_paid_tax_incl - $order->total_paid_tax_excl,\n 'url' => $this->context->link->getAdminLink('AdminNewsmanAjax'),\n 'customer' => $order->id_customer];\n }\n }", "public function getordershipmentdatabyorderid($orderid){\n\t\t$this->db->where('OrdId', $orderid);\n\t\t$query=$this->db->get('tbl_order_shipment');\n\t\treturn $query->result();\n\t}", "protected function _get_card_type($id)\n\t{\n\t\treturn model('card_type')->get_info_rule(array(\n\t\t\t'id' => $id,\n\t\t\t'status' => 1,\n\t\t));\n\t}", "public function getOrder($orderId) {\n\t\t$action = new EventerraActionMyOrders($this);\n\t\ttry {\n\t\t\t$array = $action->request($orderId);\n\t\t} catch (\\Eventerra\\Exceptions\\EventerraSDKException $exception) {\n\t\t\tif ($exception->getCode() == 5) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\tthrow $exception;\n\t\t\t}\n\t\t}\n\t\treturn array_shift($array);\n\t}", "public static function _getTypeOfId($a_id)\n\t{\n\t\tglobal $ilias, $ilDB;\n\n\t\t$q = \"SELECT * FROM bookmark_data WHERE obj_id = \".\n\t\t\t$ilDB->quote($a_id, \"integer\");\n\t\t$bm_set = $ilDB->query($q);\n\t\tif ($ilDB->numRows($bm_set) == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$bm = $ilDB->fetchAssoc($bm_set);\n\t\t\treturn $bm[\"type\"];\n\t\t}\n\t}", "public function getOrderId()\n {\n $value = $this->get(self::order_id);\n return $value === null ? (integer)$value : $value;\n }" ]
[ "0.753765", "0.7151509", "0.71004546", "0.6984836", "0.68438804", "0.66166794", "0.65854627", "0.6551378", "0.6312523", "0.6275656", "0.6257056", "0.61352444", "0.61197394", "0.6093863", "0.60849905", "0.60683113", "0.6027052", "0.6024699", "0.6021583", "0.6018339", "0.5986477", "0.5958327", "0.59109074", "0.58980924", "0.5802628", "0.5795879", "0.5783922", "0.57737386", "0.5743816", "0.57426053", "0.5727105", "0.5724558", "0.5689757", "0.56562275", "0.56135267", "0.5603555", "0.5596514", "0.55847734", "0.5578299", "0.5576252", "0.55755305", "0.556022", "0.55575246", "0.5548976", "0.55474806", "0.55442715", "0.55354035", "0.55296105", "0.5525157", "0.5518645", "0.5516451", "0.550695", "0.5505262", "0.549637", "0.549637", "0.549637", "0.5486737", "0.5486253", "0.5481216", "0.5481216", "0.5481216", "0.5481216", "0.5459574", "0.5445148", "0.544369", "0.5440218", "0.5438845", "0.54354745", "0.5433546", "0.5430353", "0.5414006", "0.5406252", "0.540581", "0.5404913", "0.54041463", "0.53876585", "0.5387169", "0.53849566", "0.53802884", "0.53717023", "0.53712195", "0.53593814", "0.5356202", "0.5352165", "0.534846", "0.5348283", "0.53469974", "0.53164077", "0.53121376", "0.5307029", "0.5301925", "0.5300659", "0.52936655", "0.52717626", "0.52570754", "0.5256656", "0.52489877", "0.5235216", "0.52335936", "0.5227126" ]
0.80038726
0
Populate custom table with data from postmeta, for migrations.
public function populate_from_meta( &$order, $save = true, $delete = false ) { $table_data = $this->get_order_data_from_table( $order ); if ( is_null( $table_data ) ) { $original_creating = $this->creating; $this->creating = true; } foreach ( $this->get_postmeta_mapping() as $column => $meta_key ) { $meta = get_post_meta( $order->get_id(), $meta_key, true ); if ( empty( $table_data->$column ) && ! empty( $meta ) ) { switch ( $column ) { case 'prices_include_tax': $order->set_prices_include_tax( 'yes' === $meta ); break; default: $order->{"set_{$column}"}( $meta ); } } } if ( true === $save ) { $this->update_post_meta( $order ); } if ( true === $delete ) { foreach ( $this->get_postmeta_mapping() as $column => $meta_key ) { delete_post_meta( $order->get_id(), $meta_key ); } } $this->creating = $original_creating; return $order; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function up()\n {\n Schema::create(\"posts_meta\", function ($table) {\n $table->integer('post_id')->index();\n $table->string('name')->index();\n $table->text('value');\n });\n }", "function create_table(){\n global $wpdb;\n\n require_once(ABSPATH . \"wp-admin\" . '/includes/upgrade.php');\n\n $table_name = $wpdb->base_prefix . $this->table;\n\n $sql = \"CREATE TABLE IF NOT EXISTS $table_name (\n id bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n post_id bigint(20) unsigned,\n blog_id mediumint(9) NOT NULL,\n post_author bigint(20) unsigned,\n post_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_date_gmt datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_content longtext,\n post_title text,\n post_excerpt text,\n post_status varchar(20) DEFAULT 'post_status',\n post_type varchar(20) DEFAULT 'post',\n post_modified_gmt datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_modified datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n guid varchar(255),\n UNIQUE KEY id (id)\n );\";\n\n dbDelta( $sql );\n }", "function pw_sample_plugin_create_table() {\n\tglobal $wpdb;\n$charset_collate = $wpdb->get_charset_collate();\n\n$sql = \"CREATE TABLE `book_meta_dataa` (\n\t\tID INTEGER NOT NULL AUTO_INCREMENT,\n\t\tauthor_name TEXT NOT NULL,\n\t\tprice bigint(64),\n\t\tpublisher text DEFAULT '',\n\t\tisbn text DEFAULT '',\n\t\tyr text DEFAULT '',\n\t\tedi text DEFAULT '',\n\t\tur text DEFAULT '',\n\tPRIMARY KEY (ID)\n) $charset_collate;\";\n\nrequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\ndbDelta($sql);\n\t\n }", "public function set_table_vars() {\n\t\tglobal $wpdb;\n\n\t\t$this->table = $wpdb->prefix . self::TABLE_NAME;\n\t\t$this->ms_table = $wpdb->base_prefix . self::MS_TABLE_NAME;\n\n\t\t/* Register the snippet table names with WordPress */\n\t\t$wpdb->snippets = $this->table;\n\t\t$wpdb->ms_snippets = $this->ms_table;\n\n\t\t$wpdb->tables[] = self::TABLE_NAME;\n\t\t$wpdb->ms_global_tables[] = self::MS_TABLE_NAME;\n\t}", "function custom_plugin_table_create() {\n\n global $wpdb;\n require_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n $sql = \"\n CREATE TABLE `ih_custom_table` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `name` varchar(255) NOT NULL,\n `email` varchar(255) NOT NULL,\n `address` varchar(255) NOT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\n \";\n dbDelta( $sql );\n}", "public static function get_meta_table();", "public function create_table()\n\t{\n\t\tglobal $wpdb;\n\n\t\t$charset_collate = '';\n\t\tif ( version_compare( mysql_get_server_info(), '4.1.0', '>=' ) )\n\t\t{\n\t\t\tif ( ! empty( $wpdb->charset ) )\n\t\t\t{\n\t\t\t\t$charset_collate = \"DEFAULT CHARACTER SET {$wpdb->charset}\";\n\t\t\t}//end if\n\n\t\t\tif ( ! empty( $wpdb->collate ) )\n\t\t\t{\n\t\t\t\t$charset_collate .= \" COLLATE {$wpdb->collate}\";\n\t\t\t}//end if\n\t\t}//end if\n\n\t\trequire_once ABSPATH . 'wp-admin/upgrade-functions.php';\n\t\t$sql = \"\n\t\t\tCREATE TABLE {$this->table} (\n\t\t\t\t`id` int unsigned NOT NULL auto_increment,\n\t\t\t\t`date` DATE NOT NULL,\n\t\t\t\t`property` varchar(20) NOT NULL,\n\t\t\t\t`url` varchar(255) NOT NULL,\n\t\t\t\t`post_id` int NOT NULL DEFAULT 0,\n\t\t\t\t`views` mediumint unsigned NOT NULL DEFAULT 0,\n\t\t\t\t`added_timestamp` timestamp DEFAULT 0,\n\t\t\t\tPRIMARY KEY (id),\n\t\t\t\tKEY `date` (`date`),\n\t\t\t\tKEY `post_id` (`post_id`),\n\t\t\t\tKEY `url` (`url`)\n\t\t\t) ENGINE=InnoDB $charset_collate\n\t\t\";\n\n\t\tdbDelta( $sql );\n\t}", "protected function populateTable() {\n\t\t$query = \"\n\t\tINSERT INTO `items` VALUES (1, 'Candy', 'Crush', '1924 Sucka Drive', 'Stripper');\n\t\tINSERT INTO `items` VALUES (2, 'John', 'Smith', '9999 The Way', 'Unemployeed');\n\t\t\";\n\t\t$this->PDO->query($query);\n\t}", "protected function setup_metadata() {\n\t\tif ( $this->get_meta_type() ) {\n\t\t\t$this->fill( $this->get_metadata() );\n\t\t}\n\t}", "private function populateDummyTable() {}", "function wp_create_initial_post_meta()\n {\n }", "protected function _populateMetas()\n {\n $nodes = $this->_catalog->getModel('nodes');\n $metas = $this->_catalog->getModel('metas');\n $collection = $nodes->fetchAll();\n foreach ($collection as $node) {\n $meta = $metas->fetchNew();\n $meta->node_id = $node->id;\n $meta->save();\n }\n }", "private function _populateMigrationTable()\n\t{\n\t\t$migrations = array();\n\n\t\t// Add the base one.\n\t\t$migration = new MigrationRecord();\n\t\t$migration->version = craft()->migrations->getBaseMigration();\n\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\t\t$migrations[] = $migration;\n\n\t\t$migrationsFolder = craft()->path->getAppPath().'migrations/';\n\t\t$migrationFiles = IOHelper::getFolderContents($migrationsFolder, false, \"(m(\\d{6}_\\d{6})_.*?)\\.php\");\n\n\t\tif ($migrationFiles)\n\t\t{\n\t\t\tforeach ($migrationFiles as $file)\n\t\t\t{\n\t\t\t\tif (IOHelper::fileExists($file))\n\t\t\t\t{\n\t\t\t\t\t$migration = new MigrationRecord();\n\t\t\t\t\t$migration->version = IOHelper::getFileName($file, false);\n\t\t\t\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\n\t\t\t\t\t$migrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($migrations as $migration)\n\t\t\t{\n\t\t\t\tif (!$migration->save())\n\t\t\t\t{\n\t\t\t\t\tCraft::log('Could not populate the migration table.', LogLevel::Error);\n\t\t\t\t\tthrow new Exception(Craft::t('There was a problem saving to the migrations table: ').$this->_getFlattenedErrors($migration->getErrors()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tCraft::log('Migration table populated successfully.');\n\t}", "function setup_simple_content_table() {\n global $wpdb;\n\n $table_name = $wpdb->prefix . 'content_submissions';\n\n $sql = \"CREATE TABLE $table_name (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n name varchar (100) NOT NULL,\n email varchar (100) NOT NULL,\n content varchar (200) NOT NULL,\n PRIMARY KEY (id)\n )\";\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta($sql);\n}", "public static function create_table() {\r\n global $wpdb;\r\n $charset_collate = $wpdb->get_charset_collate();\r\n // myhome_locations store locations. It helps when filtering properties by locations (lat/lng)\r\n $table_name = $wpdb->prefix . 'myhome_locations';\r\n\r\n $query = \"CREATE TABLE $table_name (\r\n\t\t\tid bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,\r\n\t\t\tpost_id bigint(20) UNSIGNED NOT NULL,\r\n\t\t\tlat decimal(10, 8) NOT NULL,\r\n\t\t\tlng decimal(11, 8) NOT NULL,\r\n\t\t\tPRIMARY KEY (id)\r\n\t\t\t) $charset_collate;\";\r\n\r\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n dbDelta( $query );\r\n }", "private function populatePaymentTable()\n {\n $preset = $this->getPaymentInfo()->brands;\n\n foreach ($preset as $brand => $value) {\n $this->db->query(\n \"INSERT INTO `\" . DB_PREFIX . \"mundipagg_payments`\n (brand_name, is_enabled, installments_up_to, installments_without_interest, interest)\n VALUES ('\" .\n $brand . \"', \" .\n $value->enabled . \", \" .\n $value->installmentsUpTo . \", \" .\n $value->installmentsWithoutInterest . \", \" .\n $value->interest . \"\n );\"\n );\n }\n }", "function insert_wp_postmeta($wpdb, $id, $postmeta){\n $table = $wpdb->prefix.\"postmeta\";\n $class = get_id_post_type($wpdb, 'class', $postmeta['class']);\n $rul = get_id_post_type($wpdb, 'restricteduselicence', $postmeta['rul']);\n $pvp = get_id_post_type($wpdb, 'plantvariety', $postmeta['pvp']);\n $patent = get_id_post_type($wpdb, 'patent', $postmeta['patent']);\n $patent_number = get_id_post_type($wpdb, 'patentnumber', $postmeta['patent_number']);\n $patent_number_link = get_id_post_type($wpdb, 'patentnumberlink', $postmeta['patent_number_link']);\n \n add_post_meta($id, 'class', $class[0]->id);\n add_post_meta($id, 'restricted_use_licence', $rul[0]->id);\n add_post_meta($id, 'plant_variety_protection', $pvp[0]->id);\n add_post_meta($id, 'pvp_number', $postmeta['pvp_number']);\n add_post_meta($id, 'pdf_link', $postmeta['pdf_link']);\n add_post_meta($id, 'patent', $postmeta['patent']);\n add_post_meta($id, 'patent_number', $postmeta['patent_number']);\n add_post_meta($id, 'patent_number_link', $postmeta['patent_number_link']); \n}", "function lp_create_table(){\r\n\tglobal $wpdb;\r\n\t$charset_collation = $wpdb->get_charset_collate();\r\n\t$table_name = $wpdb->prefix.'like_post';\r\n\r\n\tif( $wpdb->get_var(\"show tables like '$table_name'\") != $table_name){\r\n\t\t$sql = \"CREATE TABLE $table_name (\r\n\t\t\t\t\tID \t\t\t\tINT(9)\t\t\t\t\t\t\t\tNOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tPOST_ID\t\t\tINT(9) \t\t\t\t\t\t\t\tNOT NULL,\r\n\t\t\t\t\tSTATUS \t\t\tINT(1) \t\t\t\t\t\t\t\tNOT NULL,\r\n\t\t\t\t\tLIKE_TIME\t\tDATE\t\t\t\t\t\t\t\tNOT NULL,\r\n\t\t\t\t\tPRIMARY KEY (ID)\r\n\t\t\t\t) $charset_collation;\";\r\n\r\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n\t\tdbDelta($sql);\r\n\t}\r\n\tadd_option('lp_showing_year','');\r\n\r\n}", "public function backfill_postmeta( &$order ) {\n\t\t$data = $this->get_order_data_from_table( $order );\n\n\t\tif ( is_null( $data ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $this->get_postmeta_mapping() as $column => $meta_key ) {\n\t\t\tif ( isset( $data->$column ) ) {\n\t\t\t\tupdate_post_meta( $order->get_id(), $meta_key, $data->$column );\n\t\t\t}\n\t\t}\n\t}", "public function register_table() {\n\t\t// make WP aware of our table\n\t\t$this->wpdb->tables[] = static::NAME;\n\t\t$this->wpdb->{static::NAME} = $this->get_full_table_name( static::NAME );\n\n\t\t// create the tables\n\t\tif ( $this->schema_update_required() ) {\n\t\t\t$this->update_table( static::NAME );\n\t\t\t$this->mark_schema_update_complete();\n\t\t}\n\t}", "public function insertDefaultMetas() {\n $class = config('blog.post_meta_class');\n $metas = [];\n foreach ((new $class())->defaultMetas($this) as $key => $content) {\n $metas[] = compact('key', 'content');\n }\n\n $this->metas()->createMany($metas);\n return $this;\n }", "function wp_plugin_business_init() \n{\n global $wpdb; // Este objeto global permite acceder a la base de datos de WP\n // Crea la tabla sólo si no existe\n // Utiliza el mismo prefijo del resto de tablas\n $tabla_aspirantes = $wpdb->prefix . 'business';\n // Utiliza el mismo tipo de orden de la base de datos\n $charset_collate = $wpdb->get_charset_collate();\n // Prepara la consulta\n $query = \"CREATE TABLE IF NOT EXISTS $tabla_aspirantes (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n titulo varchar(200) NOT NULL,\n nombre varchar(300) NOT NULL,\n cliente varchar(400) NOT NULL,\n dirurl varchar(400) NOT NULL,\n fecha datetime NOT NULL,\n imagen varchar(600) NOT NULL,\n \n UNIQUE (id)\n ) $charset_collate;\";\n // La función dbDelta permite crear tablas de manera segura se\n // define en el archivo upgrade.php que se incluye a continuación\n include_once ABSPATH . 'wp-admin/includes/upgrade.php';\n dbDelta($query); // Lanza la consulta para crear la tabla de manera segura\n}", "protected function MetaAfterCreate() {\n\t\t}", "private static function postmeta_table( $query ) {\n\t\t\t/** @var \\wpdb $wpdb */\n\t\t\tglobal $wpdb;\n\t\t\t$postmeta_table = $wpdb->postmeta;\n\n\t\t\tif ( ! $query->tribe_is_multi_posttype ) {\n\t\t\t\treturn $postmeta_table;\n\t\t\t}\n\n\t\t\t$qv = $query->query_vars;\n\n\t\t\t// check if are any meta queries\n\t\t\tif ( ! empty( $qv['meta_key'] ) ) {\n\t\t\t\t$postmeta_table = 'tribe_event_postmeta';\n\t\t\t} else {\n\t\t\t\tif ( isset( $qv['meta_query'] ) ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t( is_array( $qv['meta_query'] ) && ! empty( $qv['meta_query'] ) ) ||\n\t\t\t\t\t\t( $qv['meta_query'] instanceof WP_Meta_Query && ! empty( $qv['meta_query']->queries ) )\n\t\t\t\t\t) {\n\t\t\t\t\t\t$postmeta_table = 'tribe_event_postmeta';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$postmeta_table = $wpdb->postmeta;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $postmeta_table;\n\t\t}", "function thrive_tasks_setup_table() \n{\n\tglobal $wpdb;\n\n\t$tasks_table_name = $wpdb->prefix . THRIVE_TASKS_TABLE;\n\t\n\t$charset_collate = $wpdb->get_charset_collate();\n\n\t$tasks_table_structure = \"CREATE TABLE $tasks_table_name (\n \t\tid int(10) NOT NULL AUTO_INCREMENT,\n \t\ttitle varchar(255) NOT NULL,\n \t\tdescription text NOT NULL,\n \t\tuser int(10) NOT NULL,\n \t\tmilestone_id int(10) NOT NULL,\n \t\tproject_id int(10) NOT NULL,\n \t\tpriority int(2) NOT NULL,\n \t\tcompleted_by int(10) NOT NULL,\n \t\tdate_created timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n \t\tPRIMARY KEY (id)\n\t) $charset_collate ;\";\n\n\t// Include the 'upgrade' script inside WP include dir.\n\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n\t// Run the dbDelta function with our table specification.\n\tdbDelta( $tasks_table_structure );\n\n\tadd_option( 'thrive_tasks_table_version', THRIVE_TASKS_TABLE_VERSION );\n\n\treturn;\n}", "public function create_tables() {\n global $wpdb;\n\n $charset_collate = $wpdb->get_charset_collate();\n\n $schema = \"CREATE TABLE IF NOT EXISTS`{$wpdb->prefix}cmp_data` (\n `code` bigint(20) NOT NULL AUTO_INCREMENT,\n `vendor_provider` longtext DEFAULT NULL,\n `contract_subscription_entity_used` longtext DEFAULT NULL,\n `product_type` longtext DEFAULT NULL,\n `product_description` longtext DEFAULT NULL,\n `contract_value` longtext DEFAULT NULL,\n `contract` longtext DEFAULT NULL,\n `contract_currency` longtext DEFAULT NULL,\n `contract_id` longtext DEFAULT NULL,\n `contract_signed_date` longtext DEFAULT NULL,\n `by_user` longtext DEFAULT NULL,\n `no_of_users` longtext DEFAULT NULL,\n `start_date` longtext DEFAULT NULL,\n `end_date` longtext DEFAULT NULL,\n `coordinator_person_in_change` longtext DEFAULT NULL,\n `vendor_person_in_change` longtext DEFAULT NULL,\n `vendor_email` longtext DEFAULT NULL,\n `vendor_contact` longtext DEFAULT NULL,\n `payment_entity_used` longtext DEFAULT NULL,\n `payment_amount` longtext DEFAULT NULL,\n `payment_currency` longtext DEFAULT NULL,\n `monthly_quarterly_semannual_annual` longtext DEFAULT NULL,\n `invoice_id` longtext DEFAULT NULL,\n `invoice_date` longtext DEFAULT NULL,\n `approval_document` longtext DEFAULT NULL,\n `upload_invoice` longtext DEFAULT NULL,\n `subscription_module` longtext DEFAULT NULL,\n `fullfillment_name` longtext DEFAULT NULL,\n `fullfillment_email` longtext DEFAULT NULL,\n `location_country_user` longtext DEFAULT NULL,\n `amount_per_user` longtext DEFAULT NULL,\n `department_user` longtext DEFAULT NULL,\n PRIMARY KEY (`code`)\n ) {$charset_collate}\";\n// exit($schema);\n if ( ! function_exists( 'dbDelta' ) ) {\n require_once ABSPATH . 'wp-admin/includes/upgrade.php';\n }\n\n dbDelta( $schema );\n }", "function create_data_tables(){\n global $wpdb;\n\n $table_name = $wpdb->prefix . 'visitor_analytics';\n $charset_collate = $wpdb->get_charset_collate();\n\n $query = \"CREATE TABLE $table_name (\n count_id int(6) NOT NULL AUTO_INCREMENT,\n count_date date NULL,\n count_time_in varchar(100) NULL,\n count_time_out varchar(100) NULL,\n count_ip_address varchar(15) NULL,\n count_state varchar(100) NULL,\n count_country varchar(100) NULL,\n count_latitude varchar(100) NULL,\n count_longitude varchar(100) NULL,\n PRIMARY KEY (count_id)\n ) $charset_collate\";\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t dbDelta( $query );\n}", "private function createNewColumnsInBaseTable()\n {\n\n Schema::table($this->baseTable, function (Blueprint $table) {\n\n //If no associative columns, the use same column name as merge column.\n if(empty($this->associativeColumns))\n {\n $columns = Schema::getColumnListing($this->mergeTable);\n\n foreach($columns as $key){\n if(!Schema::hasColumn($table->getTable(),$key)) {\n $table->text($key)->nullable();\n }\n }\n //Otherwise create only the table columns in baseTable which appears in array.\n }else{\n foreach ($this->associativeColumns as $baseColumn => $mergeColumn)\n {\n if(!Schema::hasColumn($table->getTable(),$baseColumn)) {\n $table->text($baseColumn)->nullable();\n }\n }\n }\n\n });\n }", "private function createNewColumnsInBaseTable()\n {\n\n Schema::table($this->baseTable, function (Blueprint $table) {\n\n //If no associative columns, the use same column name as merge column.\n if (empty($this->columns)) {\n $columns = Schema::getColumnListing($this->mergeTable);\n\n foreach ($columns as $key) {\n if (!Schema::hasColumn($table->getTable(), $key)) {\n $table->text($key)->nullable();\n }\n }\n //Otherwise create only the table columns in baseTable which appears in array.\n } else {\n foreach ($this->columns as $baseColumn => $mergeColumn) {\n if (!Schema::hasColumn($table->getTable(), $baseColumn)) {\n $table->text($baseColumn)->nullable();\n }\n }\n }\n\n });\n }", "protected function setUpTable()\n {\n if (!Schema::hasTable($this->TABLE)){\n Schema::create($this->TABLE, function (Blueprint $table) {\n $table->string(self::ID)->primary();\n $table->string(self::TEXT);\n $table->integer(self::DATE);\n $table->string(self::SENDER_ID);\n $table->string(self::RECIPIENT_ID);\n });\n }\n }", "public function setUp()\n {\n foreach ($this->data as $row) {\n $this->table->insert($row);\n }\n\n parent::setUp();\n\n }", "public function metaImport($data);", "function classiera_authors_tbl_create() {\r\n\r\n global $wpdb;\r\n\r\n $sql2 = (\"CREATE TABLE IF NOT EXISTS {$wpdb->prefix}author_followers (\r\n\r\n id int(11) NOT NULL AUTO_INCREMENT,\r\n\r\n author_id int(11) NOT NULL,\r\n\r\n follower_id int(11) NOT NULL,\r\n\r\n PRIMARY KEY (id)\r\n\r\n ) ENGINE=InnoDB AUTO_INCREMENT=1;\");\r\n\r\n $wpdb->query($sql2);\r\n\r\n $sql = (\"CREATE TABLE IF NOT EXISTS {$wpdb->prefix}author_favorite (\r\n\r\n id int(11) NOT NULL AUTO_INCREMENT,\r\n\r\n author_id int(11) NOT NULL,\r\n\r\n post_id int(11) NOT NULL,\r\n\r\n PRIMARY KEY (id)\r\n\r\n ) ENGINE=InnoDB AUTO_INCREMENT=1;\");\r\n\r\n $wpdb->query($sql);\r\n\r\n}", "protected function loadPosts() {\r\n $this->posts = new \\App\\Table\\PostTable(App::getInstance()->getDb());\r\n \r\n }", "function sitetweet_install()\n{\n global $wpdb;\n $table = $wpdb->prefix.\"sitetweet\";\n $structure = \"CREATE TABLE $table (\n api_code VARCHAR(250) NOT NULL,\n show_country INT NOT NULL DEFAULT 0\n );\";\n $wpdb->query($structure);\n $structure = \"INSERT INTO $table (api_code) VALUES ('');\";\n $wpdb->query($structure);\n}", "public function importPostMeta() {\n\t\t$postsPerAction = 100;\n\t\t$publicPostTypes = implode( \"', '\", aioseo()->helpers->getPublicPostTypes( true ) );\n\t\t$timeStarted = gmdate( 'Y-m-d H:i:s', aioseo()->transients->get( 'import_post_meta_yoast_seo' ) );\n\n\t\t$posts = aioseo()->db\n\t\t\t->start( 'posts' . ' as p' )\n\t\t\t->select( 'p.ID, p.post_type' )\n\t\t\t->join( 'postmeta as pm', '`p`.`ID` = `pm`.`post_id`' )\n\t\t\t->leftJoin( 'aioseo_posts as ap', '`p`.`ID` = `ap`.`post_id`' )\n\t\t\t->whereRaw( \"pm.meta_key LIKE '_yoast_wpseo_%'\" )\n\t\t\t->whereRaw( \"( p.post_type IN ( '$publicPostTypes' ) )\" )\n\t\t\t->whereRaw( \"( ap.post_id IS NULL OR ap.updated < '$timeStarted' )\" )\n\t\t\t->orderBy( 'p.ID DESC' )\n\t\t\t->limit( $postsPerAction )\n\t\t\t->run()\n\t\t\t->result();\n\n\t\tif ( ! $posts || ! count( $posts ) ) {\n\t\t\taioseo()->transients->delete( 'import_post_meta_yoast_seo' );\n\t\t\treturn;\n\t\t}\n\n\t\t$mappedMeta = [\n\t\t\t'_yoast_wpseo_title' => 'title',\n\t\t\t'_yoast_wpseo_metadesc' => 'description',\n\t\t\t'_yoast_wpseo_canonical' => 'canonical_url',\n\t\t\t'_yoast_wpseo_meta-robots-noindex' => 'robots_noindex',\n\t\t\t'_yoast_wpseo_meta-robots-nofollow' => 'robots_nofollow',\n\t\t\t'_yoast_wpseo_meta-robots-adv' => '',\n\t\t\t'_yoast_wpseo_focuskw' => '',\n\t\t\t'_yoast_wpseo_focuskeywords' => '',\n\t\t\t'_yoast_wpseo_opengraph-title' => 'og_title',\n\t\t\t'_yoast_wpseo_opengraph-description' => 'og_description',\n\t\t\t'_yoast_wpseo_opengraph-image' => 'og_image_custom_url',\n\t\t\t'_yoast_wpseo_twitter-title' => 'twitter_title',\n\t\t\t'_yoast_wpseo_twitter-description' => 'twitter_description',\n\t\t\t'_yoast_wpseo_twitter-image' => 'twitter_image_custom_url',\n\t\t\t'_yoast_wpseo_schema_page_type' => '',\n\t\t\t'_yoast_wpseo_schema_article_type' => ''\n\t\t];\n\n\t\tforeach ( $posts as $post ) {\n\t\t\t$postMeta = aioseo()->db\n\t\t\t\t->start( 'postmeta' . ' as pm' )\n\t\t\t\t->select( 'pm.meta_key, pm.meta_value' )\n\t\t\t\t->where( 'pm.post_id', $post->ID )\n\t\t\t\t->whereRaw( \"`pm`.`meta_key` LIKE '_yoast_wpseo_%'\" )\n\t\t\t\t->run()\n\t\t\t\t->result();\n\n\t\t\tif ( ! $postMeta || ! count( $postMeta ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$meta = [\n\t\t\t\t'post_id' => (int) $post->ID,\n\t\t\t];\n\n\t\t\tforeach ( $postMeta as $record ) {\n\t\t\t\t$name = $record->meta_key;\n\t\t\t\t$value = $record->meta_value;\n\n\t\t\t\tif ( ! in_array( $name, array_keys( $mappedMeta ), true ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tswitch ( $name ) {\n\t\t\t\t\tcase '_yoast_wpseo_meta-robots-noindex':\n\t\t\t\t\tcase '_yoast_wpseo_meta-robots-nofollow':\n\t\t\t\t\t\tif ( (bool) $value ) {\n\t\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = ! empty( $value );\n\t\t\t\t\t\t\t$meta['robots_default'] = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_meta-robots-adv':\n\t\t\t\t\t\t$values = explode( ',', $value );\n\t\t\t\t\t\tif ( $values ) {\n\t\t\t\t\t\t\tforeach ( $values as $value ) {\n\t\t\t\t\t\t\t\t$meta[ \"robots_$value\" ] = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_canonical':\n\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_opengraph-image':\n\t\t\t\t\t\t$meta['og_image_type'] = 'custom_image';\n\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_twitter-image':\n\t\t\t\t\t\t$meta['twitter_use_og'] = false;\n\t\t\t\t\t\t$meta['twitter_image_type'] = 'custom_image';\n\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_schema_page_type':\n\t\t\t\t\t\t$value = aioseo()->helpers->pregReplace( '#\\s#', '', $value );\n\t\t\t\t\t\tif ( in_array( $post->post_type, [ 'post', 'page', 'attachment' ], true ) ) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( in_array( $value, ImportExport\\SearchAppearance::$supportedWebPageGraphs, true ) ) {\n\t\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = 'WebPage';\n\t\t\t\t\t\t\t$options = new \\stdClass();\n\t\t\t\t\t\t\t$options->webPage = [ 'webPageType' => $value ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$meta['schema_type_options'] = wp_json_encode( $options );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_schema_article_type':\n\t\t\t\t\t\t$value = aioseo()->helpers->pregReplace( '#\\s#', '', $value );\n\t\t\t\t\t\tif ( 'none' === lcfirst( $value ) ) {\n\t\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = 'None';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( in_array( $post->post_type, [ 'page', 'attachment' ], true ) ) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$options = new \\stdClass();\n\t\t\t\t\t\tif ( isset( $meta['schema_type_options'] ) ) {\n\t\t\t\t\t\t\t$options = json_decode( $meta['schema_type_options'] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$options->article = [ 'articleType' => 'Article' ];\n\t\t\t\t\t\tif ( in_array( $value, ImportExport\\SearchAppearance::$supportedArticleGraphs, true ) ) {\n\t\t\t\t\t\t\t$options->article = [ 'articleType' => $value ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$options->article = [ 'articleType' => 'BlogPosting' ];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$meta['schema_type'] = 'Article';\n\t\t\t\t\t\t$meta['schema_type_options'] = wp_json_encode( $options );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_focuskw':\n\t\t\t\t\t\t$keyphrase = [\n\t\t\t\t\t\t\t'focus' => [ 'keyphrase' => aioseo()->helpers->sanitizeOption( $value ) ],\n\t\t\t\t\t\t\t'additional' => []\n\t\t\t\t\t\t];\n\t\t\t\t\t\t$meta['keyphrases'] = wp_json_encode( $keyphrase );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_focuskeywords':\n\t\t\t\t\t\t$keyphrases = [];\n\t\t\t\t\t\tif ( ! empty( $meta[ $mappedMeta[ $name ] ] ) ) {\n\t\t\t\t\t\t\t$keyphrases = (array) json_decode( $meta[ $mappedMeta[ $name ] ] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$yoastKeyphrases = json_decode( $value );\n\t\t\t\t\t\tfor ( $i = 0; $i < count( $yoastKeyphrases ); $i++ ) {\n\t\t\t\t\t\t\t$keyphrase = [ 'keyphrase' => aioseo()->helpers->sanitizeOption( $yoastKeyphrases[ $i ]->keyword ) ];\n\t\t\t\t\t\t\t$keyphrases['additional'][ $i ] = $keyphrase;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! empty( $keyphrases ) ) {\n\t\t\t\t\t\t\t$meta['keyphrases'] = wp_json_encode( $keyphrases );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_title':\n\t\t\t\t\tcase '_yoast_wpseo_metadesc':\n\t\t\t\t\tcase '_yoast_wpseo_opengraph-title':\n\t\t\t\t\tcase '_yoast_wpseo_opengraph-description':\n\t\t\t\t\t\tif ( 'page' === $post->post_type ) {\n\t\t\t\t\t\t\t$value = aioseo()->helpers->pregReplace( '#%%primary_category%%#', '', $value );\n\t\t\t\t\t\t\t$value = aioseo()->helpers->pregReplace( '#%%excerpt%%#', '', $value );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$value = aioseo()->importExport->yoastSeo->helpers->macrosToSmartTags( $value, 'post', $post->post_type );\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = esc_html( wp_strip_all_tags( strval( $value ) ) );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$aioseoPost = Models\\Post::getPost( (int) $post->ID );\n\t\t\t$aioseoPost->set( $meta );\n\t\t\t$aioseoPost->save();\n\t\t}\n\n\t\tif ( count( $posts ) === $postsPerAction ) {\n\t\t\ttry {\n\t\t\t\tas_schedule_single_action( time() + 5, aioseo()->importExport->yoastSeo->postActionName, [], 'aioseo' );\n\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\t// Do nothing.\n\t\t\t}\n\t\t} else {\n\t\t\taioseo()->transients->delete( 'import_post_meta_yoast_seo' );\n\t\t}\n\t}", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '$this->table_name'\" ) == $this->table_name ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = \"CREATE TABLE \" . $this->table_name . \" (\n\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\tuser_id bigint(20) NOT NULL,\n\t\tusername varchar(50) NOT NULL,\n\t\temail varchar(50) NOT NULL,\n\t\tname mediumtext NOT NULL,\n\t\tproduct_count bigint(20) NOT NULL,\n\t\tsales_value mediumtext NOT NULL,\n\t\tsales_count bigint(20) NOT NULL,\n\t\tstatus mediumtext NOT NULL,\n\t\tnotes longtext NOT NULL,\n\t\tdate_created datetime NOT NULL,\n\t\tPRIMARY KEY (id),\n\t\tUNIQUE KEY email (email),\n\t\tKEY user (user_id)\n\t\t) CHARACTER SET utf8 COLLATE utf8_general_ci;\";\n\n\t\tdbDelta( $sql );\n\n\t\tupdate_option( $this->table_name . '_db_version', $this->version );\n\t}", "protected function migrateTable()\n {\n DB::schema()->create('models', function ($table) {\n $table->id();\n $table->string('default');\n $table->text('input');\n });\n\n Model::create(['default' => 'model', 'input' => ['en' => 'translation', 'nl' => 'vertaling']]);\n }", "function carton_taxonomy_metadata_wpdbfix() {\n\tglobal $wpdb;\n\t$termmeta_name = 'carton_termmeta';\n\t$itemmeta_name = 'carton_order_itemmeta';\n\n\t$wpdb->carton_termmeta = $wpdb->prefix . $termmeta_name;\n\t$wpdb->order_itemmeta = $wpdb->prefix . $itemmeta_name;\n\n\t$wpdb->tables[] = 'carton_termmeta';\n\t$wpdb->tables[] = 'order_itemmeta';\n}", "function postCreateTable(){\n\t}", "public function run()\n {\n \n\n \\DB::table('tr_usermeta')->delete();\n \n \\DB::table('tr_usermeta')->insert(array (\n 0 => \n array (\n 'umeta_id' => 1,\n 'user_id' => 1,\n 'meta_key' => 'first_name',\n 'meta_value' => '',\n ),\n 1 => \n array (\n 'umeta_id' => 2,\n 'user_id' => 1,\n 'meta_key' => 'last_name',\n 'meta_value' => '',\n ),\n 2 => \n array (\n 'umeta_id' => 3,\n 'user_id' => 1,\n 'meta_key' => 'nickname',\n 'meta_value' => 'True Agency',\n ),\n 3 => \n array (\n 'umeta_id' => 4,\n 'user_id' => 1,\n 'meta_key' => 'description',\n 'meta_value' => '',\n ),\n 4 => \n array (\n 'umeta_id' => 5,\n 'user_id' => 1,\n 'meta_key' => 'rich_editing',\n 'meta_value' => 'true',\n ),\n 5 => \n array (\n 'umeta_id' => 6,\n 'user_id' => 1,\n 'meta_key' => 'comment_shortcuts',\n 'meta_value' => 'false',\n ),\n 6 => \n array (\n 'umeta_id' => 7,\n 'user_id' => 1,\n 'meta_key' => 'admin_color',\n 'meta_value' => 'fresh',\n ),\n 7 => \n array (\n 'umeta_id' => 8,\n 'user_id' => 1,\n 'meta_key' => 'use_ssl',\n 'meta_value' => '0',\n ),\n 8 => \n array (\n 'umeta_id' => 9,\n 'user_id' => 1,\n 'meta_key' => 'show_admin_bar_front',\n 'meta_value' => 'true',\n ),\n 9 => \n array (\n 'umeta_id' => 10,\n 'user_id' => 1,\n 'meta_key' => 'tr_capabilities',\n 'meta_value' => 'a:1:{s:13:\"administrator\";b:1;}',\n ),\n 10 => \n array (\n 'umeta_id' => 11,\n 'user_id' => 1,\n 'meta_key' => 'tr_user_level',\n 'meta_value' => '10',\n ),\n 11 => \n array (\n 'umeta_id' => 12,\n 'user_id' => 1,\n 'meta_key' => 'dismissed_wp_pointers',\n 'meta_value' => 'wp330_toolbar,wp330_saving_widgets,wp340_choose_image_from_library,wp340_customize_current_theme_link,wp350_media,wp360_revisions,wp360_locks',\n ),\n 12 => \n array (\n 'umeta_id' => 13,\n 'user_id' => 1,\n 'meta_key' => 'show_welcome_panel',\n 'meta_value' => '0',\n ),\n 13 => \n array (\n 'umeta_id' => 14,\n 'user_id' => 1,\n 'meta_key' => 'tr_dashboard_quick_press_last_post_id',\n 'meta_value' => '19',\n ),\n 14 => \n array (\n 'umeta_id' => 15,\n 'user_id' => 1,\n 'meta_key' => 'closedpostboxes_page',\n 'meta_value' => 'a:1:{i:0;s:10:\"wpseo_meta\";}',\n ),\n 15 => \n array (\n 'umeta_id' => 16,\n 'user_id' => 1,\n 'meta_key' => 'metaboxhidden_page',\n 'meta_value' => 'a:30:{i:0;s:12:\"postimagediv\";i:1;s:23:\"acf-group_5403de5cdd5f4\";i:2;s:23:\"acf-group_5456f850c8fef\";i:3;s:23:\"acf-group_54040af62d753\";i:4;s:23:\"acf-group_541a3cc82beeb\";i:5;s:23:\"acf-group_5403f05057688\";i:6;s:23:\"acf-group_57551651e7902\";i:7;s:23:\"acf-group_53fab282b49d2\";i:8;s:23:\"acf-group_547be44758b83\";i:9;s:23:\"acf-group_552db08f517c6\";i:10;s:23:\"acf-group_57ce482294695\";i:11;s:23:\"acf-group_53ed91788d70e\";i:12;s:23:\"acf-group_57997c03a9490\";i:13;s:23:\"acf-group_57999aa2e68f0\";i:14;s:23:\"acf-group_53fd6c780a8c4\";i:15;s:23:\"acf-group_575522e3b6783\";i:16;s:23:\"acf-group_575a31c94135c\";i:17;s:23:\"acf-group_53fac08362088\";i:18;s:23:\"acf-group_5555531263166\";i:19;s:23:\"acf-group_541693159897d\";i:20;s:23:\"acf-group_54cb028f22163\";i:21;s:23:\"acf-group_55c00331e6ed5\";i:22;s:23:\"acf-group_54cf1c64a4604\";i:23;s:23:\"acf-group_54068349cba7a\";i:24;s:12:\"revisionsdiv\";i:25;s:10:\"postcustom\";i:26;s:16:\"commentstatusdiv\";i:27;s:11:\"commentsdiv\";i:28;s:7:\"slugdiv\";i:29;s:9:\"authordiv\";}',\n ),\n 16 => \n array (\n 'umeta_id' => 17,\n 'user_id' => 1,\n 'meta_key' => 'manageedit-pagecolumnshidden',\n 'meta_value' => 'a:8:{i:0;s:11:\"wpseo-score\";i:1;s:11:\"wpseo-title\";i:2;s:14:\"wpseo-metadesc\";i:3;s:13:\"wpseo-focuskw\";i:4;s:0:\"\";i:5;s:0:\"\";i:6;s:0:\"\";i:7;s:0:\"\";}',\n ),\n 17 => \n array (\n 'umeta_id' => 18,\n 'user_id' => 1,\n 'meta_key' => 'edit_page_per_page',\n 'meta_value' => '20',\n ),\n 18 => \n array (\n 'umeta_id' => 19,\n 'user_id' => 1,\n 'meta_key' => 'manageedit-postcolumnshidden',\n 'meta_value' => 'a:8:{i:0;s:11:\"wpseo-score\";i:1;s:11:\"wpseo-title\";i:2;s:14:\"wpseo-metadesc\";i:3;s:13:\"wpseo-focuskw\";i:4;s:0:\"\";i:5;s:0:\"\";i:6;s:0:\"\";i:7;s:0:\"\";}',\n ),\n 19 => \n array (\n 'umeta_id' => 20,\n 'user_id' => 1,\n 'meta_key' => 'edit_post_per_page',\n 'meta_value' => '20',\n ),\n 20 => \n array (\n 'umeta_id' => 21,\n 'user_id' => 1,\n 'meta_key' => 'wpseo_title',\n 'meta_value' => '',\n ),\n 21 => \n array (\n 'umeta_id' => 22,\n 'user_id' => 1,\n 'meta_key' => 'wpseo_metadesc',\n 'meta_value' => '',\n ),\n 22 => \n array (\n 'umeta_id' => 23,\n 'user_id' => 1,\n 'meta_key' => 'wpseo_metakey',\n 'meta_value' => '',\n ),\n 23 => \n array (\n 'umeta_id' => 24,\n 'user_id' => 1,\n 'meta_key' => '_yoast_wpseo_profile_updated',\n 'meta_value' => '1408078874',\n ),\n 24 => \n array (\n 'umeta_id' => 25,\n 'user_id' => 1,\n 'meta_key' => 'googleplus',\n 'meta_value' => '',\n ),\n 25 => \n array (\n 'umeta_id' => 26,\n 'user_id' => 1,\n 'meta_key' => 'twitter',\n 'meta_value' => '',\n ),\n 26 => \n array (\n 'umeta_id' => 27,\n 'user_id' => 1,\n 'meta_key' => 'facebook',\n 'meta_value' => '',\n ),\n 27 => \n array (\n 'umeta_id' => 28,\n 'user_id' => 1,\n 'meta_key' => 'closedpostboxes_acf',\n 'meta_value' => 'a:0:{}',\n ),\n 28 => \n array (\n 'umeta_id' => 29,\n 'user_id' => 1,\n 'meta_key' => 'metaboxhidden_acf',\n 'meta_value' => 'a:1:{i:0;s:7:\"slugdiv\";}',\n ),\n 29 => \n array (\n 'umeta_id' => 30,\n 'user_id' => 1,\n 'meta_key' => 'closedpostboxes_dashboard',\n 'meta_value' => 'a:0:{}',\n ),\n 30 => \n array (\n 'umeta_id' => 31,\n 'user_id' => 1,\n 'meta_key' => 'metaboxhidden_dashboard',\n 'meta_value' => 'a:0:{}',\n ),\n 31 => \n array (\n 'umeta_id' => 32,\n 'user_id' => 1,\n 'meta_key' => 'closedpostboxes_acf-field-group',\n 'meta_value' => 'a:0:{}',\n ),\n 32 => \n array (\n 'umeta_id' => 33,\n 'user_id' => 1,\n 'meta_key' => 'metaboxhidden_acf-field-group',\n 'meta_value' => 'a:1:{i:0;s:7:\"slugdiv\";}',\n ),\n 33 => \n array (\n 'umeta_id' => 34,\n 'user_id' => 1,\n 'meta_key' => 'tr_user-settings',\n 'meta_value' => 'libraryContent=browse&hidetb=0&editor=tinymce',\n ),\n 34 => \n array (\n 'umeta_id' => 35,\n 'user_id' => 1,\n 'meta_key' => 'tr_user-settings-time',\n 'meta_value' => '1478072253',\n ),\n 35 => \n array (\n 'umeta_id' => 36,\n 'user_id' => 1,\n 'meta_key' => 'managenav-menuscolumnshidden',\n 'meta_value' => 'a:4:{i:0;s:11:\"link-target\";i:1;s:11:\"css-classes\";i:2;s:3:\"xfn\";i:3;s:11:\"description\";}',\n ),\n 36 => \n array (\n 'umeta_id' => 37,\n 'user_id' => 1,\n 'meta_key' => 'metaboxhidden_nav-menus',\n 'meta_value' => 'a:3:{i:0;s:8:\"add-post\";i:1;s:12:\"add-post_tag\";i:2;s:17:\"add-true_faqs_tax\";}',\n ),\n 37 => \n array (\n 'umeta_id' => 38,\n 'user_id' => 1,\n 'meta_key' => 'nav_menu_recently_edited',\n 'meta_value' => '4',\n ),\n 38 => \n array (\n 'umeta_id' => 39,\n 'user_id' => 1,\n 'meta_key' => 'session_tokens',\n 'meta_value' => 'a:3:{s:64:\"96f3c645ec480b2972a158e21c104d0224cac55419d4b48409117c3b0612b94a\";a:4:{s:10:\"expiration\";i:1493082753;s:2:\"ip\";s:14:\"118.127.116.74\";s:2:\"ua\";s:109:\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36\";s:5:\"login\";i:1492909953;}s:64:\"00a67c0420c4061a1b86c2a00100cf6435272f1559f69ff7e12374ece8ab8f00\";a:4:{s:10:\"expiration\";i:1493171943;s:2:\"ip\";s:14:\"118.127.116.74\";s:2:\"ua\";s:72:\"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0\";s:5:\"login\";i:1492999143;}s:64:\"6b0db64c6ec26471546e5cb051a6acb4a84f9b4bb7b084cfa6f44fca34130480\";a:4:{s:10:\"expiration\";i:1494209924;s:2:\"ip\";s:14:\"118.127.116.74\";s:2:\"ua\";s:82:\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:52.0) Gecko/20100101 Firefox/52.0\";s:5:\"login\";i:1493000324;}}',\n ),\n 39 => \n array (\n 'umeta_id' => 40,\n 'user_id' => 2,\n 'meta_key' => 'nickname',\n 'meta_value' => 'playz',\n ),\n 40 => \n array (\n 'umeta_id' => 41,\n 'user_id' => 2,\n 'meta_key' => 'first_name',\n 'meta_value' => 'Jeff',\n ),\n 41 => \n array (\n 'umeta_id' => 42,\n 'user_id' => 2,\n 'meta_key' => 'last_name',\n 'meta_value' => '',\n ),\n 42 => \n array (\n 'umeta_id' => 43,\n 'user_id' => 2,\n 'meta_key' => 'description',\n 'meta_value' => '',\n ),\n 43 => \n array (\n 'umeta_id' => 44,\n 'user_id' => 2,\n 'meta_key' => 'rich_editing',\n 'meta_value' => 'true',\n ),\n 44 => \n array (\n 'umeta_id' => 45,\n 'user_id' => 2,\n 'meta_key' => 'comment_shortcuts',\n 'meta_value' => 'false',\n ),\n 45 => \n array (\n 'umeta_id' => 46,\n 'user_id' => 2,\n 'meta_key' => 'admin_color',\n 'meta_value' => 'fresh',\n ),\n 46 => \n array (\n 'umeta_id' => 47,\n 'user_id' => 2,\n 'meta_key' => 'use_ssl',\n 'meta_value' => '0',\n ),\n 47 => \n array (\n 'umeta_id' => 48,\n 'user_id' => 2,\n 'meta_key' => 'show_admin_bar_front',\n 'meta_value' => 'true',\n ),\n 48 => \n array (\n 'umeta_id' => 49,\n 'user_id' => 2,\n 'meta_key' => 'tr_capabilities',\n 'meta_value' => 'a:1:{s:6:\"editor\";b:1;}',\n ),\n 49 => \n array (\n 'umeta_id' => 50,\n 'user_id' => 2,\n 'meta_key' => 'tr_user_level',\n 'meta_value' => '7',\n ),\n 50 => \n array (\n 'umeta_id' => 51,\n 'user_id' => 2,\n 'meta_key' => 'dismissed_wp_pointers',\n 'meta_value' => 'wp350_media,wp360_revisions,wp360_locks,wp390_widgets',\n ),\n 51 => \n array (\n 'umeta_id' => 52,\n 'user_id' => 2,\n 'meta_key' => 'wpseo_title',\n 'meta_value' => '',\n ),\n 52 => \n array (\n 'umeta_id' => 53,\n 'user_id' => 2,\n 'meta_key' => 'wpseo_metadesc',\n 'meta_value' => '',\n ),\n 53 => \n array (\n 'umeta_id' => 54,\n 'user_id' => 2,\n 'meta_key' => 'wpseo_metakey',\n 'meta_value' => '',\n ),\n 54 => \n array (\n 'umeta_id' => 55,\n 'user_id' => 2,\n 'meta_key' => 'wpseo_excludeauthorsitemap',\n 'meta_value' => '',\n ),\n 55 => \n array (\n 'umeta_id' => 56,\n 'user_id' => 2,\n 'meta_key' => '_yoast_wpseo_profile_updated',\n 'meta_value' => '1478220195',\n ),\n 56 => \n array (\n 'umeta_id' => 57,\n 'user_id' => 2,\n 'meta_key' => 'googleplus',\n 'meta_value' => '',\n ),\n 57 => \n array (\n 'umeta_id' => 58,\n 'user_id' => 2,\n 'meta_key' => 'twitter',\n 'meta_value' => '',\n ),\n 58 => \n array (\n 'umeta_id' => 59,\n 'user_id' => 2,\n 'meta_key' => 'facebook',\n 'meta_value' => '',\n ),\n 59 => \n array (\n 'umeta_id' => 61,\n 'user_id' => 2,\n 'meta_key' => 'tr_user-settings',\n 'meta_value' => 'editor=tinymce&libraryContent=browse&mfold=o&hidetb=1&wplink=1',\n ),\n 60 => \n array (\n 'umeta_id' => 62,\n 'user_id' => 2,\n 'meta_key' => 'tr_user-settings-time',\n 'meta_value' => '1423520031',\n ),\n 61 => \n array (\n 'umeta_id' => 63,\n 'user_id' => 2,\n 'meta_key' => 'edit_true_faqs_per_page',\n 'meta_value' => '20',\n ),\n 62 => \n array (\n 'umeta_id' => 64,\n 'user_id' => 2,\n 'meta_key' => 'closedpostboxes_page',\n 'meta_value' => 'a:0:{}',\n ),\n 63 => \n array (\n 'umeta_id' => 65,\n 'user_id' => 2,\n 'meta_key' => 'metaboxhidden_page',\n 'meta_value' => 'a:18:{i:0;s:23:\"acf-group_5403de5cdd5f4\";i:1;s:23:\"acf-group_5456f850c8fef\";i:2;s:23:\"acf-group_54040af62d753\";i:3;s:23:\"acf-group_541a3cc82beeb\";i:4;s:23:\"acf-group_5403f05057688\";i:5;s:23:\"acf-group_53fab282b49d2\";i:6;s:23:\"acf-group_547be44758b83\";i:7;s:23:\"acf-group_53ed91788d70e\";i:8;s:23:\"acf-group_53fd6c780a8c4\";i:9;s:23:\"acf-group_53fac08362088\";i:10;s:23:\"acf-group_541693159897d\";i:11;s:23:\"acf-group_54cb028f22163\";i:12;s:23:\"acf-group_54cf1c64a4604\";i:13;s:12:\"revisionsdiv\";i:14;s:10:\"postcustom\";i:15;s:16:\"commentstatusdiv\";i:16;s:7:\"slugdiv\";i:17;s:9:\"authordiv\";}',\n ),\n 64 => \n array (\n 'umeta_id' => 66,\n 'user_id' => 1,\n 'meta_key' => 'wp_statistics',\n 'meta_value' => 'a:2:{s:16:\"overview_display\";a:2:{s:1:\"A\";a:5:{i:1;s:7:\"summary\";i:2;s:8:\"browsers\";i:3;s:9:\"referring\";i:4;s:9:\"countries\";i:5;s:5:\"about\";}s:1:\"B\";a:7:{i:1;s:3:\"map\";i:2;s:4:\"hits\";i:3;s:6:\"search\";i:4;s:5:\"words\";i:5;s:5:\"pages\";i:6;s:6:\"recent\";i:7;s:4:\"none\";}}s:10:\"editor_set\";s:5:\"9.3.1\";}',\n ),\n 65 => \n array (\n 'umeta_id' => 67,\n 'user_id' => 1,\n 'meta_key' => 'metaboxhidden_post',\n 'meta_value' => 'a:1:{i:0;s:29:\"wp_statistics_editor_meta_box\";}',\n ),\n 66 => \n array (\n 'umeta_id' => 68,\n 'user_id' => 1,\n 'meta_key' => 'wpseo_ignore_tour',\n 'meta_value' => '1',\n ),\n 67 => \n array (\n 'umeta_id' => 69,\n 'user_id' => 1,\n 'meta_key' => 'closedpostboxes_true_pagecopy',\n 'meta_value' => 'a:0:{}',\n ),\n 68 => \n array (\n 'umeta_id' => 70,\n 'user_id' => 1,\n 'meta_key' => 'metaboxhidden_true_pagecopy',\n 'meta_value' => 'a:23:{i:0;s:23:\"acf-group_5403de5cdd5f4\";i:1;s:23:\"acf-group_5456f850c8fef\";i:2;s:23:\"acf-group_54040af62d753\";i:3;s:23:\"acf-group_541a3cc82beeb\";i:4;s:23:\"acf-group_5403f05057688\";i:5;s:23:\"acf-group_57551651e7902\";i:6;s:23:\"acf-group_53fab282b49d2\";i:7;s:23:\"acf-group_547be44758b83\";i:8;s:23:\"acf-group_552db08f517c6\";i:9;s:23:\"acf-group_53ed91788d70e\";i:10;s:23:\"acf-group_57997c03a9490\";i:11;s:23:\"acf-group_53fd6c780a8c4\";i:12;s:23:\"acf-group_575a61f41c592\";i:13;s:23:\"acf-group_575522e3b6783\";i:14;s:23:\"acf-group_575a31c94135c\";i:15;s:23:\"acf-group_53fac08362088\";i:16;s:23:\"acf-group_5555531263166\";i:17;s:23:\"acf-group_541693159897d\";i:18;s:23:\"acf-group_54cb028f22163\";i:19;s:23:\"acf-group_55c00331e6ed5\";i:20;s:23:\"acf-group_54cf1c64a4604\";i:21;s:23:\"acf-group_54068349cba7a\";i:22;s:7:\"slugdiv\";}',\n ),\n 69 => \n array (\n 'umeta_id' => 71,\n 'user_id' => 1,\n 'meta_key' => 'tr_yoast_notifications',\n 'meta_value' => 'a:2:{i:0;a:2:{s:7:\"message\";s:165:\"Yoast SEO has been updated to version 3.4.2. <a href=\"http://playz-v2.trueserver.com.au/cms/wp-admin/admin.php?page=wpseo_dashboard&intro=1\">Find out what\\'s new!</a>\";s:7:\"options\";a:8:{s:4:\"type\";s:7:\"updated\";s:2:\"id\";s:19:\"wpseo-dismiss-about\";s:5:\"nonce\";N;s:8:\"priority\";d:0.5;s:9:\"data_json\";a:0:{}s:13:\"dismissal_key\";N;s:12:\"capabilities\";s:14:\"manage_options\";s:16:\"capability_check\";s:3:\"all\";}}i:1;a:2:{s:7:\"message\";s:180:\"Don\\'t miss your crawl errors: <a href=\"http://playz-v2.trueserver.com.au/cms/wp-admin/admin.php?page=wpseo_search_console&tab=settings\">connect with Google Search Console here</a>.\";s:7:\"options\";a:8:{s:4:\"type\";s:7:\"warning\";s:2:\"id\";s:17:\"wpseo-dismiss-gsc\";s:5:\"nonce\";N;s:8:\"priority\";d:0.5;s:9:\"data_json\";a:0:{}s:13:\"dismissal_key\";N;s:12:\"capabilities\";s:14:\"manage_options\";s:16:\"capability_check\";s:3:\"all\";}}}',\n ),\n 70 => \n array (\n 'umeta_id' => 72,\n 'user_id' => 1,\n 'meta_key' => 'cpac-hide-install-addons-notice',\n 'meta_value' => '1',\n ),\n 71 => \n array (\n 'umeta_id' => 73,\n 'user_id' => 1,\n 'meta_key' => 'acf_user_settings',\n 'meta_value' => 'a:0:{}',\n ),\n 72 => \n array (\n 'umeta_id' => 74,\n 'user_id' => 1,\n 'meta_key' => 'wpseo-dismiss-gsc',\n 'meta_value' => 'seen',\n ),\n 73 => \n array (\n 'umeta_id' => 75,\n 'user_id' => 1,\n 'meta_key' => 'wpseo-dismiss-about',\n 'meta_value' => 'seen',\n ),\n 74 => \n array (\n 'umeta_id' => 76,\n 'user_id' => 1,\n 'meta_key' => 'cpac-hide-review-notice',\n 'meta_value' => '1',\n ),\n 75 => \n array (\n 'umeta_id' => 77,\n 'user_id' => 1,\n 'meta_key' => 'meta-box-order_dashboard',\n 'meta_value' => 'a:4:{s:6:\"normal\";s:18:\"custom_help_widget\";s:4:\"side\";s:24:\"wpseo-dashboard-overview\";s:7:\"column3\";s:0:\"\";s:7:\"column4\";s:0:\"\";}',\n ),\n 76 => \n array (\n 'umeta_id' => 78,\n 'user_id' => 2,\n 'meta_key' => 'wpseo_content_analysis_disable',\n 'meta_value' => '',\n ),\n 77 => \n array (\n 'umeta_id' => 79,\n 'user_id' => 2,\n 'meta_key' => 'wpseo_keyword_analysis_disable',\n 'meta_value' => '',\n ),\n 78 => \n array (\n 'umeta_id' => 80,\n 'user_id' => 2,\n 'meta_key' => 'acf_user_settings',\n 'meta_value' => 'a:0:{}',\n ),\n 79 => \n array (\n 'umeta_id' => 81,\n 'user_id' => 1,\n 'meta_key' => 'meta-box-order_true_pagecopy',\n 'meta_value' => 'a:4:{s:15:\"acf_after_title\";s:0:\"\";s:4:\"side\";s:9:\"submitdiv\";s:6:\"normal\";s:583:\"acf-group_5403de5cdd5f4,acf-group_5456f850c8fef,acf-group_54040af62d753,acf-group_541a3cc82beeb,acf-group_5403f05057688,acf-group_57551651e7902,acf-group_53fab282b49d2,acf-group_547be44758b83,acf-group_552db08f517c6,acf-group_57ce482294695,acf-group_53ed91788d70e,acf-group_57997c03a9490,acf-group_57999aa2e68f0,acf-group_53fd6c780a8c4,acf-group_575a61f41c592,acf-group_575522e3b6783,acf-group_575a31c94135c,acf-group_53fac08362088,acf-group_5555531263166,acf-group_541693159897d,acf-group_54cb028f22163,acf-group_55c00331e6ed5,acf-group_54cf1c64a4604,acf-group_54068349cba7a,slugdiv\";s:8:\"advanced\";s:0:\"\";}',\n ),\n 80 => \n array (\n 'umeta_id' => 82,\n 'user_id' => 1,\n 'meta_key' => 'screen_layout_true_pagecopy',\n 'meta_value' => '2',\n ),\n 81 => \n array (\n 'umeta_id' => 83,\n 'user_id' => 1,\n 'meta_key' => 'itsec_user_activity_last_seen',\n 'meta_value' => '1493119019',\n ),\n 82 => \n array (\n 'umeta_id' => 84,\n 'user_id' => 1,\n 'meta_key' => 'wpcf7_hide_welcome_panel_on',\n 'meta_value' => 'a:1:{i:0;s:3:\"4.5\";}',\n ),\n 83 => \n array (\n 'umeta_id' => 85,\n 'user_id' => 2,\n 'meta_key' => 'itsec_user_activity_last_seen',\n 'meta_value' => '1511303489',\n ),\n 84 => \n array (\n 'umeta_id' => 86,\n 'user_id' => 2,\n 'meta_key' => 'session_tokens',\n 'meta_value' => 'a:2:{s:64:\"6ee1ab61c0ec5459174fe11cd72a90341bb9057c0f819e9f7423ccabedbde111\";a:4:{s:10:\"expiration\";i:1511405516;s:2:\"ip\";s:14:\"144.132.70.191\";s:2:\"ua\";s:115:\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Safari/604.1.38\";s:5:\"login\";i:1511232716;}s:64:\"549e36abaf1b5e4a5ac874cd34da5d3899a5b96f0ac0face32c4e664e21e37f3\";a:4:{s:10:\"expiration\";i:1511409760;s:2:\"ip\";s:13:\"115.146.75.10\";s:2:\"ua\";s:120:\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36\";s:5:\"login\";i:1511236960;}}',\n ),\n 85 => \n array (\n 'umeta_id' => 87,\n 'user_id' => 2,\n 'meta_key' => 'default_password_nag',\n 'meta_value' => '',\n ),\n 86 => \n array (\n 'umeta_id' => 88,\n 'user_id' => 2,\n 'meta_key' => 'tr_media_library_mode',\n 'meta_value' => 'list',\n ),\n 87 => \n array (\n 'umeta_id' => 89,\n 'user_id' => 2,\n 'meta_key' => 'closedpostboxes_dashboard',\n 'meta_value' => 'a:2:{i:0;s:18:\"custom_help_widget\";i:1;s:24:\"wpseo-dashboard-overview\";}',\n ),\n 88 => \n array (\n 'umeta_id' => 90,\n 'user_id' => 2,\n 'meta_key' => 'metaboxhidden_dashboard',\n 'meta_value' => 'a:0:{}',\n ),\n ));\n \n \n }", "private function _createTable() {\n $query = \"\n CREATE TABLE `seo_metadata` (\n `metadata_id` int(11) NOT NULL auto_increment,\n `seo_id` char(60) NOT NULL,\n `seo_title` varchar(255) NOT NULL,\n `seo_description` varchar(255) NOT NULL,\n `seo_keyword` varchar(255) NOT NULL,\n PRIMARY KEY (`metadata_id`),\n KEY `id_idx` (`id`)\n )\";\n $this->getAdapter()->query( $query );\n }", "private function initColumns(){\n //Initialize our custom post type column management\n $this->cptWPDSCols = new Columns($this->wpdsPostType);\n \n //Remove our title\n $this->cptWPDSCols->removeColumn('title');\n \n //Add our content column\n $this->cptWPDSCols->addColumn('content', 'Content', 2);\n \n //Add our content column content\n $this->cptWPDSCols->addColumnPostContent('content');\n \n //Add our content column content\n $this->cptWPDSCols->addColumnOptionData('content', 'site_url');\n \n //Reposition column\n $this->cptWPDSCols->reorderColumn('content', 1);\n }", "static function install_db() {\r\n\t\tglobal $wpdb;\r\n\t\t$options = get_option( 'mf_timeline' );\r\n\t\t$table = $wpdb->prefix . 'mf_timeline_stories';\r\n\t\t\r\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS `{$table}` (\r\n\t\t\t`story_id` mediumint(9) NOT NULL AUTO_INCREMENT,\r\n\t\t\t`story_title` text NOT NULL,\r\n\t\t\t`story_content` text,\r\n\t\t\t`timeline_date` date NOT NULL DEFAULT '0000-00-00',\r\n\t\t\t`featured` int(1) NOT NULL DEFAULT '0',\r\n\t\t\t`story_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\tPRIMARY KEY (`story_id`),\r\n\t\t\tKEY `timeline_date` (`timeline_date`,`story_modified`)\r\n\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;\";\r\n\t\t\r\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n\t\tdbDelta( $sql );\r\n\t\t\r\n\t\t// Update the user's db version to version 1 and run the upgrade script.\r\n\t\tif( !isset( $options['db_version'] ) || empty( $options['db_version'] ) ) {\r\n\t\t\t$options['db_version'] = 1;\r\n\t\t\tupdate_option( 'mf_timeline', $options );\r\n\r\n\t\t\tself::upgrade_db();\r\n\t\t}\r\n\t}", "private function newPostTable () {\n\t\t$query = \n\t\t\t\"CREATE TABLE IF NOT EXISTS a2_posts (hostname VARCHAR(100), url VARCHAR(100), date VARCHAR(20), image VARCHAR(100), text VARCHAR(100), PRIMARY KEY (url))\";\n\t\t$this->sendQuery($query);\n\t}", "function wpdb_demo_table() {\n\tglobal $wpdb_table;\n\n\t// activate the demo\n\t$wpdb_table->create('table_demo', 'id mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t\t time datetime DEFAULT \"0000-00-00 00:00:00\" NOT NULL,\n\t\t\t\t\t\t\t\t\t UNIQUE KEY id (id)' );\n}", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\t$table_name \t = $this->table_name;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$query = \"CREATE TABLE {$table_name} (\n\t\t\tid bigint(10) NOT NULL AUTO_INCREMENT,\n\t\t\tname text NOT NULL,\n\t\t\tdate_created datetime NOT NULL,\n\t\t\tdate_modified datetime NOT NULL,\n\t\t\tstatus text NOT NULL,\n\t\t\tical_hash text NOT NULL,\n\t\t\tPRIMARY KEY id (id)\n\t\t) {$charset_collate};\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $query );\n\n\t}", "function ois_install_database() {\r\n global $wpdb;\r\n\r\n $table_name = $wpdb->prefix . 'optinskin';\r\n\r\n // create the table.\r\n // this table is specifically for storing impressions and submissions data.\r\n\r\n $sql = \"CREATE TABLE $table_name (\r\n skin int(4),\r\n ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\r\n post int(4),\r\n submission int(2));\";\r\n //echo $sql;\r\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n dbDelta( $sql );\r\n}", "public function update_post_view_table_structure() {\n global $wpdb;\n\n $current_version = get_option( 'laterpay_version' );\n if ( version_compare( $current_version, '0.9.11.4', '<' ) ) {\n return;\n }\n\n $table = $wpdb->prefix . 'laterpay_post_views';\n $columns = $wpdb->get_results( 'SHOW COLUMNS FROM ' . $table . ';' );\n\n $is_up_to_date = false;\n\n foreach ( $columns as $column ) {\n if ( $column->Field === 'id' ) {\n $is_up_to_date = true;\n }\n }\n\n if ( ! $is_up_to_date ) {\n $wpdb->query( 'ALTER TABLE ' . $table . ' ADD `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;' );\n $wpdb->query( 'ALTER TABLE ' . $table . ' DROP COLUMN `count`;' );\n }\n }", "function aqgallery_init(){\n\n global $wpdb;\n $table = $wpdb->prefix.\"aqdct_gallery\";\n $structure = \"CREATE TABLE $table (\n id INT(9) NOT NULL AUTO_INCREMENT,\n name VARCHAR(80) NOT NULL,\n description VARCHAR(240),\n UNIQUE KEY id (id)\n );\";\n $wpdb->query($structure);\n \n // Populate table\n $wpdb->query(\"INSERT INTO $table(name, description)\n VALUES('Sample Gallery', 'This is a sample gallery in the aqdct-gallery WP plugin')\");\n}", "function create_tbl_woo2app_mainpage(){\r global $wpdb;\r $charset_collate = $wpdb->get_charset_collate();\r $table_name = $wpdb->prefix . 'woo2app_mainpage';\r $sql = \"CREATE TABLE $table_name (\r\t\t\tmp_id bigint(20) NOT NULL AUTO_INCREMENT,\r\t\t\tPRIMARY key(mp_id),\r\t\t\tmp_title varchar(100) NOT NULL,\r\t\t\tmp_type tinyint(4) NOT NULL ,\r\t\t\tmp_value text NOT NULL ,\r\t\t\tmp_showtype tinyint(4) NOT NULL,\r\t\t\tmp_pic text NOT NULL,\r\t\t\tmp_order bigint(20),\r\t\t\tmp_sort text NULL \r\t\t) $charset_collate;\";\r require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r dbDelta( $sql );\r add_option( 'woo2app_version', '1.3' );\r }", "function mikado_create_db_tables() {\n\tinclude_once (WP_PLUGIN_DIR . '/mikado/lib/install-db.php');\t\t\t\n\tmikado_install_db();\n}", "function init_uppslag_table() {\n $version = 8;\n global $wpdb;\n $installed_ver = get_option(\"ep_uppslag\");\n if ($installed_ver != $version) {\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n $table_name = $wpdb->prefix . 'ep_uppslag';\n $sql = \"CREATE TABLE `\" . $table_name . \"` (\n `id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n `ssn` varchar(32) DEFAULT NULL COMMENT 'Personnummer',\n `status` int(2) NOT NULL DEFAULT '1',\n `ip` varchar(64) NOT NULL DEFAULT '',\n `guid` varchar(128) DEFAULT NULL,\n `email` varchar(64) DEFAULT NULL,\n `fname` varchar(64) DEFAULT NULL,\n `ename` varchar(64) DEFAULT NULL,\n `address` varchar(64) DEFAULT NULL,\n `zip` varchar(16) DEFAULT NULL,\n `city` varchar(64) DEFAULT NULL,\n `phone` varchar(32) DEFAULT NULL,\n `mobile` varchar(32) DEFAULT NULL, \n `create_date` datetime DEFAULT NULL,\n `updated_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;\";\n dbDelta($sql);\n //echo $sql;\n update_option(\"ep_uppslag\", $version);\n }\n}", "public function createNutrMetaTable()\r\n\t{\r\n\t\t$query = 'CREATE TABLE `usdaMeta` (\r\n\t\t\t`NDB_No` int(5) unsigned zerofill NOT NULL,\r\n\t\t\t`metaValue` int(8) unsigned NOT NULL,\r\n\t\t\tPRIMARY KEY (`NDB_No`,`metaValue`),\r\n\t\t\tUNIQUE KEY `NDB_No` (`NDB_No`,`metaValue`)\r\n\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT=\"USDA Ingredient-metavalue mapping\"';\r\n\t\t$this->_db->setQuery($query);\r\n\t\treturn $this->_db->query();\r\n\t}", "function siteorigin_panels_wp_import_post_meta($post_meta){\n\tforeach($post_meta as $i => $meta) {\n\t\tif($meta['key'] == 'panels_data') {\n\t\t\t$value = $meta['value'];\n\t\t\t$value = preg_replace(\"/[\\r\\n]/\", \"<<<br>>>\", $value);\n\t\t\t$value = preg_replace('!s:(\\d+):\"(.*?)\";!e', \"'s:'.strlen('$2').':\\\"$2\\\";'\", $value);\n\t\t\t$value = unserialize($value);\n\t\t\t$value = array_map('siteorigin_panels_wp_import_post_meta_map', $value);\n\n\t\t\t$post_meta[$i]['value'] = $value;\n\t\t}\n\t}\n\n\treturn $post_meta;\n}", "function table_creation(){\n\t\tglobal $wpdb;\n\t\t\t$table = $wpdb->prefix.'wiki';\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `$table`(\n\t\t\t\t`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t`post_id` bigint(20) NOT NULL,\n\t\t\t\t`author_id` bigint(20) NOT NULL,\t\n\t\t\t\t`post_content` longtext collate utf8_general_ci,\n\t\t\t\t`percent` int(100),\n\t\t\t\t`matched_keys` longtext collate utf8_general_ci,\n\t\t\t\t`time` TIMESTAMP,\t\t\t\t\n\t\t\t\tPRIMARY KEY(id)\n\t\t\t\t\n\t\t\t\t)\";\n\t\t\t//loading the dbDelta function manually\n\t\t\tif(!function_exists('dbDelta')) :\n\t\t\t\trequire_once(ABSPATH.'wp-admin/includes/upgrade.php');\n\t\t\tendif;\n\t\t\tdbDelta($sql);\n\t}", "public function postLoad(LifecycleEventArgs $eventArgs)\n {\n $this->migrateMeta($eventArgs);\n }", "static private function create_tables(){\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n self::create_views_table();\n }", "function __construct()\n\t{\n\t\t// changes the metaColumnsSQL, adds columns: attnum[6]\n\t}", "function create_tbl_woo2app_nazar(){\r global $wpdb;\r $charset_collate = $wpdb->get_charset_collate();\r $table_name = $wpdb->prefix . 'woo2app_nazar';\r $sql = \"CREATE TABLE $table_name (\r\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\r\t\tPRIMARY KEY (id),\r\t\ttitle TEXT NOT NULL ,\r\t\ttype tinyint(4) NOT NULL,\r\t\tvalue TEXT NOT NULL,\r\t\tdisable tinyint(4) NOT NULL\r\t) $charset_collate;\";\r require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r dbDelta( $sql );\r add_option( 'woo2app_version', '1.3' );\r }", "function plugin_customfields_create_data_table($itemtype) {\n global $DB;\n\n $table = plugin_customfields_table($itemtype);\n\n if (!TableExists($table)) {\n $sql = \"CREATE TABLE `$table` (\n `id` int(11) NOT NULL default '0',\n PRIMARY KEY (`id`)\n )ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3;\";\n $result = $DB->query($sql);\n return ($result ? true : false);\n }\n return true;\n}", "protected static function install_tables() {\n\t\tglobal $wpdb;\n\n\t\t// Load wp-admin/includes/upgrade.php, which defines dbDelta().\n\t\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n\t\t$table = wc_custom_order_table()->get_table_name();\n\t\t$collate = $wpdb->get_charset_collate();\n\t\t$tables = \"\n\t\t\tCREATE TABLE {$table} (\n\t\t\t\torder_id BIGINT UNSIGNED NOT NULL,\n\t\t\t\torder_key varchar(100) NOT NULL,\n\t\t\t\tcustomer_id BIGINT UNSIGNED NOT NULL,\n\t\t\t\tbilling_first_name varchar(100) NOT NULL,\n\t\t\t\tbilling_last_name varchar(100) NOT NULL,\n\t\t\t\tbilling_company varchar(100) NOT NULL,\n\t\t\t\tbilling_address_1 varchar(200) NOT NULL,\n\t\t\t\tbilling_address_2 varchar(200) NOT NULL,\n\t\t\t\tbilling_city varchar(100) NOT NULL,\n\t\t\t\tbilling_state varchar(100) NOT NULL,\n\t\t\t\tbilling_postcode varchar(100) NOT NULL,\n\t\t\t\tbilling_country varchar(100) NOT NULL,\n\t\t\t\tbilling_email varchar(200) NOT NULL,\n\t\t\t\tbilling_phone varchar(200) NOT NULL,\n\t\t\t\tshipping_first_name varchar(100) NOT NULL,\n\t\t\t\tshipping_last_name varchar(100) NOT NULL,\n\t\t\t\tshipping_company varchar(100) NOT NULL,\n\t\t\t\tshipping_address_1 varchar(200) NOT NULL,\n\t\t\t\tshipping_address_2 varchar(200) NOT NULL,\n\t\t\t\tshipping_city varchar(100) NOT NULL,\n\t\t\t\tshipping_state varchar(100) NOT NULL,\n\t\t\t\tshipping_postcode varchar(100) NOT NULL,\n\t\t\t\tshipping_country varchar(100) NOT NULL,\n\t\t\t\tpayment_method varchar(100) NOT NULL,\n\t\t\t\tpayment_method_title varchar(100) NOT NULL,\n\t\t\t\tdiscount_total float NOT NULL DEFAULT 0,\n\t\t\t\tdiscount_tax float NOT NULL DEFAULT 0,\n\t\t\t\tshipping_total float NOT NULL DEFAULT 0,\n\t\t\t\tshipping_tax float NOT NULL DEFAULT 0,\n\t\t\t\tcart_tax float NOT NULL DEFAULT 0,\n\t\t\t\ttotal float NOT NULL DEFAULT 0,\n\t\t\t\tversion varchar(16) NOT NULL,\n\t\t\t\tcurrency varchar(3) NOT NULL,\n\t\t\t\tprices_include_tax tinyint(1) NOT NULL,\n\t\t\t\ttransaction_id varchar(200) NOT NULL,\n\t\t\t\tcustomer_ip_address varchar(40) NOT NULL,\n\t\t\t\tcustomer_user_agent varchar(200) NOT NULL,\n\t\t\t\tcreated_via varchar(200) NOT NULL,\n\t\t\t\tdate_completed datetime DEFAULT NULL,\n\t\t\t\tdate_paid datetime DEFAULT NULL,\n\t\t\t\tcart_hash varchar(32) NOT NULL,\n\t\t\tPRIMARY KEY (order_id)\n\t\t\t) $collate;\n\t\t\";\n\n\t\t// Apply the database migration.\n\t\tdbDelta( $tables );\n\n\t\t// Store the table version in the options table.\n\t\tupdate_option( self::SCHEMA_VERSION_KEY, (int) self::$table_version, false );\n\t}", "function _get_meta_table($type)\n {\n }", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(MetaTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(MetaTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new MetaTableMap());\n }\n }", "protected function fromDatabase( $data )\n\t{\n\t\tforeach ( $data AS $field => $value ) \n\t\t{\t\n\t\t\tif ( isset( static::$schema[ $field ] ) )\n\t\t\t{\n\t\t\t\tif ( is_array( static::$schema[ $field ] ) )\n\t\t\t\t{\n\t\t\t\t\t$type = static::$schema[ $field ][ 'type' ];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$type = static::$schema[ $field ];\n\t\t\t\t}\n\t\n\t\t\t\t$this->data[ $field ] = $this->sanitize( $type, $value );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->loaded = true;\n\t}", "public function __construct($post)\n {\n $this->id = $post->ID;\n\n // Get the data we need from our custom fields\n foreach ($post->meta as $key=>$value) {\n if ( property_exists ( $this , $key ) ) {\n $this->$key = $value[0];\n }\n }\n\n }", "public function seed()\n\t{\n\t\t$this->createDataType();\n\t\t$this->createDataRowForColumns();\n\t}", "public function run()\n {\n DB::table('site_managements')->insert(\n [\n [\n 'meta_key' => 'home_settings',\n 'meta_value' => 'a:1:{i:0;a:8:{s:11:\"home_banner\";s:14:\"banner-img.jpg\";s:17:\"home_banner_image\";s:10:\"img-01.png\";s:12:\"banner_title\";s:23:\"Hire expert freelancers\";s:15:\"banner_subtitle\";s:19:\"for any job, Online\";s:18:\"banner_description\";s:101:\"Consectetur adipisicing elit sed dotem eiusmod tempor incuntes ut labore etdolore maigna aliqua enim.\";s:10:\"video_link\";s:43:\"https://www.youtube.com/watch?v=B-ph2g5o2K4\";s:11:\"video_title\";s:17:\"See For Yourself!\";s:10:\"video_desc\";s:43:\"How it works & experience the ultimate joy.\";}}',\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 [\n 'meta_key' => 'app_desc',\n 'meta_value' => '<p>Dotem eiusmod tempor incune utnaem labore etdolore maigna aliqua enim poskina ilukita ylokem lokateise ination voluptate velit esse cillum dolore eu fugiat nulla pariatur lokaim urianewce.</p>\n <p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborumed perspiciatis.</p>',\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 [\n 'meta_key' => 'app_android_link',\n 'meta_value' => 'https://play.google.com/store/apps/details?id=com.app.amento.worketic',\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 [\n 'meta_key' => 'app_ios_link',\n 'meta_value' => '#',\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 [\n 'meta_key' => 'socials',\n 'meta_value' => 'a:5:{i:0;a:2:{s:5:\"title\";s:8:\"facebook\";s:3:\"url\";s:1:\"#\";}i:1;a:2:{s:5:\"title\";s:7:\"twitter\";s:3:\"url\";s:1:\"#\";}i:2;a:2:{s:5:\"title\";s:7:\"youtube\";s:3:\"url\";s:1:\"#\";}i:3;a:2:{s:5:\"title\";s:9:\"instagram\";s:3:\"url\";s:1:\"#\";}i:4;a:2:{s:5:\"title\";s:10:\"googleplus\";s:3:\"url\";s: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 [\n 'meta_key' => 'footer_settings',\n 'meta_value' => 'a:6:{s:11:\"footer_logo\";s:20:\"1554450384-flogo.png\";s:11:\"description\";s:187:\"Dotem eiusmod tempor incune utnaem labore etdolore maigna aliqua enim poskina ilukita ylokem lokateise ination voluptate velit esse cillum dolore eu fugiat nulla pariatur lokaim urianewce\";s:9:\"copyright\";s:61:\"Copyright © 2019 The Worketic, All Right Reserved Amentotech\";s:12:\"menu_title_1\";s:7:\"Company\";s:12:\"menu_pages_1\";a:3:{i:0;s:1:\"2\";i:1;s:1:\"3\";i:2;s:1:\"4\";}s:5:\"pages\";a:3:{i:0;s:1:\"2\";i:1;s:1:\"3\";i:2;s:1:\"4\";}}',\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 [\n 'meta_key' => 'commision',\n 'meta_value' => 'a:1:{i:0;a:4:{s:9:\"commision\";s:2:\"20\";s:10:\"min_payout\";s:3:\"250\";s:14:\"payment_method\";a:2:{i:0;s:6:\"paypal\";i:1;s:6:\"stripe\";}s:8:\"currency\";s:3:\"USD\";}}',\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 [\n 'meta_key' => 'menu_title',\n 'meta_value' => 'Explore More',\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 [\n 'meta_key' => 'search_menu',\n 'meta_value' => 'a:4:{i:0;a:2:{s:5:\"title\";s:18:\"Freelancers in USA\";s:3:\"url\";s:1:\"#\";}i:1;a:2:{s:5:\"title\";s:21:\"Freelancers in Turkey\";s:3:\"url\";s:1:\"#\";}i:2;a:2:{s:5:\"title\";s:11:\"Jobs in USA\";s:3:\"url\";s:1:\"#\";}i:3;a:2:{s:5:\"title\";s:9:\"Find Jobs\";s:3:\"url\";s: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 [\n 'meta_key' => 'settings',\n 'meta_value' => 'a:1:{i:0;a:5:{s:5:\"title\";s:8:\"Worketic\";s:5:\"email\";s:20:\"[email protected]\";s:16:\"connects_per_job\";N;s:12:\"gmap_api_key\";N;s:4:\"logo\";s:19:\"1555333800-logo.png\";}}',\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 [\n 'meta_key' => 'email_data',\n 'meta_value' => 'a:1:{i:0;a:7:{s:10:\"from_email\";s:16:\"[email protected]\";s:13:\"from_email_id\";s:16:\"[email protected]\";s:11:\"sender_name\";s:6:\"Amento\";s:14:\"sender_tagline\";s:17:\"Your Work Partner\";s:10:\"sender_url\";s:39:\"http://amentotech.com/projects/worketic\";s:10:\"email_logo\";s:22:\"1555743744-favicon.png\";s:12:\"email_banner\";s:21:\"1555743744-banner.jpg\";}}',\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 [\n 'meta_key' => 'section_settings',\n 'meta_value' => 'a:1:{i:0;a:12:{s:20:\"home_section_display\";s:4:\"true\";s:10:\"section_bg\";s:21:\"1557484284-banner.jpg\";s:13:\"company_title\";s:16:\"Start As Company\";s:12:\"company_desc\";s:172:\"Consectetur adipisicing elit sed dotem eiusmod tempor incune utnaem labore etdolore maigna aliqua enim poskina ilukita ylokem lokateise ination voluptate velit esse cillum.\";s:11:\"company_url\";s:1:\"#\";s:16:\"freelancer_title\";s:19:\"Start As Freelancer\";s:15:\"freelancer_desc\";s:172:\"Consectetur adipisicing elit sed dotem eiusmod tempor incune utnaem labore etdolore maigna aliqua enim poskina ilukita ylokem lokateise ination voluptate velit esse cillum.\";s:14:\"freelancer_url\";s:1:\"#\";s:19:\"app_section_display\";s:4:\"true\";s:16:\"download_app_img\";s:36:\"1558518016-1557484284-mobile-img.png\";s:9:\"app_title\";s:20:\"Limitless Experience\";s:12:\"app_subtitle\";s:30:\"Roam Around With Your Business\";}}',\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 [\n 'meta_key' => 'show-page-1',\n 'meta_value' => 'true',\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 [\n 'meta_key' => 'show-page-3',\n 'meta_value' => 0,\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 [\n 'meta_key' => 'access_type',\n 'meta_value' => 'both',\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 [\n 'meta_key' => 'show-page-5',\n 'meta_value' => 0,\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 [\n 'meta_key' => 'show-banner-5',\n 'meta_value' => 0,\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 [\n 'meta_key' => 'show-page-6',\n 'meta_value' => 0,\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 [\n 'meta_key' => 'show-banner-6',\n 'meta_value' => 0,\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 [\n 'meta_key' => 'show-page-7',\n 'meta_value' => 0,\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 [\n 'meta_key' => 'show-banner-7',\n 'meta_value' => 0,\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 [\n 'meta_key' => 'homepage',\n 'meta_value' => 'a:1:{s:4:\"home\";s:1:\"5\";}',\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 [\n 'meta_key' => 'show-page-2',\n 'meta_value' => 0,\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 [\n 'meta_key' => 'show-banner-2',\n 'meta_value' => 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 [\n 'meta_key' => 'page-banner-2',\n 'meta_value' => '1579950098-img-02.jpg',\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 ]\n );\n }", "public function initialize()\n {\n $this->setSource('tblEntry');\n\n $this->hasOne('userId', '\\Soul\\Model\\User', 'userId', ['alias' => 'user']);\n $this->belongsTo('eventId', '\\Soul\\Model\\Event', 'eventId', ['alias' => 'event']);\n $this->hasOne('paymentId', '\\Soul\\Model\\Payment', 'paymentId', ['alias' => 'payment']);\n }", "public function initialize()\n {\n // attributes\n $this->setName('meta');\n $this->setPhpName('Meta');\n $this->setIdentifierQuoting(true);\n $this->setClassName('\\\\CE\\\\Model\\\\Meta');\n $this->setPackage('src.CE.Model');\n $this->setUseIdGenerator(true);\n // columns\n $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null);\n $this->addForeignKey('website_id', 'WebsiteId', 'INTEGER', 'website', 'id', false, null, null);\n $this->addForeignKey('website_routing_id', 'WebsiteRoutingId', 'INTEGER', 'website_routing', 'id', false, null, null);\n $this->addColumn('culture', 'Culture', 'VARCHAR', false, 5, null);\n $this->addColumn('html', 'Html', 'LONGVARCHAR', true, null, null);\n }", "private function _add_post_meta( $post_id, $data ) {\n\n foreach ($data as $meta_key => $meta_value) {\n update_post_meta( $post_id, $meta_key, $meta_value );\n }\n\n }", "public static function run_install()\n {\n global $wpdb;\n\n // Create Base Table in mysql\n //$charset_collate = $wpdb->get_charset_collate();\n //require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n }", "function build_event_tbl() {\n global $wpdb;\n\n $charset_collate = $wpdb->get_charset_collate();\n\n $table_name = $wpdb->prefix . \"events\";\n\n $sql = \"CREATE TABLE $table_name (\n id mediumint(9) NOT NULL,\n time datetime DEFAULT '0000-00-00 00:00:00',\n venue mediumint(9),\n performer mediumint(9),\n city text,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n \n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta( $sql );\n\n $performer_name = $wpdb->prefix . \"performers\";\n $performerSql = \"CREATE TABLE $performer_name (\n id mediumint(9) NOT NULL,\n name text,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta( $performerSql );\n\n $category_name = $wpdb->prefix . \"categories\";\n $categorySql = \"CREATE TABLE $category_name (\n id mediumint(9) NOT NULL,\n name text,\n wp_id mediumint(9),\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta( $categorySql );\n\n $searched_terms_name = $wpdb->prefix . \"searched_terms\";\n $searchedSql = \"CREATE TABLE $searched_terms_name (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n term text,\n num_searched mediumint(9) DEFAULT 1,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta( $searchedSql );\n\n $cached_results_name = $wpdb->prefix . \"cached_results\";\n $cachedSql = \"CREATE TABLE $cached_results_name (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n term text,\n result blob,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta( $cachedSql );\n\n $predictive_name = $wpdb->prefix . \"predictive_terms\";\n $predictiveSql = \"CREATE TABLE $predictive_name (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n term text,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta( $predictiveSql );\n}", "function createMetaData()\n\t{\n\t\tparent::createMetaData();\n\t\t$this->saveAuthorToMetadata();\n\t}", "public function setUpDatabaseTables()\n {\n $table = new DModuleTable();\n $table -> setName(\"currencies\");\n $table -> addBigIncrements( \"id\" , true );\n $table -> addString( \"base\" , true);\n $table -> addLongText( 'rates' , true);\n $table -> addDateTime( 'added' , true );\n $table -> addBoolean( 'status' , true);\n $table -> addString( \"extra\" , false);\n $table -> addString( \"extra2\" , false);\n $this -> addTable( $table );\n }", "private function metaLoad()\n {\n $this->meta ??= $this?->relations['meta'] ?? $this->meta()->get();\n }", "protected function setUpDatabase($app)\n {\n $app['db']->connection()->getSchemaBuilder()->create('users', function (Blueprint $table) {\n $table->increments('id');\n $table->string('email');\n });\n\n include_once __DIR__.'/../database/migrations/create_posts_table.php.stub';\n\n (new \\CreatePostsTable())->up();\n\n $user = User::create(['email' => '[email protected]']);\n\n $app[Post::class]->create([\n 'author_id' => $user->id,\n 'slug' => 'test-slug',\n 'title' => 'published test',\n 'body' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Totam voluptas placeat pariatur, blanditiis molestiae natus eligendi vitae, libero ipsam alias numquam, ducimus aut. Fugit expedita recusandae veniam, quis autem cum!',\n 'is_published' => true,\n 'published_at' => Carbon::now()->previous(Carbon::WEDNESDAY),\n ]);\n }", "private function prepareTables() {}", "public function build_database_table()\n {\n global $wpdb;\n $table_name = $wpdb->base_prefix . $this->token;\n\n if ($wpdb->get_var(\"SHOW TABLES LIKE '$table_name'\") != $table_name) {\n $charset_collate = '';\n\n if (!empty($wpdb->charset)) {\n $charset_collate = \"DEFAULT CHARACTER SET {$wpdb->charset}\";\n }\n\n if (!empty($wpdb->collate)) {\n $charset_collate .= \" COLLATE {$wpdb->collate}\";\n }\n\n $sql = \"CREATE TABLE `$table_name` (\n\t\t\t\t\t\t\t\t`id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t`frontdesk_id` int(10) unsigned DEFAULT NULL,\n\t\t\t\t\t\t\t\t`blog_id` int(10) unsigned DEFAULT 0,\n\t\t\t\t\t\t\t\t`first_name` varchar(255) DEFAULT NULL,\n\t\t\t\t\t\t\t\t`last_name` varchar(255) DEFAULT NULL,\n\t\t\t\t\t\t\t\t`email` varchar(255) DEFAULT NULL,\n\t\t\t\t\t\t\t\t`address` varchar(255) NOT NULL,\n\t\t\t\t\t\t\t\t`address2` varchar(255) DEFAULT NULL,\n\t\t\t\t\t\t\t\t`phone` varchar(20) DEFAULT NULL,\n\t\t\t\t\t\t\t\t`score` varchar(20) DEFAULT NULL,\n\t\t\t\t\t\t\t\t`responses` varchar(50) DEFAULT NULL,\n\t\t\t\t\t\t\t\t`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\t\t\t\t`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\t\t\t\tPRIMARY KEY (`id`)\n\t\t\t\t\t\t\t) $charset_collate;\";\n\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql);\n }\n }", "public function _meta(){\n if(!$this->db->table_exists($this->table_name())):\n throw new OrmExceptions(sprintf(\"The table %s does not exist\", $this->table_name()));\n endif;\n\n if(empty($this->_model_meta )){\n $this->_model_meta = $this->db->field_data($this->table_name());\n $this->_fields_loaded = TRUE;\n }\n return $this->_model_meta ;\n }", "public function run()\n {\n DB::table('meta_apps')->insert([\n ['role_id' => 3, 'page_id' => 1, 'order' => 1],\n ['role_id' => 2, 'page_id' => 1, 'order' => 1],\n ]);\n }", "function fatherly_fcr_populate_data()\n{\n global $wpdb;\n $table_name = $wpdb->prefix . 'feed_content_recirculation_posts';\n $csv_file = __DIR__ . '/inc/data/popular_posts.csv';\n $csv_file_data = array_map('str_getcsv', file($csv_file));\n\n foreach ($csv_file_data as $csv_file_datum) {\n $wpdb->insert($table_name, array('post_url' => $csv_file_datum[0], 'post_id' => $csv_file_datum[1]));\n }\n}", "protected function _setup() {\n // $this->_createTable();\n parent::_setup();\n }", "function setup_meta_translation() {\n\t\t\tglobal $post, $wpdb;\n\t\t\t$post_id = $post->ID;\n\t\t\t\n\t\t\tforeach($this->arabic_meta_keys as $key ) {\n\t\t\t\tif ($post_id){\n\t\t\t\t\t$$key = get_post_meta($post_id, $key, true);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$$key = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$the_post = get_post($post_id);\n\t\t\t\n\t\t\tinclude(dirname(__FILE__).'/views/ipc-meta-box-translation.php');\n\t\t}", "function alter_tables_if_required() {\r\n global $wpdb;\r\n $options = get_option('nus_altered_table');\r\n $altercolumns = false;\r\n if(!$options) {\r\n $altercolumns = true;\r\n }\r\n\r\n if($altercolumns) {\r\n $wpdb->query(\"ALTER TABLE \" . NUS_TEMP_TABLE .\" MODIFY nus_feed_id varchar(255) NOT NULL\");\r\n $wpdb->query(\"ALTER TABLE \" . NUS_TRACKER_TABLE .\" MODIFY nus_feed_id varchar(255) NOT NULL\");\r\n add_option('nus_altered_table', 'altered');\r\n }\r\n\r\n\r\n}", "protected function addCustomFieldset()\n {\n $this->meta = array_merge_recursive(\n $this->meta,\n [\n static::NOTE_FIELD_INDEX => $this->getFieldsetConfig(),\n ]\n );\n }", "function woo_supportpress_install_tables() {\n\t\n\tglobal $wpdb;\n\t\n\t$collate = '';\n if($wpdb->supports_collation()) {\n\t if(!empty($wpdb->charset)) $collate = \"DEFAULT CHARACTER SET $wpdb->charset\";\n\t if(!empty($wpdb->collate)) $collate .= \" COLLATE $wpdb->collate\";\n }\n\t\n\t$wpdb->query(\"CREATE TABLE IF NOT EXISTS \". $wpdb->prefix . \"supportpress_watching_tickets (\n\t\t`id` int(9) NOT NULL AUTO_INCREMENT,\n\t\t`user_id` int(9) NOT NULL,\n\t\t`item_id` int(9) NOT NULL,\n\t\tPRIMARY KEY id (`id`)) $collate;\");\n}", "function install_main_table() {\n global $wpdb;\n\n $charset_collate = '';\n if ( ! empty($wpdb->charset) )\n $charset_collate = \"DEFAULT CHARACTER SET $wpdb->charset\";\n if ( ! empty($wpdb->collate) )\n $charset_collate .= \" COLLATE $wpdb->collate\";\t\n $table_name = $wpdb->prefix . \"store_locator\";\n $sql = \"CREATE TABLE $table_name (\n sl_id mediumint(8) unsigned NOT NULL auto_increment,\n sl_store varchar(255) NULL,\n sl_address varchar(255) NULL,\n sl_address2 varchar(255) NULL,\n sl_city varchar(255) NULL,\n sl_state varchar(255) NULL,\n sl_zip varchar(255) NULL,\n sl_country varchar(255) NULL,\n sl_latitude varchar(255) NULL,\n sl_longitude varchar(255) NULL,\n sl_tags mediumtext NULL,\n sl_description text NULL,\n sl_email varchar(255) NULL,\n sl_url varchar(255) NULL,\n sl_hours varchar(255) NULL,\n sl_phone varchar(255) NULL,\n sl_fax varchar(255) NULL,\n sl_image varchar(255) NULL,\n sl_private varchar(1) NULL,\n sl_neat_title varchar(255) NULL,\n sl_linked_postid int NULL,\n sl_pages_url varchar(255) NULL,\n sl_pages_on varchar(1) NULL,\n sl_option_value longtext NULL,\n sl_lastupdated timestamp NOT NULL default current_timestamp,\t\t\t\n PRIMARY KEY (sl_id),\n KEY (sl_store(255)),\n KEY (sl_longitude(255)),\n KEY (sl_latitude(255))\n ) \n $charset_collate\n \";\n\n // If we updated an existing DB, do some mods to the data\n //\n if ($this->dbupdater($sql,$table_name) === 'updated') {\n // We are upgrading from something less than 2.0\n //\n if (floatval($this->db_version_on_start) < 2.0) {\n dbDelta(\"UPDATE $table_name SET sl_lastupdated=current_timestamp \" . \n \"WHERE sl_lastupdated < '2011-06-01'\"\n );\n } \n if (floatval($this->db_version_on_start) < 2.2) {\n dbDelta(\"ALTER $table_name MODIFY sl_description text \");\n }\n } \n\n //set up google maps v3\n $old_option = get_option('sl_map_type');\n $new_option = 'roadmap';\n switch ($old_option) {\n case 'G_NORMAL_MAP':\n $new_option = 'roadmap';\n break;\n case 'G_SATELLITE_MAP':\n $new_option = 'satellite';\n break;\n case 'G_HYBRID_MAP':\n $new_option = 'hybrid';\n break;\n case 'G_PHYSICAL_MAP':\n $new_option = 'terrain';\n break;\n default:\n $new_option = 'roadmap';\n break;\n }\n update_option('sl_map_type', $new_option);\n }", "function populate_custom_column ( $column, $post_id ) {\n switch ( $column ) {\n case 'prezzo':\n echo get_post_meta ( $post_id, 'prezzo', true ) . ' €';\n break;\n case 'ingredienti':\n echo get_post_meta ( $post_id, 'ingredienti', true );\n break;\n }\n }", "function set_generated_meta( $insert_id = 0, $meta_type = '' ) {\n\n\t// Handle our before.\n\tdo_action( Core\\HOOK_PREFIX . 'before_sourced_meta_generated', $insert_id, $meta_type );\n\n\t// Handle the meta type switch.\n\tswitch ( $meta_type ) {\n\n\t\t// Handle post meta.\n\t\tcase 'post' :\n\t\tcase 'posts' :\n\t\tcase 'attachment' :\n\t\tcase 'attachments' :\n\t\tcase 'product' :\n\t\tcase 'products' :\n\n\t\t\t// Update the meta with our keys.\n\t\t\tupdate_post_meta( $insert_id, Core\\META_PREFIX . 'sourced', 1 );\n\t\t\tupdate_post_meta( $insert_id, Core\\META_PREFIX . 'created', time() );\n\n \t\t\t// And break.\n \t\t\tbreak;\n\n \t\t// Handle comment and review meta.\n\t\tcase 'comment' :\n\t\tcase 'comments' :\n\t\tcase 'review' :\n\t\tcase 'reviews' :\n\n\t\t\t// Update the meta with our keys.\n\t\t\tupdate_comment_meta( $insert_id, Core\\META_PREFIX . 'sourced', 1 );\n\t\t\tupdate_comment_meta( $insert_id, Core\\META_PREFIX . 'created', time() );\n\n \t\t\t// And break.\n \t\t\tbreak;\n\n \t\t// Handle user and customer meta.\n\t\tcase 'user' :\n\t\tcase 'users' :\n\t\tcase 'customer' :\n\t\tcase 'customers' :\n\n\t\t\t// Update the meta with our keys.\n\t\t\tupdate_user_meta( $insert_id, Core\\META_PREFIX . 'sourced', 1 );\n\t\t\tupdate_user_meta( $insert_id, Core\\META_PREFIX . 'created', time() );\n\n \t\t\t// And break.\n \t\t\tbreak;\n\n\t\t// End all case breaks.\n\t}\n\n\t// No other updates needed, so do the action.\n\tdo_action( Core\\HOOK_PREFIX . 'after_sourced_meta_generated', $insert_id, $meta_type );\n}", "public function metas()\n {\n return $this->hasMany(PostMeta::class);\n }", "function acf_setup_postdata( $values = array(), $post_id = 0, $is_main = false ) {\n\treturn acf_get_instance('ACF_Local_Meta')->add( $values, $post_id, $is_main );\n}", "function fatherly_fcr_install()\n{\n global $wpdb;\n\n $table_name = $wpdb->prefix . 'feed_content_recirculation_posts';\n if ($wpdb->get_var(\"SHOW TABLES LIKE '$table_name'\") != $table_name) {\n $sql = \"CREATE TABLE `$table_name` (\n `id` BIGINT(20) NOT NULL AUTO_INCREMENT,\n `post_url` varchar(255) NOT NULL,\n `post_id` BIGINT(20) UNSIGNED NOT NULL,\n `processed` INT(1) DEFAULT 0 NOT NULL,\n PRIMARY KEY(`id`)\n );\";\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql);\n fatherly_fcr_populate_data();\n }\n}", "function manage_wp_posts_using_bulk_quick_edit_manage_posts_columns( $columns, $post_type ) {\n\t/*if ( $post_type == 'movies' ) {\n\t\t$columns[ 'release_date' ] = 'Release Date';\n\t\t$columns[ 'coming_soon' ] = 'Coming Soon';\n\t\t$columns[ 'film_rating' ] = 'Film Rating';\n\t}\n\t\t\n\treturn $columns;*/\n\t\n\t/**\n\t * The second example adds our new column after the “Title” column.\n\t * Notice that we're specifying a post type because our function covers ALL post types.\n\t */\n\tswitch ( $post_type ) {\n\t\n\t\tcase 'movies':\n\t\t\n\t\t\t// building a new array of column data\n\t\t\t$new_columns = array();\n\t\t\t\n\t\t\tforeach( $columns as $key => $value ) {\n\t\t\t\n\t\t\t\t// default-ly add every original column\n\t\t\t\t$new_columns[ $key ] = $value;\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * If currently adding the title column,\n\t\t\t\t * follow immediately with our custom columns.\n\t\t\t\t */\n\t\t\t\tif ( $key == 'title' ) {\n\t\t\t\t\t$new_columns[ 'release_date' ] = 'Release Date';\n\t\t\t\t\t$new_columns[ 'coming_soon' ] = 'Coming Soon';\n\t\t\t\t\t$new_columns[ 'film_rating' ] = 'Film Rating';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $new_columns;\n\t\t\t\n\t}\n\t\n\treturn $columns;\n\t\n}", "function create_ROMP_settings_Db_table(){\n\t\tob_start();\n\t\t$table_name = $this->wpdb->prefix . 'romp_settings';\n \t$charset_collate = $this->wpdb->get_charset_collate();\n\n\t\t$sql = \"CREATE TABLE $table_name (\n\t\t\t\t`romp_crm_id` TEXT NOT NULL ,\n\t\t\t\t`romp_cf_link` TEXT NOT NULL\n\t\t\t) $charset_collate;\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $sql );\n\t}", "protected function applyMeta(): void\n {\n $this->state->mergeIntoArray('tca.meta', $this->cache->get(static::TCA_META_CACHE_KEY, []));\n }", "function _flush_and_update_postmeta($post_id, $entity, $omit = array())\n {\n // We need to insert post meta data for each property\n // Unfortunately, that means flushing all existing postmeta\n // and then inserting new values. Depending on the number of\n // properties, this could be slow. So, we directly access the database\n /* @var $wpdb wpdb */\n global $wpdb;\n if (!is_array($omit)) {\n $omit = array($omit);\n }\n // By default, we omit creating meta values for columns in the posts table\n $omit = array_merge($omit, $this->object->_table_columns);\n // Delete the existing meta values\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->postmeta} WHERE post_id = %s\", $post_id));\n // Create query for new meta values\n $sql_parts = array();\n foreach ($entity as $key => $value) {\n if (in_array($key, $omit)) {\n continue;\n }\n if (is_array($value) or is_object($value)) {\n $value = $this->object->serialize($value);\n }\n $sql_parts[] = $wpdb->prepare(\"(%s, %s, %s)\", $post_id, $key, $value);\n }\n $wpdb->query(\"INSERT INTO {$wpdb->postmeta} (post_id, meta_key, meta_value) VALUES \" . implode(',', $sql_parts));\n }", "private function createDataRowForColumns(){\n\t\t$DataRows = [];\n\t\tforeach (\\DB::select('show columns from ' . $this->model->getTable() ) as $column)\n\t\t\t$DataRows[] = (new DataRowColumn)->setModel($this->model)->setField($column->Field)->fillModel();\n\n\t\t$this->DataType->dataRows()->saveMany($DataRows);\n\t}", "function travel_map_install() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"travelmap_countries\";\n\n $charset_collate = $wpdb->get_charset_collate();\n\n $sql = \"CREATE TABLE $table_name (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n country varchar(100) DEFAULT '' NOT NULL,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta( $sql );\n }", "public function populate() {\r\n\t\t\r\n\t\t$query_args = array(\r\n\t\t\t'post_status'\t => 'publish',\r\n\t\t\t'post_type'\t => wpmanual_get_post_type(),\r\n\t\t\t'p' => intval( $this->id )\r\n\t\t);\r\n\t\t\r\n\t\t$this->query = new WP_Query( $query_args );\r\n\r\n\t}", "function fgcf_table_install() {\n global $wpdb;\n $sql = \"CREATE TABLE \" . Fgcf::$table_name . \" (\n\t id mediumint(9) NOT NULL AUTO_INCREMENT,\n\t user_name VARCHAR(255) NOT NULL,\n\t user_email VARCHAR(255) NOT NULL,\n\t user_message TEXT NOT NULL,\n\t UNIQUE KEY id (id)\n\t);\";\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql);\n }" ]
[ "0.606024", "0.60519373", "0.5992187", "0.59794635", "0.5906317", "0.5904465", "0.58768284", "0.586737", "0.5857807", "0.57982165", "0.5773252", "0.5728638", "0.5685537", "0.56637955", "0.561878", "0.56082743", "0.55962753", "0.5549576", "0.5532366", "0.55311036", "0.55283725", "0.55148506", "0.5503821", "0.5502795", "0.5495811", "0.5483253", "0.5480637", "0.54796237", "0.5475092", "0.5468572", "0.5464564", "0.54644156", "0.5451695", "0.54323345", "0.5432029", "0.54247", "0.54142046", "0.54123527", "0.5407139", "0.5400657", "0.5387335", "0.5386587", "0.5385142", "0.5376781", "0.5368884", "0.53679395", "0.5345111", "0.5344656", "0.53347033", "0.53335506", "0.5330231", "0.5322328", "0.5302786", "0.52840686", "0.5276514", "0.525987", "0.5240836", "0.5239863", "0.5236444", "0.5235197", "0.5224562", "0.52093", "0.5203939", "0.5193122", "0.5191844", "0.5170439", "0.51681453", "0.5165823", "0.5154168", "0.5150534", "0.5143461", "0.5142988", "0.51416755", "0.51409155", "0.5136284", "0.513543", "0.51275", "0.5119515", "0.5115885", "0.5115178", "0.51144785", "0.5112575", "0.51125544", "0.5104777", "0.51029277", "0.5095696", "0.50932324", "0.50914973", "0.508699", "0.5085535", "0.5084884", "0.50754064", "0.50713813", "0.5065705", "0.50609857", "0.50602794", "0.5054415", "0.5051154", "0.504926", "0.5044094", "0.50433105" ]
0.0
-1
Populate order postmeta from a custom table, for rolling back.
public function backfill_postmeta( &$order ) { $data = $this->get_order_data_from_table( $order ); if ( is_null( $data ) ) { return; } foreach ( $this->get_postmeta_mapping() as $column => $meta_key ) { if ( isset( $data->$column ) ) { update_post_meta( $order->get_id(), $meta_key, $data->$column ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function carton_taxonomy_metadata_wpdbfix() {\n\tglobal $wpdb;\n\t$termmeta_name = 'carton_termmeta';\n\t$itemmeta_name = 'carton_order_itemmeta';\n\n\t$wpdb->carton_termmeta = $wpdb->prefix . $termmeta_name;\n\t$wpdb->order_itemmeta = $wpdb->prefix . $itemmeta_name;\n\n\t$wpdb->tables[] = 'carton_termmeta';\n\t$wpdb->tables[] = 'order_itemmeta';\n}", "public function populate_from_meta( &$order, $save = true, $delete = false ) {\n\t\t$table_data = $this->get_order_data_from_table( $order );\n\n\t\tif ( is_null( $table_data ) ) {\n\t\t\t$original_creating = $this->creating;\n\t\t\t$this->creating = true;\n\t\t}\n\n\t\tforeach ( $this->get_postmeta_mapping() as $column => $meta_key ) {\n\t\t\t$meta = get_post_meta( $order->get_id(), $meta_key, true );\n\n\t\t\tif ( empty( $table_data->$column ) && ! empty( $meta ) ) {\n\t\t\t\tswitch ( $column ) {\n\t\t\t\t\tcase 'prices_include_tax':\n\t\t\t\t\t\t$order->set_prices_include_tax( 'yes' === $meta );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$order->{\"set_{$column}\"}( $meta );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( true === $save ) {\n\t\t\t$this->update_post_meta( $order );\n\t\t}\n\n\t\tif ( true === $delete ) {\n\t\t\tforeach ( $this->get_postmeta_mapping() as $column => $meta_key ) {\n\t\t\t\tdelete_post_meta( $order->get_id(), $meta_key );\n\t\t\t}\n\t\t}\n\n\t\t$this->creating = $original_creating;\n\n\t\treturn $order;\n\t}", "function update_post_meta_on_activation(){\n\n\tglobal $wpdb;\n\n\t$sql = \"SELECT ID FROM wp_posts\";\n\n\t$posts = $wpdb->get_results( $sql );\n\n\tforeach( $posts as $post ){\n\t\tif( ! get_post_meta( $post->ID, 'post_order' ) ){\n\t\t\tadd_post_meta( $post->ID, 'post_order', 0 );\n\t\t}\n\t}\n\tif( function_exists( 'register_uninstall_hook' ) ){\n\t\tregister_uninstall_hook( __FILE__, 'custom_post_order_uninstall' );\n\t}\n}", "function jtl_save_testimonial_order_meta($post_id, $post) {\n\tif ($post->post_type == 'testimonial') {\n\t\t// Check to see if order value exists\n\t\t$meta_value = get_post_meta($post_id, 'jlt_testimonial_order', true);\n\t\tif (!$meta_value || empty($meta_value)) {\n\t\t\tadd_post_meta($post_id, 'jlt_testimonial_order', 0, true);\n\t\t}\n\t}\n\t\n}", "function dokan_generate_sync_table() {\n global $wpdb;\n\n $sql = \"SELECT oi.order_id, p.ID as product_id, p.post_title, p.post_author as seller_id,\n oim2.meta_value as order_total, terms.name as order_status\n FROM {$wpdb->prefix}woocommerce_order_items oi\n LEFT JOIN {$wpdb->prefix}woocommerce_order_itemmeta oim ON oim.order_item_id = oi.order_item_id\n LEFT JOIN {$wpdb->prefix}woocommerce_order_itemmeta oim2 ON oim2.order_item_id = oi.order_item_id\n LEFT JOIN $wpdb->posts p ON oim.meta_value = p.ID\n LEFT JOIN {$wpdb->term_relationships} rel ON oi.order_id = rel.object_id\n LEFT JOIN {$wpdb->term_taxonomy} tax ON rel.term_taxonomy_id = tax.term_taxonomy_id\n LEFT JOIN {$wpdb->terms} terms ON tax.term_id = terms.term_id\n WHERE\n oim.meta_key = '_product_id' AND\n oim2.meta_key = '_line_total'\n GROUP BY oi.order_id\";\n\n $orders = $wpdb->get_results( $sql );\n $table_name = $wpdb->prefix . 'dokan_orders';\n\n $wpdb->query( 'TRUNCATE TABLE ' . $table_name );\n\n if ( $orders ) {\n foreach ($orders as $order) {\n $percentage = dokan_get_seller_percentage( $order->seller_id );\n\n $wpdb->insert(\n $table_name,\n array(\n 'order_id' => $order->order_id,\n 'seller_id' => $order->seller_id,\n 'order_total' => $order->order_total,\n 'net_amount' => ($order->order_total * $percentage)/100,\n 'order_status' => $order->order_status,\n ),\n array(\n '%d',\n '%d',\n '%f',\n '%f',\n '%s',\n )\n );\n } // foreach\n } // if\n}", "protected function update_post_meta( &$order ) {\n\t\tglobal $wpdb;\n\n\t\t$edit_data = array(\n\t\t\t'order_key' => $order->get_order_key( 'edit' ),\n\t\t\t'customer_id' => $order->get_customer_id( 'edit' ),\n\t\t\t'payment_method' => $order->get_payment_method( 'edit' ),\n\t\t\t'payment_method_title' => $order->get_payment_method_title( 'edit' ),\n\t\t\t'transaction_id' => $order->get_transaction_id( 'edit' ),\n\t\t\t'customer_ip_address' => $order->get_customer_ip_address( 'edit' ),\n\t\t\t'customer_user_agent' => $order->get_customer_user_agent( 'edit' ),\n\t\t\t'created_via' => $order->get_created_via( 'edit' ),\n\t\t\t'date_completed' => $order->get_date_completed( 'edit' ),\n\t\t\t'date_paid' => $order->get_date_paid( 'edit' ),\n\t\t\t'cart_hash' => $order->get_cart_hash( 'edit' ),\n\n\t\t\t'billing_first_name' => $order->get_billing_first_name( 'edit' ),\n\t\t\t'billing_last_name' => $order->get_billing_last_name( 'edit' ),\n\t\t\t'billing_company' => $order->get_billing_company( 'edit' ),\n\t\t\t'billing_address_1' => $order->get_billing_address_1( 'edit' ),\n\t\t\t'billing_address_2' => $order->get_billing_address_2( 'edit' ),\n\t\t\t'billing_city' => $order->get_billing_city( 'edit' ),\n\t\t\t'billing_state' => $order->get_billing_state( 'edit' ),\n\t\t\t'billing_postcode' => $order->get_billing_postcode( 'edit' ),\n\t\t\t'billing_country' => $order->get_billing_country( 'edit' ),\n\n\t\t\t'billing_email' => $order->get_billing_email( 'edit' ),\n\t\t\t'billing_phone' => $order->get_billing_phone( 'edit' ),\n\n\t\t\t'shipping_first_name' => $order->get_shipping_first_name( 'edit' ),\n\t\t\t'shipping_last_name' => $order->get_shipping_last_name( 'edit' ),\n\t\t\t'shipping_company' => $order->get_shipping_company( 'edit' ),\n\t\t\t'shipping_address_1' => $order->get_shipping_address_1( 'edit' ),\n\t\t\t'shipping_address_2' => $order->get_shipping_address_2( 'edit' ),\n\t\t\t'shipping_city' => $order->get_shipping_city( 'edit' ),\n\t\t\t'shipping_state' => $order->get_shipping_state( 'edit' ),\n\t\t\t'shipping_postcode' => $order->get_shipping_postcode( 'edit' ),\n\t\t\t'shipping_country' => $order->get_shipping_country( 'edit' ),\n\n\t\t\t'discount_total' => $order->get_discount_total( 'edit' ),\n\t\t\t'discount_tax' => $order->get_discount_tax( 'edit' ),\n\t\t\t'shipping_total' => $order->get_shipping_total( 'edit' ),\n\t\t\t'shipping_tax' => $order->get_shipping_tax( 'edit' ),\n\t\t\t'cart_tax' => $order->get_total_tax( 'edit' ),\n\t\t\t'total' => $order->get_total( 'edit' ),\n\n\t\t\t'version' => $order->get_version( 'edit' ),\n\t\t\t'currency' => $order->get_currency( 'edit' ),\n\t\t\t'prices_include_tax' => $order->get_prices_include_tax( 'edit' ),\n\t\t);\n\n\t\t$changes = array();\n\n\t\tif ( $this->creating ) {\n\t\t\t$wpdb->insert(\n\t\t\t\t\"{$wpdb->prefix}woocommerce_orders\",\n\t\t\t\tarray_merge( array(\n\t\t\t\t\t'order_id' => $order->get_id(),\n\t\t\t\t), $edit_data )\n\t\t\t);\n\n\t\t\t// We are no longer creating the order, it is created.\n\t\t\t$this->creating = false;\n\t\t} else {\n\t\t\t$changes = array_intersect_key( $edit_data, $order->get_changes() );\n\n\t\t\tif ( ! empty( $changes ) ) {\n\t\t\t\t$wpdb->update(\n\t\t\t\t\t\"{$wpdb->prefix}woocommerce_orders\",\n\t\t\t\t\t$changes,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'order_id' => $order->get_id(),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$updated_props = array_keys( (array) $changes );\n\n\t\t// If customer changed, update any downloadable permissions.\n\t\tif ( in_array( 'customer_user', $updated_props ) || in_array( 'billing_email', $updated_props ) ) {\n\t\t\t$data_store = WC_Data_Store::load( 'customer-download' );\n\t\t\t$data_store->update_user_by_order_id( $order->get_id(), $order->get_customer_id(), $order->get_billing_email() );\n\t\t}\n\n\t\tdo_action( 'woocommerce_order_object_updated_props', $order, $updated_props );\n\t}", "function wpdbfix() {\n\t\tglobal $wpdb;\n\t\t$wpdb->taxonomymeta = \"{$wpdb->prefix}taxonomymeta\";\n\t}", "function update_post_meta_on_post_save(){\n\n\tif( isset( $_POST[ 'post_ID' ] ) ){\n\n\t\t$id = $_POST[ 'post_ID' ];\n\n\t\tif( ! get_post_meta( $id, 'post_order' ) ){\n\t\t\tadd_post_meta( $id, 'post_order', 0 );\n\t\t}\n\t}\n}", "function insert_wp_postmeta($wpdb, $id, $postmeta){\n $table = $wpdb->prefix.\"postmeta\";\n $class = get_id_post_type($wpdb, 'class', $postmeta['class']);\n $rul = get_id_post_type($wpdb, 'restricteduselicence', $postmeta['rul']);\n $pvp = get_id_post_type($wpdb, 'plantvariety', $postmeta['pvp']);\n $patent = get_id_post_type($wpdb, 'patent', $postmeta['patent']);\n $patent_number = get_id_post_type($wpdb, 'patentnumber', $postmeta['patent_number']);\n $patent_number_link = get_id_post_type($wpdb, 'patentnumberlink', $postmeta['patent_number_link']);\n \n add_post_meta($id, 'class', $class[0]->id);\n add_post_meta($id, 'restricted_use_licence', $rul[0]->id);\n add_post_meta($id, 'plant_variety_protection', $pvp[0]->id);\n add_post_meta($id, 'pvp_number', $postmeta['pvp_number']);\n add_post_meta($id, 'pdf_link', $postmeta['pdf_link']);\n add_post_meta($id, 'patent', $postmeta['patent']);\n add_post_meta($id, 'patent_number', $postmeta['patent_number']);\n add_post_meta($id, 'patent_number_link', $postmeta['patent_number_link']); \n}", "function _flush_and_update_postmeta($post_id, $entity, $omit = array())\n {\n // We need to insert post meta data for each property\n // Unfortunately, that means flushing all existing postmeta\n // and then inserting new values. Depending on the number of\n // properties, this could be slow. So, we directly access the database\n /* @var $wpdb wpdb */\n global $wpdb;\n if (!is_array($omit)) {\n $omit = array($omit);\n }\n // By default, we omit creating meta values for columns in the posts table\n $omit = array_merge($omit, $this->object->_table_columns);\n // Delete the existing meta values\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->postmeta} WHERE post_id = %s\", $post_id));\n // Create query for new meta values\n $sql_parts = array();\n foreach ($entity as $key => $value) {\n if (in_array($key, $omit)) {\n continue;\n }\n if (is_array($value) or is_object($value)) {\n $value = $this->object->serialize($value);\n }\n $sql_parts[] = $wpdb->prepare(\"(%s, %s, %s)\", $post_id, $key, $value);\n }\n $wpdb->query(\"INSERT INTO {$wpdb->postmeta} (post_id, meta_key, meta_value) VALUES \" . implode(',', $sql_parts));\n }", "protected function applyMeta(): void\n {\n $this->state->mergeIntoArray('tca.meta', $this->cache->get(static::TCA_META_CACHE_KEY, []));\n }", "protected static function install_tables() {\n\t\tglobal $wpdb;\n\n\t\t// Load wp-admin/includes/upgrade.php, which defines dbDelta().\n\t\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n\t\t$table = wc_custom_order_table()->get_table_name();\n\t\t$collate = $wpdb->get_charset_collate();\n\t\t$tables = \"\n\t\t\tCREATE TABLE {$table} (\n\t\t\t\torder_id BIGINT UNSIGNED NOT NULL,\n\t\t\t\torder_key varchar(100) NOT NULL,\n\t\t\t\tcustomer_id BIGINT UNSIGNED NOT NULL,\n\t\t\t\tbilling_first_name varchar(100) NOT NULL,\n\t\t\t\tbilling_last_name varchar(100) NOT NULL,\n\t\t\t\tbilling_company varchar(100) NOT NULL,\n\t\t\t\tbilling_address_1 varchar(200) NOT NULL,\n\t\t\t\tbilling_address_2 varchar(200) NOT NULL,\n\t\t\t\tbilling_city varchar(100) NOT NULL,\n\t\t\t\tbilling_state varchar(100) NOT NULL,\n\t\t\t\tbilling_postcode varchar(100) NOT NULL,\n\t\t\t\tbilling_country varchar(100) NOT NULL,\n\t\t\t\tbilling_email varchar(200) NOT NULL,\n\t\t\t\tbilling_phone varchar(200) NOT NULL,\n\t\t\t\tshipping_first_name varchar(100) NOT NULL,\n\t\t\t\tshipping_last_name varchar(100) NOT NULL,\n\t\t\t\tshipping_company varchar(100) NOT NULL,\n\t\t\t\tshipping_address_1 varchar(200) NOT NULL,\n\t\t\t\tshipping_address_2 varchar(200) NOT NULL,\n\t\t\t\tshipping_city varchar(100) NOT NULL,\n\t\t\t\tshipping_state varchar(100) NOT NULL,\n\t\t\t\tshipping_postcode varchar(100) NOT NULL,\n\t\t\t\tshipping_country varchar(100) NOT NULL,\n\t\t\t\tpayment_method varchar(100) NOT NULL,\n\t\t\t\tpayment_method_title varchar(100) NOT NULL,\n\t\t\t\tdiscount_total float NOT NULL DEFAULT 0,\n\t\t\t\tdiscount_tax float NOT NULL DEFAULT 0,\n\t\t\t\tshipping_total float NOT NULL DEFAULT 0,\n\t\t\t\tshipping_tax float NOT NULL DEFAULT 0,\n\t\t\t\tcart_tax float NOT NULL DEFAULT 0,\n\t\t\t\ttotal float NOT NULL DEFAULT 0,\n\t\t\t\tversion varchar(16) NOT NULL,\n\t\t\t\tcurrency varchar(3) NOT NULL,\n\t\t\t\tprices_include_tax tinyint(1) NOT NULL,\n\t\t\t\ttransaction_id varchar(200) NOT NULL,\n\t\t\t\tcustomer_ip_address varchar(40) NOT NULL,\n\t\t\t\tcustomer_user_agent varchar(200) NOT NULL,\n\t\t\t\tcreated_via varchar(200) NOT NULL,\n\t\t\t\tdate_completed datetime DEFAULT NULL,\n\t\t\t\tdate_paid datetime DEFAULT NULL,\n\t\t\t\tcart_hash varchar(32) NOT NULL,\n\t\t\tPRIMARY KEY (order_id)\n\t\t\t) $collate;\n\t\t\";\n\n\t\t// Apply the database migration.\n\t\tdbDelta( $tables );\n\n\t\t// Store the table version in the options table.\n\t\tupdate_option( self::SCHEMA_VERSION_KEY, (int) self::$table_version, false );\n\t}", "public function setCustomFields ($order) {\n \n }", "protected function _populateMetas()\n {\n $nodes = $this->_catalog->getModel('nodes');\n $metas = $this->_catalog->getModel('metas');\n $collection = $nodes->fetchAll();\n foreach ($collection as $node) {\n $meta = $metas->fetchNew();\n $meta->node_id = $node->id;\n $meta->save();\n }\n }", "function action_woocommerce_order_items_table( $order ) {\n\t\t// make action magic happen here... \n\t\t$data = get_post_meta( $order->id, '_metatest_data', true );\n\t\techo '<tr>\n\t\t\t\t<th scope=\"row\"><span class=\"np_forudpdate\">Накладная (Новая почта):</span></th>\n\t\t\t\t\t<td>' . $data . '</td>\n\t\t\t\t</tr>';\n\t}", "public function importPostMeta() {\n\t\t$postsPerAction = 100;\n\t\t$publicPostTypes = implode( \"', '\", aioseo()->helpers->getPublicPostTypes( true ) );\n\t\t$timeStarted = gmdate( 'Y-m-d H:i:s', aioseo()->transients->get( 'import_post_meta_yoast_seo' ) );\n\n\t\t$posts = aioseo()->db\n\t\t\t->start( 'posts' . ' as p' )\n\t\t\t->select( 'p.ID, p.post_type' )\n\t\t\t->join( 'postmeta as pm', '`p`.`ID` = `pm`.`post_id`' )\n\t\t\t->leftJoin( 'aioseo_posts as ap', '`p`.`ID` = `ap`.`post_id`' )\n\t\t\t->whereRaw( \"pm.meta_key LIKE '_yoast_wpseo_%'\" )\n\t\t\t->whereRaw( \"( p.post_type IN ( '$publicPostTypes' ) )\" )\n\t\t\t->whereRaw( \"( ap.post_id IS NULL OR ap.updated < '$timeStarted' )\" )\n\t\t\t->orderBy( 'p.ID DESC' )\n\t\t\t->limit( $postsPerAction )\n\t\t\t->run()\n\t\t\t->result();\n\n\t\tif ( ! $posts || ! count( $posts ) ) {\n\t\t\taioseo()->transients->delete( 'import_post_meta_yoast_seo' );\n\t\t\treturn;\n\t\t}\n\n\t\t$mappedMeta = [\n\t\t\t'_yoast_wpseo_title' => 'title',\n\t\t\t'_yoast_wpseo_metadesc' => 'description',\n\t\t\t'_yoast_wpseo_canonical' => 'canonical_url',\n\t\t\t'_yoast_wpseo_meta-robots-noindex' => 'robots_noindex',\n\t\t\t'_yoast_wpseo_meta-robots-nofollow' => 'robots_nofollow',\n\t\t\t'_yoast_wpseo_meta-robots-adv' => '',\n\t\t\t'_yoast_wpseo_focuskw' => '',\n\t\t\t'_yoast_wpseo_focuskeywords' => '',\n\t\t\t'_yoast_wpseo_opengraph-title' => 'og_title',\n\t\t\t'_yoast_wpseo_opengraph-description' => 'og_description',\n\t\t\t'_yoast_wpseo_opengraph-image' => 'og_image_custom_url',\n\t\t\t'_yoast_wpseo_twitter-title' => 'twitter_title',\n\t\t\t'_yoast_wpseo_twitter-description' => 'twitter_description',\n\t\t\t'_yoast_wpseo_twitter-image' => 'twitter_image_custom_url',\n\t\t\t'_yoast_wpseo_schema_page_type' => '',\n\t\t\t'_yoast_wpseo_schema_article_type' => ''\n\t\t];\n\n\t\tforeach ( $posts as $post ) {\n\t\t\t$postMeta = aioseo()->db\n\t\t\t\t->start( 'postmeta' . ' as pm' )\n\t\t\t\t->select( 'pm.meta_key, pm.meta_value' )\n\t\t\t\t->where( 'pm.post_id', $post->ID )\n\t\t\t\t->whereRaw( \"`pm`.`meta_key` LIKE '_yoast_wpseo_%'\" )\n\t\t\t\t->run()\n\t\t\t\t->result();\n\n\t\t\tif ( ! $postMeta || ! count( $postMeta ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$meta = [\n\t\t\t\t'post_id' => (int) $post->ID,\n\t\t\t];\n\n\t\t\tforeach ( $postMeta as $record ) {\n\t\t\t\t$name = $record->meta_key;\n\t\t\t\t$value = $record->meta_value;\n\n\t\t\t\tif ( ! in_array( $name, array_keys( $mappedMeta ), true ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tswitch ( $name ) {\n\t\t\t\t\tcase '_yoast_wpseo_meta-robots-noindex':\n\t\t\t\t\tcase '_yoast_wpseo_meta-robots-nofollow':\n\t\t\t\t\t\tif ( (bool) $value ) {\n\t\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = ! empty( $value );\n\t\t\t\t\t\t\t$meta['robots_default'] = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_meta-robots-adv':\n\t\t\t\t\t\t$values = explode( ',', $value );\n\t\t\t\t\t\tif ( $values ) {\n\t\t\t\t\t\t\tforeach ( $values as $value ) {\n\t\t\t\t\t\t\t\t$meta[ \"robots_$value\" ] = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_canonical':\n\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_opengraph-image':\n\t\t\t\t\t\t$meta['og_image_type'] = 'custom_image';\n\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_twitter-image':\n\t\t\t\t\t\t$meta['twitter_use_og'] = false;\n\t\t\t\t\t\t$meta['twitter_image_type'] = 'custom_image';\n\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_schema_page_type':\n\t\t\t\t\t\t$value = aioseo()->helpers->pregReplace( '#\\s#', '', $value );\n\t\t\t\t\t\tif ( in_array( $post->post_type, [ 'post', 'page', 'attachment' ], true ) ) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( in_array( $value, ImportExport\\SearchAppearance::$supportedWebPageGraphs, true ) ) {\n\t\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = 'WebPage';\n\t\t\t\t\t\t\t$options = new \\stdClass();\n\t\t\t\t\t\t\t$options->webPage = [ 'webPageType' => $value ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$meta['schema_type_options'] = wp_json_encode( $options );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_schema_article_type':\n\t\t\t\t\t\t$value = aioseo()->helpers->pregReplace( '#\\s#', '', $value );\n\t\t\t\t\t\tif ( 'none' === lcfirst( $value ) ) {\n\t\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = 'None';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( in_array( $post->post_type, [ 'page', 'attachment' ], true ) ) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$options = new \\stdClass();\n\t\t\t\t\t\tif ( isset( $meta['schema_type_options'] ) ) {\n\t\t\t\t\t\t\t$options = json_decode( $meta['schema_type_options'] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$options->article = [ 'articleType' => 'Article' ];\n\t\t\t\t\t\tif ( in_array( $value, ImportExport\\SearchAppearance::$supportedArticleGraphs, true ) ) {\n\t\t\t\t\t\t\t$options->article = [ 'articleType' => $value ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$options->article = [ 'articleType' => 'BlogPosting' ];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$meta['schema_type'] = 'Article';\n\t\t\t\t\t\t$meta['schema_type_options'] = wp_json_encode( $options );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_focuskw':\n\t\t\t\t\t\t$keyphrase = [\n\t\t\t\t\t\t\t'focus' => [ 'keyphrase' => aioseo()->helpers->sanitizeOption( $value ) ],\n\t\t\t\t\t\t\t'additional' => []\n\t\t\t\t\t\t];\n\t\t\t\t\t\t$meta['keyphrases'] = wp_json_encode( $keyphrase );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_focuskeywords':\n\t\t\t\t\t\t$keyphrases = [];\n\t\t\t\t\t\tif ( ! empty( $meta[ $mappedMeta[ $name ] ] ) ) {\n\t\t\t\t\t\t\t$keyphrases = (array) json_decode( $meta[ $mappedMeta[ $name ] ] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$yoastKeyphrases = json_decode( $value );\n\t\t\t\t\t\tfor ( $i = 0; $i < count( $yoastKeyphrases ); $i++ ) {\n\t\t\t\t\t\t\t$keyphrase = [ 'keyphrase' => aioseo()->helpers->sanitizeOption( $yoastKeyphrases[ $i ]->keyword ) ];\n\t\t\t\t\t\t\t$keyphrases['additional'][ $i ] = $keyphrase;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! empty( $keyphrases ) ) {\n\t\t\t\t\t\t\t$meta['keyphrases'] = wp_json_encode( $keyphrases );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '_yoast_wpseo_title':\n\t\t\t\t\tcase '_yoast_wpseo_metadesc':\n\t\t\t\t\tcase '_yoast_wpseo_opengraph-title':\n\t\t\t\t\tcase '_yoast_wpseo_opengraph-description':\n\t\t\t\t\t\tif ( 'page' === $post->post_type ) {\n\t\t\t\t\t\t\t$value = aioseo()->helpers->pregReplace( '#%%primary_category%%#', '', $value );\n\t\t\t\t\t\t\t$value = aioseo()->helpers->pregReplace( '#%%excerpt%%#', '', $value );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$value = aioseo()->importExport->yoastSeo->helpers->macrosToSmartTags( $value, 'post', $post->post_type );\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$meta[ $mappedMeta[ $name ] ] = esc_html( wp_strip_all_tags( strval( $value ) ) );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$aioseoPost = Models\\Post::getPost( (int) $post->ID );\n\t\t\t$aioseoPost->set( $meta );\n\t\t\t$aioseoPost->save();\n\t\t}\n\n\t\tif ( count( $posts ) === $postsPerAction ) {\n\t\t\ttry {\n\t\t\t\tas_schedule_single_action( time() + 5, aioseo()->importExport->yoastSeo->postActionName, [], 'aioseo' );\n\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\t// Do nothing.\n\t\t\t}\n\t\t} else {\n\t\t\taioseo()->transients->delete( 'import_post_meta_yoast_seo' );\n\t\t}\n\t}", "function jigoshop_upgrade_120() {\n\n // update orders\n\t$args = array(\n\t\t'post_type'\t => 'shop_order',\n\t\t'numberposts' => -1,\n\t\t'post_status' => 'publish'\n\t);\n\n\t$posts = get_posts( $args );\n\n\tforeach( $posts as $post ) :\n $order_data = get_post_meta($post->ID, 'order_data', true);\n\n if (!empty($order_data['order_tax'])) :\n\n // means someone has posted a manual order. Need to update to new tax string\n if (strpos($order_data['order_tax'], ':') === false) :\n $order_data['order_tax_total'] = $order_data['order_tax'];\n $order_data['order_tax'] = jigoshop_tax::create_custom_tax($order_data['order_total'] - $order_data['order_tax_total'], $order_data['order_tax_total'], $order_data['order_shipping_tax'], $order_data['order_tax_divisor']);\n else :\n $tax_array = get_old_taxes_as_array($order_data['order_tax']);\n $order_data['order_tax'] = jigoshop_tax::array_implode($tax_array);\n endif;\n\n update_post_meta($post->ID, 'order_data', $order_data);\n\n endif;\n\n endforeach;\n \n}", "function wp_create_initial_post_meta()\n {\n }", "public function set_table_vars() {\n\t\tglobal $wpdb;\n\n\t\t$this->table = $wpdb->prefix . self::TABLE_NAME;\n\t\t$this->ms_table = $wpdb->base_prefix . self::MS_TABLE_NAME;\n\n\t\t/* Register the snippet table names with WordPress */\n\t\t$wpdb->snippets = $this->table;\n\t\t$wpdb->ms_snippets = $this->ms_table;\n\n\t\t$wpdb->tables[] = self::TABLE_NAME;\n\t\t$wpdb->ms_global_tables[] = self::MS_TABLE_NAME;\n\t}", "public function createCustomOrder()\n {\n AutoEvent::select('custom_order')->increment('custom_order', 1);\n $this->custom_order = 0;\n }", "function setup_meta_translation() {\n\t\t\tglobal $post, $wpdb;\n\t\t\t$post_id = $post->ID;\n\t\t\t\n\t\t\tforeach($this->arabic_meta_keys as $key ) {\n\t\t\t\tif ($post_id){\n\t\t\t\t\t$$key = get_post_meta($post_id, $key, true);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$$key = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$the_post = get_post($post_id);\n\t\t\t\n\t\t\tinclude(dirname(__FILE__).'/views/ipc-meta-box-translation.php');\n\t\t}", "function pw_sample_plugin_create_table() {\n\tglobal $wpdb;\n$charset_collate = $wpdb->get_charset_collate();\n\n$sql = \"CREATE TABLE `book_meta_dataa` (\n\t\tID INTEGER NOT NULL AUTO_INCREMENT,\n\t\tauthor_name TEXT NOT NULL,\n\t\tprice bigint(64),\n\t\tpublisher text DEFAULT '',\n\t\tisbn text DEFAULT '',\n\t\tyr text DEFAULT '',\n\t\tedi text DEFAULT '',\n\t\tur text DEFAULT '',\n\tPRIMARY KEY (ID)\n) $charset_collate;\";\n\nrequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\ndbDelta($sql);\n\t\n }", "protected function parse_orderby_meta($orderby_raw)\n {\n }", "public static function get_meta_table();", "function siteorigin_panels_wp_import_post_meta($post_meta){\n\tforeach($post_meta as $i => $meta) {\n\t\tif($meta['key'] == 'panels_data') {\n\t\t\t$value = $meta['value'];\n\t\t\t$value = preg_replace(\"/[\\r\\n]/\", \"<<<br>>>\", $value);\n\t\t\t$value = preg_replace('!s:(\\d+):\"(.*?)\";!e', \"'s:'.strlen('$2').':\\\"$2\\\";'\", $value);\n\t\t\t$value = unserialize($value);\n\t\t\t$value = array_map('siteorigin_panels_wp_import_post_meta_map', $value);\n\n\t\t\t$post_meta[$i]['value'] = $value;\n\t\t}\n\t}\n\n\treturn $post_meta;\n}", "private static function postmeta_table( $query ) {\n\t\t\t/** @var \\wpdb $wpdb */\n\t\t\tglobal $wpdb;\n\t\t\t$postmeta_table = $wpdb->postmeta;\n\n\t\t\tif ( ! $query->tribe_is_multi_posttype ) {\n\t\t\t\treturn $postmeta_table;\n\t\t\t}\n\n\t\t\t$qv = $query->query_vars;\n\n\t\t\t// check if are any meta queries\n\t\t\tif ( ! empty( $qv['meta_key'] ) ) {\n\t\t\t\t$postmeta_table = 'tribe_event_postmeta';\n\t\t\t} else {\n\t\t\t\tif ( isset( $qv['meta_query'] ) ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t( is_array( $qv['meta_query'] ) && ! empty( $qv['meta_query'] ) ) ||\n\t\t\t\t\t\t( $qv['meta_query'] instanceof WP_Meta_Query && ! empty( $qv['meta_query']->queries ) )\n\t\t\t\t\t) {\n\t\t\t\t\t\t$postmeta_table = 'tribe_event_postmeta';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$postmeta_table = $wpdb->postmeta;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $postmeta_table;\n\t\t}", "protected function MetaAfterCreate() {\n\t\t}", "function wisataone_X1_get_all_order() {\n global $wpdb, $wisataone_X1_tblname;\n $wp_track_table = $wpdb->prefix . $wisataone_X1_tblname;\n\n return $wpdb->get_results( \n \"\n SELECT *\n FROM {$wp_track_table}\n \"\n );\n}", "protected function save_paypal_meta_data( $order, $posted ) {\n }", "private function metaLoad()\n {\n $this->meta ??= $this?->relations['meta'] ?? $this->meta()->get();\n }", "private function populatePaymentTable()\n {\n $preset = $this->getPaymentInfo()->brands;\n\n foreach ($preset as $brand => $value) {\n $this->db->query(\n \"INSERT INTO `\" . DB_PREFIX . \"mundipagg_payments`\n (brand_name, is_enabled, installments_up_to, installments_without_interest, interest)\n VALUES ('\" .\n $brand . \"', \" .\n $value->enabled . \", \" .\n $value->installmentsUpTo . \", \" .\n $value->installmentsWithoutInterest . \", \" .\n $value->interest . \"\n );\"\n );\n }\n }", "public function maybe_update_meta_keys() {\n global $wpdb;\n\n // check, if the current version is greater than or equal 0.9.7\n if ( version_compare( $this->config->get( 'version' ), '0.9.7', '>=' ) ) {\n // map old values to new ones\n $meta_key_mapping = array(\n 'Teaser content' => 'laterpay_post_teaser',\n 'Pricing Post' => 'laterpay_post_pricing',\n 'Pricing Post Type' => 'laterpay_post_pricing_type',\n );\n\n $sql = 'UPDATE ' . $wpdb->postmeta . \" SET meta_key = '%s' WHERE meta_key = '%s'\";\n\n foreach ( $meta_key_mapping as $before => $after ) {\n $prepared_sql = $wpdb->prepare( $sql, array( $after, $before ) );\n $wpdb->query( $prepared_sql );\n }\n }\n }", "public function migrate_pricing_post_meta( $return, $post_id, $meta_key ) {\n // migrate the pricing postmeta to an array\n if ( $meta_key === 'laterpay_post_prices' ) {\n $meta_migration_mapping = array(\n 'laterpay_post_pricing' => 'price',\n 'laterpay_post_revenue_model' => 'revenue_model',\n 'laterpay_post_default_category' => 'category_id',\n 'laterpay_post_pricing_type' => 'type',\n 'laterpay_start_price' => 'start_price',\n 'laterpay_end_price' => 'end_price',\n 'laterpay_change_start_price_after_days' => 'change_start_price_after_days',\n 'laterpay_transitional_period_end_after_days' => 'transitional_period_end_after_days,',\n 'laterpay_reach_end_price_after_days' => 'reach_end_price_after_days',\n );\n\n $new_meta_values = array();\n\n foreach ( $meta_migration_mapping as $old_meta_key => $new_key ) {\n $value = get_post_meta( $post_id, $old_meta_key, true );\n\n if ( $value !== '' ) {\n // migrate old data: if post_pricing is '0' or '1', set it to 'individual price'\n if ( $old_meta_key === 'laterpay_post_pricing_type' && in_array( $value, array( '0', '1' ) ) ) {\n $value = LaterPay_Helper_Pricing::TYPE_INDIVIDUAL_PRICE;\n }\n\n // add the meta_value to the new postmeta array\n $new_meta_values[ $new_key ] = $value;\n\n // delete the old postmeta\n delete_post_meta( $post_id, $old_meta_key );\n }\n }\n\n if ( ! empty( $new_meta_values ) ) {\n add_post_meta( $post_id, 'laterpay_post_prices', $new_meta_values, true );\n }\n }\n\n return $return;\n }", "function populate_custom_column ( $column, $post_id ) {\n switch ( $column ) {\n case 'prezzo':\n echo get_post_meta ( $post_id, 'prezzo', true ) . ' €';\n break;\n case 'ingredienti':\n echo get_post_meta ( $post_id, 'ingredienti', true );\n break;\n }\n }", "private function save_paypal_meta_data()\n {\n $postMeta = [\n 'payer_email' => 'Payer PayPal address',\n 'first_name' => 'Payer first name',\n 'last_name' => 'Payer last name',\n 'payment_type' => 'Payment type',\n ];\n\n foreach ($postMeta as $key => $name) {\n $value = wc_clean($this->request->get($key, FILTER_DEFAULT));\n $value and update_post_meta($this->order->get_id(), $name, $value);\n }\n }", "protected function addOrderCustomFields(): void\n {\n $custom_field_set_id = md5('Viacash custom_field_set');\n\n $this->container->get('custom_field_set.repository')->upsert(\n [\n [\n 'id' => $custom_field_set_id,\n 'name' => 'custom_viacash',\n 'config' => [\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Viacash\", \"en-GB\" => \"Viacash\"]),\n \"translated\" => true\n ],\n 'active' => true,\n 'global' => false,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field_set_relation.repository')->upsert(\n [\n [\n 'id' => md5('Viacash custom_field_set_relation'),\n 'customFieldSetId' => $custom_field_set_id,\n 'entityName' => 'order',\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_checkout_token'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_checkout_token',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Checkout-Token\", \"en-GB\" => \"Viacash Checkout-Token\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 1\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_slip_id'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_slip_id',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Slip-ID\", \"en-GB\" => \"Viacash Slip-ID\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 2\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_division_id'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_division_id',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Interne Barzahlen Divisions-Nummer\", \"en-GB\" => \"Internal Viacash division number\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 3\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_is_sandboxed'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_is_sandboxed',\n 'type' => 'switch',\n 'config' => [\n 'type' => 'switch',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Sandbox-Transaktion\", \"en-GB\" => \"Viacash sandboxed transaction\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"switch\",\n \"customFieldPosition\" => 4\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_refundable_amount'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_refundable_amount',\n 'type' => 'number',\n 'config' => [\n 'type' => 'number',\n \"label\" => $this->injectFallbackLanguage([\n \"de-DE\" => \"Verbleibender per Barzahlen erstattbarer Betrag\",\n \"en-GB\" => \"Remaining amount that can be refunded with Viacash\",\n ]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"number\",\n \"customFieldPosition\" => 5\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_validity_days'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_validity_days',\n 'type' => 'number',\n 'config' => [\n 'type' => 'number',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Gültigkeitsdauer des Zahlscheins in Tagen\", \"en-GB\" => \"Days of payslip validity.\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"number\",\n \"customFieldPosition\" => 5\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n }", "private function import_metas() {\n\t\tWPSEO_Meta::replace_meta( '_aioseop_description', WPSEO_Meta::$meta_prefix . 'metadesc', $this->replace );\n\t\tWPSEO_Meta::replace_meta( '_aioseop_keywords', WPSEO_Meta::$meta_prefix . 'metakeywords', $this->replace );\n\t\tWPSEO_Meta::replace_meta( '_aioseop_title', WPSEO_Meta::$meta_prefix . 'title', $this->replace );\n\t}", "private function _add_post_meta( $post_id, $data ) {\n\n foreach ($data as $meta_key => $meta_value) {\n update_post_meta( $post_id, $meta_key, $meta_value );\n }\n\n }", "function thememount_custom_post_order($query){\n\t/* \n\tSet post types.\n\t_builtin => true returns WordPress default post types. \n\t_builtin => false returns custom registered post types. \n\t*/\n\t$post_types = get_post_types(array('_builtin' => false), 'names');\n\t\n\t/* The current post type. */\n\t$post_type = $query->get('testimonial');\n\t\n\t/* Check post types. */\n\tif(in_array($post_type, $post_types)){\n\t\t/* Post Column: e.g. title */\n\t\tif($query->get('orderby') == ''){\n\t\t\t$query->set('orderby', 'date');\n\t\t}\n\t\t/* Post Order: ASC / DESC */\n\t\tif($query->get('order') == ''){\n\t\t\t$query->set('order', 'DESC');\n\t\t}\n\t}\n}", "function Trigger_SetOrderColumn(&$tNG) {\r\n $orderFieldObj = new tNG_SetOrderField($tNG);\r\n $orderFieldObj->setFieldName(\"sort\");\r\n return $orderFieldObj->Execute();\r\n}", "function Trigger_SetOrderColumn(&$tNG) {\r\n $orderFieldObj = new tNG_SetOrderField($tNG);\r\n $orderFieldObj->setFieldName(\"sort\");\r\n return $orderFieldObj->Execute();\r\n}", "function Trigger_SetOrderColumn(&$tNG) {\r\n $orderFieldObj = new tNG_SetOrderField($tNG);\r\n $orderFieldObj->setFieldName(\"sort\");\r\n return $orderFieldObj->Execute();\r\n}", "public function testUpdateOrderCustomFields()\n {\n }", "public function applyPromotion()\n {\n $this->promotion->setOrder($this);\n }", "protected function save_order_meta_fields( $order, $request ) {\n\t\tupdate_post_meta( $order->get_id(), '_ebanx_tef_bank', sanitize_text_field( WC_EBANX_Request::read( 'tef' ) ) );\n\n\t\tparent::save_order_meta_fields( $order, $request );\n\t}", "public function redoMetaMigration() {\n\t\taioseo()->transients->update( 'v3_migration_in_progress_posts', time(), WEEK_IN_SECONDS );\n\t\t$this->meta->migrateMeta();\n\t}", "private function import_metas() {\n\t\tWPSEO_Meta::replace_meta( '_aioseop_description', WPSEO_Meta::$meta_prefix . 'metadesc', false );\n\t\tWPSEO_Meta::replace_meta( '_aioseop_keywords', WPSEO_Meta::$meta_prefix . 'metakeywords', false );\n\t\tWPSEO_Meta::replace_meta( '_aioseop_title', WPSEO_Meta::$meta_prefix . 'title', false );\n\t}", "function construction_realestate_pro_bn_meta_callback_properties( $post ) {\n wp_nonce_field( basename( __FILE__ ), 'bn_nonce' );\n $bn_stored_meta = get_post_meta( $post->ID );\n ?>\n\t<div id=\"property_stuff\">\n\t\t<table id=\"list-table\" style=\"background: #fff;padding: 1%;border: 0;\">\t\t\t\n\t\t\t<tbody id=\"the-list\" data-wp-lists=\"list:meta\">\n\t\t\t\t<tr id=\"meta-1\">\n\t\t\t\t\t<td class=\"left\" id=\"meta-pricelabel\">\n\t\t\t\t\t\t<?php esc_html_e( 'Price', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"number\" name=\"meta-price\" id=\"meta-price\" value=\"<?php echo $bn_stored_meta['meta-price'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-2\">\n\t\t\t\t\t<td class=\"left\" id=\"meta-compricelable\">\n\t\t\t\t\t\t<?php esc_html_e( 'Compare Price', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"number\" name=\"meta-comprice\" id=\"meta-comprice\" value=\"<?php echo $bn_stored_meta['meta-comprice'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-3\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Property ID', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-propertyid\" id=\"meta-propertyid\" value=\"<?php echo $bn_stored_meta['meta-propertyid'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-4\">\n\t\t\t\t\t<td class=\"left\" id=\"meta-addresslabel\">\n\t\t\t\t\t\t<?php esc_html_e( 'Property Address', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<textarea class=\"widefat\" id=\"meta-address\" name=\"meta-address\" type=\"text\" value=\"<?php echo $bn_stored_meta['meta-address'][0]; ?>\" ><?php echo $bn_stored_meta['meta-address'][0]; ?></textarea>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-4\">\n\t\t\t\t\t<td class=\"left\" id=\"meta-location\">\n\t\t\t\t\t\t<?php esc_html_e( 'Location', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input class=\"widefat\" id=\"meta-location\" name=\"meta-location\" type=\"text\" value=\"<?php echo $bn_stored_meta['meta-location'][0]; ?>\" >\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-5\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Property Type', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-proptype\" id=\"meta-proptype\" value=\"<?php echo $bn_stored_meta['meta-proptype'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-6\">\n\t\t\t\t\t<?php $meta_element_class = get_post_meta($post->ID, 'meta-status', true); //true ensures you get just one value instead of an array\n \t\t\t\t?> \n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Property Status', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<select name=\"meta-status\" id=\"meta-status\" class=\"selectbox\">\n\t\t\t\t\t <option value=\"\" <?php selected( $meta_element_class, '' ); ?>><?php esc_html_e('','construction-realestate-posttype' ); ?></option>\n\t\t\t\t\t <option value=\"Sale\" <?php selected( $meta_element_class, 'Sale' ); ?>><?php esc_html_e('Sale','construction-realestate-posttype' ); ?></option>\n\t\t\t\t\t <option value=\"Rent\" <?php selected( $meta_element_class, 'Rent' ); ?>><?php esc_html_e('Rent','construction-realestate-posttype' ); ?></option>\n\t\t\t\t\t </select>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-7\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Property Size', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-size\" id=\"meta-size\" value=\"<?php echo $bn_stored_meta['meta-size'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-8\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Bathrooms', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-bathrooms\" id=\"meta-bathrooms\" value=\"<?php echo $bn_stored_meta['meta-bathrooms'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-9\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Bedrooms', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-bedrooms\" id=\"meta-bedrooms\" value=\"<?php echo $bn_stored_meta['meta-bedrooms'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-10\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Garage', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-garage\" id=\"meta-garage\" value=\"<?php echo $bn_stored_meta['meta-garage'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-11\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Year Built', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-yearbuilt\" id=\"meta-yearbuilt\" value=\"<?php echo $bn_stored_meta['meta-yearbuilt'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-12\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Child Rooms', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-childrooms\" id=\"meta-childrooms\" value=\"<?php echo $bn_stored_meta['meta-childrooms'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-13\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Furnished', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-furnished\" id=\"meta-furnished\" value=\"<?php echo $bn_stored_meta['meta-furnished'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-14\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'No of Floors', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-floors\" id=\"meta-floors\" value=\"<?php echo $bn_stored_meta['meta-floors'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-12\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Swimming Pool', 'construction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-swimming\" id=\"meta-swimming\" value=\"<?php echo $bn_stored_meta['meta-swimming'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-6\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Longitude', 'lconstruction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-longitude\" id=\"meta-longitude\" value=\"<?php echo $bn_stored_meta['meta-longitude'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-13\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Latitude', 'lconstruction-realestate-posttype' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-latitude\" id=\"meta-latitude\" value=\"<?php echo $bn_stored_meta['meta-latitude'][0]; ?>\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n <?php\n}", "protected function populateTable() {\n\t\t$query = \"\n\t\tINSERT INTO `items` VALUES (1, 'Candy', 'Crush', '1924 Sucka Drive', 'Stripper');\n\t\tINSERT INTO `items` VALUES (2, 'John', 'Smith', '9999 The Way', 'Unemployeed');\n\t\t\";\n\t\t$this->PDO->query($query);\n\t}", "function set_generated_meta( $insert_id = 0, $meta_type = '' ) {\n\n\t// Handle our before.\n\tdo_action( Core\\HOOK_PREFIX . 'before_sourced_meta_generated', $insert_id, $meta_type );\n\n\t// Handle the meta type switch.\n\tswitch ( $meta_type ) {\n\n\t\t// Handle post meta.\n\t\tcase 'post' :\n\t\tcase 'posts' :\n\t\tcase 'attachment' :\n\t\tcase 'attachments' :\n\t\tcase 'product' :\n\t\tcase 'products' :\n\n\t\t\t// Update the meta with our keys.\n\t\t\tupdate_post_meta( $insert_id, Core\\META_PREFIX . 'sourced', 1 );\n\t\t\tupdate_post_meta( $insert_id, Core\\META_PREFIX . 'created', time() );\n\n \t\t\t// And break.\n \t\t\tbreak;\n\n \t\t// Handle comment and review meta.\n\t\tcase 'comment' :\n\t\tcase 'comments' :\n\t\tcase 'review' :\n\t\tcase 'reviews' :\n\n\t\t\t// Update the meta with our keys.\n\t\t\tupdate_comment_meta( $insert_id, Core\\META_PREFIX . 'sourced', 1 );\n\t\t\tupdate_comment_meta( $insert_id, Core\\META_PREFIX . 'created', time() );\n\n \t\t\t// And break.\n \t\t\tbreak;\n\n \t\t// Handle user and customer meta.\n\t\tcase 'user' :\n\t\tcase 'users' :\n\t\tcase 'customer' :\n\t\tcase 'customers' :\n\n\t\t\t// Update the meta with our keys.\n\t\t\tupdate_user_meta( $insert_id, Core\\META_PREFIX . 'sourced', 1 );\n\t\t\tupdate_user_meta( $insert_id, Core\\META_PREFIX . 'created', time() );\n\n \t\t\t// And break.\n \t\t\tbreak;\n\n\t\t// End all case breaks.\n\t}\n\n\t// No other updates needed, so do the action.\n\tdo_action( Core\\HOOK_PREFIX . 'after_sourced_meta_generated', $insert_id, $meta_type );\n}", "protected function MetaAfterSave() {\n\t\t}", "public static function admin_order_add_custom_meta_data( $data, $wc_order )\n {\n $configs = OmnivaLt_Core::get_configs();\n $order = OmnivaLt_Wc_Order::get_data($wc_order->get_id(), array('omniva'));\n\n foreach ( $configs['method_params'] as $method_key => $method_values ) {\n if ( ! $method_values['is_shipping_method'] ) continue;\n if ( $order->omniva->method != $method_values['key'] ) continue;\n\n if ( $method_values['key'] == 'pt' || $method_values['key'] == 'ps' ) {\n $data['shipping_via'] = 'Omniva ' . strtolower($method_values['title']) . \": \" . OmnivaLt_Terminals::get_terminal_address($order->omniva->terminal_id);\n }\n }\n\n if ($order->omniva->method) {\n $shipping_settings = OmnivaLt_Core::get_settings();\n $omnivalt_labels = new OmnivaLt_Labels();\n\n $barcode = $order->omniva->barcodes[0];\n $country_code = $shipping_settings['shop_countrycode'];\n $data['omnivalt_tracking_link'] = $omnivalt_labels->get_tracking_link($country_code, $barcode, true);\n $data['omnivalt_barcode'] = $barcode;\n }\n\n return $data;\n }", "function construction_realestate_posttype_bn_meta_callback( $post ) {\n wp_nonce_field( basename( __FILE__ ), 'construction_realestate_posttype_bn_nonce' );\n $bn_stored_meta = get_post_meta( $post->ID );\n ?>\n <div id=\"agent_custom_stuff\">\n <table id=\"list-table\"> \n <tbody id=\"the-list\" data-wp-lists=\"list:meta\">\n <tr id=\"meta-1\">\n <td class=\"left\">\n <?php esc_html_e( 'Email', 'construction-realestate-posttype' )?>\n </td>\n <td class=\"left\" >\n <input type=\"text\" name=\"meta-desig\" id=\"meta-desig\" value=\"<?php echo esc_html($bn_stored_meta['meta-desig'][0]); ?>\" />\n </td>\n </tr>\n <tr id=\"meta-2\">\n <td class=\"left\">\n <?php esc_html_e( 'Phone Number', 'construction-realestate-posttype' )?>\n </td>\n <td class=\"left\" >\n <input type=\"text\" name=\"meta-call\" id=\"meta-call\" value=\"<?php echo esc_html($bn_stored_meta['meta-call'][0]); ?>\" />\n </td>\n </tr>\n <tr id=\"meta-3\">\n <td class=\"left\">\n <?php esc_html_e( 'Facebook Url', 'construction-realestate-posttype' )?>\n </td>\n <td class=\"left\" >\n <input type=\"url\" name=\"meta-facebookurl\" id=\"meta-facebookurl\" value=\"<?php echo esc_url($bn_stored_meta['meta-facebookurl'][0]); ?>\" />\n </td>\n </tr>\n <tr id=\"meta-4\">\n <td class=\"left\">\n <?php esc_html_e( 'Linkedin URL', 'construction-realestate-posttype' )?>\n </td>\n <td class=\"left\" >\n <input type=\"url\" name=\"meta-linkdenurl\" id=\"meta-linkdenurl\" value=\"<?php echo esc_url($bn_stored_meta['meta-linkdenurl'][0]); ?>\" />\n </td>\n </tr>\n <tr id=\"meta-5\">\n <td class=\"left\">\n <?php esc_html_e( 'Twitter Url', 'construction-realestate-posttype' )?>\n </td>\n <td class=\"left\" >\n <input type=\"url\" name=\"meta-twitterurl\" id=\"meta-twitterurl\" value=\"<?php echo esc_url( $bn_stored_meta['meta-twitterurl'][0]); ?>\" />\n </td>\n </tr>\n <tr id=\"meta-6\">\n <td class=\"left\">\n <?php esc_html_e( 'GooglePlus URL', 'construction-realestate-posttype' )?>\n </td>\n <td class=\"left\" >\n <input type=\"url\" name=\"meta-googleplusurl\" id=\"meta-googleplusurl\" value=\"<?php echo esc_url($bn_stored_meta['meta-googleplusurl'][0]); ?>\" />\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <?php\n}", "protected function saveMeta($meta){\r\n\t//System::dump($meta);\r\n\t\r\n\tforeach($meta as $item){\r\n\t\t\r\n\t\tif((string)$item->row->attributes()->system_type=='bool'){\r\n\t\t\t$postvalue = !isset($this->sourceData['meta_value_'.(string)$item->row->name]) ? 0: 1;\r\n\t\t}elseif((string)$item->row->attributes()->system_type=='text' || ( (string)$item->row->attributes()->system_type=='blob' && (string)$item->row->attributes()->cleanup==1 ) ){\r\n\t\t\t$postvalue = Filter::makeSafeString($this->sourceData['meta_value_'.(string)$item->row->name]);\r\n\t\t}else{\r\n\t\t\t$postvalue = $this->sourceData['meta_value_'.(string)$item->row->name];\r\n\t\t}\r\n\t\t\r\n\t\t$value = DataValidator::saveData($postvalue, (string)$item->row->attributes()->system_type);\r\n\t\t\r\n\t\t$metaEx = $this->metaRowExists((int)$item->row->name);\r\n\r\n\t\tif($this->id==0 || $metaEx==0){\r\n\t\t\t$id_connect = $this->id==0 ? (int)$this->lastInsert: (int)$this->id;\r\n\t\t\t$q = \"INSERT INTO \"._SQLPREFIX_.$this->metaDataTableName.\" (\".$this->metaConnectId.\", id_meta, \".(string)$item->row->attributes()->system_type.\"_value ) VALUES (\";\r\n\t\t\t$q .= \"'\".Db::escapeField($id_connect).\"', '\".(int)$item->row->name.\"'\".\", '\".Db::escapeField($value).\"')\";\r\n\t\t\r\n\t\t}else{\r\n\t\t\t$id_connect = (int)$this->id;\r\n\t\t\t$q = \"UPDATE \"._SQLPREFIX_.$this->metaDataTableName.\" SET \";\r\n\t\t\t$q .= (string)$item->row->attributes()->system_type.\"_value = '\".Db::escapeField($value).\"' WHERE \".$this->metaConnectId.\" = '\".$id_connect.\"' AND id_meta = '\".(string)$item->row->name.\"'\";\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//echo $q.'<br />'; \r\n\t\tDb::query($q);\r\n\t}\r\n}", "protected function addCustomFieldset()\n {\n $this->meta = array_merge_recursive(\n $this->meta,\n [\n static::NOTE_FIELD_INDEX => $this->getFieldsetConfig(),\n ]\n );\n }", "function lp_create_table(){\r\n\tglobal $wpdb;\r\n\t$charset_collation = $wpdb->get_charset_collate();\r\n\t$table_name = $wpdb->prefix.'like_post';\r\n\r\n\tif( $wpdb->get_var(\"show tables like '$table_name'\") != $table_name){\r\n\t\t$sql = \"CREATE TABLE $table_name (\r\n\t\t\t\t\tID \t\t\t\tINT(9)\t\t\t\t\t\t\t\tNOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tPOST_ID\t\t\tINT(9) \t\t\t\t\t\t\t\tNOT NULL,\r\n\t\t\t\t\tSTATUS \t\t\tINT(1) \t\t\t\t\t\t\t\tNOT NULL,\r\n\t\t\t\t\tLIKE_TIME\t\tDATE\t\t\t\t\t\t\t\tNOT NULL,\r\n\t\t\t\t\tPRIMARY KEY (ID)\r\n\t\t\t\t) $charset_collation;\";\r\n\r\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n\t\tdbDelta($sql);\r\n\t}\r\n\tadd_option('lp_showing_year','');\r\n\r\n}", "public function update_post_view_table_structure() {\n global $wpdb;\n\n $current_version = get_option( 'laterpay_version' );\n if ( version_compare( $current_version, '0.9.11.4', '<' ) ) {\n return;\n }\n\n $table = $wpdb->prefix . 'laterpay_post_views';\n $columns = $wpdb->get_results( 'SHOW COLUMNS FROM ' . $table . ';' );\n\n $is_up_to_date = false;\n\n foreach ( $columns as $column ) {\n if ( $column->Field === 'id' ) {\n $is_up_to_date = true;\n }\n }\n\n if ( ! $is_up_to_date ) {\n $wpdb->query( 'ALTER TABLE ' . $table . ' ADD `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;' );\n $wpdb->query( 'ALTER TABLE ' . $table . ' DROP COLUMN `count`;' );\n }\n }", "protected function save_meta() {}", "function Trigger_SetOrderColumn(&$tNG) {\n $orderFieldObj = new tNG_SetOrderField($tNG);\n $orderFieldObj->setFieldName(\"sapxep\");\n return $orderFieldObj->Execute();\n}", "function Trigger_SetOrderColumn(&$tNG) {\n $orderFieldObj = new tNG_SetOrderField($tNG);\n $orderFieldObj->setFieldName(\"sapxep\");\n return $orderFieldObj->Execute();\n}", "function tptn_install() {\r\n global $wpdb;\r\n global $tptn_db_version;\r\n\r\n $table_name = $wpdb->prefix . \"top_ten\";\r\n $table_name_daily = $wpdb->prefix . \"top_ten_daily\";\r\n \r\n if($wpdb->get_var(\"show tables like '$table_name'\") != $table_name) {\r\n \r\n\t$sql = \"CREATE TABLE \" . $table_name . \" (\r\n\t\taccessedid int NOT NULL AUTO_INCREMENT,\r\n\t\tpostnumber int NOT NULL,\r\n\t\tcntaccess int NOT NULL,\r\n\t\tPRIMARY KEY (accessedid)\r\n\t);\";\r\n\r\n\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\r\n\tdbDelta($sql);\r\n\t\r\n\tadd_option(\"tptn_db_version\", $tptn_db_version);\r\n }\r\n \r\n if($wpdb->get_var(\"show tables like '$table_name_daily'\") != $table_name_daily) {\r\n \r\n\t$sql = \"CREATE TABLE \" . $table_name_daily . \" (\r\n\t\taccessedid int NOT NULL AUTO_INCREMENT,\r\n\t\tpostnumber int NOT NULL,\r\n\t\tcntaccess int NOT NULL,\r\n\t\tdp_date date NOT NULL,\r\n\t\tPRIMARY KEY (accessedid)\r\n\t);\";\r\n\r\n\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\r\n\tdbDelta($sql);\r\n\t\r\n\tadd_option(\"tptn_db_version\", $tptn_db_version);\r\n }\r\n \r\n // Upgrade table code\r\n $installed_ver = get_option( \"tptn_db_version\" );\r\n\r\n if( $installed_ver != $tptn_db_version ) {\r\n\r\n\t$sql = \"CREATE TABLE \" . $table_name . \" (\r\n\t\taccessedid int NOT NULL AUTO_INCREMENT,\r\n\t\tpostnumber int NOT NULL,\r\n\t\tcntaccess int NOT NULL,\r\n\t\tPRIMARY KEY (accessedid)\r\n\t);\";\r\n\r\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\r\n dbDelta($sql);\r\n\t \r\n\t$sql = \"DROP TABLE $table_name_daily\";\r\n\t$wpdb->query($sql);\r\n\t\r\n\t$sql = \"CREATE TABLE \" . $table_name_daily . \" (\r\n\t\taccessedid int NOT NULL AUTO_INCREMENT,\r\n\t\tpostnumber int NOT NULL,\r\n\t\tcntaccess int NOT NULL,\r\n\t\tdp_date date NOT NULL,\r\n\t\tPRIMARY KEY (accessedid)\r\n\t);\";\r\n\r\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\r\n dbDelta($sql);\r\n\r\n update_option( \"tptn_db_version\", $tptn_db_version );\r\n }\r\n\r\n}", "protected function setup_metadata() {\n\t\tif ( $this->get_meta_type() ) {\n\t\t\t$this->fill( $this->get_metadata() );\n\t\t}\n\t}", "function postCreateTable(){\n\t}", "private function populateDummyTable() {}", "function add_custom_meta() {\n global $post;\n }", "function learndash_sync_coupon_associated_metas( int $post_id, string $field, array $ids ): void {\n\tif ( ! in_array( $field, LEARNDASH_COUPON_ASSOCIATED_FIELDS, true ) ) {\n\t\treturn;\n\t}\n\n\t$meta_prefix = \"{$field}_\";\n\n\t/**\n\t * Existing associated IDs.\n\t *\n\t * @var array<string> $existing_ids\n\t */\n\t$existing_ids = (array) learndash_get_setting( $post_id, $field );\n\n\t// Delete associated metas that we no longer need.\n\tif ( ! empty( $existing_ids ) ) {\n\t\tforeach ( array_diff( $existing_ids, $ids ) as $id ) {\n\t\t\tdelete_post_meta( $post_id, \"{$meta_prefix}{$id}\" );\n\t\t}\n\t}\n\n\t// Add associated metas we need.\n\tforeach ( $ids as $id ) {\n\t\tupdate_post_meta( $post_id, \"{$meta_prefix}{$id}\", $id );\n\t}\n}", "function mf_SALF_artist_get_custom_post_list($type){\nglobal $wpdb;\n$meta_array = array();\n$query = \"SELECT post_title, ID FROM $wpdb->posts WHERE post_type='$type' AND post_status ='publish'\";\n\n\n$meta_query= $wpdb->get_results($query);\n\t\n\tforeach ($meta_query as $object){\n\t\t$i = get_object_vars($object);\n\t\t$meta_array[$i['ID']]=$i['post_title'];\n\t\t\n\t}\n\tif (count($meta_array)<1) $meta_array[0]='No '.$type.' Found!';//*/\n\t\n\t\t\n\treturn $meta_array;\n}", "function pre_load_meta($null, $post_id)\n {\n }", "function registry_post_meta_boxes_setup() {\n\n /* Add meta boxes on the 'add_meta_boxes' hook. */\n add_action( 'add_meta_boxes', 'registry_add_post_meta_boxes', 1 );\n\n /* Save post info meta on the 'save_post' hook. */\n add_action( 'save_post', 'registry_save_coz_info_meta', 10, 2 );\n \n /* Save post info meta on the 'save_post' hook. */\n add_action( 'save_post', 'registry_save_coz_num_meta', 10, 2 );\n \n}", "public function insertDefaultMetas() {\n $class = config('blog.post_meta_class');\n $metas = [];\n foreach ((new $class())->defaultMetas($this) as $key => $content) {\n $metas[] = compact('key', 'content');\n }\n\n $this->metas()->createMany($metas);\n return $this;\n }", "protected function MetaAfterLoad() {\n\t\t}", "function _get_meta_table($type)\n {\n }", "public function prepare() {\n $this->customTaxonomies = [];\n\n // Get custom taxonomy with selectors\n $this->prepareCustomTaxonomyWithSelectors();\n\n // Get manually added custom post taxonomy\n $this->prepareManuallyAddedCustomTaxonomy();\n\n // If there is no custom taxonomy, stop.\n if(empty($this->customTaxonomies)) return;\n\n // Store it\n $this->bot->getPostData()->setCustomTaxonomies($this->customTaxonomies);\n }", "function vw_hospital_cs_meta_callback( $post ) {\n wp_nonce_field( basename( __FILE__ ), 'bn_nonce' );\n $bn_stored_meta = get_post_meta( $post->ID );\n $meta_day = get_post_meta( $post->ID, 'meta-Day', true );\n $meta_time = get_post_meta( $post->ID, 'meta-Time', true );\n ?>\n\t<div id=\"postcustom\">\n\t\t<table id=\"list-table\" style=\"background: #fff;padding: 1%;border: 0;\">\t\t\t\n\t\t\t<tbody id=\"the-list\" data-wp-lists=\"list:meta\">\t\t\t\t\n\t\t\t\t<tr id=\"meta-2\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Working Shifts', 'vw-hospital' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-Day\" id=\"meta-Day\" value=\"<?php echo esc_attr( $meta_day ); ?>\" />\n\t\t\t\t\t</td>\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"meta-3\">\n\t\t\t\t\t<td class=\"left\">\n\t\t\t\t\t\t<?php esc_html_e( 'Available From', 'vw-hospital' )?>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"left\" >\n\t\t\t\t\t\t<input type=\"text\" name=\"meta-Time\" id=\"meta-Time\" value=\"<?php echo esc_attr( $meta_time ); ?>\" />\n\t\t\t\t\t</td>\t\t\t\t\t\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n <?php\n}", "function migrate( $args, $assoc_args ) {\n\t\tlist( $meta_key, $taxonomy ) = $args;\n\n\t\tif ( ! ( $taxonomy_object = get_taxonomy( $taxonomy ) ) ) {\n\t\t\tWP_CLI::error( sprintf( \"The taxonomy '%s' doesn't exist\", $taxonomy ) );\n\t\t}\n\n \t\t$defaults = array(\n\t\t\t'post_type' => $taxonomy_object->object_type,\n \t\t\t'posts_per_page' => -1,\n \t\t\t'post_status' => 'any',\n\t\t);\n \t\t$query_args = array_merge( $defaults, $assoc_args );\n\n\t\t$query = new WP_Query( $query_args );\n\n\t\t// summary\n\t\tWP_CLI::log( sprintf(\n\t\t\t\"---\\nPer page: %d \\nPage: %d \\nTotal pages: %d\\n---\",\n\t\t\t$query_args['posts_per_page'],\n\t\t\tisset( $query_args['paged'] ) ? $query_args['paged'] : 1,\n\t\t\t$query->max_num_pages\n\t\t) );\n\n\t\twhile ( $query->have_posts() ) {\n\t\t\t$query->the_post();\n\n\t\t\t$id = get_the_id();\n\n\t\t\t// get meta\n\t\t\t$metas = get_post_meta( $id, $meta_key );\n\t\t\t// create term\n\t\t\tif ( ! $metas ) {\n\t\t\t\tWP_CLI::log( WP_CLI::colorize(\"%c[$id]%n No meta, skipped\" ) );\n\t\t\t} else if ( ! is_wp_error( wp_set_object_terms( $id, $metas, $taxonomy, true ) ) ) {\n\t\t\t\tWP_CLI::log( WP_CLI::colorize(\"%g[$id]%n Migrated: \" . implode( ', ', $metas ) ) );\n\t\t\t\t// clean meta\n\t\t\t\tdelete_post_meta( $id, $meta_key );\n\t\t\t} else {\n\t\t\t\tWP_CLI::log( WP_CLI::colorize(\"%r[$id]%n Error: Could not set terms for post\") );\n\t\t\t}\n\t\t}\n\n\t}", "function carton_add_order_item_meta( $item_id, $meta_key, $meta_value, $unique = false ){\n\treturn add_metadata( 'order_item', $item_id, $meta_key, $meta_value, $unique );\n}", "public function metaImport($data);", "public function _meta(){\n if(!$this->db->table_exists($this->table_name())):\n throw new OrmExceptions(sprintf(\"The table %s does not exist\", $this->table_name()));\n endif;\n\n if(empty($this->_model_meta )){\n $this->_model_meta = $this->db->field_data($this->table_name());\n $this->_fields_loaded = TRUE;\n }\n return $this->_model_meta ;\n }", "public function load_pre_orders_list_table() {\n\t\tif ( isset( $_GET['page'] ) && 'wc_pre_orders' == $_GET['page'] ) {\n\t\t\t$this->get_pre_orders_list_table();\n\t\t}\n\t}", "function custom_plugin_table_create() {\n\n global $wpdb;\n require_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n $sql = \"\n CREATE TABLE `ih_custom_table` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `name` varchar(255) NOT NULL,\n `email` varchar(255) NOT NULL,\n `address` varchar(255) NOT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\n \";\n dbDelta( $sql );\n}", "public function add_fields_to_csv_export_column_data( $order_data, $order, $csv_generator ) {\r\n\r\n\t\t$field_data = array();\r\n\t\t$new_order_data = array();\r\n\t\t$one_row_per_item = $this->is_one_row_per_item( $csv_generator );\r\n\r\n\t\tforeach ( $this->fields as $name => $options ) {\r\n\t\t\t$field_data[ $name ] = get_post_meta( version_compare( WC_VERSION, '3.0', '<' ) ? $order->id : $order->get_id(), $name, true );\r\n\t\t}\r\n\r\n\t\tif ( $one_row_per_item ) {\r\n\r\n\t\t\tforeach ( $order_data as $data ) {\r\n\t\t\t\t$new_order_data[] = array_merge( $field_data, (array) $data );\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\r\n\t\t\t$new_order_data = array_merge( $field_data, $order_data );\r\n\t\t}\r\n\r\n\t\treturn $new_order_data;\r\n\t}", "function DNUI_getRowPostMeta($id) {\r\n global $wpdb;\r\n $sql = 'SELECT * FROM ' . $wpdb->prefix . 'postmeta where post_id=' . $id . ';';\r\n return $wpdb->get_results($sql, \"ARRAY_A\");\r\n}", "protected function runExtTablesPostProcessingHooks() {}", "private function createOrderTable()\n {\n $this->db->query(\n \"CREATE TABLE IF NOT EXISTS `\". DB_PREFIX .\"mundipagg_order` (\n `opencart_id` INT(11) NOT NULL,\n `mundipagg_id` VARCHAR(30) NOT NULL,\n UNIQUE INDEX `opencart_id` (`opencart_id`),\n UNIQUE INDEX `mundipagg_id` (`mundipagg_id`)\n );\"\n );\n }", "public static function pre_get_posts(&$query)\n {\n if (isset($query->query_vars['orderby']))\n {\n if (in_array($query->query_vars['orderby'], array('meta_value', 'meta_value_num')) && !is_null($query->query_vars['order']))\n {\n self::$meta_order = $query->query_vars['order'];\n }\n\n if (!is_null($query->query_vars['meta_key']))\n {\n self::$meta_key = $query->query_vars['meta_key'];\n }\n }\n }", "protected function prepare_row_data( $post_id ) {\n\t\tglobal $the_product;\n\n\t\tif ( empty( $this->object ) || $this->object->get_id() !== $post_id ) {\n\t\t\t$the_product = wc_get_product( $post_id );\n\t\t\t$this->object = $the_product;\n\t\t}\n\t}", "function wck_reorder_meta(){\r\n\t\tif( !empty( $_POST['meta'] ) )\r\n\t\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\telse \r\n\t\t\t$meta = '';\r\n\t\tif( !empty( $_POST['id'] ) )\r\n\t\t\t$id = absint($_POST['id']);\r\n\t\telse \r\n\t\t\t$id = '';\r\n\t\tif( !empty( $_POST['values'] ) && is_array( $_POST['values'] ) )\r\n\t\t\t$elements_id = array_map( 'absint', $_POST['values'] );\r\n\t\telse \r\n\t\t\t$elements_id = array();\r\n\r\n\t\t// Security checks\r\n\t\tif( true !== ( $error = self::wck_verify_user_capabilities( $this->args['context'], $meta, $id ) ) ) {\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $error ) );\r\n\t\t}\r\n\r\n\t\t/* make sure this does not output anything so it won't break the json response below\r\n\t\twill keep it do_action for compatibility reasons\r\n\t\t */\r\n\t\tob_start();\r\n\t\t\tdo_action( 'wck_before_reorder_meta', $meta, $id, $elements_id );\r\n\t\t$wck_before_reorder_meta = ob_get_clean(); //don't output it\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\t$results = get_post_meta($id, $meta, true);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\t$results = get_option( apply_filters( 'wck_option_meta' , $meta ) );\r\n\t\t\r\n\t\t$new_results = array();\r\n\t\tif( !empty( $elements_id ) ){\r\n\t\t\tforeach($elements_id as $element_id){\r\n\t\t\t\t$new_results[] = $results[$element_id];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$results = $new_results;\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\tupdate_post_meta($id, $meta, $results);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\tupdate_option( apply_filters( 'wck_option_meta' , $meta, $results, $element_id ), wp_unslash( $results ) );\r\n\t\t\r\n\t\t\r\n\t\t/* if unserialize_fields is true reorder all the coresponding post metas */\r\n\t\tif( $this->args['unserialize_fields'] && $this->args['context'] == 'post_meta' ){\t\t\t\r\n\t\t\t\r\n\t\t\t$meta_suffix = 1;\r\n\t\t\tif( !empty( $new_results ) ){\r\n\t\t\t\tforeach( $new_results as $result ){\t\t\t\t\r\n\t\t\t\t\tforeach ( $result as $name => $value){\t\t\t\t\t\r\n\t\t\t\t\t\tupdate_post_meta($id, $meta.'_'.$name.'_'.$meta_suffix, $value);\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$meta_suffix++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t$entry_list = $this->wck_refresh_list( $meta, $id );\r\n\t\theader( 'Content-type: application/json' );\r\n\t\tdie( json_encode( array( 'entry_list' => $entry_list ) ) );\r\n\t}", "function wp_plugin_business_init() \n{\n global $wpdb; // Este objeto global permite acceder a la base de datos de WP\n // Crea la tabla sólo si no existe\n // Utiliza el mismo prefijo del resto de tablas\n $tabla_aspirantes = $wpdb->prefix . 'business';\n // Utiliza el mismo tipo de orden de la base de datos\n $charset_collate = $wpdb->get_charset_collate();\n // Prepara la consulta\n $query = \"CREATE TABLE IF NOT EXISTS $tabla_aspirantes (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n titulo varchar(200) NOT NULL,\n nombre varchar(300) NOT NULL,\n cliente varchar(400) NOT NULL,\n dirurl varchar(400) NOT NULL,\n fecha datetime NOT NULL,\n imagen varchar(600) NOT NULL,\n \n UNIQUE (id)\n ) $charset_collate;\";\n // La función dbDelta permite crear tablas de manera segura se\n // define en el archivo upgrade.php que se incluye a continuación\n include_once ABSPATH . 'wp-admin/includes/upgrade.php';\n dbDelta($query); // Lanza la consulta para crear la tabla de manera segura\n}", "function add_meta_objs($meta_objs) {\n array_merge($this->meta_objs, $meta_objs);\n }", "function create_table(){\n global $wpdb;\n\n require_once(ABSPATH . \"wp-admin\" . '/includes/upgrade.php');\n\n $table_name = $wpdb->base_prefix . $this->table;\n\n $sql = \"CREATE TABLE IF NOT EXISTS $table_name (\n id bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n post_id bigint(20) unsigned,\n blog_id mediumint(9) NOT NULL,\n post_author bigint(20) unsigned,\n post_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_date_gmt datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_content longtext,\n post_title text,\n post_excerpt text,\n post_status varchar(20) DEFAULT 'post_status',\n post_type varchar(20) DEFAULT 'post',\n post_modified_gmt datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_modified datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n guid varchar(255),\n UNIQUE KEY id (id)\n );\";\n\n dbDelta( $sql );\n }", "function update_booking_meta( $meta ) {\n foreach ( $meta as $key => $value ) {\n if ( $key !== 'services' ) {\n update_post_meta( $this->id, '_' . $key, $value );\n } else {\n wp_set_post_terms( $this->id, $value, YITH_WCBK_Post_Types::$service_tax );\n }\n }\n }", "public function postLoad(LifecycleEventArgs $eventArgs)\n {\n $this->migrateMeta($eventArgs);\n }", "function alter_tables_if_required() {\r\n global $wpdb;\r\n $options = get_option('nus_altered_table');\r\n $altercolumns = false;\r\n if(!$options) {\r\n $altercolumns = true;\r\n }\r\n\r\n if($altercolumns) {\r\n $wpdb->query(\"ALTER TABLE \" . NUS_TEMP_TABLE .\" MODIFY nus_feed_id varchar(255) NOT NULL\");\r\n $wpdb->query(\"ALTER TABLE \" . NUS_TRACKER_TABLE .\" MODIFY nus_feed_id varchar(255) NOT NULL\");\r\n add_option('nus_altered_table', 'altered');\r\n }\r\n\r\n\r\n}", "function MetaColumns($table,$normalize=true)\n\t{\n\t\tglobal $ADODB_FETCH_MODE;\n\n\t\t$schema = false;\n\t\t$false = false;\n\t\t$this->_findschema($table,$schema);\n\n\t\tif ($normalize) $table = strtolower($table);\n\n\t\t$save = $ADODB_FETCH_MODE;\n\t\t$ADODB_FETCH_MODE = ADODB_FETCH_NUM;\n\t\tif ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);\n\n\t\t$rs = $this->Execute($this->_generateMetaColumnsSQL($table, $schema));\n\t\tif (isset($savem)) $this->SetFetchMode($savem);\n\t\t$ADODB_FETCH_MODE = $save;\n\n\t\tif ($rs === false) {\n\t\t\treturn $false;\n\t\t}\n\t\tif (!empty($this->metaKeySQL)) {\n\t\t\t// If we want the primary keys, we have to issue a separate query\n\t\t\t// Of course, a modified version of the metaColumnsSQL query using a\n\t\t\t// LEFT JOIN would have been much more elegant, but postgres does\n\t\t\t// not support OUTER JOINS. So here is the clumsy way.\n\n\t\t\t$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;\n\n\t\t\t$rskey = $this->Execute(sprintf($this->metaKeySQL,($table)));\n\t\t\t// fetch all result in once for performance.\n\t\t\t$keys = $rskey->GetArray();\n\t\t\tif (isset($savem)) $this->SetFetchMode($savem);\n\t\t\t$ADODB_FETCH_MODE = $save;\n\n\t\t\t$rskey->Close();\n\t\t\tunset($rskey);\n\t\t}\n\n\t\t$rsdefa = array();\n\t\tif (!empty($this->metaDefaultsSQL)) {\n\t\t\t$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;\n\t\t\t$sql = sprintf($this->metaDefaultsSQL, ($table));\n\t\t\t$rsdef = $this->Execute($sql);\n\t\t\tif (isset($savem)) $this->SetFetchMode($savem);\n\t\t\t$ADODB_FETCH_MODE = $save;\n\n\t\t\tif ($rsdef) {\n\t\t\t\twhile (!$rsdef->EOF) {\n\t\t\t\t\t$num = $rsdef->fields['num'];\n\t\t\t\t\t$s = $rsdef->fields['def'];\n\t\t\t\t\tif (strpos($s,'::')===false && substr($s, 0, 1) == \"'\") { /* quoted strings hack... for now... fixme */\n\t\t\t\t\t\t$s = substr($s, 1);\n\t\t\t\t\t\t$s = substr($s, 0, strlen($s) - 1);\n\t\t\t\t\t}\n\n\t\t\t\t\t$rsdefa[$num] = $s;\n\t\t\t\t\t$rsdef->MoveNext();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tADOConnection::outp( \"==> SQL => \" . $sql);\n\t\t\t}\n\t\t\tunset($rsdef);\n\t\t}\n\n\t\t$retarr = array();\n\t\twhile (!$rs->EOF) {\n\t\t\t$fld = new ADOFieldObject();\n\t\t\t$fld->name = $rs->fields[0];\n\t\t\t$fld->type = $rs->fields[1];\n\t\t\t$fld->max_length = $rs->fields[2];\n\t\t\t$fld->attnum = $rs->fields[6];\n\n\t\t\tif ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4;\n\t\t\tif ($fld->max_length <= 0) $fld->max_length = -1;\n\t\t\tif ($fld->type == 'numeric') {\n\t\t\t\t$fld->scale = $fld->max_length & 0xFFFF;\n\t\t\t\t$fld->max_length >>= 16;\n\t\t\t}\n\t\t\t// dannym\n\t\t\t// 5 hasdefault; 6 num-of-column\n\t\t\t$fld->has_default = ($rs->fields[5] == 't');\n\t\t\tif ($fld->has_default) {\n\t\t\t\t$fld->default_value = $rsdefa[$rs->fields[6]];\n\t\t\t}\n\n\t\t\t//Freek\n\t\t\t$fld->not_null = $rs->fields[4] == 't';\n\n\n\t\t\t// Freek\n\t\t\tif (is_array($keys)) {\n\t\t\t\tforeach($keys as $key) {\n\t\t\t\t\tif ($fld->name == $key['column_name'] AND $key['primary_key'] == 't')\n\t\t\t\t\t\t$fld->primary_key = true;\n\t\t\t\t\tif ($fld->name == $key['column_name'] AND $key['unique_key'] == 't')\n\t\t\t\t\t\t$fld->unique = true; // What name is more compatible?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;\n\t\t\telse $retarr[($normalize) ? strtoupper($fld->name) : $fld->name] = $fld;\n\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\t$rs->Close();\n\t\tif (empty($retarr))\n\t\t\treturn $false;\n\t\telse\n\t\t\treturn $retarr;\n\n\t}", "function Trigger_SetOrderColumn(&$tNG) {\n $orderFieldObj = new tNG_SetOrderField($tNG);\n $orderFieldObj->setFieldName(\"menubar2orderlist\");\n return $orderFieldObj->Execute();\n}", "function add_post_meta($post_id) {\n\t\t\tglobal $wpdb;\n\t\t\tif(isset($_POST['original_publish'])||isset($_POST['save'])){\n\t\t\t\tforeach($this->english_meta_keys as $key){\n\t\t\t\t\tupdate_post_meta($post_id, $key, $_POST[$key]);\n\t\t\t\t}\n\t\t\t\tforeach($this->arabic_meta_keys as $key2){\n\t\t\t\t\tupdate_post_meta($post_id, $key2, $_POST[$key2]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach($_POST as $key => $value){\n\t\t\t\t\tif(preg_match('/_IPCDate.*/', $key) && $key != '_IPCDateCount'){\n\t\t\t\t\t\t$n = substr($key, strpos($key, \"Date\")+4);\n\t\t\t\t\t\n\t\t\t\t\t\tforeach($this->dates_meta_keys as $key3){\n\t\t\t\t\t\t\t$k = $key3.$n;\n\t\t\t\t\t\t\tupdate_post_meta($post_id, $k, $_POST[$k]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tupdate_post_meta($post_id, '_IPCDateCount', $_POST['_IPCDateCount']);\n\t\t\t}\n\t\t}", "public function set_checkout_order_meta( $order_id ) {\n\n\t\t$order = wc_get_order( $order_id );\n\n\t\tif ( $order && isset( WC()->cart->taxes['avatax'] ) ) {\n\n\t\t\tupdate_post_meta( $order_id, '_wc_avatax_tax_calculated', 'yes' );\n\n\t\t\tif ( $date_created = SV_WC_Order_Compatibility::get_date_created( $order ) ) {\n\t\t\t\tupdate_post_meta( $order_id, '_wc_avatax_tax_date', $date_created->date( 'Y-m-d' ) );\n\t\t\t}\n\t\t}\n\t}", "function prepare_items() {\n global $wpdb; //This is used only if making any database queries\n\n /**\n * First, lets decide how many records per page to show\n */\n $per_page = 5;\n \n \n /**\n * REQUIRED. Now we need to define our column headers. This includes a complete\n * array of columns to be displayed (slugs & titles), a list of columns\n * to keep hidden, and a list of columns that are sortable. Each of these\n * can be defined in another method (as we've done here) before being\n * used to build the value for our _column_headers property.\n */\n $columns = $this->get_columns();\n $hidden = array();\n $sortable = $this->get_sortable_columns();\n \n \n /**\n * REQUIRED. Finally, we build an array to be used by the class for column \n * headers. The $this->_column_headers property takes an array which contains\n * 3 other arrays. One for all columns, one for hidden columns, and one\n * for sortable columns.\n */\n $this->_column_headers = array($columns, $hidden, $sortable);\n \n \n /**\n * Optional. You can handle your bulk actions however you see fit. In this\n * case, we'll handle them within our package just to keep things clean.\n */\n $this->process_bulk_action();\n \n \n /**\n * Instead of querying a database, we're going to fetch the example data\n * property we created for use in this plugin. This makes this example \n * package slightly different than one you might build on your own. In \n * this example, we'll be using array manipulation to sort and paginate \n * our data. In a real-world implementation, you will probably want to \n * use sort and pagination data to build a custom query instead, as you'll\n * be able to use your precisely-queried data immediately.\n */\n //$data = $this->example_data;\n $table_name = $wpdb->prefix . 'BABP';\n\t\t$data = $wpdb->get_results( 'SELECT * FROM '.$table_name, ARRAY_A);\n\t\t//var_dump($data); \n\t\t//var_dump($this->example_data);\n \n /**\n * This checks for sorting input and sorts the data in our array accordingly.\n * \n * In a real-world situation involving a database, you would probably want \n * to handle sorting by passing the 'orderby' and 'order' values directly \n * to a custom query. The returned data will be pre-sorted, and this array\n * sorting technique would be unnecessary.\n */\n function usort_reorder($a,$b){\n $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'title'; //If no sort, default to title\n $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; //If no order, default to asc\n $result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order\n return ($order==='asc') ? $result : -$result; //Send final sort direction to usort\n }\n usort($data, 'usort_reorder');\n \n \n /***********************************************************************\n * ---------------------------------------------------------------------\n * vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n * \n * In a real-world situation, this is where you would place your query.\n *\n * For information on making queries in WordPress, see this Codex entry:\n * http://codex.wordpress.org/Class_Reference/wpdb\n * \n * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n * ---------------------------------------------------------------------\n **********************************************************************/\n \n \n /**\n * REQUIRED for pagination. Let's figure out what page the user is currently \n * looking at. We'll need this later, so you should always include it in \n * your own package classes.\n */\n $current_page = $this->get_pagenum();\n \n /**\n * REQUIRED for pagination. Let's check how many items are in our data array. \n * In real-world use, this would be the total number of items in your database, \n * without filtering. We'll need this later, so you should always include it \n * in your own package classes.\n */\n $total_items = count($data);\n \n \n /**\n * The WP_List_Table class does not handle pagination for us, so we need\n * to ensure that the data is trimmed to only the current page. We can use\n * array_slice() to \n */\n $data = array_slice($data,(($current_page-1)*$per_page),$per_page);\n \n \n \n /**\n * REQUIRED. Now we can add our *sorted* data to the items property, where \n * it can be used by the rest of the class.\n */\n $this->items = $data;\n \n \n /**\n * REQUIRED. We also have to register our pagination options & calculations.\n */\n $this->set_pagination_args( array(\n 'total_items' => $total_items, //WE have to calculate the total number of items\n 'per_page' => $per_page, //WE have to determine how many items to show on a page\n 'total_pages' => ceil($total_items/$per_page) //WE have to calculate the total number of pages\n ) );\n }", "protected function MetaAfterDelete() {\n\t\t}", "function es_managing_custom_product_columns( $columns, $post_type ) {\n if ( $post_type == 'product' )\n $columns[ 'member_price' ] = 'Member Price';\n return $columns;\n}" ]
[ "0.63789815", "0.6131994", "0.5977993", "0.5956847", "0.5905463", "0.5741529", "0.5707109", "0.55659497", "0.55400807", "0.55282634", "0.55242443", "0.55106556", "0.5493574", "0.54497427", "0.5447556", "0.5441842", "0.5371397", "0.53396004", "0.5289406", "0.5258317", "0.52580917", "0.52570784", "0.5245109", "0.5237027", "0.5226656", "0.52012", "0.5184652", "0.51663923", "0.51642436", "0.5159886", "0.51402736", "0.51387906", "0.5129033", "0.5112746", "0.5102159", "0.5092067", "0.5064097", "0.5063951", "0.5063785", "0.50543797", "0.50543797", "0.50543797", "0.50462395", "0.50418437", "0.50308025", "0.5029075", "0.5019771", "0.5001832", "0.5001182", "0.50006455", "0.500003", "0.49963123", "0.49941087", "0.49807683", "0.49785748", "0.49731603", "0.49677846", "0.49668896", "0.49653298", "0.49653298", "0.4963805", "0.49480644", "0.4940066", "0.4938528", "0.4934469", "0.49329898", "0.4925511", "0.49243137", "0.49217352", "0.4921495", "0.4920837", "0.49148893", "0.4889576", "0.48828322", "0.48814815", "0.4881066", "0.4867254", "0.48521346", "0.48493147", "0.48452708", "0.4844895", "0.4842316", "0.48401096", "0.4839276", "0.48354352", "0.48336124", "0.48314255", "0.48181295", "0.4817496", "0.48174602", "0.48060322", "0.48054668", "0.48044893", "0.48016918", "0.47993648", "0.4796846", "0.47920713", "0.479042", "0.47887176", "0.4784268" ]
0.7320626
0
Query for Orders matching specific criteria.
public function query( $query_vars ) { $args = $this->get_wp_query_args( $query_vars ); if ( ! empty( $args['errors'] ) ) { $query = (object) array( 'posts' => array(), 'found_posts' => 0, 'max_num_pages' => 0, ); } else { $query = new WP_Query( $args ); } $orders = ( isset( $query_vars['return'] ) && 'ids' === $query_vars['return'] ) ? $query->posts : array_filter( array_map( 'wc_get_order', $query->posts ) ); if ( isset( $query_vars['paginate'] ) && $query_vars['paginate'] ) { return (object) array( 'orders' => $orders, 'total' => $query->found_posts, 'max_num_pages' => $query->max_num_pages, ); } return $orders; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchOrders() {\n //\terror_log ( 'addOrder\\n', 3, '/var/tmp/php.log' );\n $request = Slim::getInstance ()->request ();\n\t$criteria = json_decode ( $request->getBody () );\n try {\n $db = new DbOperation();\n $orders = $db->searchOrders ( $criteria );\n if ( $orders != null ) {\n echo '{\"orders\":' . json_encode ( $orders ) . '}';\n } else {\n echo '{\"error\":{\"text\":' . \"Unable to search order\" . '}}';\n }\n } catch ( Exception $e ) {\n\t\techo '{\"errorText\":\"search orders fail with text as\", \"text\":}' . $e->getMessage () . $e . '}';\n }\n}", "private function searchOrders(): Builder\n {\n $search = request('search');\n $searchTerm = \"%{$search}%\";\n\n return Order::where(function ($query) use ($searchTerm) {\n $query->where('customer', 'like', $searchTerm)\n ->orWhere('id', 'like', $searchTerm)\n ->orWhere('number', 'like', $searchTerm)\n ->orWhere('status', 'like', $searchTerm)\n ->orWhere('total_amount', 'like', $searchTerm)\n ->orWhere('created_at', 'like', $searchTerm);\n });\n }", "public function orderQueryAction()\n {\n // https://api.weixin.qq.com/pay/orderquery?access_token=xxxxxx\n $orderId = $this->params()->fromRoute('id', '0');\n\n $order = $this->getOrderTable()->getOrder($orderId);\n if ($orderId == '0' || !$order) {\n return $this->errorViewModel(array('code' => 1, 'msg' => 'order '.$orderId.' not exist.'));\n }\n\n $postResult = $this->orderQuery($orderId);\n // echo $postResult;\n echo '<br>errcode:';\n echo $postResult->errcode;\n echo '<br>errmsg:';\n echo $postResult->errmsg;\n if ($postResult->errcode == 0) {\n echo '<br>orderinfo:';\n var_dump($postResult->order_info);\n }\n\n return $this->viewModel();\n }", "public function getOrders($searchTerm = \"\", $startDate = null, $endDate = null, $accountId = Account::LOGGED_IN_ACCOUNT) {\n $query = \"WHERE account_id = ?\";\n\n if ($searchTerm) {\n $query .= \" AND (buyer_name LIKE '%$searchTerm%' OR address LIKE '%$searchTerm%' OR status LIKE '%$searchTerm%' OR total LIKE '%$searchTerm%')\";\n }\n\n if ($startDate) {\n $query .= \" AND date >= '$startDate'\";\n }\n\n if ($endDate) {\n $query .= \" AND date <= '$endDate'\";\n }\n\n return Order::filter($query, $accountId);\n }", "public function query() {\n\t\tif (get_current_login_user() == 'admin') {\n\t\t\treturn Order::get();\n\t\t} else if (get_current_login_user() == 'store') {\n\t\t\t$store_id = auth()->guard('store')->user()->id;\n\t\t\treturn Order::where('store_id', $store_id)->get();\n\t\t}\n\t}", "function getAllOrders()\n {\n $dataService = new OrderDataService();\n\n return $dataService->getAllOrders();\n }", "public function index(Orders $orders , Request $request)\n {\n $orders = $orders->with('customs');\n $request->user()->customer_id && $orders = $orders->where('cid',$request->user()->customer_id);\n if($request->money){\n $arr = explode('-',$request->money);\n if(count($arr) == 1){\n $orders = $orders->where('money','>',$arr[0]);\n }else if(count($arr) == 2){\n $orders = $orders->whereBetween('money',explode('-',$request->money));\n }\n }\n $request->status && $orders = $orders->where('order_status',$request->status);\n $request->name && $orders = $orders->whereHas('customs',function($query) use ($request){\n $query->where('company_name','like',\"%{$request->name}%\")->orWhere('company_addr','like','%'.$request->name.'%');\n });\n $request->time && $orders = $orders->whereDate('created_at',$request->time);\n return new OrdersResources($orders->orderBy('id','desc')->paginate($request->pageSize ?? $request->pageSize));\n }", "public function findAllOrders()\n {\n return $this->createQueryBuilder('o')\n ->orderBy('o.createdDate' , 'DESC');\n }", "public function getAllOrders($symbol = NULL, $orderId = NULL, $limit = NULL, $recvWindow = NULL);", "private function GetOrders()\n\t{\t$orders = array();\n\t\t$where = array();\n\t\t\n\t\tif ($this->startdate)\n\t\t{\t$where[] = 'orderdate>=\"' . $this->startdate . ' 00:00:00\"';\n\t\t}\n\t\tif ($this->enddate)\n\t\t{\t$where[] = 'orderdate<=\"' . $this->enddate . ' 23:59:59\"';\n\t\t}\n\t\tif (!$this->showunpaid)\n\t\t{\t$where[] = 'NOT paiddate=\"0000-00-00 00:00:00\"';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT * FROM storeorders';\n\t\tif ($wstr = implode(' AND ', $where))\n\t\t{\t$sql .= ' WHERE ' . $wstr;\n\t\t}\n\t\t$sql .= ' ORDER BY orderdate DESC';\n\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$orders[$row['id']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $orders;\n\t}", "public function getOrdersForCustomer($customerId);", "public function AllOrders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllOrders($per_page, $offset);\n return $this->response($result);\n }", "public function queryOrdernumber($ordn) {\n\t\t$q = $this->query();\n\t\t$q->filterByOrdernumber($ordn);\n\t\treturn $q;\n\t}", "public function allOrders()\n\t{\n\t\trequire 'Database.php';\n\n\t\t$req = $db->prepare(\"SELECT lol_server,lol_summoner,lol_account,lol_password,order_id, order_queue, order_boost, order_type, order_wins, start_league, start_division, desired_league, desired_division, order_date, DATE_FORMAT(order_date, '%d/%m/%Y') AS date, order_price, order_status, order_pause FROM orders WHERE user_id = ? ORDER BY order_status\");\n\t\t$req->execute(array($_SESSION['id']));\n\n\t\treturn $req->fetchAll();\n\t}", "private function fetchOrders(): Builder\n {\n $sortOrder = request('order') ?? 'desc';\n $sortBy = request('sort') ?? 'created_at';\n\n if (! request()->filled('search')) {\n return Order::orderBy($sortBy, $sortOrder);\n }\n\n return $this->searchOrders();\n }", "public function AllOpen_Orders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllOpen_Orders();\n return $this->response($result);\n }", "public function the_endpoint_should_return_all_orders()\n {\n $card = CreditCard::factory()->create();\n $orders = Order::factory()->create();\n \n $response = $this->get('/api/orders');\n\n dd($response->json());\n $response->assertStatus(200);\n $response->assertJsonStructure([\n 'orders' => [\n '*' => [\n 'id',\n 'credit_card_id',\n 'user_id',\n \n ]\n ]\n ]);\n $this->assertDatabaseCount('orders', 1);\n }", "function getAllOrders(){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT *\n\t\t\t\t\t\t\t\t\t\tFROM `order`');\n\t\t$sth \t-> execute();\n\t\treturn \t$sth;\n\t}", "function getOrders() {\n\t\t$orders = Mage::getModel ( 'sales/order' )->getCollection ()->addAttributeToSelect ( \"*\" )->addAttributeToFilter ( 'status', array ('complete') );\n\t\t$orders_data = $this->preapreOrdersTosend ( $orders );\n\t\treturn $orders_data;\n\t}", "private function getAllOrders() {\n // if database connection opened\n if ($this->databaseConnection()) {\n\n // load pages for the user\n $sql = $this->db_connection->prepare(\"SELECT * FROM `orders`\");\n $sql->execute();\n\n // fetch all from the widget\n $sql = $sql->fetchAll();\n\n // $this->debug($sql);\n\n if ( isset($sql) ) {\n return $sql;\n } else {\n return false;\n }\n\n } else {\n\n return false;\n\n }\n }", "public static function getOrders()\n\t{\n $orders = DB::query(\"SELECT orderproducts.*, products.strName, products.strDescription, products.strFeatures, products.price, products.category_id, products.status_id, orders.totalAmount, orders.date, inventoryproducts.name AS inventoryproductsname\n FROM orderproducts\n LEFT JOIN orders ON orderproducts.orderId=orders.id\n LEFT JOIN products ON orderproducts.productId=products.id\n LEFT JOIN inventoryproducts ON products.inventoryproductsId=inventoryproducts.id\");\n\n // acting as a factory\n // empty array to avoid errors when nothing was found\n\t\t$ordersArray = array();\n\t\tforeach($orders as $order)\n\t\t{\n\t\t\t// create an instance / object for this SPECIFIC \n\t\t\t$ordersArray[] = new OrdersAdmin($order); // put this object onto the array\n }\n\t\t// return the list of objects\n\t\t//return $ordersArray;\n }", "public function queryOrders($query, $archived) {\n if( !$this->User->accessibleUserInList ) {\n $this->User->getAccessibleUserInList;\n }\n if($archived){\n $statusComparator = '=';\n } else {\n $statusComparator = '!=';\n }\n\n $baseOrderInList = $this->find('list', array(\n 'conditions' => array(\n 'Order.status '.$statusComparator => 'Archived',\n 'OR' => array(\n 'Order.user_id' => $this->User->accessibleUserInList,\n 'Order.user_customer_id' => $this->User->accessibleUserInList\n )\n )));\n\n //get Orders belonging to Users that were found by $query (if any)\n if(!empty($this->User->userQueryOrderInList)){\n $this->userQueryOrders($this->User->userQueryOrderInList);\n }\n\n //perform find\n $this->queryResult = $this->find('all', array(\n 'conditions' => array(\n 'Order.id' => $baseOrderInList,\n 'OR' => array(\n 'Order.order_number LIKE' => \"%{$query}%\",\n 'Order.billing_company LIKE' => \"%{$query}%\",\n 'Order.order_reference LIKE' => \"%{$query}%\"\n )\n ),\n 'contain' => array(\n 'User',\n 'UserCustomer' => array(\n 'Customer' => array(\n 'fields' => array('id', 'allow_backorder')\n )\n ),\n 'Budget',\n 'OrderItem' => array(\n 'Item',\n 'Catalog' => array(\n 'ParentCatalog' => array(\n 'Item'\n )\n )\n ),\n 'Shipment',\n )\n ));\n //Merge userQueryOrders and directly found Orders\n $this->queryResult = array_merge($this->userQueryResult, $this->queryResult);\n\n //Setup array to use standard status page grain\n $this->sortQueryOrders();\n\n //return final sorted orders\n return $this->statusOutputOrder;\n }", "private function getOrders()\n {\n $OD = $this->dbclient->coins->OwnOrderBook;\n\n $ownOrders = $OD->find(\n array('$or'=>\n array(array('Status'=>'buying'), array('Status'=>'selling'))\n ));\n\n $output = ' {\n \"success\" : true,\n \"message\" : \"\",\n \"result\" : [';\n foreach ($ownOrders as $ownOrder) {\n\n if ($ownOrder) {\n if ($ownOrder->Status == 'buying' or $ownOrder->Status == 'selling') {\n $uri = $this->baseUrl . 'public/getorderbook';\n $params['market'] = $ownOrder->MarketName;\n if ($ownOrder->Status == 'buying') {\n $params['type'] = 'sell';\n $params['uuid'] = $ownOrder->BuyOrder->uuid;\n $limit = 'buy';\n } elseif ($ownOrder->Status == 'selling') {\n $params['type'] = 'buy';\n $params['uuid'] = $ownOrder->SellOrder->uuid;\n $limit = 'sell';\n }\n\n if (!empty($params)) {\n $uri .= '?' . http_build_query($params);\n }\n\n $sign = hash_hmac('sha512', $uri, $this->apiSecret);\n $ch = curl_init($uri);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign: ' . $sign));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n $answer = json_decode($result);\n $success = false;\n $quantity = 0;\n $rate = 0;\n\n if ($answer->success == true) {\n $closest_rate = $answer->result[0]->Rate;\n\n if ($ownOrder->Status == 'buying' && $ownOrder->BuyOrder->Rate >= $closest_rate) {\n $success = true;\n $quantity = $answer->result[0]->Quantity;\n $rate = $answer->result[0]->Rate;\n }\n\n if ($ownOrder->Status == 'selling' && $ownOrder->SellOrder->Rate <= $closest_rate) {\n $success = true;\n $quantity = $answer->result[0]->Quantity;\n $rate = $answer->result[0]->Rate;\n }\n\n if (!$success) {\n $output = $output.'{\n \"AccountId\" : null,\n \"OrderUuid\" : \"' . $params['uuid'] . '\",\n \"Exchange\" : \"' . $params['market'] . '\",\n \"Type\" : \"LIMIT_' . strtoupper($limit) . '\",\n \"Quantity\" : ' . $quantity . ',\n \"QuantityRemaining\" : 0.00000000,\n \"Limit\" : 0.00000001,\n \"Reserved\" : 0.00001000,\n \"ReserveRemaining\" : 0.00001000,\n \"CommissionReserved\" : 0.00000002,\n \"CommissionReserveRemaining\" : 0.00000002,\n \"CommissionPaid\" : 0.00000000,\n \"Price\" : ' . $rate . ',\n \"PricePerUnit\" : ' . $closest_rate . ',\n \"Opened\" : \"2014-07-13T07:45:46.27\",\n \"Closed\" : null,\n \"IsOpen\" : true,\n \"Sentinel\" : \"6c454604-22e2-4fb4-892e-179eede20972\",\n \"CancelInitiated\" : false,\n \"ImmediateOrCancel\" : false,\n \"IsConditional\" : false,\n \"Condition\" : \"NONE\",\n \"ConditionTarget\" : null\n },';\n\n }\n }\n }\n }\n }\n $output = rtrim($output, ',').']\n}';\n return $output;\n }", "public function getOrders($filter = array()) {\n return $this->getTable()->getOrders();\n }", "function order_list($where, $query)\n {\n }", "public function AllClosed_Orders_get() {\n extract($_GET);\n $result = $this->feeds_model->AllClosed_Orders();\n return $this->response($result);\n }", "public function pullAllOrders()\n {\n $availableStatuses = ['confirmed', 'retrieved', 'pending'];\n foreach ($availableStatuses as $status) {\n /** @var ExpediaConfig $config */\n foreach ($this->getConfig() as $config) {\n\n $requestData = $this->requestDataFormatter->formatGetAllBookingsData($config, $status);\n $request = $this->requestFormatter->formatGetOrdersRequest($requestData);\n\n $response = $this->sendRequestAndGetResponse($request);\n $this->handlePullOrdersResponse($response, $config, $result, true);\n }\n }\n }", "public function getOrders(){\n if ( is_null($this->orders) ){\n $db = $this->getTable()->getAdapter();\n $sid = $this->getCourier()->getId();\n\n //get all orders of courier service\n $sql = sprintf(\"select id from orders\n where (billCourier=0 or billCourier is NULL)\n and courierId = %d\",$sid);\n \n $rows = $db->fetchAll($sql);\n $orders = new SplObjectStorage();\n foreach($rows as $o){\n try{\n $order = new Yourdelivery_Model_Order($o['id']);\n\n if ( $order->getMode() == \"great\" && $order->getState() != 2 &&\n //check for great which do not provide pfand\n //kreiner, gela\n !in_array($order->getCourier()->getId(),array(12123,12115)) ){\n continue;\n }\n\n if ( $order->getState() < 0 ){\n continue;\n }\n\n if ( $order->getDeliverTime() > $this->until ){\n continue;\n }\n\n $orders->attach($order);\n }\n catch ( Yourdelivery_Exception_Database_Inconsistency $e ){\n\n }\n }\n $this->orders = $orders;\n }\n return $this->orders;\n }", "public function getCriteria();", "public function getAllOwnOrders() {\n\n $query = $this->db->prepare(\"SELECT * FROM `orders` WHERE `order_partner_id` = 28\");\n\n try {\n\n $query->execute();\n\n $result = $query->fetchAll();\n return $result;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "public function getOrders(Request $request) {\n $orders = Orders::orders();\n $status = $request->input('status', null);\n\n if ($status !== null) {\n $orders->where('status', $status);\n }\n\n $orders = $orders->paginate(Orders::getPageSize());\n\n return response()->json($orders);\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n #count_orders\n $order_table = Order::model()->tableName();\n $order_count_sql = \"(select count(*) from `\".$order_table.\"` as pt3 where pt3.user_id = t.id)\";\n\n #first_buy\n $first_buy_sql = \"(select min(pt4.date_create) from `\".$order_table.\"` as pt4 where pt4.user_id = t.id)\";\n\n\n if((isset($this->orders_date_first) && trim($this->orders_date_first) != \"\") && (isset($this->orders_date_last) && trim($this->orders_date_last) != \"\")){\n $orders_by_period_sql = \"(select count(*) from `\".$order_table.\"` as pt7 where pt7.user_id = t.id AND pt7.date_create between '\".$this->orders_date_first.\"' AND '\".$this->orders_date_last.\"')\";\n //$criteria->join = \"INNER JOIN `\".$order_table.\"` AS pt8 where pt8.user_id = t.id\";\n }else{\n $orders_by_period_sql = \"(select count(*) from `\".$order_table.\"` as pt7 where pt7.user_id = t.id)\";\n $criteria->compare($orders_by_period_sql, $this->orders_by_period);\n }\n\n $criteria->select = array(\n '*',\n $order_count_sql . \" as order_count\",\n $first_buy_sql . \" as first_buy\",\n $orders_by_period_sql . \" as orders_by_period\",\n );\n\n if((isset($this->date_first) && trim($this->date_first) != \"\") && (isset($this->date_last) && trim($this->date_last) != \"\")){\n $criteria->addBetweenCondition('(select min(pt6.date_create) from `'.$order_table.'` as pt6 where pt6.user_id = t.id)', ''.$this->date_first.'', ''.$this->date_last.'');\n }\n\n $criteria->compare($order_count_sql, $this->order_count);\n $criteria->compare($order_count_sql, $this->order_count);\n $criteria->compare($orders_by_period_sql, $this->orders_by_period);\n $criteria->compare('t.id', $this->id);\n $criteria->compare('t.login', $this->login, true);\n $criteria->compare('t.password', $this->password, true);\n $criteria->compare('t.email', $this->email, true);\n $criteria->compare('t.display_name', $this->display_name, true);\n $criteria->compare('t.name', $this->name, true);\n $criteria->compare('t.servicename', $this->servicename, true);\n $criteria->compare('t.phone', $this->phone, true);\n $criteria->compare('t.address', $this->address);\n $criteria->compare('t.status', $this->status);\n $criteria->compare('t.discount', $this->status);\n $criteria->compare('t.camefrom', $this->camefrom);\n $criteria->compare('t.position', $this->position);\n\n\n\n return parent::searchInit($criteria);\n }", "public function findByFilter(array $filter, array $order);", "public function get_my_orders( $args = array() )\n {\n return $this->_request('myorders', $args);\n }", "public function getRecurringOrders();", "public function displayOrders()\n {\n $chairQuery = \"SELECT\n `orders`.*,\n `payments`.`payment_status`,\n `customers`.`email`,\n `customers`.`surname`,\n `customers`.`firstname`\n FROM `orders`\n JOIN `payments`\n INNER JOIN `customers`\n ON `orders`.`cust_id` = `customers`.`cust_id`\n AND `orders`.`payment_id` = `payments`.`payment_id`\n WHERE `orders`.`payment_id` = '2'\n ORDER BY `orders`.`date` ASC\";\n\n if ($statement = $this->prepare($chairQuery)) {\n $statement->execute();\n return $statement->get_result();\n }\n $statement->close();\n return false;\n }", "protected function obtainDataOrders()\n\t{\n\t\t$this->dbQueryResult['ORDERS'] = CSaleOrder::GetList(array($this->sortBy => $this->sortOrder), $this->filter);\n\t\t$this->dbQueryResult['ORDERS']->NavStart($this->arParams[\"ORDERS_PER_PAGE\"], false);\n\n\t\tif(empty($this->dbQueryResult['ORDERS']))\n\t\t\treturn;\n\n\t\twhile ($arOrder = $this->dbQueryResult['ORDERS']->GetNext())\n\t\t{\n\t\t\t$arOBasket = array();\n\t\t\t$dbBasket = CSaleBasket::GetList(array('NAME' => 'asc'), array(\"ORDER_ID\"=>$arOrder[\"ID\"]), false, false, array('*'));\n\t\t\twhile ($arBasket = $dbBasket->Fetch())\n\t\t\t{\n\t\t\t\tif (CSaleBasketHelper::isSetItem($arBasket))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$arOBasket[] = $arBasket;\n\t\t\t}\n\n\t\t\t$this->dbResult['ORDERS'][] = array(\n\t\t\t\t\"ORDER\" => $arOrder,\n\t\t\t\t\"BASKET_ITEMS\" => $arOBasket,\n\t\t\t);\n\t\t}\n\t}", "private function getQuery(string $orderId = null)\n {\n $filter = $orderId ? \"(filter:{number:{eq:\\\"$orderId\\\"}})\" : \"\";\n return <<<QUERY\n{\n customer {\n orders {$filter}{\n items {\n number\n status\n items {\n product_sku\n }\n carrier\n shipping_method\n shipments {\n id\n number\n tracking {\n title\n carrier\n number\n }\n items {\n id\n order_item {\n product_sku\n }\n product_name\n product_sku\n product_sale_price {\n value\n currency\n }\n ... on BundleShipmentItem {\n bundle_options {\n label\n values {\n product_name\n product_sku\n quantity\n price {\n value\n }\n }\n }\n }\n quantity_shipped\n }\n comments {\n timestamp\n message\n }\n }\n }\n }\n }\n}\nQUERY;\n }", "public function loadByOrder($criteria = array (), $order = array ())\r\n {\r\n \r\n return $this->repository->findBy($criteria, $order);\r\n }", "public function getOrderings() {}", "public function getOrderings();", "function findAllOrdersDescPaginated();", "static function getCustomerOrders(int $CustomerID) {\r\n $sqlSelect = \"SELECT * FROM Orders WHERE CustomerID = :CustomerID\";\r\n //Query\r\n self::$db->query($sqlSelect);\r\n //Bind\r\n self::$db->bind(':CustomerID', $CustomerID);\r\n //Execute\r\n self::$db->execute();\r\n //Return\r\n return self::$db->resultSet();\r\n }", "public function getFulfilledOrders()\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.arrival_date IS NOT NULL\nORDER BY orders.order_date;\nSQL\n );\n $order->execute();\n return $order->fetchAll(\\PDO::FETCH_OBJ);\n }", "private function userQueryOrders($inList) {\n $this->userQueryResult = $this->find('all', array(\n 'conditions' => array(\n 'Order.id' => $inList\n ),\n 'contain' => array(\n 'User',\n 'UserCustomer' => array(\n 'Customer' => array(\n 'fields' => array('id', 'allow_backorder')\n )\n ),\n 'Budget',\n 'OrderItem' => array(\n 'Item',\n 'Catalog' => array(\n 'ParentCatalog' => array(\n 'Item'\n )\n )\n ),\n 'Shipment',\n )\n ));\n }", "public function search(){\n if ($search = \\Request::get(trim('search'))) {\n $orders = Order::where('name', 'LIKE', \"%$search%\")\n ->orWhere('street', 'LIKE', \"%$search%\")\n ->orWhere('postcode', 'LIKE', \"%$search%\")\n ->orWhere('country', 'LIKE', \"%$search%\")\n ->orWhere('email', 'LIKE', \"%$search%\")\n ->orWhere('cart', 'LIKE', \"%$search%\")->orderBy('created_at', 'desc')->paginate(2);\n }else{\n $orders = Order::paginate(2);\n }\n return $orders;\n }", "public function query(Order $model)\n {\n if(auth()->user()->hasRole(['admin', 'manager', 'manager'])){\n return $model\n ->where('library_id', 1) // 1 is default admin library\n ->where('status', '!=', 1)\n ->with('orderItems.book')\n ->newQuery();\n }else{\n return $model\n ->where('library_id', Auth::user()->library->id)\n ->where('status', '!=', 1)\n ->with('orderItems.book')\n ->newQuery();\n }\n }", "public function GetAllOrders() {\n return $this->orderManager->GetAllOrders();\n }", "function getOrderings() ;", "public function search($status = null)\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\t\t$criteria->with = array('invoices');\n\t\t//$criteria->join='LEFT JOIN hts_invoices ON hts_invoices.orderId=t.orderId';\n\t\t$criteria->compare('orderId',$this->orderId);\n\t\t$criteria->compare('sellerId',$this->sellerId);\n\t\t$criteria->compare('totalCost',$this->totalCost,true);\n\t\t$criteria->compare('totalShipping',$this->totalShipping,true);\n\t\t$criteria->compare('discount',$this->discount,true);\n\t\t$criteria->compare('discountSource',$this->discountSource,true);\n\t\t$criteria->compare(\"from_unixtime(`orderDate`, '%d-%m-%Y')\",$this->orderDate,true);\n\t\t/*if(!empty($this->orderDate))\n\t\t $criteria->condition = \"from_unixtime(`orderDate`, '%d-%m-%Y') = '$this->orderDate'\";\n\t\t else\n\t\t $criteria->compare('orderDate',$this->orderDate); */\n\t\t$criteria->compare('shippingAddress',$this->shippingAddress);\n\t\t$criteria->compare('currency',$this->currency,true);\n\n\n\t\tif(Yii::app()->controller->action->id == 'scroworders') {\n\t\t\t$criteria->addCondition(\"trackPayment != ''\");\n\t\t\tif($status == 'approved') {\n\t\t\t\t$criteria->addCondition(\"trackPayment = 'paid'\");\n\t\t\t} elseif($status == 'delivered') {\n\t\t\t\t$criteria->addCondition(\"trackPayment = 'pending'\");\n\t\t\t\t$criteria->addCondition(\"status = 'delivered'\");\n\t\t\t} elseif($status == 'cancelled') {\n\t\t\t\t$criteria->addCondition(\"trackPayment = 'pending'\");\n\t\t\t\t$criteria->addCondition(\"status = 'cancelled'\");\n\t\t\t} elseif($status == 'refunded') {\n\t\t\t\t$criteria->addCondition(\"trackPayment = 'refunded'\");\n\t\t\t\t$criteria->addCondition(\"status = 'cancelled'\");\n\t\t\t} else {\n\t\t\t\t$criteria->compare('status',$status,true);\n\t\t\t}\n\t\t} else {\n\t\t\t$criteria->addCondition(\"trackPayment = ''\");\n\t\t\t$criteria->compare('status',$status,true);\n\t\t}\n\t\tif(Yii::app()->request->isAjaxRequest) {\n\t\t\tif(!empty($status))\n\t\t\t$criteria->addCondition(\"status = '$status'\");\n\t\t\t\n\t\t}\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t'sort'=>array(\n 'defaultOrder'=>'orderId DESC',\n\t\t)\n\t\t));\n\t}", "protected function getListQuery() {\n // Create a new query object.\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n // Select the required fields from the table.\n $query->select(\n $this->getState('DISTINCT ' .\n 'list.select', ' a.id,a.guid,a.ordering,a.name,a.alias,a.ordertype_id,a.orderstate_id,a.archived,a.user_id,a.sent,a.completed,a.created_by,a.created'\n )\n );\n\n $query->from('#__sdi_order AS a');\n\n // Join over the users for the checked out user.\n $query->select('uc.name AS editor');\n $query->join('LEFT', '#__users AS uc ON uc.id=a.checked_out');\n\n // Join over the user field 'user'\n $query->select($db->quoteName('users2.name', 'user'))\n ->select($db->quoteName('users2.username', 'username'))\n ->innerJoin('#__sdi_user AS sdi_user ON sdi_user.id = a.user_id')\n ->innerJoin('#__users AS users2 ON users2.id = sdi_user.user_id');\n\n // Join over the orderstate field 'orderstate'\n $query->select('orderstate.value AS orderstate')\n ->innerJoin('#__sdi_sys_orderstate AS orderstate ON orderstate.id = a.orderstate_id');\n\n $query->group('orderstate.value');\n\n // Join over the ordertype field 'ordertype'\n $query->select('ordertype.value AS ordertype')\n ->innerJoin('#__sdi_sys_ordertype AS ordertype ON ordertype.id = a.ordertype_id');\n\n $query->group('ordertype.value');\n // Filter by ordertype type\n $ordertype = $this->getState('filter.ordertype');\n if (is_numeric($ordertype)) {\n $query->where('a.ordertype_id = ' . (int) $ordertype);\n }\n\n // Filter by orderstate state\n $orderstate = $this->getState('filter.orderstate');\n if (is_numeric($orderstate)) {\n $query->where('a.orderstate_id = ' . (int) $orderstate);\n }\n\n // Filter by order archived state\n $orderarchived = $this->getState('filter.orderarchived');\n if (is_numeric($orderarchived)) {\n $query->where('a.archived = ' . (int) $orderarchived);\n }\n\n // Filter by order user\n $orderuser = $this->getState('filter.orderuser');\n if (is_numeric($orderuser)) {\n $query->where('a.user_id = ' . (int) $orderuser);\n }\n\n // Filter by order user's organism\n $orderuserorganism = $this->getState('filter.orderuserorganism');\n if (is_numeric($orderuserorganism)) {\n $query->innerJoin('#__sdi_user_role_organism AS uro ON sdi_user.id = uro.user_id AND uro.role_id = 1');\n $query->where('uro.organism_id = ' . (int) $orderuserorganism);\n }\n\n // Filter by orderprovider state\n $orderprovider = $this->getState('filter.orderprovider');\n if (is_numeric($orderprovider)) {\n $query\n ->innerJoin('#__sdi_order_diffusion AS order_diffusion2 ON order_diffusion2.order_id = a.id')\n ->innerJoin('#__sdi_diffusion AS diffusion2 ON diffusion2.id = order_diffusion2.diffusion_id')\n ->innerJoin('#__sdi_version AS version2 ON version2.id = diffusion2.version_id')\n ->innerJoin('#__sdi_resource AS resource2 ON resource2.id = version2.resource_id')\n ->where('resource2.organism_id = ' . (int) $orderprovider);\n }\n\n // Filter by orderdiffusion state\n $orderdiffusion = $this->getState('filter.orderdiffusion');\n if (is_numeric($orderdiffusion)) {\n $query\n ->innerJoin('#__sdi_order_diffusion AS order_diffusion3 ON order_diffusion3.order_id =a.id')\n ->where('order_diffusion3.diffusion_id = ' . (int) $orderdiffusion);\n }\n\n // Filter by ordersent state\n $ordersent = $this->getState('filter.ordersent');\n if ($ordersent !== '') {\n // Get UTC for now.\n $dNow = new JDate;\n $dStart = clone $dNow;\n\n switch ($ordersent) {\n case 'past_week':\n $dStart->modify('-7 day');\n break;\n\n case 'past_1month':\n $dStart->modify('-1 month');\n break;\n\n case 'past_3month':\n $dStart->modify('-3 month');\n break;\n\n case 'past_6month':\n $dStart->modify('-6 month');\n break;\n\n case 'post_year':\n case 'past_year':\n $dStart->modify('-1 year');\n break;\n\n case 'today':\n // Ranges that need to align with local 'days' need special treatment.\n $app = JFactory::getApplication();\n $offset = $app->getCfg('offset');\n\n // Reset the start time to be the beginning of today, local time.\n $dStart = new JDate('now', $offset);\n $dStart->setTime(0, 0, 0);\n\n // Now change the timezone back to UTC.\n $tz = new DateTimeZone('GMT');\n $dStart->setTimezone($tz);\n break;\n }\n\n if ($ordersent == 'post_year') {\n $query->where(\n 'a.sent < ' . $db->quote($dStart->format('Y-m-d H:i:s'))\n );\n } else {\n $query->where(\n 'a.sent >= ' . $db->quote($dStart->format('Y-m-d H:i:s')) .\n ' AND a.sent <=' . $db->quote($dNow->format('Y-m-d H:i:s'))\n );\n }\n }\n\n // Filter by ordercompleted state\n $ordercompleted = $this->getState('filter.ordercompleted');\n if ($ordercompleted !== '') {\n // Get UTC for now.\n $dNow = new JDate;\n $dStart = clone $dNow;\n\n switch ($ordercompleted) {\n case 'past_week':\n $dStart->modify('-7 day');\n break;\n\n case 'past_1month':\n $dStart->modify('-1 month');\n break;\n\n case 'past_3month':\n $dStart->modify('-3 month');\n break;\n\n case 'past_6month':\n $dStart->modify('-6 month');\n break;\n\n case 'post_year':\n case 'past_year':\n $dStart->modify('-1 year');\n break;\n\n case 'today':\n // Ranges that need to align with local 'days' need special treatment.\n $app = JFactory::getApplication();\n $offset = $app->getCfg('offset');\n\n // Reset the start time to be the beginning of today, local time.\n $dStart = new JDate('now', $offset);\n $dStart->setTime(0, 0, 0);\n\n // Now change the timezone back to UTC.\n $tz = new DateTimeZone('GMT');\n $dStart->setTimezone($tz);\n break;\n }\n\n if ($ordercompleted == 'post_year') {\n $query->where(\n 'a.completed < ' . $db->quote($dStart->format('Y-m-d H:i:s'))\n );\n } else {\n $query->where(\n 'a.completed >= ' . $db->quote($dStart->format('Y-m-d H:i:s')) .\n ' AND a.completed <=' . $db->quote($dNow->format('Y-m-d H:i:s'))\n );\n }\n }\n\n // Filter by search in title\n $search = $this->getState('filter.search');\n if (!empty($search)) {\n $searchOnId = '';\n if (is_numeric($search)) {\n $searchOnId = ' OR (a.id = ' . (int) $search . ')';\n }\n $search = $db->Quote('%' . $db->escape($search, true) . '%');\n $query->where('(( a.name LIKE ' . $search . ' ) ' . $searchOnId . ' )');\n }\n\n // Add the list ordering clause.\n $orderCol = $this->state->get('list.ordering');\n $orderDirn = $this->state->get('list.direction');\n if ($orderCol && $orderDirn) {\n $query->order($db->escape($orderCol . ' ' . $orderDirn));\n }\n\n //group by order_id\n $query->group('a.id');\n $query->group('a.guid');\n $query->group('a.alias');\n $query->group('a.created_by');\n $query->group('a.created');\n $query->group('a.name');\n $query->group('users2.name');\n $query->group('uc.name');\n $query->group('users2.username');\n\n return $query;\n }", "public function getCartsByUser($user, $organization_id, $user_id, $orderResults, $where=[], $options=[], $debug=false) { \n\n $order_id = $orderResults->id;\n $prod_gas_promotion_id = $orderResults->prod_gas_promotion_id;\n\n if(!isset($where['ProdGasArticlesPromotions']))\n $where['ProdGasArticlesPromotions'] = ['ProdGasArticlesPromotions.prod_gas_promotion_id' => $prod_gas_promotion_id];\n else\n $where['ProdGasArticlesPromotions'] = array_merge(['ProdGasArticlesPromotions.prod_gas_promotion_id' => $prod_gas_promotion_id], \n $where['ProdGasArticlesPromotions']);\n \n if(!isset($where['ArticlesOrders']))\n $where['ArticlesOrders'] = [];\n\n $where_article_order = [];\n if(isset($where['ArticlesOrders']))\n $where_article_order = $where['ArticlesOrders'];\n $where['ArticlesOrders'] = array_merge([$this->getAlias().'.organization_id' => $organization_id,\n $this->getAlias().'.order_id' => $order_id,\n $this->getAlias().'.stato != ' => 'N'], \n $where['ArticlesOrders']);\n \n $this->_getOptions($options); // setta sort / limit / page\n\n /*\n * da Orders chi gestisce listino articoli\n * order_type_id' => (int) 4,\n * owner_articles' => 'REFERENT',\n * owner_organization_id\n * owner_supplier_organization_id\n */\n if(!isset($where['Articles']))\n $where['Articles'] = [];\n $where['Articles'] = array_merge(['Articles.stato' => 'Y'], $where['Articles']);\n // debug($where);\n\n $results = $this->find()\n ->contain(['Articles' => ['conditions' => $where['Articles']], \n 'ProdGasArticlesPromotions' => ['conditions' => $where['ProdGasArticlesPromotions']]])\n ->where($where['ArticlesOrders'])\n ->order($this->_sort)\n ->limit($this->_limit)\n ->page($this->_page)\n ->all()\n ->toArray();\n // debug($results); \n\n /*\n * estraggo eventuali acquisti / promotions\n */ \n if($results) {\n\n $cartsTable = TableRegistry::get('Carts');\n $prodGasArticlesPromotionsTable = TableRegistry::get('ProdGasArticlesPromotions');\n foreach($results as $numResult => $result) {\n\n $results[$numResult]['order'] = $orderResults;\n\n /*\n * Carts\n */\n $where_cart = ['Carts.organization_id' => $result['organization_id'],\n 'Carts.order_id' => $result['order_id'],\n 'Carts.article_organization_id' => $result['article_organization_id'],\n 'Carts.article_id' => $result['article_id'],\n 'Carts.deleteToReferent' => 'N',\n 'Carts.user_id' => $user_id,\n 'Carts.stato' => 'Y'];\n\n $cartResults = $cartsTable->find()\n ->where($where_cart)\n ->first();\n if($debug) debug($where_cart);\n if($debug) debug($cartResults);\n\n $results[$numResult]['cart'] = [];\n if(!empty($cartResults)) {\n $results[$numResult]['cart'] = $cartResults;\n $results[$numResult]['cart']['qta'] = $cartResults->qta;\n $results[$numResult]['cart']['qta_new'] = $cartResults->qta; // nuovo valore da FE\n } \n else {\n $results[$numResult]['cart']['organization_id'] = $result['organization_id'];\n $results[$numResult]['cart']['user_id'] = $result['user_id'];\n $results[$numResult]['cart']['order_id'] = $result['order_id'];\n $results[$numResult]['cart']['article_organization_id'] = $result['article_organization_id'];\n $results[$numResult]['cart']['article_id'] = $result['article_id']; \n $results[$numResult]['cart']['qta'] = 0;\n $results[$numResult]['cart']['qta_new'] = 0; // nuovo valore da FE\n }\n\n /*\n * Promotions\n */\n $where_promotion = ['ProdGasArticlesPromotions.organization_id' => $result['article']['organization_id'],\n 'ProdGasArticlesPromotions.article_id' => $result['article']['id']];\n $prodGasArticlesPromotionsResults = $prodGasArticlesPromotionsTable->find()\n ->where($where_promotion)\n ->first();\n if($debug) debug($where_promotion);\n if($debug) debug($prodGasArticlesPromotionsResults);\n\n $results[$numResult]['promotion'] = $prodGasArticlesPromotionsResults;\n }\n } // if($results)\n \n if($debug) debug($results);\n\n return $results;\n }", "public function findOrder($orderId){\r\n \t$query = $this->getDbTable()->select()\r\n \t->from(array('d' => 'detailorder'),array('*'))\r\n \t->join(array('e' => 'equipment'),'d.equipmentId = e.equipmentId',array('e.equipmentId', 'e.name', 'e.image', 'e.price', 'e.priceSale'))\r\n \t->where('d.orderId = ?', $orderId)\r\n \t->setIntegrityCheck(false);\r\n \r\n \t$resultRows = $this->getDbTable()->fetchAll($query);\r\n \tif(count($resultRows) == 0){\r\n \t\treturn 0;\r\n \t}\r\n \telse{\r\n \t\treturn $resultRows;\r\n \t}\r\n }", "public function actionOrder()\n {\n $request = Yii::$app->getRequest();\n $requestParams = $request->getBodyParams();\n \n if (empty($requestParams)) {\n $requestParams = $request->getQueryParams();\n }\n \n $query = Order::find()\n ->where(['customer_id' => $this->customer_id])\n ->andWhere(['<>', 'status_id', Order::STATUS_DRAFT])\n // filter based on date range\n ->andFilterWhere([\n 'between',\n 'ordered_at',\n $request->getBodyParam('order_from'),\n $request->getBodyParam('order_to')\n ]);\n \n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => ['params' => $requestParams],\n 'sort' => ['params' => $requestParams],\n ]);\n \n return $dataProvider;\n }", "public abstract function findOperationBy(array $criteria);", "public function getBy(array $criteria);", "public function getCustomerInformationByOrderId($orderId)\n {\n $sql = <<<'EOT'\nSELECT\n `b`.`company` AS `billing_company`,\n `b`.`department` AS `billing_department`,\n `b`.`salutation` AS `billing_salutation`,\n `u`.`customernumber`,\n `b`.`firstname` AS `billing_firstname`,\n `b`.`lastname` AS `billing_lastname`,\n `b`.`street` AS `billing_street`,\n `b`.`additional_address_line1` AS `billing_additional_address_line1`,\n `b`.`additional_address_line2` AS `billing_additional_address_line2`,\n `b`.`zipcode` AS `billing_zipcode`,\n `b`.`city` AS `billing_city`,\n `b`.`phone` AS `phone`,\n `b`.`phone` AS `billing_phone`,\n `b`.`countryID` AS `billing_countryID`,\n `b`.`stateID` AS `billing_stateID`,\n `bc`.`countryname` AS `billing_country`,\n `bc`.`countryiso` AS `billing_countryiso`,\n `bca`.`name` AS `billing_countryarea`,\n `bc`.`countryen` AS `billing_countryen`,\n `b`.`ustid`,\n `ba`.`text1` AS `billing_text1`,\n `ba`.`text2` AS `billing_text2`,\n `ba`.`text3` AS `billing_text3`,\n `ba`.`text4` AS `billing_text4`,\n `ba`.`text5` AS `billing_text5`,\n `ba`.`text6` AS `billing_text6`,\n `b`.`orderID` AS `orderID`,\n `s`.`company` AS `shipping_company`,\n `s`.`department` AS `shipping_department`,\n `s`.`salutation` AS `shipping_salutation`,\n `s`.`firstname` AS `shipping_firstname`,\n `s`.`lastname` AS `shipping_lastname`,\n `s`.`street` AS `shipping_street`,\n `s`.`additional_address_line1` AS `shipping_additional_address_line1`,\n `s`.`additional_address_line2` AS `shipping_additional_address_line2`,\n `s`.`zipcode` AS `shipping_zipcode`,\n `s`.`city` AS `shipping_city`,\n `s`.`stateID` AS `shipping_stateID`,\n `s`.`countryID` AS `shipping_countryID`,\n `sc`.`countryname` AS `shipping_country`,\n `sc`.`countryiso` AS `shipping_countryiso`,\n `sca`.`name` AS `shipping_countryarea`,\n `sc`.`countryen` AS `shipping_countryen`,\n `sa`.`text1` AS `shipping_text1`,\n `sa`.`text2` AS `shipping_text2`,\n `sa`.`text3` AS `shipping_text3`,\n `sa`.`text4` AS `shipping_text4`,\n `sa`.`text5` AS `shipping_text5`,\n `sa`.`text6` AS `shipping_text6`,\n `u`.*,\n `g`.`id` AS `preisgruppe`,\n `g`.`tax` AS `billing_net`\nFROM\n `s_order_billingaddress` AS `b`\nLEFT JOIN `s_order_shippingaddress` AS `s`\n ON `s`.`orderID` = `b`.`orderID`\nLEFT JOIN `s_user` AS `u`\n ON `b`.`userID` = `u`.`id`\nLEFT JOIN `s_user_addresses` AS `ub`\n ON `u`.`default_billing_address_id`=`ub`.`id`\n AND `u`.`id`=`ub`.`user_id`\nLEFT JOIN `s_core_countries` AS `bc`\n ON `bc`.`id` = `b`.`countryID`\nLEFT JOIN `s_core_countries` AS `sc`\n ON `sc`.`id` = `s`.`countryID`\nLEFT JOIN `s_core_customergroups` AS `g`\n ON `u`.`customergroup` = `g`.`groupkey`\nLEFT JOIN s_core_countries_areas bca\n ON bc.areaID = bca.id\nLEFT JOIN s_core_countries_areas sca\n ON sc.areaID = sca.id\nLEFT JOIN s_order_billingaddress_attributes ba\n ON b.id = ba.billingID\nLEFT JOIN s_order_shippingaddress_attributes sa\n ON s.id = sa.shippingID\nWHERE\n `b`.`orderID`=:orderId\nEOT;\n\n return $this->db->fetchRow($sql, ['orderId' => $orderId]);\n }", "public function querySalesOrder(int $idSalesOrder): SpySalesOrderQuery;", "function show_orders() {\n\n\t\t$connection = new MySQLDataSource();\n $connection->connect($GLOBALS['db']['default']['hostname'],\n $GLOBALS['db']['default']['username'],\n $GLOBALS['db']['default']['password'],\n $GLOBALS['db']['default']['database']);\n\t\t$query = \"SELECT * FROM orders ORDER BY date;\";\n\t\t$connection->execute_query($query);\n\t\t$row = $connection->next();\n\t\t$i = 0;\n\n\t\tif(!$row) {\n\n\t\t\t$connection->disconnect();\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\twhile($row) {\n\n\t\t\t\t$orders[$i] = new Order();\n\t\t\t\t$orders[$i]->setIdOrder($row->id_order);\n\t\t\t\t$orders[$i]->setDate($row->date);\n\t\t\t\t$orders[$i]->setIdCustomer($row->id_customer);\n\t\t\t\t$orders[$i]->setAmount($row->amount);\n\t\t\t\t$row = $connection->next();\n\t\t\t\t$i++;\n\n\t\t\t}\n\n\t\t\t$connection->disconnect();\n\t\t\treturn $orders;\n\n\t\t}\n\t}", "public function query(Order $model)\n {\n return $model->newQuery()->select('id', 'product_id', 'user_id','amount', 'created_at', 'updated_at');\n }", "public function getOrders()\n {\n $response = $this->orderDesk->get( \"orders\" );\n $orders = $response[ \"orders\" ];\n $values = [];\n\n if (!empty($orders)) {\n foreach ( $orders as $order ) {\n\n $value = [\n $order[\"shipping\"][\"first_name\"],\n $order[\"shipping\"][\"last_name\"],\n $order[\"email\"],\n $order[\"shipping_method\"],\n $order[\"payment_type\"],\n $order[\"order_total\"]\n ];\n \n array_push( $values, $value );\n }\n \n $this->updateGoogleSheets( $values );\n } else {\n return $response['message'];\n }\n }", "public function GetOrders($parameters = []) {\n\t\t// set the action as required\n\t\t$this->parameters['Action'] = 'GetOrders';\n\n\t\t// merge the prepared parameters with base parameters\n\t\t$parameters = HttpHelper::handle($parameters);\n\t\t$this->parameters = array_merge($this->parameters, $parameters);\n\n\t\t// make the http request\n\t\t$data = HttpClient::makeCall($this->baseURL, $this->parameters);\n\n\t\t// handle the response given\n\t\treturn ResponseHelper::property($data, 'SuccessResponse->Body->Orders');\n\t}", "public function findByOrder ($orderId) {\n\n return $this->fetchAll(\n $this->select()\n ->where(\"`orderId` = ?\", $orderId)\n );\n\n }", "public function orders() {\n if ($this->orders != null)\n return $this->orders;\n $ids = Pdb::fetchAll('small_order', self::$table);\n return $this->orders = safe_array_map(function ($id) { return new Order($id); }, $ids); // no paging here\n }", "public function selectOMGOrderFromOrders($orderId)\r\n {\r\n $sql = \"SELECT orders.*, orderitems.product AS prItem,\r\n IFNULL(\r\n round(\r\n sum(\r\n (\r\n decrease_price * (1 -(decrease_discount / 100)) * decrease_quantity\r\n ) + (\r\n (\r\n decrease_price * (1 -(decrease_discount / 100)) * decrease_quantity\r\n ) * (vat_rate / 100)\r\n )\r\n ),\r\n 2\r\n ),\r\n 0\r\n ) AS documentAmount\r\n FROM orders\r\n LEFT JOIN orderitems ON orders.order_id = orderitems.order\r\n\t\t\t\tWHERE 1 AND (state = 'BA' OR state = 'SI')\r\n\t\t\t\tAND submitId = '$orderId'\r\n\t\t\t\tGROUP BY orders.order_id\r\n\t\t\t\tLIMIT 1\";\r\n\r\n $results=$this->conn->fetchAssoc($sql);\r\n return $results;\r\n }", "public function query($filters = array(), $meta_controls = array()) {\n\n global $user;\n\n // We don't care if an anonymous user wants to see orders that other users\n // created. We just don't send other people's email addresses to anonymous users\n\n // Implemented filters:\n // Single order by order id (order_id=<id>) (used also for cart orders created\n // by anonymous users)\n // Cart order of the logged in user (status='cart' and user id from $user->uid)\n // Every order for the logged in user (uid from $user->uid and no filter)\n\n // The filter status='cart' used to get all cart order for the logged in user\n // is still working but it's not used on the Angular side.\n // Angular uses this api to retrieve all orders for the logged-in user and\n // cart orders are included in the reply\n\n // Notice that the 'cart' filter returns all 'cart' orders for the logged-in user\n // if there are many of them\n\n // @attention here, what about orders in 'checkout_...'?\n // If an order is anonymous and it's in 'checkout_*' status, we won't be able\n // to find it by using this api. It's lost and the user will have to restart\n // from scratch\n\n $return_cart_for_current_user = false;\n $return_every_order_for_current_user = false;\n $order_id = 0;\n\n if (!empty($filters['order_id'])) {\n // If we have the order id, just send the order back\n $order_id = $filters['order_id'];\n } else {\n // No order id, let's check the status\n\n if (!empty($filters['status'])) {\n // If we have a status, it should be 'cart'. We are not supporting filtering\n // on other statuses now\n $status = $filters['status'];\n if ($status == 'cart') {\n\n // This REST api shouldn't be called to get 'cart' orders for the logged-in user\n // It's still working if called, but let me watchdog a warning\n\n watchdog('musth_restws',\n '6TG2PL Why is this api called to get cart orders?. (!f) (!u) ',\n array('!f' => print_r($filters, true),\n '!u' => print_r($user, true)),\n WATCHDOG_WARNING);\n\n // Let's go on with checking if the user is logged in\n if ($user->uid != 0) {\n $return_cart_for_current_user = true;\n } else {\n // No order id is provided, so we can only send back the 'cart' order of the\n // logged-in user. But no user is logged in, or the credentials were wrong\n\n watchdog('musth_restws',\n 'W3E069 User not logged in, we cant send back the cart order. (!f) (!u) ',\n array('!f' => print_r($filters, true),\n '!u' => print_r($user, true)),\n WATCHDOG_ERROR);\n\n throw new RestWSException('No logged-in user or wrong credentials', 403);\n }\n\n } else {\n\n watchdog('musth_restws',\n 'W3E070 Filtering on statuses other than cart not supported (!f)',\n array('!f' => print_r($filters, true)),\n WATCHDOG_ERROR);\n\n throw new RestWSException('Filtering on statuses other than cart not supported', 412);\n }\n\n } else {\n // No status set (and no order_id)\n // In this case we return every order associated to the logged-in user\n\n if ($user->uid != 0) {\n $return_every_order_for_current_user = true;\n } else {\n\n watchdog('musth_restws',\n 'W3E071 We send the full list of orders only to logged-in users. (!f) (!u) ',\n array('!f' => print_r($filters, true),\n '!u' => print_r($user, true)),\n WATCHDOG_ERROR);\n\n throw new RestWSException('We send the full list of orders only to logged-in users', 403);\n }\n\n }\n\n } // if (isset($filters['order_id']))\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'commerce_order')\n ->entityCondition('bundle', 'commerce_order');\n\n if ($return_cart_for_current_user)\n $query->propertyCondition('status', 'cart');\n\n if ($return_cart_for_current_user || $return_every_order_for_current_user)\n $query->propertyCondition('uid', $user->uid);\n\n if ($order_id)\n $query->propertyCondition('order_id', $order_id);\n\n $result = $query->execute();\n\n if (isset($result['commerce_order'])) {\n $order_ids = array_keys($result['commerce_order']);\n } else {\n // No order found? Throw an exception unless angular asked for all orders for the current user\n\n if ($return_every_order_for_current_user) {\n\n // If angular asked for all orders for the current user, we are in the case that the user\n // has no orders. It can be.\n $order_ids = array();\n\n } else {\n // In any other case we throw an exception because we should find an order\n\n watchdog('musth_rules', 'W3E072 No orders found (!f) (!u) ',\n array('!f' => print_r($filters, true),\n '!u' => print_r($user, true)),\n WATCHDOG_ERROR);\n\n // Get out of here!\n throw new RestWSException('No orders found', 404);\n\n }\n\n }\n\n // Commerce apis calculate the order total themselves, nothing to do about it\n\n //watchdog('musth_restws', 'W7D001 8181 order query flags (!f) (!m) (!n) (!i) (!q) ',\n // array('!f' => print_r($return_cart_for_current_user, true),\n // '!m' => print_r($return_every_order_for_current_user, true),\n // '!n' => print_r($order_id, true),\n // '!i' => print_r($order_ids, true),\n // '!q' => print_r($query, true),\n // ), WATCHDOG_DEBUG);\n\n return $order_ids;\n }", "public function lstOrder(){\n\t\t$Sql = \"SELECT \n\t\t\t\t\torder_id,\n\t\t\t\t\tcustomer_id,\n\t\t\t\t\tproduct_id,\n\t\t\t\t\tproduct_name,\n\t\t\t\t\torder_date,\n\t\t\t\t\tsub_total,\n\t\t\t\t\tgrand_total,\n\t\t\t\t\torder_type,\n\t\t\t\t\tstart_date,\n\t\t\t\t\tend_date,\n\t\t\t\t\tpickup_location_id,\n\t\t\t\t\tdrop_location_id,\n\t\t\t\t\tproduct_price,\n\t\t\t\t\torder_status,\n\t\t\t\t\tpayment_method\n\t\t\t\tFROM\n\t\t\t\t\trs_tbl_order\n\t\t\t\tWHERE\n\t\t\t\t\t1=1\";\n\t\t\n\t\tif($this->isPropertySet(\"order_id\", \"V\")){\n\t\t\t$Sql .= \" AND order_id='\" . $this->getProperty(\"order_id\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"customer_id\", \"V\")){\n\t\t\t$Sql .= \" AND customer_id=\" . $this->getProperty(\"customer_id\");\n\t\t}\n\t\tif($this->isPropertySet(\"product_id\", \"V\")){\n\t\t\t$Sql .= \" AND product_id=\" . $this->getProperty(\"product_id\");\n\t\t}\n\t\tif($this->isPropertySet(\"order_type\", \"V\")){\n\t\t\t$Sql .= \" AND order_type='\" . $this->getProperty(\"order_type\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"order_status\", \"V\")){\n\t\t\t$Sql .= \" AND order_status='\" . $this->getProperty(\"order_status\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"from_dt\", \"V\") && $this->isPropertySet(\"to_dt\", \"V\")){\n\t\t\t$Sql .= \" AND LEFT(order_date, 10) BETWEEN '\" . $this->getProperty(\"from_dt\") . \"' AND '\" . $this->getProperty(\"to_dt\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"from_date\", \"V\") && $this->isPropertySet(\"to_date\", \"V\")){\n\t\t\t$Sql .= \" AND order_date BETWEEN '\" . $this->getProperty(\"from_date\") . \"' AND '\" . $this->getProperty(\"to_date\") . \"'\";\n\t\t}\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\")){\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\n\t\t}\n\t\t\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\n\t\treturn $this->dbQuery($Sql);\n\t}", "function fetchAllOrders()\n\t{\n\t\t$sql = \"SELECT o.booking_id,o.journey_id,o.booking_time,o.email, o.amount, r.route_name, o.order_status, j.departure_date, j.departure_time, j.vehicle_reg,j.route_id, j.driver_id, j.conductor_id, b.color,b.model,b.coach,b.no_of_seats,r.start_point, r.end_point, r.distance,r.duration, j.driver_name,j.conductor_name,b.imgurl,b.normal_seats,b.vip_seats FROM booking as o, journey as j, route as r, bus as b WHERE j.journey_id = o.journey_id AND j.route_id = r.route_id AND j.vehicle_reg = b.registration AND j.route_id = r.route_id\";\n\t\t$result = $this->conn->query($sql);\n\t\tif ($result->num_rows > 0) {\n\t\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t\t$orders[] = new Order($row['booking_id'], $row['journey_id'], $row['booking_time'], $row['email'],\n\t\t\t\t\t$row['amount'], $row['route_name'], $row['order_status'],$row['departure_date'],\n\t\t\t\t\t$row['departure_time'],$row['vehicle_reg'],$row['route_id'],$row['driver_id'],$row['conductor_id'],\n\t\t\t\t\t$row['color'],$row['model'],$row['coach'],$row['no_of_seats'],$row['start_point'],$row['end_point'],\n\t\t\t\t\t$row['distance'],$row['duration'],$row['driver_name'],$row['conductor_name'],$row['imgurl'],$row['normal_seats'],$row['vip_seats']\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn $orders;\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}", "function getAllUsersOrders(){\n\n}", "public function getOrderById($orderId)\n {\n }", "private function getQueryInvoice($criteria = []) {\n\n $query = DB::table(\"cao_cliente AS c\")\n ->select('c.co_cliente',\n 'c.no_razao AS user',\n DB::raw('ROUND(fat.valor - (fat.total_imp_inc * fat.valor) / 100, 2) AS net_income'))\n ->join('cao_fatura AS fat', function ($join) {\n $join->on('c.co_cliente', '=', 'fat.co_cliente');\n }) \n ->join('cao_os AS os', function ($join) {\n $join->on('fat.co_os', '=', 'os.co_os');\n });\n\n if (!empty($criteria['user'])) {\n $query->whereIn('c.co_cliente', $criteria['user']);\n }\n\n if (!empty($criteria['period'])) {\n\n if (!empty($criteria['period']['start'])) {\n $query->where('dt_sol', '>=', $criteria['period']['start'] . ' 00:00:00');\n }\n\n if (!empty($criteria['period']['end'])) {\n $query->where('dt_sol', '<=', $criteria['period']['end'] . '23:59:59');\n }\n }\n\n return $query;\n \n }", "public function findQuoteBy(array $criteria)\n {\n return $this->repository->findOneBy($criteria);\n }", "public function getOrders()\n {\n $result = array();\n\n if (!empty(\\XLite\\Core\\Request::getInstance()->order_ids)) {\n $orderIds = explode(',', \\XLite\\Core\\Request::getInstance()->order_ids);\n\n foreach ($orderIds as $orderId) {\n $orderId = trim($orderId);\n $order = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Order')->find(intval($orderId));\n if ($order) {\n $result[] = $order;\n }\n }\n\n } else {\n $result[] = $this->getOrder();\n }\n\n return $result;\n }", "private function getAllOrders()\n {\n try\n {\n $this->db->openConnection();\n $connection = $this->db->getConnection();\n $statement = $connection->prepare(\"SELECT o.order_id, u.username, o.`date`\n FROM orders o\n INNER JOIN `user` u\n ON u.user_id = o.user_id\n WHERE o.active = true\"\n );\n if($statement->execute())\n {\n $results = $statement->fetchAll(PDO::FETCH_ASSOC);\n \n foreach($results as $arr)\n {\n echo \"<tr class='clickableRow orders'>\";\n echo \"<td data-order-id=\".utf8_encode($arr['order_id']).\">\".utf8_encode($arr['order_id']).\"</td>\"; \n echo \"<td>\".utf8_encode($arr['username']).\"</td>\";\n echo \"<td>\".utf8_encode($arr['date']).\"</td>\";\n echo \"</tr>\";\n }\n }\n } catch (PDOException $ex)\n {\n $this->db->showError($ex, false);\n } finally\n {\n $this->db->closeConnection();\n }\n }", "public function getCartsByArticles($user, $organization_id, $orderResults, $where=[], $options=[], $debug=false) { \n\n $order_id = $orderResults->id;\n $prod_gas_promotion_id = $orderResults->prod_gas_promotion_id;\n\n if(!isset($where['ProdGasArticlesPromotions']))\n $where['ProdGasArticlesPromotions'] = ['ProdGasArticlesPromotions.prod_gas_promotion_id' => $prod_gas_promotion_id];\n else\n $where['ProdGasArticlesPromotions'] = array_merge(['ProdGasArticlesPromotions.prod_gas_promotion_id' => $prod_gas_promotion_id], \n $where['ProdGasArticlesPromotions']);\n \n if(!isset($where['ArticlesOrders']))\n $where['ArticlesOrders'] = [];\n\n $where_article_order = [];\n if(isset($where['ArticlesOrders']))\n $where_article_order = $where['ArticlesOrders'];\n $where['ArticlesOrders'] = array_merge([$this->getAlias().'.organization_id' => $organization_id,\n $this->getAlias().'.order_id' => $order_id,\n $this->getAlias().'.stato != ' => 'N'], \n $where['ArticlesOrders']);\n \n $this->_getOptions($options); // setta sort / limit / page\n\n /*\n * da Orders chi gestisce listino articoli\n * order_type_id' => (int) 4,\n * owner_articles' => 'REFERENT',\n * owner_organization_id\n * owner_supplier_organization_id\n */\n if(!isset($where['Articles']))\n $where['Articles'] = [];\n $where['Articles'] = array_merge(['Articles.stato' => 'Y'], $where['Articles']);\n // debug($where);\n\n $results = $this->find()\n ->contain(['Articles' => ['conditions' => $where['Articles']], \n 'ProdGasArticlesPromotions' => ['conditions' => $where['ProdGasArticlesPromotions']]])\n ->where($where['ArticlesOrders'])\n ->order($this->_sort)\n ->limit($this->_limit)\n ->page($this->_page)\n ->all()\n ->toArray();\n // debug($results); \n\n /*\n * estraggo eventuali acquisti / promotions\n */ \n if($results) {\n\n $cartsTable = TableRegistry::get('Carts');\n $prodGasArticlesPromotionsTable = TableRegistry::get('ProdGasArticlesPromotions');\n foreach($results as $numResult => $result) {\n\n $results[$numResult]['order'] = $orderResults;\n\n /*\n * Carts\n */\n $where_cart = ['Carts.organization_id' => $result['organization_id'],\n 'Carts.order_id' => $result['order_id'],\n 'Carts.article_organization_id' => $result['article_organization_id'],\n 'Carts.article_id' => $result['article_id'],\n 'Carts.deleteToReferent' => 'N',\n 'Carts.stato' => 'Y'];\n \n $cartResults = $cartsTable->find()\n ->where($where_cart)\n ->all();\n if($debug) debug($where_cart);\n if($debug) debug($cartResults);\n\n $results[$numResult]['cart'] = [];\n if($cartResults->count()>0) {\n /*\n * calcolo totali\n */\n $qta_tot = 0;\n $importo_tot = 0;\n foreach($cartResults as $cartResult) {\n if($cartResult->qta_forzato > 0)\n $qta_tot += $cartResult->qta_forzato;\n else\n $qta_tot += $cartResult->qta;\n\n /*\n * gestione importi\n * */\n if ($cartResult->importo_forzato == 0) {\n if ($cartResult->qta_forzato > 0)\n $importo_tot += ($cartResult->qta_forzato * $result->prezzo);\n else {\n $importo_tot += ($cartResult->qta * $result->prezzo);\n }\n } else {\n $importo_tot += $cartResult->importo_forzato;\n }\n }\n $results[$numResult]['cart']['qta_tot'] = $qta_tot;\n $results[$numResult]['cart']['importo_tot'] = $importo_tot;\n } \n else {\n $results[$numResult]['cart']['qta_tot'] = 0;\n $results[$numResult]['cart']['importo_tot'] = 0;\n }\n\n /*\n * Promotions\n */\n $where_promotion = ['ProdGasArticlesPromotions.organization_id' => $result['article']['organization_id'],\n 'ProdGasArticlesPromotions.article_id' => $result['article']['id']];\n $prodGasArticlesPromotionsResults = $prodGasArticlesPromotionsTable->find()\n ->where($where_promotion)\n ->first();\n if($debug) debug($where_promotion);\n if($debug) debug($prodGasArticlesPromotionsResults);\n\n $results[$numResult]['promotion'] = $prodGasArticlesPromotionsResults;\n }\n } // if($results)\n \n if($debug) debug($results);\n\n return $results;\n }", "public function retrieveOrders() {\r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n global $wpdb;\r\n \r\n $query = \"SELECT ID FROM {$wpdb->prefix}posts WHERE profaktura_status = %d AND post_type = %s ORDER BY post_date DESC\";\r\n \r\n $sql = $wpdb->prepare($query, [0, 'shop_order']);\r\n \r\n $dbOrdersProStatZero = $wpdb->get_results($sql);\r\n \r\n $allOrders = $client->get('orders');\r\n \r\n $orders = [];\r\n \r\n if (count($allOrders) > 0 && count($dbOrdersProStatZero) > 0) {\r\n foreach ($allOrders as $o) {\r\n foreach ($dbOrdersProStatZero as $d) {\r\n if ($o->id == $d->ID) {\r\n $orders[] = $o;\r\n continue;\r\n }\r\n }\r\n } \r\n }\r\n \r\n if (count($orders) < 1) {\r\n return new WP_REST_Response(['message' => 'No orders found!']);\r\n }\r\n \r\n return new WP_REST_Response($orders);\r\n }", "function orders() {\n\t \treturn $this->hook(\"/{$this->subject_slug}/v1/orders.xml?api_key={$this->api_key}\",\"order\");\n\t}", "abstract public function findBy($criteria);", "private function orders()\n {\n //$query=\"SELECT a.orderid, a.OrderNo,ordersource,b.customername,a.customerid FROM `order` as a left join customer as b on a.customerid= b.customerid \";\n\t\t\t$query=\"SELECT a.*,b.customername from `order` as a left join customer as b on a.customerid= b.customerid \";\n\t\t\t$r = $this->mysqli->query($query) or die($this->mysqli->error.__LINE__);\n\t\t\tif($r->num_rows > 0)\n {\n\t\t\t\t$result = array();\n\t\t\t\twhile($row = $r->fetch_assoc()){\n\t\t\t\t\t$result[] = $row;\n\t\t\t\t }\n \n\t\t\t $this->response($this->json($result), 200); // send user details\n }\n\t\t}", "function getAllOrders()\n {\n $database = new Database();\n\n $conn = $database->getConnection();\n\n $stmt = $conn->prepare(\"SELECT * FROM mfqgkhncw3r34ada.orders INNER JOIN mfqgkhncw3r34ada.order_details ON mfqgkhncw3r34ada.orders.ID=mfqgkhncw3r34ada.order_details.orders_ID ORDER BY mfqgkhncw3r34ada.orders.TOTAL_PRICE DESC\");\n\n $stmt->execute();\n\n $result = $stmt->get_result();\n\n if (!$result) {\n echo \"assume there is an error in SQL statement\";\n exit;\n }\n\n if ($result->num_rows == 0) {\n return null;\n } else {\n\n $order_array = array();\n\n while ($user = $result->fetch_assoc()) {\n array_push($order_array, $user);\n }\n return $order_array;\n }\n }", "public function findBy($criteria);", "public function findBy($criteria);", "public function index()\n {\n $data = request()->all();\n\n if(!empty($data['per_page'])){\n $this->perPage = $data['per_page'];\n }\n\n if(!empty($data['page'])){\n $this->page = $data['page'];\n }\n\n\n if(!empty($data['with'])){\n $with = explode(',', $data['with']);\n $orders = Orders::with($with);\n }else{\n $orders = Orders::query();\n }\n if(!empty($data['id'])){\n $orders->where('id', '=', $data['id']);\n }\n\n if(!empty($data['name'])){\n $orders->where('name','LIKE',\"%{$data['name']}%\");\n }\n\n if(!empty($data['active'])){\n $orders->where('active','=', $data['active']);\n }\n\n if(!empty($data['store_id'])){\n $orders->where('store_id','=', $data['store_id']);\n }\n\n if(!empty($data['order_type_id'])){\n $orders->where('order_type_id','=', $data['order_type_id']);\n }\n\n if(!empty($data['order_history_id'])){\n $orders->where('order_history_id','=', $data['order_history_id']);\n }\n\n if(!empty($data['description'])){\n $orders->where('description','LIKE',\"%{$data['description']}%\");\n }\n\n if(!empty($data['order_by'])){\n $direction = 'asc';\n if(!empty($data['order_by_direction'])){\n $direction = $data['order_by_direction'];\n }\n $orders->orderBy($data['orderBy'], $direction);\n }\n\n $orders = $orders->paginate($this->perPage, ['*'], 'page', $this->page);\n return response([\n 'status' => 'success',\n 'data' => $orders\n ]);\n }", "public function get(array $criteria = null, array $groups = null, string $order = null): array;", "public function searchOrders(array $params) {\n $endPoint = Http::prepare('enterpriseemail/us/search.json');\n $response = json_decode(Http::send($this->apicaller, $endPoint, $params, 'GET'));\n if (!is_object($response)) {\n throw new ResponseException(__METHOD__);\n }\n return $response;\n }", "public function getAllOrdersInBasket() {\n\n $basketUser = $this->getBasketUserFromAuth();\n\n $basketDetailModel = new Application_Model_BasketDetail();\n\n $result = $basketDetailModel->getAllOrdersInBasket($basketUser);\n\n return $result;\n }", "public function show(Orders $orders)\n {\n //\n }", "public function show(Orders $orders)\n {\n //\n }", "public function show(Orders $orders)\n {\n //\n }", "public function orders_get_list() {\n\t\t $sql = <<<EOD\n\t\t SELECT\n\t\t \t{$this->wpdb->prefix}topspin_orders.id,\n\t\t \t{$this->wpdb->prefix}topspin_orders.artist_id,\n\t\t \t{$this->wpdb->prefix}topspin_orders.created_at,\n\t\t \t{$this->wpdb->prefix}topspin_orders.subtotal,\n\t\t\t{$this->wpdb->prefix}topspin_currency.currency,\n\t\t\t{$this->wpdb->prefix}topspin_currency.symbol,\n\t\t \t{$this->wpdb->prefix}topspin_orders.tax,\n\t\t \t{$this->wpdb->prefix}topspin_orders.phone,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_method_calculator,\n\t\t \t{$this->wpdb->prefix}topspin_orders.reshipment,\n\t\t \t{$this->wpdb->prefix}topspin_orders.fan,\n\t\t \t{$this->wpdb->prefix}topspin_orders.details_url,\n\t\t \t{$this->wpdb->prefix}topspin_orders.exchange_rate,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_method_code,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_firstname,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_lastname,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_lastname,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_address1,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_address2,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_city,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_state,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_postal_code,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_country,\n\t\t \t{$this->wpdb->prefix}topspin_orders.shipping_address_phone\n\t\t FROM {$this->wpdb->prefix}topspin_orders\n\t\t LEFT JOIN\n\t\t \t{$this->wpdb->prefix}topspin_currency ON {$this->wpdb->prefix}topspin_orders.currency = {$this->wpdb->prefix}topspin_currency.currency\n\t\t WHERE\n\t\t \t{$this->wpdb->prefix}topspin_orders.artist_id = '%d'\n\t\t GROUP BY\n\t\t \t{$this->wpdb->prefix}topspin_orders.id\n\t\t ORDER BY\n\t\t \t{$this->wpdb->prefix}topspin_orders.created_at DESC\nEOD;\n\t\t$ordersList = $this->wpdb->get_results($this->wpdb->prepare($sql,array($this->artist_id)));\n\t\tif(count($ordersList)) {\n\t\t\tforeach($ordersList as $key=>$order) {\n\t\t\t\t$ordersList[$key]->items_list = $this->orders_get_items_list($order->id);\n\t\t\t}\n\t\t}\n\t\treturn $ordersList;\n\t}", "public function all(array $params = [])\n {\n return $this->get('/orders.json', $params);\n }", "public function getOrderById($orderId)\n {\n $sql = <<<'EOT'\nSELECT\n `o`.`id` AS `orderID`,\n `o`.`ordernumber`,\n `o`.`ordernumber` AS `order_number`,\n `o`.`userID`,\n `o`.`userID` AS `customerID`,\n `o`.`invoice_amount`,\n `o`.`invoice_amount_net`,\n `o`.`invoice_shipping`,\n `o`.`invoice_shipping_net`,\n `o`.`ordertime` AS `ordertime`,\n `o`.`status`,\n `o`.`status` AS `statusID`,\n `o`.`cleared` AS `cleared`,\n `o`.`cleared` AS `clearedID`,\n `o`.`paymentID` AS `paymentID`,\n `o`.`transactionID` AS `transactionID`,\n `o`.`comment`,\n `o`.`customercomment`,\n `o`.`net`,\n `o`.`net` AS `netto`,\n `o`.`partnerID`,\n `o`.`temporaryID`,\n `o`.`referer`,\n o.cleareddate,\n o.cleareddate AS cleared_date,\n o.trackingcode,\n o.language,\n o.currency,\n o.currencyFactor,\n o.subshopID,\n o.dispatchID,\n cu.id AS currencyID,\n `c`.`name` AS `cleared_name`,\n `c`.`description` AS `cleared_description`,\n `s`.`name` AS `status_name`,\n `s`.`description` AS `status_description`,\n `p`.`description` AS `payment_description`,\n `d`.`name` AS `dispatch_description`,\n `cu`.`name` AS `currency_description`\nFROM\n `s_order` AS `o`\nLEFT JOIN `s_core_states` AS `s`\n ON (`o`.`status` = `s`.`id`)\nLEFT JOIN `s_core_states` AS `c`\n ON (`o`.`cleared` = `c`.`id`)\nLEFT JOIN `s_core_paymentmeans` AS `p`\n ON (`o`.`paymentID` = `p`.`id`)\nLEFT JOIN `s_premium_dispatch` AS `d`\n ON (`o`.`dispatchID` = `d`.`id`)\nLEFT JOIN `s_core_currencies` AS `cu`\n ON (`o`.`currency` = `cu`.`currency`)\nWHERE\n `o`.`id` = :orderId\nEOT;\n\n return $this->db->fetchRow($sql, ['orderId' => $orderId]);\n }", "public function findBy(array $criteria);", "protected function getAllOrders()\n {\n return Order::withTrashed()\n ->with(['address', 'user'])\n ->orderBy('id', 'DESC')\n ->get();\n }", "private function _getArticlesByOrderId($user, $organization_id, $orderResults) {\n\n $results = [];\n\n $articlesOrdersTable = TableRegistry::get('ArticlesOrders');\n \n\n /*\n * articoli associati all'ordine \n */\n $articlesOrdersTable = $articlesOrdersTable->factory($user, $organization_id, $orderResults);\n $articlesOrdersTable->addBehavior('GdxpArticleOrders');\n\n if($articlesOrdersTable!==false) {\n\n $where = [];\n $where['ArticlesOrders'] = [$articlesOrdersTable->getAlias().'.organization_id' => $orderResults->organization_id,\n $articlesOrdersTable->getAlias().'.order_id' => $orderResults->id,\n /*\n * prendo solo articoli acquistati\n */\n $articlesOrdersTable->getAlias().'.qta_cart > ' => 0\n ]; \n\n $options = [];\n $options['sort'] = [];\n $options['limit'] = Configure::read('sql.no.limit');\n $results = $articlesOrdersTable->gets($user, $organization_id, $orderResults, $where, $options=[]);\n }\n\n // debug($results);\n return $results;\n }", "public function findBy(array $where = []);", "public function getIndex(Request $request)\n {\n $query = Order::whereRaw('1=1');\n\n if ($request->has('filter')) {\n $filters = array_filter($request->input('filter'), 'strlen');\n\n foreach ($filters as $filter_name => $filter_value) {\n switch ($filter_name) {\n case 'search':\n $query->where($filters['search_column'], 'like', '%'.$filter_value.'%');\n break;\n\n case 'date_from':\n $query->where('created_at', '>', $filter_value);\n break;\n\n case 'date_to':\n $query->where('created_at', '<', $filter_value);\n break;\n\n case 'tool_id':\n $query->whereHas('items', function ($sub_query) use ($filter_value) {\n $sub_query->where('tool_id', $filter_value);\n });\n break;\n\n case 'tool_category_id':\n $query->whereHas('items.tool', function ($sub_query) use ($filter_value) {\n $sub_query->where('tool_category_id', $filter_value);\n });\n break;\n\n case 'total_price':\n $query->where('total_price', $filters['price_comparison_sign'], $filter_value);\n break;\n\n case 'payment_type':\n $query->where('payment_type', $filter_value);\n break;\n\n case 'currency':\n $query->where('currency', $filter_value);\n break;\n\n case 'order_status_id':\n $query->where('order_status_id', $filter_value);\n break;\n\n default:\n continue 2;\n }\n }\n }\n\n $query->orderBy('created_at', 'desc');\n\n if ($request->has('print_pdf')) {\n return @PDF::loadView('admin::pdf.orders', ['orders' => $query->get()])->download('orders.pdf');\n }\n\n $orders = $query->paginate(15);\n\n return view('admin::orders.index', compact('orders'));\n }", "public function _getFilter($where=null,$attrib=null,$orders=null){\n try{\n //if($where['eid']=='' || $where['oid']=='') return false;\n $select = $this->_db->select();\n if ($attrib=='') $select->from(\"lista_entregable_detalle\");\n else $select->from(\"lista_entregable_detalle\",$attrib);\n foreach ($where as $atri=>$value){\n $select->where(\"$atri = ?\", $value);\n }\n if ($orders<>null || $orders<>\"\") {\n if (is_array($orders))\n $select->order($orders);\n }\n $results = $select->query();\n $rows = $results->fetchAll();\n //print_r($results);\n if ($rows) return $rows;\n return false;\n }catch (Exception $e){\n print \"Error: Read Filter competencia \".$e->getMessage();\n }\n }", "public function show(orders $orders)\n {\n //\n }", "public function getOrdersAll()\n {\n $data = DB::table('orders')\n ->select(\n 'orders.id',\n 'orders.room_id',\n 'orders.user_id',\n 'users.name',\n 'rooms.room_name',\n DB::raw('date_format(orders.check_in, \"%e %M %Y\") as check_in'),\n DB::raw('date_format(orders.check_out, \"%e %M %Y\") as check_out'),\n 'orders.message',\n 'orders.status')\n ->join('rooms', 'room_id', 'rooms.id')\n ->join('users', 'user_id', 'users.id')\n ->get();\n\n return response()->json($data);\n }", "public function getOpenOrders(): array;" ]
[ "0.66474754", "0.6312737", "0.6261412", "0.61544096", "0.6093473", "0.6087433", "0.6077853", "0.6017852", "0.59962535", "0.5873788", "0.5867474", "0.58246213", "0.58217263", "0.57930475", "0.57501346", "0.57338935", "0.5728867", "0.5726951", "0.57187754", "0.5705568", "0.57024366", "0.56981534", "0.5653316", "0.5649007", "0.56426096", "0.564203", "0.5641551", "0.56212103", "0.5603763", "0.5603174", "0.5603001", "0.5601942", "0.5597719", "0.55909204", "0.5581862", "0.5581443", "0.5576747", "0.55675626", "0.5553815", "0.55534816", "0.5552181", "0.55475", "0.5546092", "0.55451787", "0.553254", "0.55312514", "0.5526926", "0.5525479", "0.55251026", "0.5522038", "0.5501422", "0.5494146", "0.5492942", "0.54824823", "0.5479993", "0.54782075", "0.54728115", "0.5466573", "0.5463699", "0.5459194", "0.54545766", "0.54461485", "0.5445062", "0.5441501", "0.5436865", "0.5436475", "0.5429527", "0.5424723", "0.5421924", "0.5418302", "0.54055405", "0.54018223", "0.5386482", "0.5383757", "0.53797543", "0.53735244", "0.5372556", "0.53667635", "0.5366734", "0.53644955", "0.53579295", "0.53579295", "0.5354837", "0.53527915", "0.5347606", "0.53453654", "0.53446144", "0.53446144", "0.53446144", "0.5342134", "0.5335977", "0.533125", "0.53260934", "0.5324762", "0.53210694", "0.5301334", "0.5300331", "0.53000385", "0.5297731", "0.5296081", "0.5295669" ]
0.0
-1
function that requests whatever url is passed to it using cURL and returns the json encoded response
function getrequest($url){ // gets cURL resource $curl = curl_init(); // Set some options - we are passing in a useragent too here curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => $url, CURLOPT_USERAGENT => 'BenGreenlineApp' )); // Send the request & save response to $resp $resp = curl_exec($curl); // Close request to clear up some resources curl_close($curl); //returns the json encoded response $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE); if($httpCode == 404) { $resp[0]= "MetroTransit API gave 404" ; }; return json_decode($resp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurl( $url )\n{\n$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n$res = curl_exec($curl); // execute\n if(curl_error($curl) ) // check for error\n {\n return false; // return false if error\n } else {\n return json_decode($res); // return json decoded\n }\ncurl_close($curl);\n}", "private function request($url) {\n\t\t$ch = curl_init();\n\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_ENCODING, 'gzip');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n \t\t$response = curl_exec($ch);\n\t\t// TODO: Some processing here\n\t\t$response = json_decode($response);\n\t\treturn $response;\n\t}", "function doCurl($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $data = json_decode(curl_exec($ch), true);\n curl_close($ch);\n return $data;\n}", "function simple_curl($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_NOBODY, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));\n $content = curl_exec($ch);\n $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n curl_close($ch);\n //echo $content;\n return $content;\n}", "function curl_function($url){\n\t$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, $url);\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n$output = curl_exec($ch);\necho curl_error($ch);\ncurl_close($ch);\n \n//$searchResponse = json_decode($output,true);\n return $output;\n\t\n\t}", "function curl($url) {\n\n $ch = curl_init(); // Initialising cURL\n curl_setopt($ch, CURLOPT_URL, $url); // Setting cURL's URL option with the $url variable passed into the function\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Setting cURL's option to return the webpage data\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t \t'Accept: application/json',\n\t \t'X-ELS-APIKey: 82b47f24bf707a447d642d170ae6e318'\n\t ));\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n return $data; // Returning the data from the function\n }", "function web_client($url) {\n $post = array();\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\n $result = curl_exec($ch);\n \n $response = json_decode($result, true);\n}", "function doCurl($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $data = json_decode(curl_exec($ch), true);\n curl_close($ch);\n return $data;\n }", "function curl($url) {\n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n $output = curl_exec($ch); \n curl_close($ch); \n return $output;\n}", "function fetch_curl($url) {\n $ch = curl_init($url); //initialize the fetch command\n //prevent automatic output to screen\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n // in case of MAMP issues\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\n $results = curl_exec($ch); //execute the fetch command\n curl_close($ch); //close curl request\n //decode JSON that is returned\n $data = json_decode($results);\n\n return $data;\n}", "function basicCurl($curlURL) {\n $url = $curlURL;\n $cURL = curl_init();\n curl_setopt($cURL, CURLOPT_URL, $url);\n curl_setopt($cURL, CURLOPT_HTTPGET, true);\n curl_setopt($cURL, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Accept: application/json'\n ));\n curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($cURL, CURLOPT_USERAGENT, \"spider\");\n $result = curl_exec($cURL);\n \nif ($result === FALSE) {\n return \"cURL Error: \" . curl_error($cURL);\n} else {\n\treturn $result;\n}\n curl_close($cURL);\n \n}", "function rest_get_data($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "function getCurlJSON($url) {\n\treturn json_decode( getCurl($url) );\n}", "public static function apiRequest($url){\n $handle = curl_init();\n curl_setopt($handle, CURLOPT_URL, $url);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, $url);\n curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);\n\n $output = curl_exec($handle);\n $status = curl_getinfo($handle,CURLINFO_HTTP_CODE);\n curl_close($handle);\n\n if($status != 200){\n return json_encode(\"RESOURCE NOT FOUND\");\n }\n\n return $output;\n\n }", "function curl_return($url,$json = TRUE) {\n\t\t\n\t\t$ch = curl_init($url);\t\t\n\t\t\n\t\tcurl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t$curl_result = curl_exec($ch);\n\t\t\n\t\tcurl_close($ch);\n\n\t\tif (!$json) {\n\t\t\treturn $curl_result;\n\t\t}\n\t\treturn json_decode($curl_result);\n\n\t}", "function getContents($url) {\n // $url = \"http://jayasuryapinaki.me/actions/getAllProducts.php\";\n\n // Initialize a CURL session.\n $ch = curl_init();\n\n // Return Page contents.\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n //grab URL and pass it to the variable.\n curl_setopt($ch, CURLOPT_URL, $url);\n\n //$result = curl_exec($ch);\n\n $testing = file_get_contents($url);\n\n\n // var_dump(json_decode($testing, true));\n\n $response = json_decode($testing, true);\n\n return $response;\n }", "private function curl_get($url)\n {\n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }", "function curlGet($url){\n $ch = curl_init();\n\n //setting curl options\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_URL, $url);\n /*\n Additional curl_setopt\n CURLOPT_USERAGENT \n CURLOPT_HTTPHEADER\n */\n $result = curl_exec($ch);\n \n //$httpResponse = curl_getinfo($ch,CURLINFO_HTTP_CODE);\n //echo $httpResponse;\n\n curl_close($ch);\n return $result;\n }", "function curl_URL_call($url){\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t$output = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $output;\n}", "public function Curl($url) {\n\t\t$session = curl_init($url);\n curl_setopt($session, CURLOPT_HEADER, false);\n curl_setopt($session, CURLOPT_RETURNTRANSFER, true);\n $json = curl_exec($session);\n curl_close($session);\n\t\t\n\t\t$data = json_decode($json);\n\t\treturn $data;\n\t}", "public function get($url){\n $curlSession = curl_init();\n curl_setopt($curlSession, CURLOPT_URL, $url);\n curl_setopt($curlSession, CURLOPT_BINARYTRANSFER, true);\n curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curlSession, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curlSession, CURLOPT_SSL_VERIFYHOST, false);\n\n $output = utf8_decode(curl_exec($curlSession));\n $response = json_decode($output);\n curl_close($curlSession);\n \n return $response;\n }", "function download_json($url) {\n\t// Download the webpage\n\t$ch = curl_init($url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$response = curl_exec($ch);\n\n\t// Error handling\n\tif ($response === false) {\n\t\tthrow new Exception('cURL error: ' . curl_error($ch));\n\t}\n\n\t// Parse the JSON as an associative array\n\t$json = json_decode($response, true);\n\tif (json_last_error() > 0) {\n\t\tthrow new Exception('JSON parse error #' . json_last_error());\n\t}\n\n\tcurl_close($ch);\n\treturn $json;\n}", "function httpGet($url){\n $ch = curl_init();\n\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n// curl_setopt($ch,CURLOPT_HEADER, false);\n\n $output=curl_exec($ch);\n\n curl_close($ch);\n return $output;\n}", "function getRequest($url) {\n // url to GET info for this table\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n if (curl_errno($ch)) { // Check if any error occurred\n echo 'Curl error: ' . curl_error($ch);\n }\n curl_close($ch); // close curl resource to free up system resources\n $res = json_decode($output, true); // json to array\n return $res;\n }", "public static function _call_get($url){\n $curl = curl_init();\n // Set curl opt as array\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n // No more than 30 sec on a website\n CURLOPT_TIMEOUT=>10,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_RETURNTRANSFER => true,\n ));\n // Run curl\n $response = curl_exec($curl);\n //Check for errors \n if(curl_errno($curl)){\n $errorMessage = curl_error($curl);\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log error message .\n $return = array('success'=>FALSE,'error'=>$errorMessage,'status'=>$statusCode);\n } else {\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log success\n $return = array('success'=>TRUE,'response'=>$response,'status'=>$statusCode);\n }\n //close request\n curl_close($curl);\n //Return\n return $return;\n }", "function get_data($url) {\n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function http_response($url, $opts = array()) {\n $url = preg_replace('/ /', '%20', $url);\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HEADER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_USERAGENT, \"uw_transparancy, toolserver.org wikiproject parser\");\n $output = curl_exec($ch);\n // Check for errors\n if (curl_errno($ch)) {\n wpLog(\"Curl error: \" . curl_error($ch));\n return http_response($url);\n }\n\n curl_close($ch);\n\n return $output;\n}", "function curl($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $return = curl_exec($ch);\n curl_close($ch);\n return $return;\n}", "function curl_function($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "protected function curl($url) \n {\n if ( empty($url) ) return false;\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n $data = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($data);\n }", "function get_data($url) {\n\t$ch = curl_init();\n\t$timeout = 5;\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)\");\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);\n\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\n\t$result = curl_exec($ch);\n\t$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\n\t$response = array(\n\t 'content' => $result, \n\t 'code' => $code);\n\t \n\treturn $response;\n }", "function call_url($url)\n\t{\n\t\t$ch = curl_init ($url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n\t\tcurl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, TRUE);\n\t\t$out = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\treturn $out;\n\t}", "function getPageContent($url) {\r\n // create curl variable\r\n $curl = curl_init(); \r\n // set the url\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n // return the transfer as a resource\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n // $output contains the output string\r\n $output = curl_exec($curl);\r\n // close curl resource to free up system memory\r\n curl_close($curl);\r\n // return the output of the curl\r\n return $output;\r\n}", "function gc_get_url_and_print_json( $url ) {\n header( 'Content-type: application/json' );\n $args = array(\n 'headers' => array(\n 'Authentication' => $this->api_key\n )\n );\n $response = wp_remote_get( $url, $args );\n // $http_code = wp_remote_retrieve_response_code( $response );\n echo $response['body'];\n die();\n }", "function http_get($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n //curl_setopt($ch,CURLOPT_HEADER, false); \n $output = curl_exec($ch);\n curl_close($ch);\n return $output;\n}", "function curlWrap($url, $json)\n{\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n curl_setopt($ch, CURLOPT_URL, ZDURL . $url);\n curl_setopt($ch, CURLOPT_USERPWD, ZDUSER . \"/token:\" . ZDAPIKEY);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-type: application/json'\n ));\n curl_setopt($ch, CURLOPT_USERAGENT, \"MozillaXYZ/1.0\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\n $info = curl_getinfo($ch);\n $output = curl_exec($ch);\n curl_close($ch);\n $decoded = json_decode($output);\n return $decoded;\n\n $info = curl_getinfo($ch);\n return $info;\n\n}", "function curl($url) {\n\t$ch = curl_init(); // Initialising cURL\n\tcurl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($ch, CURLOPT_URL, $url); // Setting cURL's URL option with the $url variable passed into the function\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Setting cURL's option to return the webpage data\n\t$data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n\tcurl_close($ch); // Closing cURL\n\treturn $data; // Returning the data from the function\n}", "function get_data_with_curl($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.\n curl_setopt($ch, CURLOPT_URL, $url);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n }", "function curlGet($url) {\n\t\t$ch = curl_init();\t// Initialising cURL session\n\t\t// Setting cURL options\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t$results = curl_exec($ch);\t// Executing cURL session\n\t\tcurl_close($ch);\t// Closing cURL session\n\t\treturn $results;\t// Return the results\n\t}", "function getJson($url)\n{\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_USERAGENT, 'www.paddez.com/lastfm/');\n curl_setopt($curl, CURLOPT_FAILONERROR, true);\n $response = curl_exec($curl);\n\n if($response == false || curl_errno($curl))\n {\n \t$info = curl_getinfo($curl);\n \tcurl_close($curl);\n\timagepng(errorImage(curl_error($curl)));\n\terror_log(\"Error: \".curl_error($curl));\n \tdie('Error: '.curl_error($curl));\n\n }\n\n curl_close($curl);\n return ($response);\n}", "function getDataViaCurl($url){\n\n\t// TODO: check http response 200, 404, ...etc\n\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t// option for returning data\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($curl, CURLOPT_HEADER, false);\n\t//retrieve data from curl_exec \n\t$data = curl_exec($curl);\n\t\n\tcurl_close($curl);\n\n\treturn $data;\n}", "function _http_get_json($url, array $data = null) {\n if ($data !== null)\n $url = _http_inject_url($url, $data);\n\n $response = _http_signed_request(COVER_APP, COVER_SECRET, $url);\n\n if (!$response)\n throw new Exception('No response');\n\n $data = json_decode($response);\n\n if ($data === null)\n throw new Exception('Response could not be parsed as JSON: <pre>' . htmlentities($response) . '</pre>');\n\n return $data;\n}", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n CURLOPT_SSL_VERIFYPEER => false,\n //CURLOPT_HTTPHEADER => array('Content-type: \"text/plain; charset=UTF-8\"'),\n );\n\n $ch = curl_init(); // Initialising cURL\n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n return $data; // Returning the data from the function\n }", "function fetchUrl($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 20);\n $retData = curl_exec($ch);\n curl_close($ch); \n \n return $retData;\n}", "private function _makeRequest($url){\n $process = curl_init($url);\n curl_setopt($process, CURLOPT_TIMEOUT, 30);\n curl_setopt($process, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($process, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($process, CURLOPT_SSL_VERIFYHOST, false);\n $return = curl_exec($process);\n $data = json_decode($return);\n curl_close($process);\n if ($data->id){\n return $data->id;\n }elseif($data->url){\n return $data->url;\n }else{\n return NULL;\n }\n }", "function get_content($url, $post = '') {\n $header[] = 'Content-Type: application/json';\n $header[] = \"Accept-Encoding: gzip, deflate\";\n $header[] = \"Cache-Control: max-age=0\";\n $header[] = \"Connection: keep-alive\";\n $header[] = \"Accept-Language: en-US,en;q=0.8,id;q=0.6\";\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_VERBOSE, false);\n // curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_ENCODING, true);\n curl_setopt($ch, CURLOPT_AUTOREFERER, true);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 5);\n\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36\");\n\n if ($post)\n {\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n }\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n $rs = curl_exec($ch);\n\n if(empty($rs)){\n var_dump($rs, curl_error($ch));\n curl_close($ch);\n return false;\n }\n curl_close($ch);\n return $rs;\n }", "function fetch_url ($url, $post_options = []) {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION\t,0);\n curl_setopt($ch, CURLOPT_HEADER\t\t\t,0); // DO NOT RETURN HTTP HEADERS\n curl_setopt($ch, CURLOPT_RETURNTRANSFER\t,1); // RETURN THE CONTENTS OF THE CALL\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_TIMEOUT, 9);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 3);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 9);\n curl_setopt($ch, CURLOPT_ENCODING, '');\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n}", "private function curlRequest($url)\n {\n $curl_handle=curl_init();\n curl_setopt($curl_handle, CURLOPT_URL, $url);\n curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl_handle, CURLOPT_USERAGENT, Request::header('user-agent'));\n $response = curl_exec($curl_handle);\n curl_close($curl_handle);\n return $response;\n }", "function make_curl($search_param, $url){\n \n // default header shit\n $headers = array(\"Accept: application/json\", \"Content-Type: application/json\");\n \n //step1\n $cSession = curl_init($url);\n \n //echo $search_param[\"league_name\"];\n //echo json_encode($search_param);\n\n //step2\n //curl_setopt($cSession,CURLOPT_URL, $url.\"?league_name=\".$search_param[\"league_name\"].\"&year=\".$search_param[\"year\"]);\n curl_setopt($cSession,CURLOPT_POSTFIELDS, json_encode($search_param));\n curl_setopt($cSession,CURLOPT_RETURNTRANSFER,true);\n curl_setopt($cSession,CURLOPT_HEADER, false);\n curl_setopt($cSession,CURLOPT_HTTPHEADER, $headers);\n \n //step3\n $jsonData = curl_exec($cSession);\n $err = curl_error($cSession);\n \n //step4\n curl_close($cSession);\n //echo ($jsonData);\n \n //step5\n return ($jsonData);\n}", "private function makeRequest($url)\n {\n return json_decode(file_get_contents($url));\n }", "function airtableCallByCurl($url, $headers) {\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HTTPGET, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_URL, $url);\n $entries = curl_exec($ch);\n curl_close($ch);\n $airtableResponse = json_decode($entries, TRUE);\n\n return $airtableResponse;\n}", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n );\n \n $ch = curl_init(); // Initialising cURL\n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n return $data; // Returning the data from the function\n }", "private function just_curl_get_data($url,$data)\n {\n \n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n\n }", "function curl( $url ) {\n\t$curl = curl_init( $url );\n\tcurl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $curl, CURLOPT_HEADER, 0 );\n\tcurl_setopt( $curl, CURLOPT_USERAGENT, '' );\n\tcurl_setopt( $curl, CURLOPT_TIMEOUT, 10 );\n\t$response = curl_exec( $curl );\n\tif ( 0 !== curl_errno( $curl ) || 200 !== curl_getinfo( $curl, CURLINFO_HTTP_CODE ) ) {\n\t\t$response = null;\n\t}\n\tcurl_close( $curl );\n\treturn $response;\n}", "function callApi($url) {\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt ($ch, CURLOPT_URL, $url);\n\n // Get the response and close the channel.\n $response = curl_exec ( $ch );\n\n if ($response === false) {\n echo \"Failed to \".$action.\" : \" . curl_error ( $ch );\n }\n\n curl_close($ch);\n\n return $response;\n}", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n );\n \n $ch = curl_init(); // Initialising cURL \n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL \n return $data; // Returning the data from the function \n }", "function __apiCall($url, $post_parameters = FALSE) {\n \n \t// Initialize the cURL session\n\t $curl_session = curl_init();\n\t \t\n\t // Set the URL of api call\n\t\tcurl_setopt($curl_session, CURLOPT_URL, $url);\n\t\t \n\t\t// If there are post fields add them to the call\n\t\tif($post_parameters !== FALSE) {\n\t\t\tcurl_setopt ($curl_session, CURLOPT_POSTFIELDS, $post_parameters);\n\t\t}\n\t\t \n\t\t// Return the curl results to a variable\n\t curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);\n\t\t \n\t // Execute the cURL session\n\t $contents = curl_exec ($curl_session);\n\t\t \n\t\t// Close cURL session\n\t\tcurl_close ($curl_session);\n\t\t \n\t\t// Return the response\n\t\treturn json_decode($contents);\n \n }", "function make_call($url)\n {\n echo \"API Call:<br /><textarea id='orig' rows='4' cols='150'>$url</textarea><br />\";\n $ch = curl_init();\n $timeout = 20;\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_VERBOSE, true);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\n\n $data = curl_exec($ch);\n\n if (curl_errno($ch)) {\n print curl_error($ch);\n } else {\n curl_close($ch);\n }\n echo htmlentities($data) . \"<br />\";\n return $data;\n }", "public function getResultByCurlRequest($url) {\n//\t\terror_log(\"API Call: '\".$url.\"'\");\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$result = curl_exec($ch);\n\t\tcurl_close($ch);\n//\t\terror_log(\"JSON: $result\");\n\t\treturn $result;\n\t}", "function socialtoaster_curl_to_json($url) {\n //check cURL\n if(required_functions()){\n return socialtoaster_parse_json(socialtoaster_curl($url));\n }\n }", "function pete_curl_get($url, $params){\n\t$post_params = array();\n\tforeach ($params as $key => &$val) {\n\t\tif (is_array($val)) $val = implode(',', $val);\n\t\t$post_params[] = $key.'='.urlencode($val);\n\t}\n\t$post_string = implode('&', $post_params);\n\t$fullurl = $url.\"?\".$post_string;\n\t$ch = curl_init();curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);curl_setopt($ch, CURLOPT_URL, $fullurl);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040608');\n\t$result = curl_exec($ch);curl_close($ch);\n\treturn $result;\n}", "function make_get_call($mid_url) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_HEADER, false);\n \n $output = json_decode(curl_exec($curl));\n curl_close($curl);\n \n return $output;\n }", "private static function GetWithCurl($url) {\n\t$ch = curl_init($url);\n\tcurl_setopt($ch,CURLOPT_USERAGENT,'' );\n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\n\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5);\n\tcurl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);\n\tcurl_setopt($ch,CURLOPT_MAXREDIRS,2);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$str = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $str;\n }", "public function call($url, $request = 'GET')\n {\n // Construct the URL\n $url = 'https://www.transifex.com/api/2/project/'.$this->projectSlug.$url;\n\n // Construct the command\n $cmd = 'curl -s -L -X '.$request.' --user '.$this->username.':'.$this->password.' '.$url;\n //echo $cmd.\"\\n\";\n\n // Make the call\n $rs = exec($cmd, $output);\n $output = implode(\"\\n\", $output);\n $json = json_decode($output);\n\n return $json;\n }", "public function curlGetCall( $url ) \n {\n \n try\n {\n $requestTime = date('r');\n #CURL REQUEST PROCESS-START#\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n $result = curl_exec($curl);\n }\n catch( Exception $e)\n {\n $strResponse = \"\";\n $strErrorCode = $e->getCode();\n $strErrorMessage = $e->getMessage();\n die('Connection Failure with API');\n }\n $responseArr = json_decode($result,true);\n return $responseArr;\n }", "function getCurlData($url)\n{\n$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($curl, CURLOPT_TIMEOUT, 10);\ncurl_setopt($curl, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16\");\n$curlData = curl_exec($curl);\ncurl_close($curl);\nreturn $curlData;\n}", "function get_response($url, $headers) {\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\r\n curl_setopt($ch, CURLOPT_HEADER, false);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($ch);\r\n curl_close($ch);\r\n return $response;\r\n }", "function url_get_contents ($url) {\n if (!function_exists('curl_init')){ \n die('CURL is not installed!'); //Curl will return a false bool and die here if CURL is not enabled.\n }\n $ch = curl_init(); //Return curl handle\n curl_setopt($ch, CURLOPT_URL, $url); //The URL to fetch\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //Return curl contents as opposed to dumping\n\tcurl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate,sdch'); //set encoding\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); //follow redirects\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 0); //I don't know some shit\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0\");\n\n $output = curl_exec($ch);\n\t\n\tif (FALSE === $output)\n throw new Exception(curl_error($ch), curl_errno($ch));\n\t\n curl_close($ch); //Close handle\n return $output; //Return contents\n}", "function get_rest_api($api_url = '')\n{\n try {\n // url\n $url = $api_url;\n\n // init\n $curl = curl_init();\n // execute rest\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n \n // save data \n $response = curl_exec($curl); \n\n // close connection\n curl_close($curl);\n\n return $response;\n\n } catch (\\Throwable $th) {\n //throw $th;\n }\n}", "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}", "function getData($url) {\n $ch = curl_init();\n $timeout = 5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function curl($url,$opt=[],$curl_info=false){\n $ch = curl_init();\n//2.设置URL和相应的选项\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n if(!empty($opt)){\n curl_setopt_array($ch,$opt);\n }\n//3.抓取URL并把它传递给浏览器\n $res = curl_exec($ch);\n// echo curl_getinfo($ch)['total_time'].'<br/>';\n\n if($curl_info === true){\n return curl_getinfo($ch);\n }\n //4.关闭cURL资源,并且释放系统资源\n curl_close($ch);\n return json_decode($res,true);\n}", "private static function _getJson($url)\n {\n $resource = curl_init($url);\n curl_setopt($resource, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($resource);\n curl_close($resource);\n\n return $output;\n }", "private function request($url)\n\t{\n\t\t$curl_handler = curl_init();\n\n\t\t$url = $url . \"&api_key=\" . $this->apikey;\n\n\t\tcurl_setopt($curl_handler, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl_handler, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t$response = curl_exec($curl_handler);\n\n\t\tcurl_close($curl_handler);\n\n\t\tif ($response !== false)\n\t\t{\n\t\t\treturn $response;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function get_data($url) {\n $usrpwd = 'Contact CATA for access credentials';\n $ch = curl_init();\n $timeout = 15;\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERPWD,$usrpwd);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function curlWrap($url, $json, $action)\n{\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 10 );\n\tcurl_setopt($ch, CURLOPT_URL, ZDURL.$url);\n\tcurl_setopt($ch, CURLOPT_USERPWD, ZDUSER.\"/token:\".ZDAPIKEY);\n\tswitch($action){\n\t\tcase \"POST\":\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n\t\t\tbreak;\n\t\tcase \"GET\":\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\t\tbreak;\n\t\tcase \"PUT\":\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"MozillaXYZ/1.0\");\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\t$output = curl_exec($ch);\n\tcurl_close($ch);\n\t$decoded = json_decode($output);\n\treturn $decoded;\n}", "private function getURL($url)\n\t{\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_AUTOREFERER, 1);\n\t\tcurl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\t\tcurl_setopt($ch, CURLOPT_SSLVERSION, 0);\n\t\tcurl_setopt($ch, CURLOPT_CAINFO, AKEEBA_CACERT_PEM);\n\t\tcurl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, 'reponseHeaderCallback'));\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 1);\n\n\t\t$result = curl_exec($ch);\n\n\t\t$errno = curl_errno($ch);\n\t\t$errmsg = curl_error($ch);\n\t\t$error = '';\n\t\t$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n\t\tif ($result === false)\n\t\t{\n\t\t\t$error = sprintf(\"(cURL Error %u) %s\", $errno, $errmsg);\n\t\t}\n\t\telseif (($http_status >= 300) && ($http_status <= 399) && isset($this->headers['Location']) && !empty($this->headers['Location']))\n\t\t{\n\t\t\treturn $this->getURL($this->headers['Location']);\n\t\t}\n\t\telseif ($http_status > 399)\n\t\t{\n\t\t\t$errno = $http_status;\n\t\t\t$error = sprintf('HTTP %u error', $http_status);\n\t\t}\n\n\t\tcurl_close($ch);\n\n\t\tif ($result === false)\n\t\t{\n\t\t\tthrow new \\RuntimeException($error, $errno);\n\t\t}\n\n\t\treturn $result;\n\t}", "function do_curl($url, $data_arr=NULL, $tierionHeaderArray=[])\n{\n\t$ch = curl_init($url);\n\n\t$headers = $tierionHeaderArray;\n\t// curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)');\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\n\tif ($data_arr != NULL) {\n\t\t$headers = array_merge(array('Content-Type: application/json'), $headers);\n\t\t$data_string = json_encode($data_arr);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);\n\t}\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n\tob_start(); // prevent any output\n\treturn curl_exec($ch); // Execute the Curl Command\n\tob_end_clean(); // stop preventing output\n\tcurl_close($ch);\n}", "function url_get_contents($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_URL, $url);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function curl($url) {\n\n $ch = curl_init(); // Initialising cURL\n\n $timeout = 2; // Initialise cURL timeout\n $useragent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0';\n\n curl_setopt($ch, CURLOPT_USERAGENT, $useragent);\n curl_setopt($ch, CURLOPT_URL, $url); // Setting cURL's URL option with the $url variable passed into the function\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Return the webpage data as a string\n \n // curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n // curl_setopt ($ch, CURLOPT_HEADER, 0);\n // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n // curl_setopt($ch, CURLOPT_CAINFO, 'https://'.$_SERVER['HTTP_HOST'].'/scotiabeautycom.crt');\n // curl_setopt($ch, CURLOPT_CAINFO, 'https://'.$_SERVER['HTTP_HOST'].'/cacert.pem');\n\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // Setting cURL's timeout option\n\n if (curl_exec($ch) === FALSE) {\n\n curl_exec($ch);\n \n echo '<p><strong>Curl returns FALSE.</strong></p>';\n echo '<p><strong>Curl Error:</strong> <em>'.curl_error($ch).'</em></p>';\n\n echo '<pre>';\n print_r(curl_getinfo($ch));\n echo '</pre>';\n\n } \n\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n \n return $data; // Returning the data from the function\n}", "function file_get_contents_curl($url) {\r\n $ch = curl_init();\r\n\r\n curl_setopt($ch, CURLOPT_HEADER, 0);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n\r\n $data = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n return $data;\r\n}", "function getPage($url) {\n debug($url, 'json');\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_TIMEOUT, 90);\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.5 Safari/537.17\");\n $page = curl_exec($ch);\n if (curl_errno($ch)) {\n echo '<font color=red> Database temporarily unavailable: ';\n echo curl_errno($ch) . ' ' . curl_error($ch);\n if (isDebug()) {\n echo $url;\n }\n echo '</font><br>';\n }\n curl_close($ch);\n debug(print_r($page, true), 'json');\n return $page;\n}", "public static function curlGet($url)\n {\n $ch = curl_init();\n\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n// curl_setopt($ch,CURLOPT_HEADER, false);\n\n $output=curl_exec($ch);\n\n curl_close($ch);\n return $output;\n }", "function h_GET(string $url, $data = []) {\n // if URL doesn't start with \"http\", prepend API_URL\n if (!preg_match('/^http/', $url, $matches)) {\n $url = API_URL . $url;\n }\n\n if ($data) {\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n \n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n curl_close($curl);\n\n return json_decode($result, true);\n}", "function github_request($url)\r\n{\r\n $ch = curl_init();\r\n\r\n $access = 'username:db1ff77b2eb06b3aa967e28f1943193ac831f064';\r\n\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));\r\n curl_setopt($ch, CURLOPT_USERAGENT, 'Agent smith');\r\n curl_setopt($ch, CURLOPT_HEADER, 0);\r\n curl_setopt($ch, CURLOPT_USERPWD, $access);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\r\n $output = curl_exec($ch);\r\n curl_close($ch);\r\n $result = json_decode(trim($output), true);\r\n return $result;\r\n}", "protected function curlRequest($url)\n {\n //curl_init — Initialize a cURL session (Client URL Library)\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_URL, $url);\n\n return curl_exec($curl);\n }", "function getDatafromServerUsingCurl( $rel_url )\n\t{\n\t\t$url\t = \"https://api.razorpay.com/v1/\" . $rel_url;\n\t\t$options = array(\n\t\t\tCURLOPT_URL\t\t\t => $url,\n\t\t\tCURLOPT_USERPWD\t\t => $this->password,\n\t\t\tCURLOPT_RETURNTRANSFER => true, // return web page\n\t\t\tCURLOPT_CONNECTTIMEOUT => 20, // timeout on connect\n\t\t\tCURLOPT_TIMEOUT => 120, // timeout on response\n\t\t\tCURLOPT_MAXREDIRS => 10, // stop after 10 redirects\n\t\t\tCURLOPT_SSL_VERIFYPEER => true, // enable SSL Cert checks\n\t\t\tCURLOPT_SSL_VERIFYHOST => 2,\n\t\t\tCURLOPT_SSLVERSION\t => CURL_SSLVERSION_TLSv1_2\n\t\t);\n\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt_array( $ch, $options );\n\t\t$result = curl_exec( $ch );\n\t\tif (curl_errno($ch))\n\t\t {\n\t\t\techo 'Error:' . curl_error($ch);\n\t\t }\n\t\tcurl_close( $ch );\n\t\treturn json_decode($result);\n\t}", "function get_curl($url){\n if(function_exists('curl_init')){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); \n $output = curl_exec($ch);\n echo curl_error($ch);\n curl_close($ch);\n return $output;\n }else{\n return file_get_contents($url);\n }\n\n}", "function geturl($url){\n if($url==\"\"){\n $url = \"http://www.36kr.com/\";\n }\n \n $ch = curl_init();\n\n // set the url to fetch \n curl_setopt($ch, CURLOPT_URL, $url);\n\n //return the transfer (the result of curl_exec()) as a string instead of outputing directly\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n //return the HTTP Response header using the callback function readHeader\n //curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'readHeader');\n\n // execute the curl session\n $output = curl_exec($ch);\n\n // close curl resource to free up system resources \n curl_close($ch);\n\n //the callback function used to retreive the header info\n function readHeader($ch, $string) {\n $length = strlen($string);\n //only display the headers with content\n if (trim($string) != '')\n echo \"<center>Header: $string</center><br />\\n\";\n return $length;\n }\n\n //echo \"<br /><center><b><u>BELOW this line is the content fetched from www.example.com:</u></b></center><br />\";\n return $output;\n}", "function file_get_contents_curl($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function callJsonApi($url) {\n $response = callApi($url);\n $jsonResponse = false;\n if ($response === false) {\n echo \"Failed to \".$action.\" : \" . curl_error ( $ch );\n } else {\n $jsonResponse = json_decode ( $response );\n if (! isset ( $jsonResponse->success )) {\n echo \"Failed to $url : $response\";\n } else if (! $jsonResponse->success) {\n echo \"Failed to $url : $jsonResponse->code - $jsonResponse->message\";\n }\n }\n return $jsonResponse;\n}", "function url_get_contents($Url) {\n if (!function_exists('curl_init')){ \n die('CURL is not installed!');\n }\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $Url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $output = curl_exec($ch);\n curl_close($ch);\n return $output;\n}", "function socialtoaster_curl($url) {\n $curl_handle=curl_init();\n curl_setopt($curl_handle,CURLOPT_URL,$url);\n curl_setopt($curl_handle,CURLOPT_VERBOSE,0);\n curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,10);\n curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);\n $result = curl_exec($curl_handle);\n curl_close($curl_handle);\n\n return $result;\n }", "function hb_curl($link_url)\r\n\t{\r\n\t\t$ch = curl_init(\"$link_url\");\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\t\t\r\n\t\t$output = curl_exec($ch);\r\n\t\tcurl_error($ch);\r\n\t\tcurl_close($ch);\r\n\t\treturn $output;\r\n\t}", "private function do_get_request($ch,$url,$params=array()){ \n if(is_array($params) && count($params)>0){\n $url.='?';\n foreach($params as $key=>$val){\n $url.='&'.$key.'='.urlencode($val);\n }\n }\n $ch=curl_init();\n $timeout=5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);\n $result=curl_exec($ch);\n return $result;\n }", "private function curl($url)\n {\n $data = '';\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_USERAGENT, \"PHP LiteBlogAPI v\" . $this->version);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n }", "public static function curlGET($url,$dato){\n$query = http_build_query($dato);\n$url=$url.\"?\".$query;\n$ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n $response = curl_exec($ch);\n curl_close($ch);\n if(!$response)\n {\n return false;\n }\n else\n {\n return $response;\n }\n}", "function doGet($url)\n{\n $return = curlExecute($url);\n return $return;\n}", "function doCurl ($url, $options) {\n\tglobal $adminName, $adminPass, $verbose, $doe;\n\t\n\t$options = $options +\n\t\t\t array(CURLOPT_RETURNTRANSFER => true,\n\t\t\t\t\t CURLOPT_USERPWD => $adminName . \":\" . $adminPass,\n\t\t\t\t\t CURLOPT_HTTPHEADER => array('OCS-APIRequest:true', 'Accept: application/json'),\n\t\t\t );\n\n\tif ($verbose > 2) {\n\t\t$options = $options +\n\t\t\t\t array(CURLOPT_VERBOSE => TRUE,\n\t\t\t\t\t\t CURLOPT_HEADER => TRUE\n\t\t\t\t );\n\t}\n\n\t$ch = curl_init($url);\n\n \tcurl_setopt_array( $ch, $options);\n\t\n// For use with Charles proxy:\n// \tcurl_setopt($ch, CURLOPT_PROXYPORT, '8888');\n// \tcurl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');\n// \tcurl_setopt($ch, CURLOPT_PROXY, '127.0.0.1');\n\n $response = curl_exec($ch);\n //print_r($response);\n $response = json_decode($response);\n //print_r($response);\n\n $statuscode = $response->{'ocs'}->{'meta'}->statuscode;\n\n \n if($statuscode != \"100\"){\n echo $statuscode;\n echo $response->{'ocs'}->{'meta'}->message;\n return $statuscode;\n exit(1);\n }\n\n if($response === false) {\n echo 'Curl error: ' . curl_error($ch) . \"\\n\";\n\t\texit(1);\n\t}\n\t\n\tcurl_close($ch);\n \n\t/* An error causes an exit\n\tif (preg_match(\"~<statuscode>(\\d+)</statuscode>~\", $response, $matches)) {\n $responseCode = $matches[1]; // what's the status code\n //echo $matches[3];\n //echo \"<h3>\" . $response . \"</h3>\";\n if ($responseCode == '404') {\n return \"2\";\n exit(2);\n } elseif ($responseCode != '100') {\n echo \"1Error response code; exiting\\n$response\\n\";\n\t\t\texit(1);\n\t\t}\n\t}\n\telse { // something is definitely wrong\n echo \"No statuscode response; exiting:\\n$response\\n\";\n \n\t\texit(1);\n\t}\n */\n\t// What sort of response do we want to give\n//\tif ($verbose == 1) { echo \"Response code from server: $responseCode\\n\"; }\n\t//if ($verbose == 1) { echo \"\\n\"; }\n\t//if ($verbose > 1) { echo \"Response from server:\\n$response\\n\\n\"; }\n\n\treturn $response;\n}", "private function sendCurl($url) {\n $handle = curl_init();\n $opts = curl_setopt_array($handle, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'https://' . $url . \"&method=CURL\",\n CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $this->payload\n ));\n // Send the request & save response to $resp\n $exec = curl_exec($handle);\n // Close request to clear up some resources\n $close = curl_close($handle);\n\n //$json_array = json_decode($exec, TRUE);\n\n if($this->testing) echo \"<hr /><h1>JSON RESPONSE:</h1><br />$exec <hr />\";\n }" ]
[ "0.7720324", "0.74984884", "0.7498166", "0.7485744", "0.7449741", "0.74355775", "0.7363466", "0.72981375", "0.71837544", "0.717369", "0.71515626", "0.70993507", "0.7052525", "0.7037627", "0.7036808", "0.69671476", "0.696463", "0.6962168", "0.6957833", "0.69276434", "0.69203883", "0.6920042", "0.6914453", "0.6906203", "0.69015753", "0.68984437", "0.68951106", "0.6889687", "0.6882303", "0.68813545", "0.6877007", "0.68741614", "0.6864658", "0.68616295", "0.68317485", "0.68315786", "0.6830476", "0.68152404", "0.68139625", "0.68132204", "0.68106675", "0.68051666", "0.67955375", "0.67940694", "0.67910475", "0.6790713", "0.67671746", "0.67641735", "0.675508", "0.67506886", "0.67449415", "0.6736771", "0.6731946", "0.67223006", "0.67018944", "0.66897446", "0.66862744", "0.6684554", "0.66808105", "0.66727984", "0.666743", "0.6643445", "0.6641122", "0.66225445", "0.6613827", "0.6605898", "0.65935254", "0.6572612", "0.65630895", "0.65614617", "0.65516335", "0.6542492", "0.65385544", "0.6537567", "0.6535015", "0.65299505", "0.65258497", "0.65236855", "0.65164614", "0.6515963", "0.65122557", "0.6507438", "0.6506627", "0.6502641", "0.64991266", "0.6485157", "0.6485013", "0.6484196", "0.64776635", "0.647098", "0.6469857", "0.6465426", "0.6457797", "0.6455981", "0.6450211", "0.6450151", "0.6440025", "0.64348525", "0.6432869", "0.64321077" ]
0.7485074
4
This function builds the header and the content. HEADER The header comes from $this>header If the header is a split header (more than one row), ($this>has_split_header()) Then the header object is an array of rows. Each row is an array of objects. Each object has colCount and content as properties $this>header = array($row0 = array(new stdClass(colCount, content), new stdClass(colCount, content)),$row1 = array(...)) Else the header is an array of TH CONTENTS BODY The body comes from $this>data $this>data is an array or rows $this>data = array(row0, row1, row2.....) Each row is an array or cells. $row0 = array(cell0, cell1, cell 2) If cell is an object Then it will take the colspan, content and class properties and create a cell with these Else its a string Its JUST the html content of the TD
function perform_export() { global $CFG; require_once($CFG->dirroot.'/blocks/bcgt/lib.php'); global $CFG, $USER; $name = preg_replace("/[^a-z 0-9]/i", "", $this->get_name()); ob_clean(); header("Pragma: public"); header('Content-Type: application/vnd.ms-excel; charset=utf-8'); header('Content-Disposition: attachment; filename="'.$name.'.xlsx"'); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private", false); require_once $CFG->dirroot . '/blocks/bcgt/lib/PHPExcel/Classes/PHPExcel.php'; $objPHPExcel = new \PHPExcel(); $objPHPExcel->getProperties() ->setCreator(fullname($USER)) ->setLastModifiedBy(fullname($USER)) ->setTitle($this->get_name()) ->setSubject($this->get_name()) ->setDescription($this->get_description()); // Remove default sheet $objPHPExcel->removeSheetByIndex(0); $sheetIndex = 0; // Set current sheet $objPHPExcel->createSheet($sheetIndex); $objPHPExcel->setActiveSheetIndex($sheetIndex); $objPHPExcel->getActiveSheet()->setTitle("Report"); $rowNum = 1; // Headers if(isset($this->header)) { if(!$this->has_split_header()) { $col = 0; foreach($this->header AS $head) { $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $head); $col++; } $rowNum++; } else { //foreach row foreach($this->header AS $row) { $col = 0; foreach($row AS $rowObj) { $columnCount = $rowObj->colCount; $columnContent = $rowObj->content; //add all the cells, //thenmerge $startCol = $col; for($i=0;$i<$columnCount;$i++) { if($i == 0) { $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $columnContent); } else { $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, ''); } $col++; } $endCol = $col; if($columnCount != 1) { $objPHPExcel->getActiveSheet()->mergeCells(''.PHPExcel_Cell::stringFromColumnIndex($startCol). ''.$rowNum.':'.PHPExcel_Cell::stringFromColumnIndex($endCol - 1).''.$rowNum); } } $rowNum++; } } } //data if(isset($this->data)) { foreach($this->data AS $data) { $col = 0; foreach($data AS $cell) { if(is_a($cell, 'stdClass')) { $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $this->build_excell_cell($cell)); $objPHPExcel->getActiveSheet()->getStyle(''.PHPExcel_Cell::stringFromColumnIndex($col).''.$rowNum)->applyFromArray( array( 'fill' => array( 'type' => PHPExcel_Style_Fill::FILL_SOLID, 'color' => $this->get_excell_cell_color($cell) ), 'borders' => array( 'outline' => array( 'style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('rgb'=>'cfcfcf') ) ) ) ); if(isset($cell->colspan) && $cell->colspan > 1) { $objPHPExcel->getActiveSheet()->mergeCells(''.PHPExcel_Cell::stringFromColumnIndex($col). ''.$rowNum.':'.PHPExcel_Cell::stringFromColumnIndex($col + ($cell->colspan - 1)).''.$rowNum); $col = $col + ($cell->colspan - 1); } } else { $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $cell); } $col++; } $rowNum++; } } // Freeze rows and cols (everything to the left of D and above 2) $objPHPExcel->getActiveSheet()->freezePane($this->get_frozen_panes()); // End $objPHPExcel->setActiveSheetIndex(0); $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); ob_clean(); $objWriter->save('php://output'); exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function buildHeader()\n {\n $month_name = $this->monthLabels[$this->month - 1] . ' ' . $this->year;\n $vclass = strtolower($this->view);\n $h = \"<table class='\" . $this->tableClass . \" \" . $vclass . \"'>\";\n $h .= \"<thead>\";\n $h .= \"<tr class='\" . $this->headClass . \"'>\";\n $cs = 5;\n if ($this->view == 'week' || $this->view == 'day') {\n $h .= \"<th>&nbsp;</th>\";\n }\n if ($this->view == 'day') {\n $cs = 1;\n }\n\n if ($this->nav) {\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->prevClass . \"' href='\" . $this->prevLink() . \"'>\" . $this->prevIco . \"</a>\";\n $h .= \"</th>\";\n $h .= \"<th colspan='$cs'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->nextClass . \"' href='\" . $this->nextLink() . \"'>\" . $this->nextIco . \"</a>\";\n $h .= \"</th>\";\n } else {\n $h .= \"<th colspan='7'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n }\n $h .= \"</tr>\";\n $h .= \"</thead>\";\n\n $h .= \"<tbody>\";\n if ($this->view != 'day' && $this->view != 'week') {\n $h .= \"<tr class='\" . $this->labelsClass . \"'>\";\n\n for ($i = 0; $i <= 6; $i++) {\n $h .= \"<td>\";\n $h .= $this->dayLabels[$i];\n $h .= \"</td>\";\n }\n\n $h .= \"</tr>\";\n }\n if ($this->view == 'day' || $this->view == 'week') {\n $h .= self::getWeekDays();\n }\n\n $this->html .= $h;\n }", "private function render_data()\n\t{\n\t\t// create if the headers exists\n\t\t// 2 header style table\n\t\tif(count($this->headers) == 2 && isset($this->headers[0][0]) && isset($this->headers[1][0]) )\n\t\t{\n\t\t\t// generate the column headers\n\t\t\t$html = '<tr><th></th>';\n\t\t\tforeach($this->headers[0] as $header)\n\t\t\t\t$html .= \"<th>$header</th>\";\n\t\t\t$html .= '</tr>';\n\t\t\t\n\t\t\t// generate the row headers and the data\n\t\t\tfor($i=0; $i<count($this->headers[1]); $i++)\n\t\t\t{\n\t\t\t\t// the header\n\t\t\t\t$html .= \"<tr><th>{$this->headers[1][$i]}</th>\";\n\t\t\t\t\n\t\t\t\t// and now the data\n\t\t\t\tforeach($this->data[$i] as $datum)\n\t\t\t\t\t$html .= \"<td>$datum</td>\";\n\t\t\t\t\n\t\t\t\t$html .= '</tr>';\n\t\t\t}\n\t\t\treturn $html;\n\t\t}//end if\n\t\t\n\t\t// 1 header style table\n\t\tif(count($this->headers) > 0 && isset($this->headers[0]) && !is_array($this->headers[0]) )\n\t\t{\n\t\t\t// generate the column headers\n\t\t\t$html = '<tr>';\n\t\t\tforeach($this->headers as $header)\n\t\t\t\t$html .= \"<th>$header</th>\";\n\t\t\t$html .= '</tr>';\n\t\t\t\n\t\t\t// generate the data\n\t\t\tfor($i=0; $i<count($this->data); $i++)\n\t\t\t{\n\t\t\t\tforeach($this->data[$i] as $datum)\n\t\t\t\t\t$html .= \"<td>$datum</td>\";\n\t\t\t\t\n\t\t\t\t$html .= '</tr>';\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}//end if\n\t\t\n\t\treturn '';\n\t}", "private function buildHeader()\n\t{\n\t\tif ($this->hide_header)\n\t\t\treturn;\n\n\t\techo '<thead><tr>';\n\n\t\t// Get field names of result\n\t\t$headers = $this->_db->fieldNameArray($this->result);\n\t\t$this->column_count = count($headers);\n\n\t\t// Add a blank column if the row number is to be shown\n\t\tif ($this->show_row_number)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header\">&nbsp;</td>';\n\t\t}\n\n\t\t// Show checkboxes\n\t\tif ($this->show_checkboxes)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header tbl-checkall\"><input type=\"checkbox\" name=\"checkall\" onclick=\"tblToggleCheckAll'.$this->_clsnumber.'()\"></td>';\n\t\t}\n\n\t\t// Loop through each header and output it\n\t\tforeach ($headers as $t)\n\t\t{\n\t\t\t// Skip column if hidden\n\t\t\tif (in_array($t, $this->hidden))\n\t\t\t{\n\t\t\t\t$this->column_count--;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check for header caption overrides\n\t\t\tif (array_key_exists($t, $this->header))\n\t\t\t\t$header = $this->header[$t];\n\t\t\telse\n\t\t\t\t$header = $t;\n\n\t\t\tif ($this->hide_order)\n\t\t\t\techo '<td class=\"tbl-header\">' . $header; // Prevent the user from changing order\n\t\t\telse {\n\t\t\t\tif ($this->order and $this->order['Column'] == $t)\n\t\t\t\t\t$order = ($this->order['Order'] == self::ORDER_ASC)\n\t\t\t\t\t? self::ORDER_DESC\n\t\t\t\t\t: self::ORDER_ASC;\n\t\t\t\telse\n\t\t\t\t\t$order = self::ORDER_ASC;\n\n\t\t\t\techo '<td class=\"tbl-header\"><a href=\"javascript:;\" onclick=\"tblSetOrder'.$this->_clsnumber.'(\\'' . $t . '\\', \\'' . $order . '\\')\">' . $header . \"</a>\";\n\n\t\t\t\t// Show the user the order image if set\n\t\t\t\tif ($this->order and $this->order['Column'] == $t)\n\t\t\t\t\techo '&nbsp;<img src=\"images/sort_' . strtolower($this->order['Order']) . '.gif\" class=\"tbl-order\">';\n\t\t\t}\n\n\t\t\t// Add filters if allowed and only if the column type is not \"special\"\n\t\t\tif ($this->allow_filters and !empty($t)){\n\t\t\t\t\t\n\t\t\t\tif (!in_array($this->type[$t][0], array(\n\t\t\t\t\t\tself::TYPE_ARRAY,\n\t\t\t\t\t\tself::TYPE_IMAGE,\n\t\t\t\t\t\tself::TYPE_FUNCTION,\n\t\t\t\t\t\tself::TYPE_DATE,\n\t\t\t\t\t\tself::TYPE_CHECK,\n\t\t\t\t\t\tself::TYPE_CUSTOM,\n\t\t\t\t\t\tself::TYPE_PERCENT\n\t\t\t\t)))\n\t\t\t\t{\n\t\t\t\t\tif ($this->filter['Column'] == $t and !empty($this->filter['Value']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$filter_display = 'block';\n\t\t\t\t\t\t$filter_value = $this->filter['Value'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$filter_display = 'none';\n\t\t\t\t\t\t$filter_value = '';\n\t\t\t\t\t}\n\t\t\t\t\techo '<a href=\"javascript:;\" onclick=\"tblShowHideFilter'. $this->_clsnumber .'(\\'' . $t . '\\')\"> filter </a>\n\t\t\t\t\t<br><div class=\"tbl-filter-box\" id=\"'.$this->_clsnumber.'filter-' . $t . '\" style=\"display:' . $filter_display . '\">\n\t\t\t\t\t<input type=\"text\" size=\"6\" id=\"'.$this->_clsnumber.'filter-value-' . $t . '\" value=\"'.$filter_value.'\">&nbsp;\n\t\t\t\t\t<a href=\"javascript:;\" onclick=\"tblSetFilter'.$this->_clsnumber.'(\\'' . $t . '\\')\">filter</a></div>';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\n\t\t\techo '</td>';\n\t\t}\n\n\t\t// If we have controls, add a blank column\n\t\tif (count($this->controls) > 0)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header\">&nbsp;</td>';\n\t\t}\n\n\t\techo '</tr></thead>';\n\t}", "public function makeTable($header, $data) {\n $this->SetFillColor(255, 0, 0);\n $this->SetTextColor(255);\n $this->SetDrawColor(128, 0, 0);\n $this->SetLineWidth(.3);\n $this->SetFont('', 'B');\n // Header\n $w = array(10, 25, 40, 10, 25, 15, 60, 10, 10, 10, 10, 10, 10, 10, 10, 10);\n for ($i = 0; $i < count($header); $i++)\n if ($i == 0) {\n $this->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);\n } else {\n $this->Cell($w[$i], 7, $header[$i], 1, 0, 'L', true);\n }\n $this->Ln();\n // Color and font restoration\n $this->SetFillColor(224, 235, 255);\n $this->SetTextColor(0);\n $this->SetFont('');\n // Data\n $fill = false;\n\n foreach ($data as $row) {\n $this->nr++;\n $this->Cell($w[0], 6, $this->nr, 'LR', 0, 'C', $fill);\n $this->Cell($w[1], 6, $row['article'], 'LR', 0, 'L', $fill);\n $this->Cell($w[2], 6, $row['brand'], 'LR', 0, 'L', $fill);\n $this->Cell($w[3], 6, $row['inch'], 'LR', 0, 'L', $fill);\n $this->Cell($w[4], 6, $row['size'], 'LR', 0, 'L', $fill);\n $this->Cell($w[5], 6, $row['lisi'], 'LR', 0, 'L', $fill);\n $this->Cell($w[6], 6, $row['design'], 'LR', 0, 'L', $fill);\n $this->Cell($w[7], 6, $row['onhand'], 'LR', 0, 'C', $fill);\n $this->Cell($w[8], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[9], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[10], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[11], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[12], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[13], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[14], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[15], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Ln();\n $fill = !$fill;\n }\n // Closing line\n $this->Cell(array_sum($w), 0, '', 'T');\n }", "private function getHeaders(){\n\t\t$thead=\"\";\n\t\tif(!empty($this->headers)){\n\t\t\t$thead=\"<thead>\";\n\t\t\t$thead.=\"<tr>\";\n\t\t\t$headerNumber=0;\n\t\t\t$fieldNumber=0;\n\t\t\t$count=count($this->headers)-1;\n\t\t\t\n\t\t\t//Busca si hay columnas anteriores a agregar\n\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t$thead.=\"<th>{$col[\"header\"]}</th>\";\n\t\t\t\t\t$headerNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Busca las columnas declaradas\n\t\t\tforeach($this->headers as $name){\n\t\t\t\tif($this->headerSortable){\n\t\t\t\t\tif($this->order!==\"\"&&!empty($this->order)){\n\t\t\t\t\t\t$order=explode('|',$this->order);\n\t\t\t\t\t\tif(is_array($order)&&$fieldNumber==$order[0]){\n\t\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-\".$order[1];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-both\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-both\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$thead.=\"<th {$this->id}-column-header class=\\\"$classSortable\\\" onclick=\\\"javascript:{$this->id}Reorder($fieldNumber);\\\" {$this->id}_field_number=\\\"$fieldNumber\\\">$name</th>\";\n\t\t\t\t}else{\n\t\t\t\t\t$thead.=\"<th {$this->id}-column-header>$name</th>\";\n\t\t\t\t}\n\t\t\t\t$fieldNumber++;\n\t\t\t\t$headerNumber++;\n\t\t\t}\n\t\t\t\n\t\t\t//Busca si hay columnas posteriores a agregar\n\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t$thead.=\"<th>{$col[\"header\"]}</th>\";\n\t\t\t\t\t$headerNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$thead.=\"</tr>\";\n\t\t\t\n\t\t\t//Guardamos el numero total de columnas\n\t\t\t$this->cols=$headerNumber;\n\t\t\t\n\t\t\t\n\t\t\t$tfilter=\"\";\n\t\t\t$type=\"\";\n\t\t\tif($this->headerFilterable){\n\t\t\t\t$cols=count($this->fields)-1;\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<=$cols;$i++){\n\t\t\t\t\t$meClass=velkan::$config[\"datagrid\"][\"filters\"][\"inputClass\"];\n\t\t\t\t\t\n\t\t\t\t\t$type=\"\";\n\t\t\t\t\tif(!empty($this->types)){\n\t\t\t\t\t\t$type=$this->types[$i];\n\t\t\t\t\t}\n\t\t\t\t\t$value=\"\";\n\t\t\t\t\tif(!empty($this->filters)){\n\t\t\t\t\t\tforeach($this->filters as $filter){\n\t\t\t\t\t\t\tif($filter[0]==$i){\n\t\t\t\t\t\t\t\t$value=$filter[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$tfilter.=\"<th class='velkan-grid-column-filter'>\";\n\t\t\t\t\t\n\t\t\t\t\tswitch($type){\n\t\t\t\t\t\tcase \"date\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_DATE));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"datetime\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_DATETIME));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"time\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_TIME));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$tfilter.=\"<input type='search' name='grid{$this->id}Filter[]' $type value=\\\"$value\\\">\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$tfilter.=\"</th>\";\n\t\t\t\t}\n\t\t\t\t$display=($this->ShowFilters?\"\":\"style='display:none'\");\n\t\t\t\t\n\t\t\t\t$filterPrepend=\"\";\n\t\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t\t$filterPrepend.=\"<th>&nbsp;</th>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$filterAppend=\"\";\n\t\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t\t$filterAppend.=\"<th>&nbsp;</th>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tfilter=\"<tr id='grid{$this->id}Filters' $display>{$filterPrepend}{$tfilter}{$filterAppend}</tr>\";\n\t\t\t}\n\t\t\t\n\t\t\tif($type!=\"\"){\n\t\t\t\t$jss=new generalJavaScriptFunction();\n\t\t\t\t$jss->registerFunction(\"applyFormats\");\n\t\t\t}\n\t\t\t\n\t\t\t$thead.=\"$tfilter</thead>\";\n\t\t}\n\t\t\n\t\treturn $thead;\n\t}", "public static function create_table_head()\n\t{\n\t\t\n\t\tif (!static::$columns)\n\t\t{\n\t\t\treturn static::$template['wrapper_start'].'<tr><th>No columns config</th></tr>'.static::$template['wrapper_end'];\n\t\t}\n\n\t\t$table_head = static::$template['wrapper_start'];\n\t\t$table_head .= '<tr>';\n\t\t\n\t\tforeach(static::$columns as $column)\n\t\t{\n\t\t\t$sort_key \t= (is_array($column) ? isset($column[1]) ? $column[1] : strtolower($column[0]) : $column);\n\t\t\t$col_attr\t= (is_array($column) && isset($column[2]) ? $column[2] : array());\n\t\t\t\n\t\t\t$new_direction = static::$direction;\n\t\t\t\n\t\t\tif(static::$sort_by == $sort_key)\n\t\t\t{\n\t\t\t\t$active_class_name = static::$template['col_class_active'].' '.static::$template['col_class_active'].'_'.$new_direction;\n\t\t\t\tif(isset($col_attr['class']))\n\t\t\t\t{\n\t\t\t\t\t$col_attr['class'] .= ' '.$active_class_name;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$col_attr['class'] = $active_class_name;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$new_direction = (static::$direction == 'asc' ? 'desc' : 'asc');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(is_array($column) && (!isset($column[1]) || isset($column[1]) && $column[1] !== false)){\n\t\t\t\t\n\t\t\t\t$url \t\t\t= rtrim(static::$base_url, '/').(static::$current_page ? '/'.static::$current_page : '');\n\t\t\t\t$url \t\t\t.= '/'.$sort_key.static::$uri_delimiter.$new_direction;\n\t\t\t\t\n\t\t\t\t$cell_content \t= rtrim(static::$template['link_start'], '> ').' href=\"'.$url.'\">';\n\t\t\t\t$cell_content \t.= $column[0];\n\t\t\t\t$cell_content \t.= static::$template['link_end'];\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tif(is_array($column))\n\t\t\t\t{\n\t\t\t\t\t$column = $column[0];\n\t\t\t\t}\n\t\t\t\t$cell_content = static::$template['nolink_start'].$column.static::$template['nolink_end'];\t\n\t\t\t}\n\t\t\t\n\t\t\t$table_head .= html_tag(static::$template['col_tag'], $col_attr, $cell_content);\n\t\t\t\n\t\t}\n\t\t\n\t\t$table_head .= '</tr>';\n\t\t$table_head .= static::$template['wrapper_end'];\n\n\t\treturn $table_head;\n\t}", "protected function getTableHeader() {\n $newDirection = ($this->sortDirection == 'asc') ? 'desc' : 'asc';\n\n $tableHeaderData = array(\n 'title' => array(\n 'link' => $this->getLink('title', ($this->sortField == 'title') ? $newDirection : $this->sortDirection),\n 'name' => 'Title',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n 'document_type' => array(\n 'link' => $this->getLink('type', $this->sortField == 'document_type' ? $newDirection : $this->sortDirection),\n 'name' => 'Type',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n 'date' => array(\n 'link' => $this->getLink('date', $this->sortField == 'date' ? $newDirection : $this->sortDirection),\n 'name' => 'Date',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n );\n\t\t\n // insert institution field in 3rd column, if this is search results\n if($this->uri == 'search') {\n $tableHeaderData = array_slice($tableHeaderData, 0, 2, true) +\n array('institution' => array(\n 'link' => $this->getLink('institution', $this->sortField == 'institution' ? $newDirection : $this->sortDirection),\n 'name' => 'Institution',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n )) +\n array_slice($tableHeaderData, 2, count($tableHeaderData)-2, true);\n }\n\t\t\n return $tableHeaderData;\n }", "function Header()\n\t{\n\t\t$this->SetFont('Arial','',12);\n\t\t$this->MultiCell(190,5,nombre_empresa(),'0','C');\n\t\t$this->SetFont('Arial','',10);\n\t\t$this->MultiCell(190,5,tipo_serv(),'0','C');\n\t\t$this->SetFont('Arial','B',10);\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->MultiCell(190,7,strtoupper(_('listado de clientes para cortes')),'0','C');\n\t\t$this->SetFont('Arial','B',8);\n\t\t$this->SetX(133);\n\t\t$this->Cell(12,5,strtoupper(_('fecha')).': ',0,0,'L');\n\t\t$this->SetFont('Arial','',8);\n\t\t$this->Cell(18,5,date(\"d/m/Y\"),0,0,'L');\n\t\t$this->SetFont('Arial','B',8);\n\t\t$this->Cell(12,5,strtoupper(_('hora')).': ',0,0,'L');\n\t\t$this->SetFont('Arial','',8);\n\t\t$this->Cell(18,5,date(\"h:i:s A\"),0,0,'L');\n\t\t$this->Ln();\t\t\n\t}", "public function buildHeader() {\n return [\n ['data' => t('Teaching format'), 'class' => ['align-middle']],\n ['data' => t('Event'), 'class' => ['align-middle']],\n ['data' => t('Tutor'), 'class' => ['align-middle']],\n ['data' => t('Location'), 'class' => ['align-middle']],\n ['data' => t('Room'), 'class' => ['align-middle']],\n [\n 'data' => t('Date/time'),\n 'field' => 'time.field_event_time_value',\n 'sort' => 'desc',\n 'class' => ['align-middle'],\n ],\n ['data' => t('Registration status'), 'class' => ['align-middle']],\n ];\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 }", "private function generate_columns_header($p_edit,&$p_resultat,&$p_result_header)\r\n\t\t{\r\n\t\t\t// Create a new line\r\n\t\t\t$html = '<tr id=\"tr_header_title_'.$this->c_id.'\">';\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Create the first column (checkbox and edit button)\r\n\t\t\t ====================================================================*/\t\r\n\t\t\t$html .= '<td align=\"left\" id=\"header_th_0__'.$this->c_id.'\" class=\"__'.$this->c_theme.'__cell_opt_h\"><div id=\"th0_'.$this->c_id.'\"></div></td>';\r\n\t\t\t$html .= '<td></td>';\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t// Quantify of order clause\r\n\t\t\t$qtt_order = $this->get_nbr_order();\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Display the resize cursor or not\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tif($this->c_mode != __CMOD__)\r\n\t\t\t{\r\n\t\t\t\t$cursor = ' cur_resize';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$cursor = '';\r\n\t\t\t}\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Browse all columns\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tforeach($this->c_columns as $key_col => $val_col)\r\n\t\t\t{\r\n\t\t\t\tif($val_col['display'])\r\n\t\t\t\t{\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Define order icon\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($this->c_columns[$key_col]['order_by'] != false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// An order clause is defined\r\n\t\t\t\t\t\tif($this->c_columns[$key_col]['order_by'] == __ASC__)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// ASC icon\r\n\t\t\t\t\t\t\t$class_order = ' __'.$this->c_theme.'_ico_sort-ascend __'.$this->c_theme.'_ico';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// DESC icon\r\n\t\t\t\t\t\t\t$class_order = ' __'.$this->c_theme.'_ico_sort-descend __'.$this->c_theme.'_ico';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Display the number of order only if there is more than one order clause\r\n\t\t\t\t\t\t($qtt_order > 1) ? $order_prio = $this->c_columns[$key_col]['order_priority'] : $order_prio = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// No order clause defined\r\n\t\t\t\t\t\t$class_order = '';\r\n\t\t\t\t\t\t$order_prio = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Order column\r\n\t\t\t\t\t$html .= '<td class=\"__'.$this->c_theme.'_bloc_empty'.$class_order.'\"><span class=\"__vimofy_txt_mini_ vimofy_txt_top\">'.$order_prio.'</span></td>';\r\n\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Define order icon\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($this->c_mode != __CMOD__)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$onmousedown = 'onmousedown=\"vimofy_resize_column_start('.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t\t$ondblclick = 'ondblclick=\"vimofy_mini_size_column('.$key_col.',\\''.$this->c_id.'\\');\" ';\r\n\t\t\t\t\t\t$lib_redim = $this->hover_out_lib(17,17);\r\n\t\t\t\t\t\t$event = $this->hover_out_lib(40,40).' onmousedown=\"vimofy_move_column_start(event,'.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$onmousedown = '';\r\n\t\t\t\t\t\t$ondblclick = '';\r\n\t\t\t\t\t\t$lib_redim = '';\r\n\t\t\t\t\t\t$event = $this->hover_out_lib(40,40).' onmousedown=\"click_column_order(\\''.$this->c_id.'\\','.$key_col.');\"';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*===================================================================*/\r\n\r\n\t\t\t\t\t// Column title\r\n\t\t\t\t\t$html .= '<td align=\"left\" class=\"__'.$this->c_theme.'__cell_h nowrap\" id=\"header_th_'.$key_col.'__'.$this->c_id.'\"><div '.$event.' class=\"align_'.$this->c_columns[$key_col]['alignment'].' __'.$this->c_theme.'_column_title\" id=\"th'.$key_col.'_'.$this->c_id.'\"><span id=\"span_'.$key_col.'_'.$this->c_id.'\">'.$this->c_columns[$key_col]['name'].'</span></div></td>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Display other column\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($p_edit != false) $html .= '<td style=\"padding:0;margin:0;\"></td>';\r\n\r\n\t\t\t\t\t$html .= '<td '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t$html .= '<td '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__sep_h'.$cursor.'\"></td>';\r\n\t\t\t\t\t$html .= '<td id=\"right_mark_'.$key_col.'_'.$this->c_id.'\" '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$html .= '</tr>';\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Input for search on the column\r\n\t\t\t ====================================================================*/\t\r\n\t\t\t// Create a new line\r\n\t\t\t$html .= '<tr id=\"tr_header_input_'.$this->c_id.'\">';\r\n\t\t\t\r\n\t\t\t// Create the first column (checkbox and edit button)\r\n\t\t\t$html .= '<td align=\"left\" class=\"__'.$this->c_theme.'__cell_opt_h\"><div id=\"thf0_'.$this->c_id.'\" class=\"__'.$this->c_theme.'__vimofy_version\" onclick=\"window.open(\\'vimofy_bugs\\');\">v'.$this->c_software_version.'</div></td>';\r\n\t\t\t\r\n\t\t\t// Id column display counter\r\n\t\t\t$id_col_display = 0;\r\n\t\t\t\r\n\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Browse all columns\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tforeach($this->c_columns as $key_col => $val_col)\r\n\t\t\t{\r\n\t\t\t\tif($val_col['display'])\r\n\t\t\t\t{\r\n\t\t\t\t\tif($id_col_display == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= '<td id=\"th_0_c'.$key_col.'_'.$this->c_id.'\"></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= '<td id=\"th_0_c'.($key_col).'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*if(isset($this->c_columns[$key_col]))\r\n\t\t\t\t\t{*/\r\n\t\t\t\t\t\t$onmousedown = 'onmousedown=\"vimofy_resize_column_start('.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t\t$ondblclick = 'ondblclick=\"vimofy_mini_size_column('.$key_col.',\\''.$this->c_id.'\\');\" ';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t\t * Define the filter value\r\n\t\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\t\t$filter_input_value = '';\r\n\t\t\t\t\t\t$state_filter_input = '';\r\n\t\t\t\t\t\tif(isset($val_col['filter']['input']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// A filter was defined by the user\r\n\t\t\t\t\t\t\t$filter_input_value = $val_col['filter']['input']['filter'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// No filter was defined by the user\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Check if vimofy was in edit mode\r\n\t\t\t\t\t\t\tif($p_edit != false && !isset($val_col['rw_flag']) || ($p_edit != false && isset($val_col['rw_flag']) && $val_col['rw_flag'] != __FORBIDEN__))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// The vimofy was in edit mode, search all same value in the column\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Place the cursor on the first row of the recordset\r\n\t\t\t\t\t\t\t\tif($this->c_obj_bdd->rds_num_rows($p_result_header) > 0)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$this->c_obj_bdd->rds_data_seek($p_result_header,0);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// TODO Use a DISTINCT QUERY - Vimofy 1.0\r\n\t\t\t\t\t\t\t\t$key_cold_line = 0;\r\n\t\t\t\t\t\t\t\t$last_value = '';\r\n\t\t\t\t\t\t\t\t$flag_same = false;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\twhile($row = $this->c_obj_bdd->rds_fetch_array($p_result_header))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif($key_cold_line > 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($last_value == $row[$val_col['sql_as']])\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$flag_same = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$flag_same = false;\r\n\t\t\t\t\t\t\t\t\t\t\t// The value is not the same of the previous, stop browsing data \r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$flag_same = true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t$last_value = $row[$val_col['sql_as']];\r\n\t\t\t\t\t\t\t\t\t$key_cold_line = $key_cold_line + 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif($flag_same)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$filter_input_value = $last_value;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$filter_input_value = '';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif($p_edit != false && isset($val_col['rw_flag']) && $val_col['rw_flag'] == __FORBIDEN__)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$state_filter_input = 'disabled';\t\t\t\t\t\t\t\t\t// Disable the input because the edition of column is forbiden\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(isset($val_col['filter']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_on __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isset($val_col['lov']) && isset($val_col['is_lovable']) && $val_col['is_lovable'] == true)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_lovable __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(isset($val_col['lov']))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_no_icon __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t\t * Menu button oncontextmenu\r\n\t\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\t\tif($this->c_type_internal_vimofy == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Principal vimofy, diplay internal vimofy\r\n\t\t\t\t\t\t\t$oncontextmenu = 'vimofy_display_internal_vim(\\''.$this->c_id.'\\',__POSSIBLE_VALUES__,'.$key_col.');return false;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Internal vimofy, doesn't display other internal vimofy\r\n\t\t\t\t\t\t\t$oncontextmenu = 'return false;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= '<td id=\"th_1_c'.$key_col.'_'.$this->c_id.'\" class=\"__vimofy_unselectable\" style=\"width:20px;\"><div style=\"width:20px;margin:0;\" '.$this->hover_out_lib(21,21).' oncontextmenu=\"'.$oncontextmenu.'\" class=\"'.$class_btn_menu.'\" onclick=\"vimofy_toggle_header_menu(\\''.$this->c_id.'\\','.$key_col.');\" id=\"th_menu_'.$key_col.'__'.$this->c_id.'\"></div></td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_2_c'.$key_col.'_'.$this->c_id.'\" align=\"left\" class=\"__'.$this->c_theme.'__cell_h\">';\r\n\t\t\t\t\t\t$html .= '<div style=\"margin:0 3px;\"><input value=\"'.str_replace('\"','&quot;',$filter_input_value).'\" class=\"__'.$this->c_theme.'__input_h full_width\" '.$state_filter_input.' id=\"th_input_'.$key_col.'__'.$this->c_id.'\" type=\"text\" style=\"margin: 2px 0;\" size=1 onkeyup=\"if(document.getElementById(\\'chk_edit_c'.$key_col.'_'.$this->c_id.'\\'))document.getElementById(\\'chk_edit_c'.$key_col.'_'.$this->c_id.'\\').checked=true;vimofy_input_keydown(event,this,\\''.$this->c_id.'\\','.$key_col.');\" onchange=\"vimofy_col_input_change(\\''.$this->c_id.'\\','.$key_col.');\"/></div>';\r\n\t\t\t\t\t\tif($p_edit != false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif($state_filter_input == '')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '<td style=\"width:10px;padding:0;margin:0;\"><input '.$this->hover_out_lib(76,76).' type=\"checkbox\" id=\"chk_edit_c'.$key_col.'_'.$this->c_id.'\" style=\"height:11px;width:11px;margin: 0 5px 0 2px;display:block;\"/></td>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '<td style=\"width:0;padding:0;margin:0;\"></td>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= '</td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_3_c'.$key_col.'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_4_c'.$key_col.'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__sep_h'.$cursor.'\"></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$id_col_display = $id_col_display + 1;\r\n\t\t\t\t//}\r\n\t\t\t}\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t$html .= '<td id=\"th_0_c'.($key_col+1).'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t$html.= '<td><div style=\"width:200px\"></div></td>';\r\n\t\t\t$html .= '</tr>';\r\n\t\t\t/*===================================================================*/\r\n\r\n\t\t\t// Place the cursor on the first row of the recordset\r\n\t\t\tif($this->c_obj_bdd->rds_num_rows($p_resultat) > 0)\r\n\t\t\t{\r\n\t\t\t\t$this->c_obj_bdd->rds_data_seek($p_resultat,0);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\treturn $html;\r\n\t\t}", "function Table_Headers($header,$w)\r\n{\r\n //Colors, line width and bold font\r\n $this->SetFillColor(153,153,153);\r\n $this->SetTextColor(0);\r\n $this->SetDrawColor(128,0,0);\r\n $this->SetLineWidth(.3);\r\n $this->SetFont('Arial','B','7');\r\n\t\r\n //Header\r\n\t\r\n\t//Output table header\r\n for($i=0;$i<count($header);$i++)\r\n $this->Cell($w[$i],5,$header[$i],1,0,'C',1);\r\n $this->Ln();\r\n}", "public function generateHtmlTableData($header,$result,$class=null,$sumColumn=null)\n\t{\n\t\t$addClass=$columns=null;\n\t\tif($class)$addClass='class=\"'.$class.'\"';\n\t\t$tableContent= \"<table $addClass >\";\n\t\t$tableContent=$tableContent.\"<tr>\";\n\t\t\t\tforeach($header as $title)\n\t\t\t\t $tableContent=$tableContent. \"<th> $title </th>\";\n\t\t$tableContent=$tableContent.\"</tr>\";\n\t\tif($result){ $i=0;\n\t\t\t foreach($result as $row) {\n\t\t\t\t\tif($i==0){$columns=array_keys($this->objectToArray($row));$i++;}\n\t\t\t\t $tableContent=$tableContent.\"<tr>\";\n\t\t\t foreach ( $row as $key=>$data) {\n\t\t\t\t\t if(is_float($data)) $data=$this->numFormat($data);\n\t\t\t\t\t\tif(is_numeric($data)) { $numView=explode('.',$data);\n\t\t\t\t\t\t\tif(isset($numView[1])) $data=$this->numFormat($data); }\n\t\t\t\t\t\t$tableContent=$tableContent.\"<td>$data</td>\"; }\n\t\t\t\t$tableContent=$tableContent.\"</tr>\"; }}\n\t\tif($sumColumn)\n\t\t{\n\t\t\tif($columns){\n\t\t\t$tableContent=$tableContent.\"<tr>\";\n\n\t\t\tforeach($columns as $dataColumn){\n\t\t\t\t$total=$tddata=null;\n\t\t\t\tforeach( $sumColumn as $column)\n\t\t\t\t\tif($column==$dataColumn){\n\t\t\t\t\t\t$total=(float)0;\n\t\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t\t$value=(float)$row->$column;\n\t\t\t\t\t\t\t$total=$total+$value;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t if($total)\n\t\t\t\t$tddata=\"<b>\".$this->numFormat($total).\"</b>\";\n\t\t\t $tableContent=$tableContent.\"<td style='color:#FF0000;'>\".$tddata.\"</td>\";\n\t\t\t}\n\t\t\t$tableContent=$tableContent.\"</tr>\"; }\n\t\t}\n\t\t//print_r($columns);\n\t\t$tableContent=$tableContent.\"</table>\";\n\n\t\treturn $tableContent;\n\t}", "function FancyTable($header, $data)\n{\n $this->SetFillColor(255,0,0);\n $this->SetTextColor(255);\n $this->SetDrawColor(128,0,0);\n $this->SetLineWidth(.3);\n $this->SetFont('','B');\n // Header\n $w = array(40, 35, 40, 45);\n for($i=0;$i<count($header);$i++)\n $this->Cell($w[$i],7,$header[$i],1,0,'C',true);\n $this->Ln();\n // Color and font restoration\n $this->SetFillColor(224,235,255);\n $this->SetTextColor(0);\n $this->SetFont('');\n // Data\n $fill = false;\n foreach($data as $row)\n {\n $this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);\n $this->Cell($w[1],6,$row[1],'LR',0,'L',$fill);\n $this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);\n $this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);\n $this->Ln();\n $fill = !$fill;\n }\n // Closing line\n $this->Cell(array_sum($w),0,'','T');\n}", "function prepareDefaultHeader()\n {\n $this->formatBuffer .= \"p.normalText, li.normalText, div.normalText{\\n\";\n $this->formatBuffer .= \" mso-style-parent: \\\"\\\";\\n\";\n $this->formatBuffer .= \" margin: 0cm;\\n\";\n $this->formatBuffer .= \" margin-bottom: 6pt;\\n\";\n $this->formatBuffer .= \" mso-pagination: widow-orphan;\\n\";\n $this->formatBuffer .= \" font-size: {$this->fontSize}pt;\\n\";\n $this->formatBuffer .= \" font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \" mso-fareast-font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \"}\\n\\n\";\n \n $this->formatBuffer .= \"table.normalTable{\\n\";\n $this->formatBuffer .= \" mso-style-name: \\\"Tabela com grade\\\";\\n\";\n $this->formatBuffer .= \" mso-tstyle-rowband-size: 0;\\n\";\n $this->formatBuffer .= \" mso-tstyle-colband-size: 0;\\n\";\n $this->formatBuffer .= \" border-collapse: collapse;\\n\";\n $this->formatBuffer .= \" mso-border-alt: solid windowtext {$this->tableBorderAlt}pt;\\n\";\n $this->formatBuffer .= \" mso-yfti-tbllook: 480;\\n\";\n $this->formatBuffer .= \" mso-padding-alt: 0cm {$this->tablePaddingAltRight}pt 0cm {$this->tablePaddingAltLeft}pt;\\n\";\n $this->formatBuffer .= \" mso-border-insideh: {$this->tableBorderInsideH}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-border-insidev: {$this->tableBorderInsideV}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-para-margin: 0cm;\\n\";\n $this->formatBuffer .= \" mso-para-margin-bottom: .0001pt;\\n\";\n $this->formatBuffer .= \" mso-pagination: widow-orphan;\\n\";\n $this->formatBuffer .= \" font-size: {$this->fontSize}pt;\\n\";\n $this->formatBuffer .= \" font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \"}\\n\";\n $this->formatBuffer .= \"table.normalTable td{\\n\";\n $this->formatBuffer .= \" border: solid windowtext 1.0pt;\\n\";\n $this->formatBuffer .= \" border-left: none;\\n\";\n $this->formatBuffer .= \" mso-border-left-alt: solid windowtext .5pt;\\n\";\n $this->formatBuffer .= \" mso-border-alt: solid windowtext .5pt;\\n\";\n $this->formatBuffer .= \" padding: 0cm 5.4pt 0cm 5.4pt;\\n\";\n $this->formatBuffer .= \"}\\n\\n\";\n \n $this->formatBuffer .= \"table.tableWithoutGrid{\\n\";\n $this->formatBuffer .= \" mso-style-name: \\\"Tabela sem grade\\\";\\n\";\n $this->formatBuffer .= \" mso-tstyle-rowband-size: 0;\\n\";\n $this->formatBuffer .= \" mso-tstyle-colband-size: 0;\\n\";\n $this->formatBuffer .= \" border-collapse: collapse;\\n\";\n $this->formatBuffer .= \" border: none;\\n\";\n $this->formatBuffer .= \" mso-border-alt: none;\\n\";\n $this->formatBuffer .= \" mso-yfti-tbllook: 480;\\n\";\n $this->formatBuffer .= \" mso-padding-alt: 0cm {$this->tablePaddingAltRight}pt 0cm {$this->tablePaddingAltLeft}pt;\\n\";\n $this->formatBuffer .= \" mso-border-insideh: {$this->tableBorderInsideH}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-border-insidev: {$this->tableBorderInsideV}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-para-margin: 0cm;\\n\";\n $this->formatBuffer .= \" mso-para-margin-bottom: .0001pt;\\n\";\n $this->formatBuffer .= \" mso-pagination: widow-orphan;\\n\";\n $this->formatBuffer .= \" font-size: {$this->fontSize}pt;\\n\";\n $this->formatBuffer .= \" font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \"}\\n\\n\";\n \n if ($this->cssFile != '') {\n if (file_exists($this->cssFile))\n $this->formatBuffer .= file_get_contents($this->cssFile);\n }\n }", "static function generateTableHeaderHTML()\n\t{\n\t\techo \"<tr class='exTableRow'>\\n\";\n\t\techo \"<th class='exTableColLineNum'>Item #</th>\\n\";\n\t\techo \"<th class='exTableColDesc'>Description of Work</th>\\n\";\n\t\techo \"<th class='exTableColAmount'>Amount</th>\\n\";\n\t\techo \"</tr>\\n\";\n\t}", "protected function renderHeaderCellContent()\n\t{\n\t\t$name = $this->name;\n\t\tif (substr_compare($name, '[]', -2, 2) === 0) {\n\t\t\t$name = substr($name, 0, -2);\n\t\t}\n\t\tif (substr_compare($name, ']', -1, 1) === 0) {\n\t\t\t$name = substr($name, 0, -1) . '_all]';\n\t\t} else {\n\t\t\t$name .= '_all';\n\t\t}\n\n\t\t$id = $this->grid->options['id'];\n\n$_allSelectJs = <<< JS\n\t$('.select-on-check-all').on('click', function(){\n\t\tvar rows = table.rows({ 'search': 'applied' }).nodes();\n\t\t$('input[type=\"checkbox\"]', rows).prop('checked', this.checked);\n\t});\n\n\t$('#$id tbody').on('change', 'input[type=\"checkbox\"]', function(){\n\t\tif(!this.checked){\n\t\t\tvar el = $('.select-on-check-all').get(0);\n\t\t\tif(el && el.checked && ('indeterminate' in el)){\n\t\t\t\tel.indeterminate = true;\n\t\t\t}\n\t\t}\n\t});\nJS;\n\n\t\t$this->grid->getView()->registerJs($_allSelectJs);\n\n\t\tif ($this->header !== null || !$this->multiple) {\n\t\t\treturn parent::renderHeaderCellContent();\n\t\t} else {\n\t\t\treturn Html::checkBox($name, false, ['class' => 'select-on-check-all']);\n\t\t}\n\t}", "function outputFormat(array $headers, array $cells, $result, $content_name) {\necho '<h3>'.ucfirst($content_name).' Content</h3>';\necho '<table>';\nforeach ($headers as $val) {\necho '<th>'.$val.'</th>';\n}\nwhile($row = mysqli_fetch_array($result))\n {\n echo '<tr>';\n foreach ($cells as $val) {\n echo '<td>'.$row[$val].'</td>';\n }\n echo '</tr>';\n }\n echo '</table>';\n}", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "public function buildHeaderFields() {}", "function draw_header(){\r\n\t\t$out_multiple_search='';\r\n\r\n\t\t$arr_width=explode(',',$this->width);\r\n\t\t$out='<thead><tr id=\"'.$this->id.'_sort\">';\r\n\r\n\t\t$arr_sort=explode('_',$this->sort);\r\n\t\t$arr_header=explode(',',$this->header);\r\n\r\n\t\t$column=1;\r\n\t\tfor($i=0; $i<count($arr_header);$i++){\r\n\r\n\t\t\tif($this->sort_init!==false and $this->sort_init[$i]!='f'){\r\n\t\t\t\t\t$out.='<th'.(($this->width!='' and $arr_width[$i]>0) ? ' width=\"'.$arr_width[$i].'\"' : '').' onclick=\"'.$this->change_tags($this->get_url($i+1)).'\"><span'.($arr_sort[$i]=='f' ? ' class=\"no_sort' : ' class=\"sort').(substr($arr_sort[$i],-1)=='a' ? '_asc' : (substr($arr_sort[$i],-1)=='d' ? '_desc' : '')).'\"></span>'.$arr_header[$i].'</th>';\r\n\t\t\t}else{\r\n\t\t\t\t$out.='<th'.(($this->width!='' and $arr_width[$i]>0) ? ' width=\"'.$arr_width[$i].'\"' : '').'><span></span>'.$arr_header[$i].'</th>';\r\n\t\t\t}\r\n\r\n\t\t\tif($this->multiple_search_init===true or $this->multiple_search_init=='hide' or (strpos($this->multiple_search_init,'hide')!==false and $this->multiple_search_init[$i]=='t') or $this->multiple_search_init[$i]=='t')\r\n\t\t\t\t$out_multiple_search.='<th><input type=\"text\" id=\"'.$this->id.'_multiple_search'.($i+1).'\" name=\"'.$this->id.'_multiple_search[]'.'\" value=\"'.$this->multiple_search[$i].'\" onkeyup=\"ctMultiSearch(\\''.$this->id.'\\');\" /></a></th>';\r\n\t\t\telse\r\n\t\t\t\t$out_multiple_search.='<th></th>';\r\n\t\t}\r\n\r\n\r\n\t\t$out.='</tr>';\r\n\r\n\t\tif($this->multiple_search_init===true or strpos($this->multiple_search_init,'hide')!==false or strpos($this->multiple_search_init,'t')!==false)\r\n\t\t\t$out.='<tr id=\"'.$this->id.'_multiple_search\"'.(($this->multiple_search_init!==true and strpos($this->multiple_search_init,'hide')!==false) ? ' style=\"display: none;\"' : '').'>'.$out_multiple_search.'</tr>';\r\n\r\n\t\t$out.'</thead>';\r\n\r\n\t\treturn $out;\r\n\t}", "function Header() {\r\n $this->Image($this->logourl, 6, 5, 12,12);\r\n $this->SetFont('courier', '', 8);\r\n $this->SetY(11);\r\n $this->SetX(19);\r\n// $this->SetTextColor(224,17,36);\r\n $this->SetTextColor(1,152,74);\r\n $this->SetFont('courier', 'B', 10);\r\n $this->Cell(55, 4, $this->companyname, 0, 0, 'L');\r\n $this->SetY(14);\r\n $this->SetX(19);\r\n $this->SetFont('courier', 'B', 8);\r\n// $this->SetTextColor(1,152,74);\r\n $this->SetTextColor(224,17,36);\r\n $this->Cell(55, 4, $this->companyaddress, 0, 0, 'L');\r\n $this->SetTextColor(0);\r\n $this->SetY(10);\r\n $this->SetX(130);\r\n// $this->Cell(75, 4, 'Department : ' . $this->dataheader[0], 0, 0, 'R', false);\r\n \r\n $this->SetFont('courier', 'B', 14);\r\n \r\n $this->SetY(12);\r\n $this->SetX(5);\r\n $this->Cell(200, 6, $this->metadata['Title'], 0, 0, 'C');\r\n $this->SetY(18);\r\n $this->SetFont('courier', '', 8);\r\n $this->Cell(200, 5, $this->dataheader[0], 0, 0, 'C');\r\n// $this->Cell(200, 5, 'test', 0, 0, 'C');\r\n $this->SetY(22);\r\n \r\n $this->SetFont('courier', 'B', 8);\r\n $this->Ln(1);\r\n }", "function Header() {\r\n\r\n $this->setPrintFooter(false);\r\n //$this->setFooterData(array(0,64,0), array(0,64,128));\r\n //$this->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);\r\n //$this->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM);\r\n\r\n $this->SetXY(5,5);\r\n\r\n\r\n if ($this->objParam->getParametro('desde') == '' && $this->objParam->getParametro('hasta') != '') {\r\n $cabecera_datos = ' <td style=\"width: 200px; text-align: center; vertical-align: middle; height: 42px;\"><strong>Departamento:</strong> Contabilidad <br /><strong>Desde: </strong>01/01/'.$this->objParam->getParametro('gestion').' <strong>Hasta:</strong> '.$this->objParam->getParametro('hasta').'<br /><strong>Gesti&oacute;n:</strong>'.$this->objParam->getParametro('gestion').'</td>\r\n ';\r\n } elseif ($this->objParam->getParametro('hasta') == '' && $this->objParam->getParametro('desde') != '') {\r\n $cabecera_datos = '\r\n <td style=\"width: 200px; text-align: center; vertical-align: middle; height: 42px;\"><strong>Departamento:</strong> Contabilidad <br /><strong>Desde: </strong>'.$this->objParam->getParametro('desde').' <strong>Hasta:</strong> 31/12/'.$this->objParam->getParametro('gestion').'<br /><strong>Gesti&oacute;n:</strong> '.$this->objParam->getParametro('gestion').'</td>\r\n\r\n ';\r\n } elseif ($this->objParam->getParametro('hasta') != '' && $this->objParam->getParametro('desde') != '') {\r\n $cabecera_datos = '\r\n <td style=\"width: 200px; text-align: center; vertical-align: middle; height: 42px;\"><strong>Departamento:</strong> Contabilidad <br /><strong>Desde: </strong>'.$this->objParam->getParametro('desde').' <strong>Hasta:</strong> '.$this->objParam->getParametro('hasta').'<br /><strong>Gesti&oacute;n:</strong> '.$this->objParam->getParametro('gestion').'</td>\r\n ';\r\n } elseif ($this->objParam->getParametro('hasta') == '' && $this->objParam->getParametro('desde') == '') {\r\n $cabecera_datos = '\r\n <td style=\"width: 200px; text-align: center; vertical-align: middle; height: 42px;\"><strong>Departamento:</strong> Contabilidad <br /><strong>Desde: </strong> 01/01/'.$this->objParam->getParametro('gestion').' <strong>Hasta:</strong> 31/12/'.$this->objParam->getParametro('gestion').'<br /><strong>Gesti&oacute;n:</strong> '.$this->objParam->getParametro('gestion').'</td>\r\n ';\r\n }\r\n\r\n\r\n $cabecera = '<font size=\"8\">\r\n <table style=\"height: 20px;\" border = \"1\" cellspacing=\"0\" cellpadding=\"2\" >\r\n <tbody>\r\n <tr style=\"height: 40px;\">\r\n <td style=\"width: 100px; height: 42px;\">&nbsp;<img style=\"width: 80px;\" align=\"middle\" src=\"../../../lib/imagenes/Logo_libro_mayor.jpg\" alt=\"Logo\"></td>\r\n <td style=\"width: 655px; text-align: center; vertical-align: middle; height: 42px;\"><h1>REPORTE <br>LIBRO MAYOR</h1></td>\r\n '.$cabecera_datos.'\r\n </tr>\r\n </tbody>\r\n </table>\r\n </font>\r\n ';\r\n\r\n $this->writeHTML($cabecera, true, 0, true, 0);\r\n\r\n //$this->SetAutoPageBreak(true, 2);\r\n\r\n }", "private function getBody(){\n\t\t$tbody=\"\";\n\t\t$tfilter=\"\";\n\t\t\n\t\tif($this->renderEmptyBody){\n\t\t\treturn \"<tbody></tbody>\";\n\t\t}\n\t\t\n\t\t//Si tiene un llamado a la base de datos, obtenemos los datos\n\t\tif($this->hasCallToDataBase){\n\t\t\t$this->getData();\n\t\t}\n\t\t\n\t\tif(!empty($this->data)){\n\t\t\tforeach($this->data as $dataRow){\n\t\t\t\t$tbody.=\"<tr>\";\n\t\t\t\t$counter=0;\n\t\t\t\t\n\t\t\t\t/*Buscamos si el grid tiene alguna columna adicional al principio*/\n\t\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t\t$counter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach($dataRow as $key=>$data){\n\t\t\t\t\tif(!empty($this->bindedTypes)){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$type=$this->bindedTypes[$key];\n\t\t\t\t\t\t$parameter=$this->bindedTypesParams[$key];\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch ($type){\n\t\t\t\t\t\t\tcase 'progressbar':\n\t\t\t\t\t\t\t\t$bar=new progressbar(array(\"id\"=>$key));\n\t\t\t\t\t\t\t\t$pje=$data*100;\n\t\t\t\t\t\t\t\t$bar->setBars(array($pje));\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$tbody.=\"<td>\".$bar->render(true).\"</td>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"link\":\n\t\t\t\t\t\t\t\t$link=new link();\n\t\t\t\t\t\t\t\t$link->replaceFields($dataRow, $parameter);\n\t\t\t\t\t\t\t\t$link->setDisplay($data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$tbody.=\"<td>\".$link->render(true).\"</td>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$tbody.=\"<td>$data</td>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$tbody.=\"<td>$data</td>\";\n\t\t\t\t\t}\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/*Buscamos si el grid tiene alguna columna adicional al final*/\n\t\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t\t$counter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tbody.=\"</tr>\";\n\t\t\t}\n\t\t\t\n\t\t\tif($tfilter!=\"\"){\n\t\t\t\t$tbody=$tfilter.$tbody;\n\t\t\t}\n\t\t\t\n\t\t\t$tbody=\"<tbody>$tbody</tbody>\";\n\t\t}else{\n\t\t\t$tbody=\"<tbody><tr><td colspan=\\\"{$this->cols}\\\"><div class=\\\"alert alert-error\\\">\".velkan::$lang[\"grid_msg\"][\"noDataFound\"].\"</div></td></tr></tbody>\";\n\t\t}\n\t\t\n\t\treturn $tbody;\n\t}", "protected function getTableHeader() {\n /** @var \\Drupal\\webform\\WebformInterface $webform */\n $webform = $this->getEntity();\n $header = [];\n $header['title'] = $this->t('Title');\n\n $header['key'] = [\n 'data' => $this->t('Key'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ];\n $header['type'] = [\n 'data' => $this->t('Type'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ];\n $header['correct_answer'] = $this->t('Answer');\n $header['weight'] = $this->t('Weight');\n $header['operations'] = $this->t('Operations');\n// $header['answer'] = [\n// 'data' => $this->t('Answer'),\n// 'class' => [RESPONSIVE_PRIORITY_LOW],\n// ];\n//\n// $header['required'] = [\n// 'data' => $this->t('Required'),\n// 'class' => ['webform-ui-element-required', RESPONSIVE_PRIORITY_LOW],\n// ];\n// $header['parent'] = $this->t('Parent');\n// $header['operations'] = [\n// 'data' => $this->t('Operations'),\n// 'class' => ['webform-ui-element-operations'],\n// ];\n return $header;\n }", "function constructTableHead() {\n\n $header = '<tr><th>Country</th>';\n if (isset($_GET['pop'])) {\n $header .= '<th>Total Population</th>';\n }\n if (isset($_GET['birth'])) {\n $header .= '<th>Birth Rate</th>';\n }\n if (isset($_GET['death'])) {\n $header .= '<th>Death Rate</th>';\n }\n\n $header .= '</tr>';\n return $header;\n }", "function getTable($array, $firstLineHeader = true, $lastLineFooter = true, $withTableStructure = true)\n{\n\t$ret = '';\n\n\t$rows = count($array);\n\t$cols = isset($array[0]) ? count($array[0]) : 0;\n\t$i = 0;\n\n\tif($firstLineHeader)\n\t{\n\t\t$ret .= '<tr class=\"tableHeaderRow\">';\n\t\tfor($j = 0; $j < $cols; $j++)\n\t\t{\n\t\t\tif($j == ($cols - 1))\n\t\t\t\t$ret .= '<td class=\"tableHeaderCellR\">';\n\t\t\telse if($j == 0)\n\t\t\t\t$ret .= '<td class=\"tableHeaderCellL\">';\n\t\t\telse\n\t\t\t\t$ret .= '<td class=\"tableHeaderCell\">';\n\n\t\t\t$ret .= $array[$i][$j] . '</td>' . \"\\n\";\n\t\t}\n\t\t$ret .= '</tr>' . \"\\n\";\n\n\t\t$i++;\n\t}\n\n\tfor(; $i < $rows; $i++)\n\t{\n\t\t$ret .= '<tr class=\"tableRow\">';\n\t\tfor($j = 0; $j < $cols; $j++)\n\t\t{\n\t\t\tif($j == ($cols - 1))\n\t\t\t{\n\t\t\t\tif($i == ($rows - 1) && $lastLineFooter)\n\t\t\t\t\t$ret .= '<td class=\"tableCellBR\">';\n\t\t\t\telse if($i == 0)\n\t\t\t\t\t$ret .= '<td class=\"tableCellTR\">';\n\t\t\t\telse\n\t\t\t\t\t$ret .= '<td class=\"tableCellR\">';\n\t\t\t}\n\t\t\telse if($j == 0)\n\t\t\t{\n\t\t\t\tif($i == ($rows - 1) && $lastLineFooter)\n\t\t\t\t\t$ret .= '<td class=\"tableCellBL\">';\n\t\t\t\telse if($i == 0)\n\t\t\t\t\t$ret .= '<td class=\"tableCellTL\">';\n\t\t\t\telse\n\t\t\t\t\t$ret .= '<td class=\"tableCellL\">';\n\t\t\t}\n\t\t\telse if($i == ($rows - 1) && $lastLineFooter)\n\t\t\t\t$ret .= '<td class=\"tableCellB\">';\n\t\t\telse if($i == 0)\n\t\t\t\t$ret .= '<td class=\"tableCellT\">';\n\t\t\telse\n\t\t\t\t$ret .= '<td class=\"tableCell\">';\n\n\t\t\t$ret .= $array[$i][$j] . '</td>' . \"\\n\";\n\t\t}\n\t\t$ret .= '</tr>' . \"\\n\";\n\t}\n\n\tif($withTableStructure)\n\t\t$ret = '<p/><table class=\"tableMain\">' . $ret . '</table>';\n\n\treturn $ret;\n}", "public function Header(){\n $ci =& get_instance();\n // Select Arial bold 15\n $this->AddFont('Futura-Medium');\n $this->SetFont('Futura-Medium','',16);\n // Move to the right\n //$this->Cell(80);\n // Framed title\n // Logo\n $this->Image(asset_url() . \"images/logo.png\",11,5,0,20);\n $this->Ln(15);\n $this->Cell(0,10,\"GetYourGames\",0,1,'L');\n $this->SetFont('Futura-Medium','',12);\n $this->Cell(0,10,site_url(),0,1,\"L\");\n $this->Ln(5);\n $this->SetFont('Futura-Medium','',18);\n $this->Cell(0,10,utf8_decode($this->title),0,1,'C');\n // Line break\n $this->Ln(10);\n $this->SetFont('Futura-Medium','',11);\n $this->Cell(15,10,utf8_decode('#'),'B',0,'C');\n $this->Cell(100,10,utf8_decode($ci->lang->line('table_product')),'B',0,'L');\n $this->Cell(30,10,utf8_decode($ci->lang->line('table_qty')),'B',0,'L');\n $this->Cell(40,10,utf8_decode($ci->lang->line('table_subtotal')),'B',1,'L');\n\n $this->Ln(2);\n }", "function ImprovedTable($header,$data)\n{\n\t//Anchuras de las columnas\n\t$w=array(60,30,20,35,35);\n\t//Cabeceras\n\t$l = mysql_connect(\"localhost\",\"pmm\",\"guhAf2eh\");\n\t//$l = mysql_connect(\"DBSERVER\",\"root\",\"root\");\n\tmysql_select_db(\"pmm_dbpruebas\", $l);\n\t//mysql_select_db(\"pmm_dbweb\", $l);\n\t$s = \"SELECT CONCAT_WS(' ',nombre,paterno,materno) AS cliente, d.calle, d.poblacion, d.estado, d.pais\n\tFROM catalogocliente cc\n\tINNER JOIN direccion d ON cc.id = d.codigo\n\tWHERE d.facturacion='SI'\n\tLIMIT 0,100\";\t\n\t$r = mysql_query($s,$l) or die($s);\n\t\n\tfor($i=0;$i<count($header);$i++)\n\t\t$this->Cell($w[$i],7,$header[$i],1,0,'C');\n\t$this->Ln();\n\t//Datos\t\n\t\twhile($row = mysql_fetch_array($r)){\n\t\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');\n\t\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');\n\t\t\t$this->Ln();\n\t\t}\n\t/*foreach($data as $row)\n\t{\n\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');\n\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');\n\t\t$this->Ln();\n\t}*/\n\t//Lnea de cierre\n\t$this->Cell(array_sum($w),0,'','T');\n}", "public function Header(){\n if(count($this->_groups)){\n $this->SetFont('Arial','B',8);\n $this->SetDrawColor(160,160,160);\n $this->SetTextColor(160,160,160);\n $grp = array();\n foreach(array_keys($this->_groups) as $field){\n if(empty($this->_groups[$field][\"currentMsg\"])||!$this->_changePage){\n $grp[] = \"{grp_$field}\";\n }else{\n $grp[] = $this->_groups[$field][\"currentMsg\"];\n }\n }\n $grp = join($grp,\" / \");\n $this->Cell(0,4,$grp,'B',1,'L');\n $this->Ln(4);\n }\n $date = new Date();\n $this->SetTextColor(100);\n $this->SetFillColor(245);\n $this->SetY(4);\n $this->SetFont('Arial','B',10);\n //$str = \"Elaborado el \".$date->getYear().\" - \".$date->getMonthName().\" - \".$date->getDay().\" del \".date(\"H:i:s\");\n $this->ln();\n $this->ln();\n $this->ln();\n $this->ln();\n $str = \"Fecha: \".$date->getYear().\" - \".$date->getMonth().\" - \".$date->getDay();\n $x = $this->GetStringWidth($str);\n $this->Cell($x+10,5,$str,0,0,'L');\n // $this->Cell(0,5,Session::getData(\"nomcaj\"),\"B\",\"R\",'R');\n $this->ln();\n $this->ln();\n $this->ln();\n $this->SetTextColor(0);\n $this->SetFont('Arial','B',12);\n if(is_array($this->_titulo)){\n foreach($this->_titulo as $titulo){\n $w=$this->GetStringWidth($titulo);\n $this->SetX(($this->w - $w) / 2);\n $this->Cell($w,5,$titulo,0,1,'C');\n }\n }else{\n $w=$this->GetStringWidth($this->_titulo);\n $this->SetX(($this->w - $w) / 2);\n $this->Cell($w,5,$this->_titulo,0,1,'C');\n }\n $this->Ln();\n $this->Ln();\n $this->SetTextColor(100);\n $this->SetFont('Arial','',9);\n $this->Cell(0,2,'',0,1,'C');\n //$this->Image(\"public/img/portal/logo_mercurio_report.jpg\",14,11,60,13);\n //$this->Image(\"public/img/portal/logo_sys_report.jpg\",140,11,60,15);\n if(!count($this->_groups)||$this->_changePage){\n $this->__Header();\n $this->_changePage = false;\n }else{\n $this->__Header();\n }\n }", "function headers()\n {\n // Maintain URL params for pagination\n if (empty($this->params['pass'])) {\n $this->params['pass'] = array();\n }\n $options = array(\n 'url' => array_merge($this->tableOptions['url'], $this->params['named'], $this->params['pass']),\n //'model' => $this->defaultModel\n );\n if (!empty($this->tableOptions['ajax'])) {\n $options['update'] = $this->tableOptions['ajax']['mh-update'];\n $options['indicator'] = $this->tableOptions['ajax']['mh-indicator'];\n $options['before'] = $this->Js->get($options['indicator'])->effect('fadeIn', array('buffer' => false));\n $options['complete'] = $this->Js->get($options['indicator'])->effect('fadeOut', array('buffer' => false));\n }\n\n\n $this->Paginator->options($options);\n\n $lines = array();\n foreach ($this->Columns as $field => $Column) {\n $lines[] = $headerHTML[] = $Column->header();\n }\n\n $row = $this->Html->tag('tr', implode(chr(10), $lines));\n\n return $this->Html->tag('thead', $row);\n }", "public function header($Arr_Labels=false)\n\t{\n\t\t$this->Arr_Labels = $Arr_Labels;\n\n $Int_Column = 0;\n if ($Arr_Labels)\n {\n\t foreach ($Arr_Labels as $Str_Field => $Str_Label)\n\t\t\t{\n $Str_Column = $Str_Label;\n $this->Obj_Doc->getActiveSheet()->setCellValueByColumnAndRow($Int_Column, 1, $Str_Column);\n\t\t\t\t$Int_Column++;\n\t }\n\t\t}\n\t\telseif (isset($this->Arr_Data[0]))\n\t\t{\n\t foreach ($this->Arr_Data[0] as $Str_Field => $Str_Label)\n\t\t\t{\n\t\t\t\t$Int_Column++;\n $Str_Column = Inflector::humanize($Str_Field);\n $this->Obj_Doc->getActiveSheet()->setCellValueByColumnAndRow($Int_Column, 1, $Str_Column);\n\t }\n\t\t}\n\n\t\t//Set the worksheet styles.\n $this->Obj_Doc->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);\n //$this->Obj_Doc->getActiveSheet()->getStyle('A1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);\n //$this->Obj_Doc->getActiveSheet()->getStyle('A1')->getFill()->getStartColor()->setRGB('ffffff');\n $this->Obj_Doc->getActiveSheet()->duplicateStyle( $this->Obj_Doc->getActiveSheet()->getStyle('A1'), 'B1:'.$this->Obj_Doc->getActiveSheet()->getHighestColumn().'1');\n\n\t\tfor ($i = 1; $i <= $Int_Column; $i++)\n\t\t{\n $this->Obj_Doc->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setAutoSize(true);\n }\n\n\t\treturn $this;\n\t}", "public function Header() {\r\n $this->SetTextColor(0,0,0);\r\n $this->SetDrawColor(0,0,0);\r\n /* definimos variables con titulo y subtitulo */\r\n $titulo=\"Coordinación de Calidad\";\r\n $subtitulo=\"Reporte Diario de Sustancias Químicas \";\r\n /* posicionamos el puto de insercion 2mm. debajo\r\n del borde del papel */\r\n $this->SetY(8);\r\n /* escribimos el titulo con la fuente que se establezca\r\n por el método opcion SetHeaderFont */\r\n $this->SetFont('helvetica', 'B', 14);\r\n\r\n $this->Cell(0, 5,$titulo,0,1,'C');\r\n /* modificamos tipografia para el subtitulo\r\n e insertamos este */\r\n $this->SetFont('helvetica', '', 12);\r\n $this->Cell(0, 2,$subtitulo,0,1,'C');\r\n /* trazamos un rectangulo sombreado que por sus dimensiones\r\n ocupará el area de texto de la pagina */\r\n \r\n /*trazamos una linea roja debajo del encabezado */\r\n $this->Line(15,30,195,30); \r\n /* insertamos una imagen de fondo con 15% de opacidad */\r\n \r\n $this->Image('logo.png',0,0,30,30,\r\n '','','N','','','L');\r\n /* recuperamos la opacidad por defecto */\r\n \r\n }", "function header() {\n //\n //Get the fields in this sql \n $cols= $this->fields->get_array();\n //\n //Loop through the fields and display the <tds>\n foreach ($cols as $col) {\n //\n $name= is_null($col->alias) ? $col->to_str():$col->alias;\n echo \"<th>$name</th>\"; \n }\n }", "function tableheader_open($colspan = 1, $align = null, $rowspan = 1, $classes = null) {\n $class = 'class=\"col'.$this->_counter['cell_counter']++;\n if(!is_null($align)) {\n $class .= ' '.$align.'align';\n }\n if($classes !== null) {\n if(is_array($classes)) $classes = join(' ', $classes);\n $class .= ' ' . $classes;\n }\n $class .= '\"';\n $this->doc .= '<th '.$class;\n if($colspan > 1) {\n $this->_counter['cell_counter'] += $colspan - 1;\n $this->doc .= ' colspan=\"'.$colspan.'\"';\n }\n if($rowspan > 1) {\n $this->doc .= ' rowspan=\"'.$rowspan.'\"';\n }\n $this->doc .= '>';\n }", "public function getHtml()\n {\n $header = new TableHeader($this);\n $header->addText('Dokument');\n $header->addText('Ersteller');\n $header->addEmpty();\n\n\n $fileReader = new FileReader();\n\n $contentLogModel = new ContentLogModel();\n $fileReader->addFieldByModel($contentLogModel);\n\n $userModel = new UserModel();\n $fileReader->addFieldByModel($userModel);\n\n $join = new ModelJoin($fileReader);\n $join->externalModel = $contentLogModel;\n $join->type = $fileReader->model->id;\n $join->externalType = $contentLogModel->dataId;\n\n $join = new ModelJoin($fileReader);\n $join->externalModel = $userModel;\n $join->type = $contentLogModel->userCreatedId;;\n $join->externalType = $userModel->id;\n\n $fileReader->filter->andEqual($contentLogModel->parentId, $this->dataId);\n $fileReader->filter->andEqual($contentLogModel->contentTypeId, (new FileTemplateStatus())->contentId);\n\n\n foreach ($fileReader->getData() as $fileRow) {\n\n $row = new TableRow($this);\n\n if (!$fileRow->delete) {\n $row->addHyperlink($fileRow->file->getUrl(), $fileRow->file->getFilename());\n\n } else {\n\n $stroke = new Strike($row);\n $stroke->content = $fileRow->file->getFilename();\n\n }\n // show image bzw. detail ansicht\n\n $userDisplay = $fileRow->getModelValue($userModel->displayName);\n $dateTimeCreated = new DateTime($fileRow->getModelValue($contentLogModel->dateTimeCreated));\n\n $row->addText($userDisplay . ' ' . $dateTimeCreated->getShortDateTimeLeadingZeroFormat());\n\n if (!$fileRow->delete) {\n $site = clone(FileDeleteSite::$site);\n $site->addParameter(new FileParameter($fileRow->id));\n $site->addParameter(new DataIdParameter($this->dataId));\n $row->addIconSite($site);\n } else {\n $row->addEmpty();\n }\n\n\n }\n\n return parent::getHtml();\n\n }", "function table_from_array(&$data_array, $has_header = TRUE, $class = \"\", $id = \"\", $text_limit_to_trim = null) {\n if ((count($data_array) == 0) || (count(current($data_array)) == 0)) {\n trigger_error(\"Array to build HTML table is empty\", E_USER_NOTICE);\n return FALSE;\n }\n $table_object = new html_classes\\table($class, $id);\n\n foreach ($data_array as $row_index => $row_data) {\n if ($has_header && ($row_index === 0)) {\n $thead = $table_object->append_thead();\n $tr = $thead->append_tr();\n } else {\n if (!isset($tbody)) {\n $tbody = $table_object->append_tbody();\n }\n $tr = $tbody->append_tr();\n }\n foreach ($row_data as $col_index => $col_value) {\n if ($has_header && ($row_index === 0)) {\n $tr->append_th($col_value);\n } else {\n if (!is_object($col_value)) {\n if (is_numeric($col_value)) {\n if (is_float($col_value)) {\n $col_value = number_format($col_value, 2);\n } else {\n $col_value = number_format($col_value);\n }\n }\n if (is_numeric($text_limit_to_trim) && strlen($col_value) > $text_limit_to_trim) {\n $col_value = substr($col_value, 0, $text_limit_to_trim) . \"...\";\n }\n } else {\n if (is_numeric($text_limit_to_trim) && strlen($col_value->get_value()) > $text_limit_to_trim) {\n $col_value->set_value(substr($col_value->get_value(), 0, $text_limit_to_trim) . \"...\");\n }\n// d($col_value->get_value());\n }\n $tr->append_td($col_value);\n }\n }\n }\n// \\var_dump($table_object);\n return $table_object;\n}", "public function Header()\n {\n // Set custom header and footer\n $this->setCustomHeader();\n\n if (array_key_exists($this->category, $this->categories)) {\n $title = $this->categories[$this->category]['name'];\n } else {\n $title = '';\n }\n\n $this->SetTextColor(0, 0, 0);\n $this->SetFont($this->currentFont, 'B', 18);\n\n if (0 < PMF_String::strlen($this->customHeader)) {\n $this->writeHTMLCell(0, 0, '', '', $this->customHeader);\n $this->Ln();\n $this->writeHTMLCell(0, 0, '', '', html_entity_decode($title, ENT_QUOTES, 'utf-8'), 0, 0, false, true, 'C');\n } else {\n $this->MultiCell(0, 10, html_entity_decode($title, ENT_QUOTES, 'utf-8'), 0, 'C', 0);\n $this->SetMargins(PDF_MARGIN_LEFT, $this->getLastH() + 5, PDF_MARGIN_RIGHT);\n }\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 getTable(){\n\t\t\tglobal $page, $tableContent, $tableHeadings;\n\t\t\t// reset current page content\n\t\t\t$page = \"\";\n\t\t\t\n\t\t\t$page = '<div class=\"tableContainer\"><table class=\"twoCol\">';\n\t\t\t\n\t\t\t// make sure we have a header row, else skip\n\t\t\t/*\n\t\t\t$headerSize = count($tableHeadings);\n\t\t\tif($headerSize > 0){\n\t\t\t\t\n\t\t\t\t$page = $page . '<tr class = \"tableHeader\">';\n\t\t\t\t\n\t\t\t\tforeach ($tableHeadings as $h){\n\t\t\t\t\t$page = $page . '<td class = \"headerCell\">' . $h . '</td>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t}\n\t\t\t*/\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t$page = $page . '<tr class = \"tableHeader\">';\n\t\t\t\t\n\t\t\t\tforeach (array_keys($tableContent[0]) as $h){\n\t\t\t\t\t\n\t\t\t\t\t$page = $page . '<th class = \"headerCell\">' . $h . '</th>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\n\t\t\t\n\t\t\t// make sure we have table content to print\n\t\t\t\n\t\t\t$contentSize = count($tableContent);\n\t\t\t\n\t\t\tfor($i = 0; $i < $contentSize; $i++){\n\t\t\t\t$rowSize = count($tableContent[$i]);\n\t\t\t\t\n\t\t\t\t// vary row depending on odd/even\n\t\t\t\tif($i % 2){\n\t\t\t\t\t$page = $page . ('<tr class = \"odd\">');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$page = $page . ('<tr class = \"even\">');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// now build row content\n\t\t\t\t$oddevenCount = 0;\n\t\t\t\tforeach ($tableContent[$i] as $row){\n\t\t\t\t\t\n\t\t\t\t\t// vary cell tag depending on odd/even\n\t\t\t\t\tif($oddevenCount % 2){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$page = $page . '<td class = \"odd\">';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$page = $page . '<td class = \"even\">';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// add content\n\t\t\t\t\t$page = $page . $row;\n\t\t\t\t\t\n\t\t\t\t\t// close cell tag\n\t\t\t\t\t$page = $page . '</td>';\n\t\t\t\t\t$oddevenCount += 1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// close row tag\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$page = $page . ('</table></div>');\n\t\t\t\n\t\t\treturn $page;\n\t\t}", "public function Header()\r\n\t{\r\n\t\t$this->Ln();\r\n\t\t$this->SetFont('Arial','',14);\r\n\t\t$this->Cell(170,7,\"Date :: \". $this->today_date ,1,0,'C');\r\n\t\t$this->Ln();\r\n\t\t$this->SetFont('Arial','',14); \r\n\t\t$this->MultiCell(170,8,\"Room Things Report \\n\".$this->title,1,'C');\r\n\t\t$this->Ln(5);\r\n\r\n\t}", "function Header()\n {\n\n\n //list($r, $b, $g) = $this->xheadercolor;\n $this->setY(5);\n //$this->SetFillColor($r, $b, $g);\n //$this->SetTextColor(0 , 0, 0);\n //$this->Cell(0,20, '', 0,1,'C', 1);\n //$this->Text(15,26,$this->xheadertext );\n \n \n // get the current page break margin\n $bMargin = $this->getBreakMargin();\n // get current auto-page-break mode\n $auto_page_break = $this->AutoPageBreak;\n // disable auto-page-break\n $this->SetAutoPageBreak(false, 0);\n // set bacground image\n $img_file = WWW_ROOT.'/img/Resul_Agua.jpg';\n $this->Image($img_file, 0, 0, 216, 279, '', '', '', false, 300, '', false, false, 0);\n // restore auto-page-break status\n $this->SetAutoPageBreak($auto_page_break, $bMargin);\n // set the starting point for the page content\n $this->setPageMark();\n \n\n $this->writeHTML($this->xheadertext, true, false, true, false, '');\n\n // Transformacion para la rotacion de el numero de orden y el contenedor de la muestra\n $this->StartTransform();\n //$this->SetFont('freesans', '', 5);\n $this->SetFont('', '', 5);\n $this->Rotate(-90, 117, 117);\n //$tcpdf->Rect(39, 50, 40, 10, 'D');\n $this->Text(5, 30, 'Software Asistencial Médico \"SAM\" V.1.1 ® - https://samsalud.info ®');\n // Stop Transformation\n $this->StopTransform();\n\n // if ( $this->variable == 1 )\n // {\n // draw jpeg image x, y ancho, alto\n // $this->Image(WWW_ROOT.'/img/BORRADOR.png', 40, 60, 450, 250, '', '', '', true, 72);\n\n // restore full opacity\n $this->SetAlpha(0);\n // }\n\n }", "function getTable(){\n\t\t\tglobal $page, $tableContent, $tableHeadings, $idName, $URL;\n\t\t\t// reset current page content\n\t\t\t$page = \"\";\n\t\t\t\n\t\t\t$page = '<div class=\"tableContainer\"><table class=\"twoCol\">';\n\t\t\t\n\t\t\t\t\n\t\t\t\t$page = $page . '<tr class = \"tableHeader\">';\n\t\t\t\t$page = $page . '<td class = \"headerCell\"></td>';\n\t\t\t\t\n\t\t\t\tforeach (array_keys($tableContent[0]) as $h){\n\t\t\t\t\t\n\t\t\t\t\t$page = $page . '<td class = \"headerCell\">' . $h . '</td>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\n\t\t\t\n\t\t\t// make sure we have table content to print\n\t\t\t\n\t\t\t$contentSize = count($tableContent);\n\t\t\t\n\t\t\tfor($i = 0; $i < $contentSize; $i++){\n\t\t\t\t$rowSize = count($tableContent[$i]);\n\t\t\t\t\n\t\t\t\t// vary row depending on odd/even\n\t\t\t\tif($i % 2){\n\t\t\t\t\t$page = $page . ('<tr class = \"odd\">');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$page = $page . ('<tr class = \"even\">');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// now build row content\n\t\t\t\t$oddevenCount = 1;\n\t\t\t\t$view = '<td class = \"even\">\n\t\t\t\t<a href=\"' . $URL . '?id=' . $tableContent[$i][$idName] . '\">\n\t\t\t\tVIEW</a></td>';\n\t\t\t\t$page = $page . $view;\n\t\t\t\t\n\t\t\t\tforeach ($tableContent[$i] as $row){\n\t\t\t\t\t\n\t\t\t\t\t// vary cell tag depending on odd/even\n\t\t\t\t\tif($oddevenCount % 2){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$page = $page . '<td class = \"even\">';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$page = $page . '<td class = \"odd\">';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// add content\n\t\t\t\t\t$page = $page . $row;\n\t\t\t\t\t\n\t\t\t\t\t// close cell tag\n\t\t\t\t\t$page = $page . '</td>';\n\t\t\t\t\t$oddevenCount += 1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// close row tag\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$page = $page . ('</table></div>');\n\t\t\t\n\t\t\treturn $page;\n\t\t}", "function generateTitle($header, $data)\n\t{\n\t\t$this->SetFillColor(63,73,204);\n\t\t$this->SetTextColor(255);\n\t\t$this->SetDrawColor(18,0,0);\n\t\t$this->SetLineWidth(.1);\n\t\t$this->SetFont('','B');\n\t\t// Header\n\t\t$w = array(70, 25, 30, 20,30,35,25);\n\t\tfor($i=0;$i<count($header);$i++)\n\t\t\t$this->Cell($w[$i],7,$header[$i],1,0,'C',true);\n\t\t$this->Ln();\n\t\t// Color and font restoration\n\t\t$this->SetFillColor(224,235,255);\n\t\t$this->SetTextColor(0);\n\t\t$this->SetFont('');\n\t\t// Data\n\t\t$fill = false;\n\t\tforeach($data as $row)\n\t\t{\n\t\t\t$this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);\n/*\t\t\t$this->Cell($w[1],6,$row[1],'LR',0,'C',$fill);\n\t\t\t$this->Cell($w[2],6,$row[2],'LR',0,'C',$fill);\n\t\t\t$this->Cell($w[3],6,$row[3],'LR',0,'C',$fill);\n\t\t\t$this->Cell($w[4],6,$row[4],'LR',0,'C',$fill);\n\t\t\t$this->Cell($w[5],6,$row[5],'LR',0,'C',$fill);*/\n\t\t\t$this->Ln();\n\t\t\t$fill = !$fill;\n\t\t}\n\t\t// Closing line\n\t\t$this->Cell(array_sum($w),0,'','T');\n\t}", "function Header(){\n\t\t$linha = 5;\n\t\t// define o X e Y na pagina\n\t\t$this->SetXY(10,10);\n\t\t// cria um retangulo que comeca na coordenada X,Y e\n\t\t// tem 190 de largura e 265 de altura, sendo neste caso,\n\t\t// a borda da pagina\n\t\t$this->Rect(10,10,190,265);\n\t\t\n\t\t// define a fonte a ser utilizada\n\t\t$this->SetFont('Arial', 'B', 8);\n\t\t$this->SetXY(11,11);\n\t\t\n\t\t// imprime uma celula com bordas opcionais, cor de fundo e texto.\n\t\t$agora = date(\"G:i:s\");\n\t\t$hoje = date(\"d/m/Y\");\n\t\t$this->Cell(10,$linha,$agora,0,0,'C');\n\t\t$this->Cell(150,$linha,'..:: Fatec Bauru - Relatorio de Cursos da Fatec ::..',0,0,'C');\n\t\t$this->Cell(30,$linha,$hoje,0,0,'C');\n\t\t\n\t\t// quebra de linha\n\t\t$this->ln();\n\t\t$this->SetFillColor(232,232,232);\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->SetFont('Arial', 'B', 8);\n\n\t\t$this->Cell(10,4,'ID','LTR',0,'C',1);\n\t\t$this->Cell(140,4,'Nome do Curso','LTR',0,'C',1);\n\t\t$this->Cell(40,4,'Periodo','LTR',0,'C',1);\n\t}", "private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }", "public function makeTable($headings, $content);", "function ImprovedTable($header, $data)\n\t{\n\t\t//$this ->Ln(20);\n\t\t\n\t\t$contador = 0;\n\t\t$w = array(40, 40, 30, 30);\n\t\t// Cabeceras\n\t\tfor($i=0;$i<count($header);$i++)\n\t\t\t$this->Cell($w[$i],7,$header[$i],1,0,'C');\n\t\t\n\t\t$this->Ln();\n\t\t// Datos\n\t\t$this->SetFont('Arial','',12);\n\t\tforeach($data as $row)\n\t\t{\n\t\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t\t$this->Cell($w[2],6,$row[2],'LR',0,'L');\n\t\t\t$this->Cell($w[3],6,$row[3],'LR',0,'R');\n\t\t\t$this->Ln();\n\t\t\t$contador++;\n\t\t\tif($contador == 46){\n\t\t\t\t$this-> AddPage();\n\t\t\t\t$contador = 0;\n\t\t\t}\n\t\t}\n\t\t// Línea de cierre\n\t\t$this->Cell(array_sum($w),0,'','T');\n\t}", "protected function create_header_cell($content, $collCount)\n {\n return $this->create_cell(array('content'=>$content,'colCount'=>$collCount));\n }", "public function createHeader() {\n\t\t$header = new PHPWord_Section_Header($this->_sectionCount);\n\t\t$this->_header = $header;\n\t\treturn $header;\n\t}", "function BorderlessTable($header, $data)\n\t{\n\t $this->SetFillColor(128,128,128);\n\t $this->SetTextColor(255);\n\t $this->SetDrawColor(0,0,0);\n\t $this->SetLineWidth(.3);\n\t // Color and font restoration\n\t $this->SetFillColor(224,235,255);\n\t $this->SetTextColor(0);\n\t $this->SetFont('Arial','',12);\n\t // Data\n\t $this->SetWidths(array(40, 65, 50, 60, ));\n\t foreach($data as $row){\n\t\t$this->BorderlessRow($row);\n\t }\n\t // Closing line\n\t // $this->Cell(array_sum($w),0,'','T');\n\t}", "function display_report()\n {\n $out = '<div>';\n $out .= '<table id=\"resultsTable\">';\n $out .= '<thead>';\n if(isset($this->header))\n {\n if(!$this->has_split_header())\n {\n $out .= '<tr>';\n foreach($this->header AS $head)\n {\n $out .= '<th>'.$head.'</th>';\n } \n $out .= '</tr>';\n }\n else\n {\n //foreach row\n foreach($this->header AS $row)\n {\n $out .= '<tr>';\n foreach($row AS $rowObj)\n {\n $columnCount = isset($rowObj->colCount) ? $rowObj->colCount : 1;\n $columnContent = $rowObj->content;\n $out .= '<th colspan=\"'.$columnCount.'\">'.$columnContent.'</th>';\n }\n $out .= '</tr>';\n }\n } \n }\n $out .= '</thead>';\n $out .= '<tbody>';\n if(isset($this->data))\n {\n foreach($this->data AS $row)\n {\n $out .= '<tr>';\n foreach($row AS $cell)\n {\n if(is_a($cell, 'stdClass'))\n {\n $out .= $this->build_cell($cell);\n }\n else\n {\n $out .= '<td>'.$cell.'</td>';\n }\n } \n $out .= '</tr>';\n }\n }\n //count the last row\n// $out .= '<tr>';\n// for($i=0;$i<count($row);$i++)\n// {\n// $out .= '<td class=\"emptyrow\"><div class=\"emptycell\">X</div></td>';\n// }\n// $out .= '</tr>';\n $out .= '</tbody>';\n $out .= '</table>';\n $out .= '</div>';\n \n return $out;\n }", "function print_header(){\n\t\tglobal $worksheet, $xlsRow;\n\t\tglobal $heading_name,$ORG_TITLE;\n\t\t\n\t\t$worksheet->set_column(0, 0, 5);\n\t\t$worksheet->set_column(1, 1, 40);\n\t\t$worksheet->set_column(2, 2, 27);\n\t\t$worksheet->set_column(3, 3, 25);\n\t\t$worksheet->set_column(4, 4, 12);\n\t\t$worksheet->set_column(5, 5, 5);\n\t\t$worksheet->set_column(6, 6, 4);\n\t\t$worksheet->set_column(7, 7, 4);\n\t\t$worksheet->set_column(8, 8, 4);\n\t\t$worksheet->set_column(9, 9, 4);\n\t\t$worksheet->set_column(10, 10, 4);\n\t\t$worksheet->set_column(11, 11, 4);\n\t\t$worksheet->set_column(12, 12, 18);\n\t\t$worksheet->set_column(13, 13, 25);\n\t\t$worksheet->set_column(14, 14, 5);\n\t\t$worksheet->set_column(15, 15, 8);\n\t\t$worksheet->set_column(16, 16, 28);\n\t\t$worksheet->set_column(17, 17, 15);\n\t\t$worksheet->set_column(18, 18, 20);\n\t\t$worksheet->set_column(19, 19, 12);\n\t\t$worksheet->set_column(20, 20, 8);\n\t\t$worksheet->set_column(21, 21, 12);\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"(1)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"(2)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 3, \"(3)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"(4)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"(5)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"(6)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 9, \"(7)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 12, \"(8)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 13, \"(9)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 14, \"(10)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 15, \"(11)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 16, \"(12)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 17,\"(13)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 18, \"(14)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 19, \"(15)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 20, \"(16)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 21, \"(17)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"ชื่อส่วนราชการ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 3, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"เลข\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\",0));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 9, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"L\", 0));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 12, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 13, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 14, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 15, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 16, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 17, \"พื้นที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 18, \"วุฒิการศึกษา/\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 19, \"อัตรา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 20, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 21, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ลำดับ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"ชื่อ-สกุล\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"ประจำตัว\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"เพศ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"เกิด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 9, \"บรรจุ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 12, \"หมวด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 13, \"ชื่อตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 14, \"ชั้น\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 15, \"ตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 16, \"ส่วนกลาง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 17, \"ปฏิบัติงาน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 18, \"ประกาศนียบัตร\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 19, \"เงินเดือน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 20, \"ปีที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\t\t\n\t\t$worksheet->write($xlsRow, 21, \"หมายเหตุ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\t\t\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 1, \"$ORG_TITLE\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"เขต/แขวง/ศูนย์\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 4, \"ประชาชน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"ว\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"ด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 8, \"ป\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 9, \"ว\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 10, \"ด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 11, \"ป\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 12, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 13, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 14, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 15, \"เลขที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 16, \"/ภูมิภาค\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 17, \"(จังหวัด)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 18, \"เฉพาะทาง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 19, \"ปัจจุบัน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 20, \"เกษียณ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 21, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t}", "function table_header($addon = FALSE, $message = FALSE) {\n\t\n\tglobal $langName, $langSurname, $langUsername, $langEmail, $langFaculty, $langTel;\n\tglobal $langDate, $langComments, $langActions;\n\tglobal $langDateRequest_small;\n\n\t$string = \"\";\n\tif ($addon) { \n\t\t$rowspan=2;\n\t\t$datestring = \"<th align='center' colspan='2'>$langDate</th>\n\t\t<th scope='col' rowspan='$rowspan' align='center'>$langComments</th>\n\t\t<th scope='col' rowspan='$rowspan' align='center'>$langActions</th>\n\t\t</tr><tr>\n\t\t<th>$langDateRequest_small</th>\n\t\t<th>$message</th>\";\n\t} else {\n\t\t$rowspan=1;\n\t\t$datestring = \"<th scope='col' align='center'>$langDate<br />$langDateRequest_small</th>\n\t\t<th scope='col' align='center'>$langComments</th>\n\t\t<th scope='col' align='center'>$langActions</th>\";\n\t}\n\n\t$string .= \"<thead><tr>\n\t<th scope='col' colspan='2' rowspan='$rowspan' class='left'>&nbsp;&nbsp;$langName $langSurname</th>\n\t<th scope='col' width='20' rowspan='$rowspan' class='left'>$langUsername</th>\n\t<th scope='col' rowspan='$rowspan' class='left'>$langEmail</th>\n\t<th scope='col' rowspan='$rowspan' class='left'>$langFaculty</th>\n\t<th scope='col' rowspan='$rowspan' align='center'>$langTel</th>\";\n\t$string .= $datestring; \n\t$string .= \"</tr></thead>\";\n\nreturn $string;\n}", "private function makeCalendarHead()\n\t{\n\t\tif(strlen($this->headerStr) < 1) {\n\t\t\t$head = \"\\t<tr>\\n\\t\\t<th colspan=\\\"7\\\" class=\\\"headerString\\\">\";\n\t\t\tif(!is_null($this->curDay)) {\n\t\t\t\t$head .= $this->curDayName.' the '.$this->curDayS.' of '.$this->curMonthName.', '.$this->curYear;\n\t\t\t} else {\n\t\t\t\t$head .= $this->curMonthName.', '.$this->curYear;\n\t\t\t}\n\t\t\t$head .= \"</th>\\n\\t</tr>\\n\";\n\t\t} else {\n\t\t\t$head = $this->headerStr;\n\t\t}\n\t\t\n\t\t$this->calWeekDays .= $head;\n\t\t$this->outArray['head'] = $head;\n\t}", "public function Header() {\n\t\t$x = 0;\n\t\t$dx = 0;\n\t\tif ($this->rtl) {\n\t\t\t$x = $this->w + $dx;\n\t\t} else {\n\t\t\t$x = 0 + $dx;\n\t\t}\n\n\t\t// print the fancy header template\n\t\tif($this->print_fancy_header){\n\t\t\t$this->printTemplate($this->header_xobjid, $x, 0, 0, 0, '', '', false);\n\t\t}\n\t\tif ($this->header_xobj_autoreset) {\n\t\t\t// reset header xobject template at each page\n\t\t\t$this->header_xobjid = false;\n\t\t}\n\t\t\n\t\t$this->y = $this->header_margin;\n\t\t$this->SimpleHeader();\n\t\t//$tmpltBase = $this->MakePaginationTemplate();\n\t\t//echo $tmpltBase;die();\n\t\t//echo('trying to print header template: ');\n\t\t//$this->printTemplate($tmpltBase, $x, $this->y, 0, 0, '', '', false);\n\t\t//die();\n\t}", "public function getHeaderHTML()\n\t{\n\t\tif(!is_array($this->elements['header'])){\n\t\t\t// Headers are optional\n\t\t\treturn false;\n\t\t}\n\n\t\t# Header buttons can also be defined outside of the header key when defining modal vales.\n\t\t$this->elements['header']['buttons'] = array_merge($this->elements['header']['buttons'] ?: [], $this->buttons ?: []);\n\n\t\t# Add the required Bootstrap header class very first\n\t\t$this->elements['header']['class'] = str::getAttrArray($this->elements['header']['class'], \"modal-header\", $this->elements['header']['only_class']);\n\n\t\t# Draggable\n\t\t$this->elements['header']['class'][] = $this->draggable ? \"modal-header-draggable\" : false;\n\n\t\t# Styles\n\t\t$this->elements['header']['style'] = str::getAttrArray($this->elements['header']['style'], NULL, $this->elements['header']['only_style']);\n\n\t\t# Dropdown buttons\n\t\tif($this->elements['header']['buttons']){\n\t\t\t$buttons = Button::get($this->elements['header']);\n\t\t}\n\n\t\t# Button(s) in a row\n\t\t$button = Button::generate($this->elements['header']['button']);\n\n\t\tif($button){\n\t\t\t$button = \"<div class=\\\"btn-float-right\\\">{$button}</div>\";\n\t\t}\n\n\t\t# Accent\n\t\t$this->elements['header']['class'][] = str::getColour($this->accent, \"bg\");\n\n\t\t# Icon\n\t\tif(!$icon = Icon::generate($this->elements['header']['icon'])){\n\t\t\t//the icon attribute can either be in the header or in the main modal\n\t\t\t$icon = Icon::generate($this->icon);\n\t\t}\n\n\t\t# Badge\n\t\t$badge = Badge::generate($this->elements['header']['badge']);\n\n\t\t# ID\n\t\t$id = str::getAttrTag(\"id\", $this->elements['header']['id']);\n\n\t\t# Style\n\t\t$style = str::getAttrTag(\"style\", $this->elements['header']['style']);\n\n\t\t# Title colour\n\t\t$class[] = str::getColour($this->elements['header']['colour']);\n\n\t\t# Script\n\t\t$script = str::getScriptTag($this->elements['header']['script']);\n\n\t\t# The header title itself\n\t\t$title = $this->elements['header']['header'] . $this->elements['header']['title'] . $this->elements['header']['html'];\n\n\t\t# Title class\n\t\tif(!empty(array_filter($class))){\n\t\t\t$title_class = str::getAttrTag(\"class\", $class);\n\t\t\t$title = \"<span{$title_class}>$title</span>\";\n\t\t}\n\n\t\t# The div class\n\t\t$class = str::getAttrTag(\"class\", $this->elements['header']['class']);\n\n\t\t# If the modal can be dismissed\n\t\tif($this->dismissible !== false){\n\t\t\t$dismiss = <<<EOF\n<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\" title=\"Close this window\"></button>\nEOF;\n\t\t}\n\n\t\treturn <<<EOF\n<div{$id}{$class}{$style}>\n\t<div class=\"container\">\n \t\t<div class=\"row\">\n \t\t<div class=\"col-auto modal-title\">\n \t\t\t{$icon}{$title}{$badge}\n \t\t</div>\n \t\t<div class=\"col\">\n \t\t\t{$buttons}{$button}{$dismiss}\n \t\t</div>\n \t</div>\n\t</div>{$script}\n</div>\nEOF;\n\t}", "function get_table($table_format, $table_data, $meta = null)\n{\n\t$meta_defaults = [\n\t\t'alt_class' => 'alt',\n\t\t'caption' => '',\n\t\t'class' => 'datatable',\n\t\t'extra_html' => '',\n\t\t'init_sort_column' => null,\n\t\t'no_data' => 'There is no data',\n\t\t'sortable' => false,\n\t\t'totals' => false,\n\t];\n\n\t$opts = array_merge($meta_defaults, $meta);\n\n\tif ( ! is_array($table_data) || (0 == count($table_data))) {\n\t\treturn $opts['no_data'];\n\t}\n\n\t$opts['caption'] = ('' != $opts['caption']) ? '<caption>'.$opts['caption'].'</caption>' : '';\n\n\t// start building the header\n\t$headhtml = '\n\t\t\t<thead>\n\t\t\t<tr>';\n\n\t$total_cols = $sort_types = [];\n\tforeach ($table_format as $col) {\n\t\t// test for SPECIAL data first\n\t\tif ( ! is_array($col[TYPE]) && ('SPECIAL_' == substr($col[TYPE], 0, 8))) {\n\t\t\t${$col[TYPE]}[] = $col; // will be named either SPECIAL_CLASS or SPECIAL_HTML\n\t\t}\n\t\telse {\n\t\t\t$sort_types[] = (isset($col[SORT])) ? $col[SORT] : null;\n\n\t\t\tif ( ! is_array($col[HEADER])) {\n\t\t\t\t$headhtml .= '\n\t\t\t\t<th>'.$col[HEADER].'</th>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$headhtml .= '\n\t\t\t\t<th title=\"'.$col[HEADER][1].'\">'.$col[HEADER][0].'</th>';\n\t\t\t}\n\n\t\t\t// do some stuff for the totals row\n\t\t\tif ($opts['totals'] && isset($col[TOTAL])) {\n\t\t\t\tif ((false != $col[TOTAL]) && ('total' != strtolower($col[TOTAL]))) {\n\t\t\t\t\t// test if we have any [[[meta_vars]]]\n\t\t\t\t\t// and make a total entry for those matches if any VALID ones are found\n\t\t\t\t\t// if the code is eval'd, we'll do that when we put the total row on\n\t\t\t\t\tif (preg_match_all('/\\\\[\\\\[\\\\[(\\\\w+)\\\\]\\\\]\\\\]/i', $col[TOTAL], $matches, PREG_PATTERN_ORDER)) {\n\t\t\t\t\t\tforeach ($matches[1] as $match) {\n\t\t\t\t\t\t\tif (in_array($match, array_keys(reset($table_data))) && ! in_array($match, $total_cols)) {\n\t\t\t\t\t\t\t\t$total_cols[] = $match;\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\telse {\n\t\t\t\t\t\t$total_cols[] = $col[TOTAL];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$total_cols = array_unique($total_cols);\n\n\t$headhtml .= '\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t';\n\n\t// start building the body\n\t$bodyhtml = '<tbody>\n\t\t\t';\n\n\t// start placing the data in the table\n\t$i = 0;\n\tforeach ($table_data as $rkey => $row) {\n\t\tif ( ! is_array($row)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// clear out previous data\n\t\t$classes = false;\n\n\t\t// run our special class code\n\t\t// this code adds a class (or not) to the table row based on field contents\n\t\tif (isset($SPECIAL_CLASS)) {\n\t\t\tforeach ($SPECIAL_CLASS as $SP_CLASS_USE) {\n\t\t\t\t$SP_CLASS_USE[CODE] = replace_meta($row, $SP_CLASS_USE[CODE]);\n\n#\t\t\t\tcall('$do_it = (bool) ('.$SP_CLASS_USE[CODE].');');\n\t\t\t\teval('$do_it = (bool) ('.$SP_CLASS_USE[CODE].');');\n\n\t\t\t\tif ($do_it && ! empty($SP_CLASS_USE[TRU])) {\n\t\t\t\t\t$classes[] = massage_data($row, $SP_CLASS_USE[TRU]);\n\t\t\t\t}\n\n\t\t\t\tif ( ! $do_it && ! empty($SP_CLASS_USE[FALS])) {\n\t\t\t\t\t$classes[] = massage_data($row, $SP_CLASS_USE[FALS]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// run our special html code\n\t\t// this code adds html (or not) to the table row based on field contents\n\t\t$spec_html = '';\n\t\tif (isset($SPECIAL_HTML)) {\n\t\t\tforeach ($SPECIAL_HTML as $SP_HTML_USE) {\n\t\t\t\tforeach ($SP_HTML_USE as $key => $col) {\n\t\t\t\t\t$SP_HTML_USE[$key] = replace_meta($row, $col);\n\t\t\t\t}\n\n#\t\t\t\tcall('$do_it = (bool) ('.$SP_HTML_USE[CODE].');');\n\t\t\t\teval('$do_it = (bool) ('.$SP_HTML_USE[CODE].');');\n\n\t\t\t\tif ($do_it && ! empty($SP_HTML_USE[TRU])) {\n\t\t\t\t\t$spec_html .= ' '.massage_data($row, $SP_HTML_USE[TRU]);\n\t\t\t\t}\n\n\t\t\t\tif ( ! $do_it && ! empty($SP_HTML_USE[FALS])) {\n\t\t\t\t\t$spec_html .= ' '.massage_data($row, $SP_HTML_USE[FALS]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (1 === ($i % 2) && ! empty($opts['alt_class'])) {\n\t\t\t$classes[] = $opts['alt_class'];\n\t\t}\n\n\t\t$class = (is_array($classes)) ? ' class=\"'.implode(' ', $classes).'\"' : '';\n\n\t\t$bodyhtml .= '<tr'.$class.$spec_html.'>';\n\n\t\t// don't just start outputting the data\n\t\t// output it in the order specified by the table_format\n\t\tforeach ($table_format as $ckey => $col) {\n\t\t\tif ( ! is_array($col)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! is_array($col[TYPE]) && ('SPECIAL_' == substr($col[TYPE], 0, 8))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$col[EXTRA] = (isset($col[EXTRA])) ? ' '.trim($col[EXTRA]) : '';\n\n\t\t\t$bodyhtml .= '\n\t\t\t\t<td'.$col[EXTRA].'>';\n\t\t\tif (is_null($col[FIELD])) {\n\t\t\t\t// we don't want to show anything in this column\n\t\t\t\t// do nothing\n\t\t\t}\n\t\t\telseif (isset($row[$col[FIELD]])) {\n\t\t\t\t// we have normal data\n\t\t\t\t$bodyhtml .= $row[$col[FIELD]];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$bodyhtml .= massage_data($row, $col[FIELD]);\n\t\t\t}\n\n\t\t\t$bodyhtml .= '</td>';\n\t\t}\n\n\t\t// grab the totals\n\t\tif ($opts['totals'] && (0 != count($total_cols))) {\n\t\t\tforeach ($total_cols as $total_col) {\n\t\t\t\tif ('__total' == $total_col) {\n\t\t\t\t\t$totals[$total_col] = 'Total';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$totals[$total_col] += $row[$total_col];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$bodyhtml .= '\n\t\t\t</tr>';\n\n\t\t++$i;\n\t}\n\n\t$bodyhtml .= '\n\t\t\t</tbody>';\n\n\t// start building the footer\n\tif ($opts['totals'] && (0 != count($totals))) {\n\t\t$foothtml = '\n\t\t\t<tfoot>\n\t\t\t<tr>';\n\n\t\tforeach ($table_format as $ckey => $col) {\n\t\t\tif ( ! is_array($col)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ('SPECIAL_' == substr($col[TYPE], 0, 8)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$foothtml .= '\n\t\t\t\t<td>';\n\t\t\tif (is_null($col[TOTAL])) {\n\t\t\t\t$foothtml .= '--';\n\t\t\t}\n\t\t\telseif (isset($totals[$col[TOTAL]])) {\n\t\t\t\t// we have normal data\n\t\t\t\t$foothtml .= $totals[$col[TOTAL]];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$foothtml .= massage_data($totals, $col[TOTAL]);\n\t\t\t}\n\n\t\t\t$foothtml .= '</td>';\n\t\t}\n\n\t\t$foothtml .= '\n\t\t\t</tr>\n\t\t\t</tfoot>';\n\t}\n\telse {\n\t\t$foothtml = '';\n\t}\n\n\t// build the sortable script\n\tif ($opts['sortable']) {\n\t\t$table_id = get_table_id( );\n\t\t$opts['extra_html'] .= ' id=\"'.$table_id.'\"';\n\n\t\t$sort_script = get_sort_script($table_id, $sort_types, $opts['alt_class'], $opts['init_sort_column']);\n\t}\n\telse {\n\t\t$sort_script = '';\n\t}\n\n\t$html = '\n\t\t<table class=\"'.$opts['class'].'\" '.$opts['extra_html'].'>\n\t\t\t'.$opts['caption']\n\t\t\t.$headhtml\n\t\t\t.$foothtml\n\t\t\t.$bodyhtml.'\n\t\t</table>'\n\t\t.$sort_script;\n\n\treturn $html;\n}", "function table_table_header_row($values)\n{\n\t$cells=new ocp_tempcode();\n\tforeach ($values as $value)\n\t{\n\t\t$cells->attach(do_template('TABLE_TABLE_HEADER_ROW_CELL',array('_GUID'=>'5002f54ccddf7259f3460d8c0759fd1a','VALUE'=>$value)));\n\t}\n\n\treturn do_template('TABLE_TABLE_HEADER_ROW',array('_GUID'=>'2f4095b8d30f50f34fdd6acf8dd566b1','CELLS'=>$cells));\n}", "public static function getContentTable($content)\r\n\t{\r\n\t\tpreg_match_all(\"/<(h[\\d]+)[^>]*>(.*)<\\/(\\s*)\\\\1(\\s*)>/i\", $content, $found_headers, PREG_SET_ORDER);\r\n\t\t\r\n\t\tif (count($found_headers) == 0) return array(\"\", $content);\r\n\t\telse\r\n\t\t{\r\n\t\t\t$num_of_headers = 0;\r\n\t\r\n\t\t\tfor ($i = 0; $i < count($found_headers); $i++)\r\n\t\t\t{\r\n\t\t\t\t$div_id = \"_header_\" . $num_of_headers++;\r\n\t\t\t\t\r\n\t\t\t\tif ($i == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$content_table = \"<div id=\\\"toc\\\">\\n<fieldset id=\\\"toc\\\"><legend>\". _AT(\"table_of_contents\").\"</legend>\\n\";\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t$content = str_replace($found_headers[$i][0], '<div id=\"'.$div_id.'\">'.$found_headers[$i][0].'</div>', $content);\r\n\t\t\t\t$content_table .= '<a href=\"'.$_SERVER[\"REQUEST_URI\"].'#'.$div_id.'\" class=\"'.$found_headers[$i][1].'\">'. $found_headers[$i][2].\"</a>\\n\";\r\n\t\r\n\t\t\t\tif ($i == count($found_headers) - 1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$content_table .= \"</fieldset></div><br />\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn array($content_table, $content);\r\n\t\t}\r\n\t}", "function toHtml()\n {\n require_once 'HTML/Table.php';\n $table = new HTML_Table(null, 0, true);\n $table->updateAttributes($this->getAttributes());\n\n $tbody = $table->getBody();\n $tbody->setAutoGrow(true);\n $tbody->setAutoFill('');\n\n $thead = $table->getHeader();\n $thead->setAutoGrow(true);\n $thead->setAutoFill('');\n \n $tfoot = $table->getFooter();\n $tfoot->setAutoGrow(true);\n $tfoot->setAutoFill('');\n \n if (isset($this->_footer) && is_array($this->_footer) && count($this->_footer)) {\n $footer = $this->_footer;\n } elseif (is_string($this->_footer)) {\n $last_column = array_pop(array_keys($this->_columnNames));\n $footer = array($last_column => $this->_footer);\n if (isset($this->_footerAttributes['@all'])) {\n if (isset($this->_footerAttributes[$last_column])) {\n $this->_footerAttributes[$last_column] = array_merge($this->_footerAttributes['@all'], $this->_footerAttributes[$last_column]);\n } else {\n $this->_footerAttributes[$last_column] = $this->_footerAttributes['@all'];\n }\n unset($this->_footerAttributes['@all']);\n }\n }\n\n $col = 0;\n if ($this->_columnNames) {\n foreach ($this->_columnNames as $key => $value) {\n $thead->setHeaderContents(0, $col, $value, $this->_columnAttributes[$key]);\n if (isset($footer)) {\n if (isset($footer[$key])) {\n $attributes = isset($this->_footerAttributes['@all']) ? $this->_footerAttributes['@all'] : array();\n if (isset($this->_footerAttributes[$key])) $attributes = array_merge($attributes, $this->_footerAttributes[$key]);\n if (isset($col_spanned)) {\n $tfoot->setCellContents(0, $col_spanned, $footer[$key]);\n $tfoot->setCellAttributes(0, $col_spanned, array_merge($attributes, array('colspan' => $key - $col_spanned + 1)));\n unset($col_spanned);\n } else {\n $tfoot->setCellContents(0, $col, $footer[$key]);\n if (!empty($attributes)) $tfoot->setCellAttributes(0, $col, $attributes);\n }\n } else {\n if (!isset($col_spanned)) $col_spanned = $key;\n }\n }\n ++$col;\n }\n }\n if (!empty($this->_rows)) {\n $row = 0;\n foreach (array_keys($this->_rows) as $key) {\n $col = 0;\n foreach (array_keys($this->_rows[$key]) as $key2) {\n $tbody->setCellContents($row, $col, $this->_rows[$key][$key2]->toHTML());\n $attributes = isset($this->_rowAttributes[$key]['@all']) ? $this->_rowAttributes[$key]['@all'] : array();\n if (isset($this->_rowAttributes[$key][$key2])) $attributes = array_merge($attributes, $this->_rowAttributes[$key][$key2]);\n if (!empty($attributes)) $tbody->setCellAttributes($row, $col, $attributes); \n ++$col;\n }\n if (isset($this->_rowAttributes[$key]['@row'])) $tbody->setRowAttributes($row, $this->_rowAttributes[$key]['@row'], true);\n ++$row;\n }\n } elseif (isset($this->_emptyText)) {\n $tbody->setCellContents(0, 0, $this->_emptyText);\n $tbody->setCellAttributes(0, 0, array('align' => 'center', 'colspan' => count($this->_columnNames)));\n }\n\n return $table->toHTML();\n }", "private function generate_html_header()\n {\n $header = \"<!DOCTYPE html> <html lang=\\\"en\\\"> <head> <meta charset=\\\"UTF-8\\\"> <title>Test statistics</title> <style> table{ border: 1px solid black; margin: 10px 20px; } thead{ background-color:lightgray; } .status{ width: 180px; } #stats{font-size:23px;} .test-name{ min-width: 400px; padding-left: 20px; color:blue; text-decoration: underline; } h1,p{ margin-left: 20px; } .success{ background: lawngreen; } .failed{ background: red; } #detail{ margin-left: 20px; } #input{ min-height: 250px; width: 300px; } #parse_output{ min-height: 400px; width: 500px; } #detail{ display: none; } .status_text_pass{ color:green; font-size: 25px; } .status_text_failed{ color:red; font-size:25px; } </style> </head> <body> <h1>Test statistics</h1><p id=\\\"stats\\\">Success: <span id=\\\"correct\\\"></span>/<span id=\\\"all\\\"></span></p> <p>For test detail click on test name</p> <table> <thead> <tr> <th>Test Name</th> <th>Pass/Fail</th> </tr> </thead> <tbody> </tbody> </table> <div id=\\\"detail\\\"> <h2><span id=\\\"test_name\\\"></span> detail</h2> <h3 id=\\\"status_text\\\"></h3><h3>Input:</h3> <textarea disabled id=\\\"input\\\"></textarea> <h3>Parse output:</h3> <textarea disabled id=\\\"parse_output\\\"></textarea> <h3>Interpret input</h3><span id=\\\"interpret_input\\\"></span> <h3>Reference output</h3><span id=\\\"ref_output\\\"></span> <h3>Interpret output</h3><span id=\\\"interpret_output\\\"></span> <h3>Reference return code:</h3> <span id=\\\"ref_return_code\\\"></span> <h3>Parse return code:</h3> <span id=\\\"parse_return_code\\\"></span> <h3>Interpret return code:</h3> <span id=\\\"interpret_return_code\\\"></span> </div> </body> <script> var tests = [\";\n return $header;\n }", "public function buildTable()\n {\n\n $view = View::getActive();\n\n // Creating the Head\n $head = '<thead class=\"ui-widget-header\" >'.NL;\n $head .= '<tr>'.NL;\n\n $head .= '<th >Project Name</th>'.NL;\n //$head .= '<th>File</th>'.NL;\n $head .= '<th >Description</th>'.NL;\n $head .= '<th style=\"width:165px\" >Nav</th>'.NL;\n\n $head .= '</tr>'.NL;\n $head .= '</thead>'.NL;\n //\\ Creating the Head\n\n // Generieren des Bodys\n $body = '<tbody class=\"ui-widget-content\" >'.NL;\n\n $num = 1;\n foreach ($this->data as $key => $row) {\n $rowid = $this->name.\"_row_$key\";\n\n $body .= \"<tr class=\\\"row$num\\\" id=\\\"$rowid\\\" >\";\n\n $urlConf = 'index.php?c=Daidalos.Projects.genMask&amp;objid='.urlencode($key);\n $linkConf = '<a title=\"GenMask\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlConf.'\">'\n .Wgt::icon('daidalos/bdl_mask.png' , 'xsmall' , 'build').'</a>';\n\n $urlGenerate = 'index.php?c=Genf.Bdl.build&amp;objid='.urlencode($key);\n $linkGenerate = '<a title=\"Code generieren\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlGenerate.'\">'\n .Wgt::icon('daidalos/parser.png' , 'xsmall' , 'build').'</a>';\n\n\n $urlDeploy = 'index.php?c=Genf.Bdl.deploy&amp;objid='.urlencode($key);\n $linkDeploy = '<a title=\"Deploy the Project\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlDeploy.'\">'\n .Wgt::icon('genf/deploy.png' , 'xsmall' , 'deploy').'</a>';\n\n $urlRefreshDb = 'index.php?c=Genf.Bdl.refreshDatabase&amp;objid='.urlencode($key);\n $linkRefreshDb = '<a title=\"Refresh the database\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlRefreshDb.'\">'\n .Wgt::icon('daidalos/db_refresh.png' , 'xsmall' , 'sync db').'</a>';\n\n $urlSyncDb = 'index.php?c=Genf.Bdl.syncDatabase&amp;objid='.urlencode($key);\n $linkSyncDb = '<a title=\"Sync the database with the model\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlSyncDb.'\">'\n .Wgt::icon('daidalos/db_sync.png' , 'xsmall' , 'sync db').'</a>';\n\n $urlPatchDb = 'index.php?c=Genf.Bdl.createDbPatch&amp;objid='.urlencode($key);\n $linkPatchDb = '<a title=\"Create an SQL Patch to alter the database\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlPatchDb.'\" >'\n .Wgt::icon('genf/dump.png' , 'xsmall' , 'create alter patch').'</a>';\n\n $urlClean = 'index.php?c=Genf.Bdl.clean&amp;objid='.urlencode($key);\n $linkClean = '<a title=\"Projekt cleanen\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlClean.'\">'\n .Wgt::icon('genf/clean.png' , 'xsmall' , 'clean').'</a>';\n\n $body .= '<td valign=\"top\" >'.$row[0].'</td>'.NL;\n //$body .= '<td valign=\"top\" >'.$row[1].'</td>'.NL;\n $body .= '<td valign=\"top\" >'.$row[2].'</td>'.NL;\n $body .= '<td valign=\"top\" align=\"center\" >'.$linkConf.' | '.$linkGenerate.$linkDeploy.' | '.$linkSyncDb.' '.$linkRefreshDb.' '.$linkPatchDb.' | '.$linkClean.'</td>'.NL;\n\n $body .= '</tr>'.NL;\n\n $num ++;\n if ($num > $this->numOfColors)\n $num = 1;\n\n }// ENDE FOREACH\n\n $body .= \"</tbody>\".NL;\n //\\ Generieren des Bodys\n\n $html ='<table id=\"table_'.$this->name.'\" class=\"full\" >'.NL;\n $html .= $head;\n $html .= $body;\n $html .= '</table>'.NL;\n\n return $html;\n\n }", "function RowHeadFoot($data) {\n $nb = 0;\n for ($i = 0; $i < count($data); $i++)\n $nb = max($nb, $this->NbLines($this->widths[$i], $data[$i]));\n $h = 5 * $nb;\n //Issue a page break first if needed\n $this->CheckPageBreak($h);\n //Draw the cells of the row\n for ($i = 0; $i < count($data); $i++) {\n $w = $this->widths[$i];\n $a = isset($this->aligns[$i]) ? $this->aligns[$i] : 'L';\n //Save the current position\n $x = $this->GetX();\n $y = $this->GetY();\n //Draw the border\n $this->Rect($x, $y, $w, $h);\n //Print the text\n $this->SetFont('Arial', 'B', 7);\n $this->SetFillColor(203, 203, 203);\n $this->MultiCell($w, 5, $data[$i], 1, $a, true);\n //Put the position to the right of the cell\n $this->SetXY($x + $w, $y);\n }\n //Go to the next line\n $this->Ln($h);\n }", "private function buildBody()\n {\n $day = 1;\n $now_date = $this->year . '-' . $this->month . '-01';\n $startingDay = date('N', strtotime('first day of this month', strtotime($now_date)));\n //Add the following line if you want to start the week with monday instead of sunday. Or change the number to suit your needs.\n //$startingDay = $startingDay - 1;\n $monthLength = $this->daysMonth[$this->month - 1];\n if ($this->month == 2 && ((($this->year % 4) == 0) && ((($this->year % 100) != 0) || (($this->year % 400) == 0)))) {\n $monthLength = $monthLength + 1;\n }\n $h = \"<tr>\";\n for ($i = $startingDay == 7 ? 1 : 0; $i < 9; $i++) {\n for ($j = 0; $j <= 6; $j++) {\n $currDate = $this->getDayDate($day);\n $class = $this->getTdClass($day);\n $h .= \"<td data-datetime='$currDate' $class>\";\n $h .= $this->dateWrap[0];\n if ($day <= $monthLength && ($i > 0 || $j >= $startingDay)) {\n $h .= $this->dayWrap[0];\n $h .= $this->getEventSearchLink($day);\n $h .= $this->dayWrap[1];\n $h .= $this->buildEvents($currDate);\n $day++;\n } else {\n $h .= \"&nbsp;\";\n }\n $h .= $this->dateWrap[1];\n $h .= \"</td>\";\n }\n // stop making rows if we've run out of days\n if ($day > $monthLength) {\n break;\n } else {\n $h .= \"</tr>\";\n $h .= \"<tr>\";\n }\n }\n $h .= \"</tr>\";\n $h .= \"</tbody>\";\n $h .= \"</table>\";\n $this->html .= $h;\n }", "public function renderTableHeader() {\n $cells = [];\n foreach ($this->columns as $column) {\n /* @var $column Column */\n $cells[] = $column->renderHeaderCell();\n }\n $content = $this->html()->tag('table-row', array('content' => implode('', $cells)), $this->headerRowOptions);\n\n if ($this->filterPosition == self::FILTER_POS_HEADER) {\n $content = $this->renderFilters() . $content;\n } elseif ($this->filterPosition == self::FILTER_POS_BODY) {\n $content .= $this->renderFilters();\n }\n\n return \"<thead>\\n\" . $content . \"\\n</thead>\";\n }", "public function docHeaderContent() {}", "protected function makeHeader()\n {\n }", "public function buildHeader() {\n $header['label'] = $this->t('Label');\n $header['workflow'] = $this->t('Workflow');\n $header['status'] = $this->t('Status');\n $header['transition'] = $this->t('Transitions');\n $header['roles'] = $this->t('Email Roles');\n $header['author'] = $this->t('Email Author');\n $header['emails'] = $this->t('Adhoc Emails');\n return $header + parent::buildHeader();\n }", "public static function htmlTable ($array, $tableHeadingSubstitutions = array (), $class = 'lines', $keyAsFirstColumn = true, $uppercaseHeadings = false, $allowHtml = false /* true/false/array(field1,field2,..) */, $showColons = false, $addCellClasses = false, $addRowKeyClasses = false, $onlyFields = array (), $compress = false, $showHeadings = true, $encodeEmailAddress = true)\r\n\t{\r\n\t\t# Check that the data is an array\r\n\t\tif (!is_array ($array)) {return $html = \"\\n\" . '<p class=\"warning\">Error: the supplied data was not an array.</p>';}\r\n\t\t\r\n\t\t# Return nothing if no data\r\n\t\tif (empty ($array)) {return '';}\r\n\t\t\r\n\t\t# Assemble the data cells\r\n\t\t$dataHtml = '';\r\n\t\tforeach ($array as $key => $value) {\r\n\t\t\tif (!$value || !is_array ($value)) {return $html = \"\\n\" . '<p class=\"warning\">Error: the supplied data was not a multi-dimensional array.</p>';}\r\n\t\t\t$headings = $value;\r\n\t\t\t$dataHtml .= \"\\n\\t\" . '<tr' . ($addRowKeyClasses ? ' class=\"' . htmlspecialchars ($key) . '\"' : '') . '>';\r\n\t\t\tif ($keyAsFirstColumn) {\r\n\t\t\t\t$thisCellClass = ($addCellClasses ? htmlspecialchars ($key) . ((is_array ($addCellClasses) && isSet ($addCellClasses[$key])) ? ' ' . $addCellClasses[$key] : '') : '') . ($keyAsFirstColumn ? ($addCellClasses ? ' ' : '') . 'key' : '');\r\n\t\t\t\t$dataHtml .= ($compress ? '' : \"\\n\\t\\t\") . (strlen ($thisCellClass) ? \"<td class=\\\"{$thisCellClass}\\\">\" : '<td>') . \"<strong>{$key}</strong></td>\";\r\n\t\t\t}\r\n\t\t\t$i = 0;\r\n\t\t\tforeach ($value as $valueKey => $valueData) {\r\n\t\t\t\tif ($onlyFields && !in_array ($valueKey, $onlyFields)) {continue;}\t// Skip if not in the list of onlyFields if that is supplied\r\n\t\t\t\t$i++;\r\n\t\t\t\t$data = $array[$key][$valueKey];\r\n\t\t\t\t$thisCellClass = ($addCellClasses ? htmlspecialchars ($valueKey) . ((is_array ($addCellClasses) && isSet ($addCellClasses[$valueKey])) ? ' ' . $addCellClasses[$valueKey] : '') : '') . ((($i == 1) && !$keyAsFirstColumn) ? ($addCellClasses ? ' ' : '') . 'key' : '');\r\n\t\t\t\t$htmlAllowed = (is_array ($allowHtml) ? (in_array ($valueKey, $allowHtml)) : $allowHtml);\t// Either true/false or an array of permitted fields where HTML is allowed\r\n\t\t\t\t$cellContents = ($htmlAllowed ? $data : htmlspecialchars ($data));\r\n\t\t\t\t$dataHtml .= ($compress ? '' : \"\\n\\t\\t\") . (strlen ($thisCellClass) ? \"<td class=\\\"{$thisCellClass}\\\">\" : '<td>') . ($encodeEmailAddress ? self::encodeEmailAddress ($cellContents) : $cellContents) . (($showColons && ($i == 1) && $data) ? ':' : '') . '</td>';\r\n\t\t\t}\r\n\t\t\t$dataHtml .= ($compress ? '' : \"\\n\\t\") . '</tr>';\r\n\t\t}\r\n\t\t\r\n\t\t# Construct the heading HTML\r\n\t\t$headingHtml = '';\r\n\t\tif ($tableHeadingSubstitutions !== false) {\r\n\t\t\t$headingHtml .= \"\\n\\t\" . '<tr>';\r\n\t\t\tif ($keyAsFirstColumn) {$headingHtml .= \"\\n\\t\\t\" . '<th></th>';}\r\n\t\t\t$columns = array_keys ($headings);\r\n\t\t\tforeach ($columns as $column) {\r\n\t\t\t\tif ($onlyFields && !in_array ($column, $onlyFields)) {continue;}\t// Skip if not in the list of onlyFields if that is supplied\r\n\t\t\t\t$columnTitle = (empty ($tableHeadingSubstitutions) ? $column : (isSet ($tableHeadingSubstitutions[$column]) ? $tableHeadingSubstitutions[$column] : $column));\r\n\t\t\t\t$headingHtml .= \"\\n\\t\\t\" . ($addCellClasses ? '<th class=\"' . $column . ((is_array ($addCellClasses) && isSet ($addCellClasses[$column])) ? ' ' . $addCellClasses[$column] : '') . '\">' : '<th>') . ($uppercaseHeadings ? ucfirst ($columnTitle) : $columnTitle) . '</th>';\r\n\t\t\t}\r\n\t\t\t$headingHtml .= \"\\n\\t\" . '</tr>';\r\n\t\t}\r\n\t\t\r\n\t\t# Construct the overall heading\r\n\t\t$html = \"\\n\\n\" . \"<table class=\\\"{$class}\\\">\";\r\n\t\tif ($showHeadings) {$html .= $headingHtml;}\r\n\t\t$html .= $dataHtml;\r\n\t\t$html .= \"\\n\" . '</table>';\r\n\t\t\r\n\t\t# Return the HTML\r\n\t\treturn $html;\r\n\t}", "public function addTableHeader($data, $params = array(), $cell_end = 'H') {\n // offset\n $offset = 0;\n if (isset($params['offset']))\n $offset = is_numeric($params['offset']) ? (int)$params['offset'] : PHPExcel_Cell::columnIndexFromString($params['offset']);\n\n // font name\n if (isset($params['font']))\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getFont()->setName($params['font']);\n\n // font size\n if (isset($params['size']))\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getFont()->setSize($params['size']);\n\n // bold\n if (isset($params['bold']))\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getFont()->setBold($params['bold']);\n\n // italic\n if (isset($params['italic']))\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getFont()->setItalic($params['italic']);\n\n // horizontal\n if (isset($params['horizontal'])) {\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getAlignment()->setHorizontal($params['horizontal']);\n }\n\n // text color\n if (isset($params['text_color'])) {\n $this->_xls->getActiveSheet()->getStyle(sprintf('A3:%s3', $cell_end))->getFont()->getColor()->setRGB($params['text_color']);\n }\n\n // fill color\n if (isset($params['fill_color'])) {\n $this->_xls->getActiveSheet()->getStyle(sprintf('A3:%s3', $cell_end))->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setRGB($params['fill_color']);\n }\n\n // set internal params that need to be processed after data are inserted\n $this->_tableParams = array(\n 'header_row' => $this->_row,\n 'offset' => $offset,\n 'row_count' => 0,\n 'auto_width' => array(),\n 'filter' => array(),\n 'wrap' => array(),\n 'horizontal' => false,\n 'fill_color' => false,\n 'text_color' => false,\n );\n\n if( !empty($data) ) {\n foreach ($data as $d) {\n $child = Common::hashEmptyField($d, 'child');\n\n // set label\n $this->_xls->getActiveSheet()->setCellValueByColumnAndRow($offset, $this->_row, $d['label']);\n\n // set width\n if (isset($d['width']) && is_numeric($d['width']))\n $this->_xls->getActiveSheet()->getColumnDimensionByColumn($offset)->setWidth((float)$d['width']);\n else\n $this->_tableParams['auto_width'][] = $offset;\n\n // filter\n if (isset($d['filter']) && $d['filter'])\n $this->_tableParams['filter'][] = $offset;\n\n // wrap\n if (isset($d['wrap']) && $d['wrap'])\n $this->_tableParams['wrap'][] = $offset;\n\n // fill color\n if (isset($d['fill_color']) && $d['fill_color'])\n $this->_tableParams['fill_color'][] = $offset;\n\n // text color\n if (isset($d['text_color']) && $d['text_color'])\n $this->_tableParams['text_color'][] = $offset;\n\n if( !empty($child) ) {\n $childRow = $this->_row+1;\n\n if( !isset($childOffset) ) {\n $childOffset = $offset;\n }\n\n foreach ($child as $key => $val) {\n $label = Common::hashEmptyField($val, 'label');\n $width = Common::hashEmptyField($val, 'width');\n\n $childOffsetAcii = 1+$childOffset;\n $childOffsetAcii = Common::getNameFromNumber($childOffsetAcii);\n $childPosition = sprintf('%s%s:%s%s', $childOffsetAcii, $childRow, $childOffsetAcii, $childRow);\n\n $this->_xls->getActiveSheet()->setCellValueByColumnAndRow($childOffset, $childRow, $label);\n \n if (isset($width) && is_numeric($width))\n $this->_xls->getActiveSheet()->getColumnDimensionByColumn($childOffset)->setWidth((float)$width);\n else\n $this->_tableParams['auto_width'][] = $childOffset;\n\n // text color\n if (isset($params['text_color'])) {\n $this->_xls->getActiveSheet()->getStyle($childPosition)->getFont()->getColor()->setRGB($params['text_color']);\n }\n\n // fill color\n if (isset($params['fill_color'])) {\n $this->_xls->getActiveSheet()->getStyle($childPosition)->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setRGB($params['fill_color']);\n }\n\n // horizontal\n if (isset($params['horizontal'])) {\n $this->_xls->getActiveSheet()->getStyle($childRow)->getAlignment()->setHorizontal($params['horizontal']);\n }\n\n $childOffset++;\n }\n }\n\n if( !empty($d['rowspan']) ) {\n $rowspan = $d['rowspan']-1;\n $default = 1+$offset;\n $row = $this->_row;\n $cell_end = $row+$rowspan; // Acii A\n\n $default = Common::getNameFromNumber($default);\n $this->_xls->getActiveSheet()->mergeCells(__('%s%s:%s%s', $default, $row, $default, $cell_end));\n // $this->_row += $rowspan;\n // $offset++;\n }\n if( !empty($d['colspan']) ) {\n $colspan = $d['colspan']-1;\n $default = 1+$offset;\n $dimensi = $default+$colspan; // Acii A\n $row = $this->_row;\n\n $default = Common::getNameFromNumber($default);\n $cell_end = Common::getNameFromNumber($dimensi);\n\n $this->_xls->getActiveSheet()->mergeCells(__('%s%s:%s%s', $default, $row, $cell_end, $row));\n \n $offset += $colspan;\n // $this->_row ++;\n }\n\n $offset++;\n }\n }\n\n $child = Set::extract('/child', $data);\n\n if ( !empty($child) ) {\n $this->_row++;\n }\n \n $this->_row++;\n\n return $this;\n }", "function create_pool_header()\n{\n $header =\n \"<thead>\n <tr>\n <th scope='col' class='rounded-company'>Pool</th>\n <th scope='col' class='rounded-q1'>Priority</th>\n <th scope='col' class='rounded-q1' colspan='2'>URL</th>\n <th scope='col' class='rounded-q1'>Gets</th>\n <th scope='col' class='rounded-q1'>Accepts</th>\n <th scope='col' class='rounded-q1'>Rejects</th>\n <th scope='col' class='rounded-q1'>Discards</th>\n <th scope='col' class='rounded-q1'>Stales</th>\n <th scope='col' class='rounded-q1'>Get Fails</th>\n <th scope='col' class='rounded-q1'>Rem fails</th>\n </tr>\n </thead>\";\n\n return $header;\n}", "public function Header() {\n $bMargin = $this->getBreakMargin();\n\n // Get current auto-page-break mode\n $auto_page_break = $this->AutoPageBreak;\n\n // Disable auto-page-break\n $this->SetAutoPageBreak(false, 0);\n\n // Define the path to the image that you want to use as watermark.\n\t\tif($this->headerImage!='')\n\t\t{\n\t\t\t $header_logo = './'.$this->headerImage;\n\t\t\t \n\t\t}else{\n\t\t\t $header_logo = './assets/logo/Assetswatch.png';\n\t\t}\n\t\tif($this->watermarkImage!='')\n\t\t{\n\t\t\t$img_file = './'.$this->watermarkImage;\n\t\t}else{\n\t\t\t $img_file = './assets/logo/water-mark.png';\n\t\t}\n \n\t\t// echo $header_logo.\"<br>\";\n\t\t// echo $img_file.\"<br>\";\n\t\t // exit();\n // Render the image\n\t\t$this->Image($header_logo, 135,5, 55, 18, '', '', '', false, 300, '', false, false, 0);\n $this->Image($img_file, 53,100, '100px', '100px', '', '', '', false, 300, '', false, false, 0);\n\t\t\n\t\tif($this->headerContent!='')\n\t\t{\n\t\t\t$this->Cell(0, 10,$this->headerContent , 0, false, 'L', 0, '', 0, false, 'T', 'M');\n\t\t}else{\n\t\t\t$this->Cell(0, 10,'' , 0, false, 'C', 0, '', 0, false, 'T', 'M');\n\t\t}\n // Restore the auto-page-break status\n $this->SetAutoPageBreak($auto_page_break, $bMargin);\n\n // Set the starting point for the page content\n $this->setPageMark();\n }", "function outputHeader()\n {\n global $application;\n\n $output = '';\n if (!is_array($this -> _attrs))\n return $output;\n\n // output error column\n if (is_array($this -> _Errors) && !empty($this -> _Errors))\n $output .= $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'header-error.tpl.html',\n array()\n );\n\n foreach($this -> _attrs as $k => $v)\n {\n if ($v != 'YES')\n continue;\n\n $template_contents = array(\n 'HeaderName' => getMsg('SYS', @$this -> _headermap[$k])\n );\n $this -> _Template_Contents = $template_contents;\n $application -> registerAttributes($this -> _Template_Contents);\n $output .= $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'header-cell.tpl.html',\n array()\n );\n }\n\n return $output;\n }", "function Header()\n\t{\n\t\tglobal $TAHUN;\n\t\tglobal $gelom;\n\t\tglobal $np;\n\t\t$this->Image('umg.jpg',2.5,0.7,1.8,1.8);\t\n\t\t$this->SetY(1);\n\t\t$this->SetFont('Times','',10);\t\t\n\t\tif($np=='1') { $test= 'BEBAS TEST'; }\n\t\tif($np=='2') { $test= 'TEST'; }\n\t\t$this->Cell(19,0.5,'UNIVERSITAS MUHAMMADIYAH GRESIK',0,0,'C'); \t\t\n\t\t$this->Ln();\n\t\t$this->Cell(19,0.5,'DAFTAR '.$test.' CALON MAHASISWA BARU',0,0,'C');\t\t\t\t\n\t\t$this->Ln();\n\t\t$this->Cell(19,0.5,'TAHUN '.$TAHUN.' GELOMBANG '.$gelom,0,0,'C');\t\t\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('Arial','B',8);\n\t\t$this->Ln();\n\t\t$this->Cell(1.2,0.5,'No','LBRT',0,'C');\n\t\t$this->Cell(2.8,0.5,'Nomor Pendaftaran','LBRT',0,'C');\n\t\tif($np=='1') \n\t\t{ \n\t\t\t$this->Cell(10.8,0.5,'Nama Calon Mahasiswa','LBRT',0,'C');\n\t\t}\n\t\tif($np=='2') \n\t\t{ \n\t\t\t$this->Cell(2.8,0.5,'Nomor Ujian','LBRT',0,'C');\n\t\t\t$this->Cell(8,0.5,'Nama Calon Mahasiswa','LBRT',0,'C');\n\t\t}\n\t\t$this->Cell(4.2,0.5,'Jurusan','LBRT',0,'C');\n\t\t$this->Ln();\n\t}", "private function makeTableHeader($type,$header,$colspan=2): void {\r\n\t\tif(!$this->bInitialized) {\r\n\t\t\t$header = ' (' . $header . ') ';\r\n\t\t\t$this->bInitialized = true;\r\n\t\t}\r\n\t\t$str_i = ($this->bCollapsed) ? 'style=\"font-style:italic\" ' : '';\r\n\t\t\r\n\t\techo '<table class=\"dBug_table dBug_'.$type.'\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th '.$str_i.' class=\"dBug_clickable_table dBug_' . $type . 'Header\" colspan=\"' . $colspan . '\">' . $header . '</th>\r\n\t\t\t\t</tr>';\r\n\t}", "public function buildHeader() {\n $this->build = [\n // '#type' => 'page',.\n 'container' => [\n '#type' => 'html_tag',\n '#tag' => 'div',\n '#attributes' => [\n 'class' => 'container',\n ],\n 'page_header' => [\n '#type' => 'html_tag',\n '#tag' => 'h2',\n '#value' => $this->t('<a href=\"@site-audit-uri\">Site Audit</a> report for @site', [\n '@site-audit-uri' => 'https://drupal.org/project/site_audit',\n '@site' => $this->options['uri'],\n ]),\n '#attributes' => [\n 'id' => 'page-header',\n ],\n 'br' => [\n '#type' => 'html_tag',\n '#tag' => 'br',\n ],\n 'sub_head' => [\n '#type' => 'html_tag',\n '#tag' => 'small',\n '#value' => $this->t('Generated on @date_time', ['@date_time' => \\Drupal::service('date.formatter')->format(\\Drupal::time()->getRequestTime())]),\n ],\n ],\n ],\n ];\n if (is_array($this->report)) {\n // There are multiple reports.\n $this->build['container']['summary'] = [\n '#type' => 'html_tag',\n '#tag' => 'div',\n '#attributes' => [\n 'id' => 'summary',\n ],\n ];\n $this->build['container']['summary']['title'] = [\n '#type' => 'html_tag',\n '#tag' => 'h2',\n '#value' => $this->t('Summary'),\n ];\n $this->build['container']['summary']['links'] = [\n '#type' => 'html_tag',\n '#tag' => 'p',\n ];\n foreach ($this->report as $report) {\n $this->build['container']['summary']['links'][$report->getPluginId()] = [\n '#type' => 'html_tag',\n '#tag' => 'a',\n '#value' => $report->getLabel() . ' (' . $report->getPercent() . '%)',\n '#attributes' => [\n 'href' => '#' . $report->getPluginId(),\n 'class' => $this->getPercentCssClass($report->getPercent()),\n ],\n ];\n }\n }\n }", "public function generateHeaders()\n {\n // set our headers first.\n if ( $this->from !== null )\n {\n $this->setHeader( \"From\", ezcMailTools::composeEmailAddress( $this->from ) );\n }\n\n if ( $this->to !== null )\n {\n $this->setHeader( \"To\", ezcMailTools::composeEmailAddresses( $this->to ) );\n }\n if ( count( $this->cc ) )\n {\n $this->setHeader( \"Cc\", ezcMailTools::composeEmailAddresses( $this->cc ) );\n }\n if ( count( $this->bcc ) && $this->options->stripBccHeader === false )\n {\n $this->setHeader( \"Bcc\", ezcMailTools::composeEmailAddresses( $this->bcc ) );\n }\n\n $this->setHeader( 'Subject', $this->subject, $this->subjectCharset );\n\n $this->setHeader( 'MIME-Version', '1.0' );\n $this->setHeader( 'User-Agent', 'eZ Components' );\n $this->setHeader( 'Date', date( 'r' ) );\n $idhost = $this->from != null && $this->from->email != '' ? $this->from->email : 'localhost';\n if ( is_null( $this->messageId ) )\n {\n $this->setHeader( 'Message-Id', '<' . ezcMailTools::generateMessageId( $idhost ) . '>' );\n }\n else\n {\n $this->setHeader( 'Message-Id', $this->messageID );\n }\n\n // if we have a body part, include the headers of the body\n if ( is_subclass_of( $this->body, \"ezcMailPart\" ) )\n {\n return parent::generateHeaders() . $this->body->generateHeaders();\n }\n return parent::generateHeaders();\n }", "function headerTable($conn)\n\t{\n\t\t$query = $conn->query(\"SELECT * FROM `tbl_transaction` NATURAL JOIN `tbl_guest` WHERE `transaction_id` LIKE $_REQUEST[transaction_id] \") or die(mysql_error());\n\t\t$fetch = $query->fetch_array();\n\n\t\t$this->SetFont(\"Times\",\"I\",9);\n\t\t$this->Cell(18,7,\"RefNo. \",0,0);\n\t\t$this->Cell(35,7,\": hr-\".$fetch['transaction_id'],0,0);\n\t\t$this->SetFont(\"Arial\",\"\",9);\n\t\t$this->Cell(26,7,\"Reservation Date \",0,0);\n\t\t$this->Cell(35,7,\": \".$fetch['reserve_date'],0,1);\n\t\t$this->Cell(18,7,\"Guest \",0,0);\n\t\t$this->Cell(35,7,\": \".$fetch['name'].' '.$fetch['surname'],0,0);\n\t\t$this->Cell(26,7,\"Email Address \",0,0);\n\t\t$this->Cell(35,7,\": \".$fetch['email_id'],0,1);\n\t\t$this->Cell(188,4,\"\",0,1);\n\t\t$this->Ln(4);\n\n\t\t//Reservation Details Title\n\t\t$this->SetFont(\"Arial\",\"U\",12);\n\t\t$this->Cell(35,10,\"Reservation Details\",0,1);\n\t\t//header\n\t\t$this->SetFont('Times','B',12);\n\t\t$this->Cell(41,10,'Room Type',1,0,'C');\n\t\t$this->Cell(22,10,'Room No.',1,0,'C');\n\t\t$this->Cell(25,10,'Check in',1,0,'C');\n\t\t$this->Cell(13,10,'Days',1,0,'C');\n\t\t$this->Cell(25,10,'Check out',1,0,'C');\n\t\t$this->Cell(22,10,'Extra bed',1,0,'C');\n\t\t$this->Cell(42,10,'Bill',1,1,'C');\n\t\t//$this->Cell(18,10,'Payment',1,1,'C');\n\t\t//$this->Ln();\n\t}", "function drawHeader(){\n switch ($this->doing){\n case 'budget_byProjects':\n case 'myguests':\n if (!(@$this->t instanceof b_table)){\n\t$this->dbg('CANCEL header');\n\t$this->t = new b_table_dummy();\n }\n break;\n\n default:\n parent::drawHeader();\n break;\n }\n }", "protected function buildDomainObject($row) {\n\t\t$header = new Header();\n\t\t$header->setId($row['header_id']);\n\t\t$header->setText($row['header_text']);\n\t\treturn $header;\n\t}", "public function Header() {\r\n $this->varcave->logger->debug('Create PDF top header');\r\n\t\tif ($this->noheader){\r\n\t\t\treturn true;\r\n\t\t}\r\n // Logo\r\n\t\t$this->setFont($this->font, 'BI', 8, '', 'false');\r\n\t\t$this->Image($this->headerImg,4,4,170);\r\n\t\t\r\n\t\t//text box after header image\r\n\t\t$this->RoundedRect(172,4,35,10,3.5,'D');\r\n\t\t$this->SetXY(173,5);\r\n\t\t$this->cell(0,3, LNE::pdf_caveRef . ': ' . $this->cavedata['caveRef'],0);\r\n\t\t$this->SetXY(173,9);\r\n\t\t//If pagegroup is on set group page number, or set a global PDF page number \r\n\t\tif ( $this->pagegroups == false )\r\n\t\t{\r\n\t\t\t$this->cell(0,3,LNE::pdf_page. ': '. $this->getAliasNumPage() . '/' . $this->getAliasNbPages(),0);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->cell(0,3,LNE::pdf_page .': '. $this->getPageGroupAlias(). '-'.$this->getPageNumGroupAlias() ,0);\r\n\t\t}\r\n\t\t\r\n }", "public function generateDataTable($header,$result,$class=null,$sumColumn=null,$tableStyle='htmltable') {\n\t\tif($tableStyle!='htmltable')\n\t\t\treturn 'Style : '.$tableStyle.' not supported !';\n\n\t\tif($tableStyle=='htmltable')\n\t\t\t{\n\t\t\t$returnTable=$this->generateHtmlTableData($header,$result,$class,$sumColumn);\n\t\t\treturn $returnTable;\n\t\t\t}\n\n\t\treturn $tableContent;\n\t}", "public function constructTableForHeader($stri_img=\"\",$stri_titre=\"\") \n\t{ \n //- constructio de l'interface\n $obj_table=parent::constructTableForHeader(\"images/mvc_imbrication.png\");\n \n return $obj_table;\t\n\t}", "function FancyTable($header,$data)\n\t\t{\n\t\t\t$this->SetFillColor(255,0,0);\n\t\t\t$this->SetTextColor(255);\n\t\t\t$this->SetDrawColor(128,0,0);\n\t\t\t$this->SetLineWidth(.1);\n\t\t\t//$this->SetFont('arial','','B');\n\t\t\t$this->SetFontSize(8);\n\t\t\t//$this->SetLeftMargin(20);\n\t\t\t//Header\n\t\t\tif ($_SESSION['klik']=='Vkupno'){\n\t\t\t\t$w=array(25,36,25,25,25,25); //tuka se kazuva kolku i kolkavi koloni imame\n\t\t\t\t$this->SetLeftMargin(22);\n\t\t\t}\n\t\t\telseif ($_SESSION['klik']==\"Vkupno_saldo\"){\n\t\t\t\t$w=array(17,34,23,25,23,23,23,23);\n\t\t\t}\n\t\t\telseif($_SESSION['klik']=='Analitika'){\n\t\t\t\tif ($_SESSION['totfin']==1){\n\t\t\t\t\t$w=array(40,30,30,30,30);\n\t\t\t\t\t$this->SetLeftMargin(24);\n\t\t\t\t}else{\n\t\t\t\t\t$w=array(25,25,40,25,25,25,25);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor($i=0;$i<count($header);$i++)\n\t\t\t\t$this->Cell($w[$i],6,$header[$i],1,0,'C',true);\n\t\t\t$this->Ln();\n\t\t\t//Color and font restoration\n\t\t\t$this->SetFillColor(224,235,255);\n\t\t\t$this->SetTextColor(0);\n\t\t\t//$this->SetFont('Arial');\n\t\t\t$this->SetFontSize(8);\n\t\t\t//Data\n\t\t\t$fill=false;\n\t\t\t\n\t\t\tif ($_SESSION['klik']=='Vkupno'){\n\t\t\tforeach($data as $row)\n\t\t\t\t{ //tuka gi pravime kolonite\n\t\t\t\t$this->Cell($w[0],6,$row[1],'LR',0,'C',$fill);\n\t\t\t\t$this->Cell($w[1],6,$row[0],'LR',0,'C',$fill);\n\t\t\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[4],6,number_format($row[4]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[5],6,number_format($row[5]),'LR',0,'R',$fill);\n\t\t\t\t$this->Ln();\n\t\t\t\t$fill=!$fill;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($_SESSION['klik']==\"Vkupno_saldo\"){\n\t\t\t\tforeach($data as $row)\n\t\t\t\t{ //tuka gi pravime kolonite\n\t\t\t\t$this->Cell($w[0],6,$row[1],'LR',0,'C',$fill);\n\t\t\t\t$this->Cell($w[1],6,$row[0],'LR',0,'C',$fill);\n\t\t\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[4],6,number_format($row[4]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[5],6,number_format($row[5]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[6],6,number_format($row[6]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[7],6,number_format($row[7]),'LR',0,'R',$fill);\n\t\t\t\t$this->Ln();\n\t\t\t\t$fill=!$fill;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($_SESSION['klik']=='Analitika'){\n\t\t\t\tif ($_SESSION['totfin']==1){\n\t\t\t\t\tforeach($data as $row)\n\t\t\t\t\t{ //tuka gi pravime kolonite\n\t\t\t\t\t$this->Cell($w[0],6,$row[4],'LR',0,'C',$fill);\n\t\t\t\t\t$this->Cell($w[1],6,number_format($row[7]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Cell($w[2],6,number_format($row[8]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Cell($w[3],6,number_format($row[9]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Cell($w[4],6,number_format($row[10]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Ln();\n\t\t\t\t\t$fill=!$fill;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tforeach($data as $row)\n\t\t\t\t\t{ //tuka gi pravime kolonite\n\t\t\t\t\t$this->Cell($w[0],6,$row[3],'LR',0,'C',$fill);\n\t\t\t\t\t$this->Cell($w[1],6,$row[2],'LR',0,'C',$fill);\n\t\t\t\t\t$this->Cell($w[2],6,$row[4],'LR',0,'C',$fill);\n\t\t\t\t\t$this->Cell($w[3],6,number_format($row[7]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Cell($w[4],6,number_format($row[8]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Cell($w[5],6,number_format($row[9]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Cell($w[6],6,number_format($row[10]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Ln();\n\t\t\t\t\t$fill=!$fill;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t$this->Cell(array_sum($w),0,'','T');\n\t\t}", "private function makeTDHeader($type,$header): void {\r\n\t\t$str_d = ($this->bCollapsed) ? ' style=\"display:none\"' : '';\r\n\t\techo '<tr'.$str_d.'>\r\n\t\t\t\t<td class=\"dBug_clickable_row dBug_'.$type.'Key\">' . $header . '</td>\r\n\t\t\t\t<td>';\r\n\t}", "private function setTableHeader($row){\n\t\t$header_data=false;\n\t\tif($this->header){\n\t\t\t$header_data=$this->header;\n\t\t}\n\t\telse{\n\t\t\tif(!empty($row) && is_array($row) && count($row)){\n\t\t\t\tforeach($row as $i => $v){\n\t\t\t\t\t$header_data[$i]=$i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!empty($header_data)){\n\t\t\t$this->table_header.=_N_T.'<tr>';\n\t\t\t$this->table_header.=_N_T_T.'<th class=\"th.LineNum\">#</th>';\n\t\t\tforeach($header_data as $name => $value){\n\t\t\t\t$this->table_header.=_N_T_T.'<th nowrap=\"nowrap\">'.$value.$this->getOrderBy($name).'</th>';\n\t\t\t}\n\t\t\t$this->table_header.=_N_T.'</tr>';\n\t\t}\n\t\treturn $this;\n\t}", "protected function setHeaders()\n {\n $row = 1; \n $this->objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);\n \n $mergeCells = 'A' . $row . ':' . 'E' . $row;\n $this->setCellValue('A' . $row, \"Differences between files.\");\n $this->objPHPExcel->getActiveSheet()->getStyle($mergeCells)->getFont()->setBold(true);\n $this->objPHPExcel->getActiveSheet()->mergeCells($mergeCells);\n $this->objPHPExcel->getActiveSheet()->getRowDimension($row)->setRowHeight(25);\n $this->objPHPExcel->getActiveSheet()->getStyle($mergeCells)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \n \n $row++;\n $cell = 'A' . $row;\n $this->setCellValue($cell, \"Comparing by: \");\n $this->objPHPExcel->getActiveSheet()->getStyle($cell)->getFont()->setBold(true);\n \n $mergeCells = 'B' . $row . ':' . 'C' . $row;\n $this->setCellValue('B' . $row, $this->getCompareTypeLabel()); \n $this->objPHPExcel->getActiveSheet()->mergeCells($mergeCells);\n \n \n $row++;\n $cell = 'A' . $row;\n $this->setCellValue($cell, \"Configuration: \");\n $this->objPHPExcel->getActiveSheet()->getStyle($cell)->getFont()->setBold(true);\n \n $mergeCells = 'B' . $row . ':' . 'M' . $row;\n $this->setCellValue('B' . $row, $this->settings['configuration']); \n $this->objPHPExcel->getActiveSheet()->mergeCells($mergeCells);\n \n $row += 5;\n $columns = $this->getColumns(); \n foreach ($columns as $columnName => $column) {\n $cell = $columnName . $row;\n $this->setCellValue($cell, $column['title']);\n $this->objPHPExcel->getActiveSheet()->getColumnDimension($columnName)->setAutoSize(true);\n $this->objPHPExcel->getActiveSheet()->getStyle($cell)->getFont()->setBold(true);\n }\n \n return $row;\n }", "abstract protected function getRowsHeader(): array;", "public function getTableHeader()\n {\n $tableHead = null;\n $tableHead .= \"<thead>\";\n $tableHead .= \"<tr>\";\n $tableHead .= \"<th>Vecka</th>\";\n $tableHead .= \"<th>Måndag</th>\";\n $tableHead .= \"<th>Tisdag</th>\";\n $tableHead .= \"<th>Onsdag</th>\";\n $tableHead .= \"<th>Torsdag</th>\";\n $tableHead .= \"<th>Fredag</th>\";\n $tableHead .= \"<th>Lördag</th>\";\n $tableHead .= \"<th>Söndag</th>\";\n $tableHead .= \"</tr>\";\n $tableHead .= \"</thead>\";\n\n return $tableHead;\n }", "public function renderTableHeader()\n {\n $cells = [];\n foreach ($this->columns as $column) {\n /* @var $column Column */\n $cells[] = $column->renderHeaderCell();\n }\n $content = Html::tag('tr', implode('', $cells), $this->headerRowOptions);\n if ($this->filterPosition === self::FILTER_POS_HEADER) {\n $content = $this->renderFilters() . $content;\n } elseif ($this->filterPosition === self::FILTER_POS_BODY) {\n $content .= $this->renderFilters();\n }\n\n return \"<thead>\\n\" . $content . \"\\n</thead>\";\n }", "function DisplayTableHeader()\n{\n\t$pdf = $GLOBALS['pdf'];\n\t$width_col_no = $GLOBALS['width_col_no'];\n\t$sync_name_index = $GLOBALS['sync_name_index'];\n\t$collectionWidth = $GLOBALS['collectionWidth'];\n\t$totalWidth = $GLOBALS['totalWidth'];\n\n\t//setkan font jadi bold untuk header\n\t$pdf->SetFont('helvetica','B',9);\n\n\t//koleksi tinggi column header\n\t$header_cols_height = array();\n\n\t//tinggi untuk column 'No'\n\t$header_cols_height[] = $pdf->getNumLines('No',$width_col_no);\n\n\t//dapatkan tinggi untuk setiap column\n\tforeach ($sync_name_index as $key => $value)\n\t{\n\t\t$width_converted = GetAndConvertColumnWidth($value, $sync_name_index, $collectionWidth, $totalWidth, $pdf);\n\t\t$header_cols_height[] = $pdf->getNumLines($value,$width_converted);\n\t}\n\n\t//cari siapa paling tinggi\n\t$max_height = max($header_cols_height);\n\n\t//display\n\t$pdf->SetFillColor(211,211,211);\n\n\t$pdf->MultiCell($w=$width_col_no, $h=5*$max_height+3, $txt='No', $border=1, $align='L', $fill=1, $ln=0, $x='', $y='', $reseth=true, $stretch=0, $ishtml=true, $autopadding=true, $maxh=$h, $v='M');\n\tforeach ($sync_name_index as $key => $value)\n\t{\n\t\t$width_converted = GetAndConvertColumnWidth($value, $sync_name_index, $collectionWidth, $totalWidth, $pdf);\n\t\t$pdf->MultiCell($w=$width_converted, $h=5*$max_height+3, $txt=$value, $border=1, $align='C', $fill=1, $ln=0, $x='', $y='', $reseth=true, $stretch=0, $ishtml=true, $autopadding=true, $maxh=$h, $v='M');\n\t}\n\n\t//reset font\n\t$pdf->SetFont('helvetica','',9);\n\t$pdf->Ln();\n}", "function FrontPageTable(){\r\n //$this->SetFillColor(135,206,250);\r\n $this->SetFillColor(176,196,222);\r\n $this->SetTextColor(0);\r\n $this->SetDrawColor(0,0,0);\r\n $this->SetLineWidth(.3);\r\n $this->SetFont('','B');\r\n // Header\r\n\r\n $this->SetX(35);\r\n $this->Cell(70,7,'Prepared By:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetTextColor(0,0,0);\r\n $this->SetFont('');\r\n $this->Cell(70,7,$this->PreparedBy,1,0,'C',false);\r\n $this->Cell(40,7,'NRAO',1,0,'C',false);\r\n $this->Cell(40,7,$this->MakeDate,1,0,'C',false);\r\n $this->Ln();\r\n\r\n\r\n $this->SetX(35);\r\n $this->SetTextColor(0);\r\n $this->SetFont('','B');\r\n $this->Cell(70,7,'FEIC WP Manager Approval:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetFont('');\r\n $this->Cell(70,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetTextColor(0);\r\n $this->SetFont('','B');\r\n $this->Cell(70,7,'FE System Engineering Approval:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetFont('');\r\n $this->Cell(70,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetTextColor(0);\r\n $this->SetFont('','B');\r\n $this->Cell(70,7,'FE IPT Lead Approval:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetFont('');\r\n $this->Cell(70,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Ln();\r\n\r\n // Color and font restoration\r\n $this->SetFillColor(224,235,255);\r\n $this->SetTextColor(255);\r\n $this->SetFont('');\r\n // Data\r\n $fill = false;\r\n }", "private function createCells($data){\r\n $html = '';\r\n foreach ($data AS $index => $row) {\r\n $html .= '<tr class=\"ctable-rows\">';\r\n foreach ($row as $rownr => $data) {\r\n $html .= '<td>' . $data . '</td>';\r\n }\r\n $html .= '</tr>';\r\n }\r\n return $html;\r\n }", "protected function process_header(import_settings $settings, $data) {\r\n $result = array();\r\n $doc = $settings->get_dom();\r\n $rows = $doc->getElementsByTagName('tr');\r\n $head = $rows->item(0);\r\n $cols = $head->getElementsByTagName('th');\r\n foreach ($cols as $col) {\r\n $name = $this->read($col, 'title');\r\n $description = $this->read($col, 'description');\r\n $type = $this->read($col, 'type');\r\n $options = $this->read_list($col, 'options');\r\n $f = array($this, 'process_header_' . $type);\r\n if (is_callable($f)) {\r\n $field = call_user_func($f, $settings, $data, $name, $description, $options);\r\n $result[] = $field;\r\n } else {\r\n $field = $this->process_header_default($settings, $type, $name, $description, $options);\r\n $result[] = $field;\r\n }\r\n }\r\n return $result;\r\n }", "function showHeader(){\n\t\t$header = \"\";\n\t\t// print the header row\n\t\t$header .= \"\t<tr>\\n\";\n\t\t// loop the fields\n\t\tforeach ($this->fields as $field) {\n\t\t\t// print each field\n\t\t\t$header .= \"\t\t<th>\".$field.\"</th>\\n\";\n\t\t}\n\t\t// end the header row\n\t\t$header .= \"\t</tr>\\n\";\n\t\treturn $header;\n\t}", "private function createHeaders($headers) {\r\n $html = '<tr class=\"ctable-headertag\">';\r\n foreach ($headers as $index => $header) {\r\n $html .= '<th>' . $header . '</th>';\r\n }\r\n $html .= '</tr>';\r\n return $html;\r\n\r\n }", "public function render()\n\t{\n\n\t\t$table = \"<table\";\n\n\t\t// Add all attributes\n\t\tforeach ($this->attributes as $key => $value) {\n\t\t\t$table .= ' ' . $key . '=\"' . $value .'\"';\n\t\t}\n\n\t\t$table .= \">\"; // Close table\n\n\t\t// Add the head\n\t\tif ($this->showHeadRow) {\n\t\t\t$table .= \"<thead><tr>\";\n\n\t\t\t// Show the number header.\n\t\t\tif ($this->showNumberColumn) {\n\t\t\t\t$table .= \"<th>#</th>\";\n\t\t\t}\n\n\t\t\tforeach ($this->columns as $column) {\n\t\t\t\t$columnHeadTitle = isset($column['headTitle']) ? $column['headTitle'] : $column[0];\n\t\t\t\t$table .= \"<th>\" . $columnHeadTitle . \"</th>\";\n\t\t\t}\n\n\t\t\t$table .= \"</tr></thead>\"; // finish head\n\t\t}\n\n\t\t// Body\n\t\t$table .= \"<tbody>\";\n\n\t\t$row = $this->numberColumnOffset;\n\n\t\tif (count($this->data) == 0) {\n\t\t\t// Show a no data entry\n\t\t\t$colspan = count($this->columns) + ($this->showNumberColumn ? 1 : 0);\n\t\t\t$table .= '<tr><td colspan=\"'.$colspan.'\"><p align=\"center\" style=\"font-weight:bold;\">Keine Einträge</p></td></tr>';\n\t\t}\n\t\telse {\n\t\t\tforeach ($this->data as $dataObject) {\n\n\t\t\t\t// Row attributes\n\t\t\t\t$attributes = $this->rowAttributes;\n\t\t\t\tif (!is_array($attributes)) {\n\t\t\t\t\tif (is_callable($this->rowAttributes)) {\n\t\t\t\t\t\t$callable = $this->rowAttributes;\n\t\t\t\t\t\t$attributes = $callable($dataObject);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$attributeString = '';\n\t\t\t\tif ($attributes) {\t\t// Add attributes if we have some\n\t\t\t\t\tforeach ($attributes as $attributeName => $attributeValue) {\n\t\t\t\t\t\t$attributeString .= $attributeName . '=\"' . $attributeValue . '\" ' ;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->rowIdDataMethod) {\n\t\t\t\t\t// method name or closure?\n\t\t\t\t\t$id = '';\n\t\t\t\t\tif (is_string($this->rowIdDataMethod)) {\n\t\t\t\t\t\t$id = $dataObject->{$this->rowIdDataMethod}(); // Call the row data method\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$rf = new \\ReflectionFunction($this->rowIdDataMethod);\n\t\t\t\t\t\tif ($rf->isClosure()) {\n\t\t\t\t\t\t\t// we got a closure\n\t\t\t\t\t\t\t$closure = $this->rowIdDataMethod;\n\t\t\t\t\t\t\t$id = $closure($dataObject);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t$table .= '<tr id=\"'. $id .'\" ' . $attributeString . '>'; // Start row with id\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$table .= \"<tr \". $attributeString .\">\";\t// Start row without id\n\t\t\t\t}\n\n\t\t\t\t// Number?\n\t\t\t\tif ($this->showNumberColumn) {\n\t\t\t\t\t$table .= \"<td>\" . $row . \"</td>\";\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->columns as $column) {\n\t\t\t\t\t$dataMethod = isset($column['dataMethod']) ? $column['dataMethod'] : $column[1];\n\t\t\t\t\tif (is_string($dataMethod)) {\n\t\t\t\t\t\t// Just call the method an insert the return value into the table cell\n\t\t\t\t\t\t$table .= \"<td>\". $dataObject->$dataMethod() .\"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$rf = new \\ReflectionFunction($dataMethod);\n\t\t\t\t\t\tif ($rf->isClosure()) {\n\n\t\t\t\t\t\t\t// Call the closure and get the result\n\t\t\t\t\t\t\t$value = $dataMethod($dataObject, $this);\n\n\t\t\t\t\t\t\t$table .= \"<td>\". $value .\"</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$table .= \"</tr>\";\t// End the table row\n\t\t\t\t$row++;\n\t\t\t}\n\n\t\t\t// Render the footer row\n\t\t\t$table = $this->renderFooter($table);\n\n\t\t}\n\n\t\t$table .= \"</tbody>\";\n\n\t\t$table .= \"</table>\";\n\t\treturn $table;\n\t}", "static function generateTableHeaderHTML($a_div)\n\t{\n\t\techo \"<tr class='inTableRow'>\\n\";\n//\t\techo \"<th class='inTableColTaskID'>Task ID</th>\\n\";\n\t\techo \"<th class='inTableColTaskName'>{$a_div}</th>\\n\";\n\t\techo \"<th>Subcontractor</th>\\n\";\n\t\techo \"<th class='chTableColAmount'>Amount</th>\\n\";\n\t\techo \"<th>Notes</th>\\n\";\n\t\techo \"</tr>\\n\";\n\t}", "public function Header() {\n // si la pagina es diferente de la 2\n // if (count($this->pages) !== 2) \n // {\n // Logo\n $image_file = K_PATH_IMAGES.'logoesen.jpg';\n $this->Image($image_file, 90, 5, 25, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);\n // Set font\n $this->SetFont('helvetica', 'B', 20);\n // Title\n //$this->Cell(0, 15, '<< TCPDF Example 003 >>', 0, false, 'C', 0, '', 0, false, 'M', 'M');\n // }\n }", "private function makeTableData(array $inputData)\n {\n // Empty template table elements.\n $td = new HtmlNode(kind: 'td');\n $th = new HtmlNode(kind: 'th');\n $span = new HtmlLeaf(kind: 'span');\n // Add dummy entries to fill last row\n $this->addDummyEntries($inputData);\n // Wrap top level nodes with table data or table header elements.\n $colCount = 1;\n $nodeCount = 1;\n $tableData = [];\n foreach ($inputData as $chunk) {\n $td_tmp = ($nodeCount <= $this->nCols & $this->enableHeaders)\n ? clone $th : clone $td;\n ++$nodeCount;\n // Check if input is of type htmlLeaf\n if ($chunk instanceof HtmlLeaf) {\n $td_tmp->appendChild($chunk);\n } else {\n $td_tmp->appendChild($span)->setContent(\"$chunk\");\n }\n\n // Reset $colCount at end of table row.\n $colCount = ($colCount == $this->nCols + 1) ? 1 : $colCount;\n // Style td and th\n $td_tmp->setAttributes(['class' => 'col' . $colCount]);\n $tableData[] = $td_tmp;\n ++$colCount;\n }\n return $tableData;\n }" ]
[ "0.71341455", "0.70779115", "0.7013448", "0.69389945", "0.6789241", "0.633894", "0.62849635", "0.6275131", "0.6246616", "0.6180552", "0.6170492", "0.6157227", "0.61496925", "0.6132502", "0.61114776", "0.61031747", "0.6086093", "0.60797226", "0.6062225", "0.6043987", "0.6037493", "0.6018557", "0.6014941", "0.600279", "0.59997207", "0.59864223", "0.59807634", "0.5976949", "0.59758514", "0.59667003", "0.59635144", "0.5956103", "0.5950662", "0.59423554", "0.59178483", "0.591267", "0.5905319", "0.59003896", "0.5888958", "0.58838755", "0.58778644", "0.5876133", "0.5873698", "0.58734477", "0.5871681", "0.5871065", "0.5868119", "0.58664644", "0.5864658", "0.5850291", "0.5845369", "0.5833829", "0.58329964", "0.58275586", "0.58251345", "0.58247775", "0.5824636", "0.58215135", "0.5817847", "0.5813182", "0.58115405", "0.5811422", "0.58099276", "0.5804396", "0.5799855", "0.57867306", "0.57836074", "0.5780958", "0.5774302", "0.57691514", "0.576643", "0.57639086", "0.5759608", "0.57518846", "0.57413614", "0.5740212", "0.5729953", "0.57296294", "0.5721088", "0.57169384", "0.5703859", "0.570312", "0.5697475", "0.5694948", "0.5694397", "0.56826806", "0.56819415", "0.567979", "0.5679237", "0.5676623", "0.56761163", "0.56473804", "0.56446767", "0.5643752", "0.5636336", "0.5630586", "0.5617675", "0.5617322", "0.56101245", "0.56087196", "0.56063724" ]
0.0
-1
wants to return, for all targetqualids, the possible grades
function get_grade_options($data = null) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function calculateFinalResult($grades);", "function scorm_get_what_grade_array(){\n return array (HIGHESTATTEMPT => get_string('highestattempt', 'scorm'),\n AVERAGEATTEMPT => get_string('averageattempt', 'scorm'),\n FIRSTATTEMPT => get_string('firstattempt', 'scorm'),\n LASTATTEMPT => get_string('lastattempt', 'scorm'));\n}", "private function insert_target_grade()\r\n {\r\n global $DB;\r\n $params = $this->get_params();\r\n $this->id = $DB->insert_record('block_bcgt_target_grades', $params);\r\n }", "function calculateQualityPoints($clid){\n //Initialize the temporary variables\n $totalhours=0;\n //Query to return the student's grades and credit hours\n $result = mysql_query(\"Select grade, sum(credit_hours) FROM(( Select grade, credit_hours FROM take T, class Cl WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'CR' and T.grade <> 'NC' and T.grade <> 'W' and T.clid = '$clid' and Cl.section_num = T.section_num and Cl.semester = T.semester and Cl.year = T.year and Cl.course_num = T.course_num and Cl.course_dept = T.course_dept and Cl.credit_hours IS NOT NULL) UNION ALL (Select S.grade, Co.credit_hours FROM spec_cred S, course Co WHERE S.grade IS NOT NULL and S.grade <> 'I' and S.grade <> 'CR' and S.grade <> 'NC' and S.grade <> 'W' and !S.transfer and S.clid = '$clid' and S.course_dept = Co.course_dept and S.course_num = Co.course_num) UNION ALL (Select T.grade,Co.credit_hours FROM take T,course Co WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'NC' and T.grade <> 'W' and T.grade <> 'CR' and T.clid = '$clid' and T.course_dept = Co.course_dept and T.course_num = Co.course_num and NOT EXISTS(select * from class Cl WHERE Cl.course_dept = Co.course_dept and Cl.course_num = Co.course_num and Cl.credit_hours IS NOT NULL))) AS result GROUP BY grade;\") or die(mysql_error());\n while($row = mysql_fetch_array($result)){\n //Is the grade an A?\n if($row['grade'] == 'A')\n //If so, increment totalhours by four times the sum of the credit hours\n $totalhours+=4*$row['sum(credit_hours)'];\n //Is the grade a B?\n else if ($row['grade']=='B')\n //If so, increment totalhours by 3 times the sum of the credit hours\n $totalhours+=3*$row['sum(credit_hours)'];\n //Is the grade a C?\n else if ($row['grade']=='C')\n //If so, increment totalhours by 2 times the sum of the credit hours\n $totalhours+=2*$row['sum(credit_hours)'];\n //Is the grade a D?\n else if ($row['grade']=='D')\n //If so, increment totalhours by the sum of the credit hours\n $totalhours+=1*$row['sum(credit_hours)'];\n }\n return $totalhours;\n}", "function prim_options_four_grade() {\n $four_grade = array(\n 'instammer_inte_alls' => t('Instämmer inte alls'),\n 'instammer_inte' => t('Instämmer inte'),\n 'instammer_delvis' => t('Instämmer delvis'),\n 'instämmer_helt' => t('Instämmer helt'),\n );\n\n return $four_grade;\n}", "function calculateGpa($clid){\n //Initialize the temporary variables\n $tempgpa=0;\n $chours=0;\n //Query to return the student's grades and credit hours\n $result = mysql_query(\"Select grade, sum(credit_hours) FROM(( Select grade, credit_hours FROM take T, class Cl WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'CR' and T.grade <> 'NC' and T.grade <> 'W' and T.clid = '$clid' and Cl.section_num = T.section_num and Cl.semester = T.semester and Cl.year = T.year and Cl.course_num = T.course_num and Cl.course_dept = T.course_dept and Cl.credit_hours IS NOT NULL) UNION ALL (Select S.grade, Co.credit_hours FROM spec_cred S, course Co WHERE S.grade IS NOT NULL and S.grade <> 'I' and S.grade <> 'CR' and S.grade <> 'W' and S.grade <> 'NC' and !S.transfer and S.clid = '$clid' and S.course_dept = Co.course_dept and S.course_num = Co.course_num) UNION ALL (Select T.grade,Co.credit_hours FROM take T,course Co WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'NC' and T.grade <> 'W' and T.grade <> 'CR' and T.clid = '$clid' and T.course_dept = Co.course_dept and T.course_num = Co.course_num and NOT EXISTS(select * from class Cl WHERE Cl.course_dept = Co.course_dept and Cl.course_num = Co.course_num and Cl.credit_hours IS NOT NULL))) AS result GROUP BY grade;\") or die(mysql_error());\n //Calculate the GPA\n while($row = mysql_fetch_array($result)){\n //Is the grade an A?\n if($row['grade'] == 'A')\n //If so, increment tempgpa by four times the sum of the credit hours\n $tempgpa+=4*$row['sum(credit_hours)'];\n //Is the grade a B?\n else if ($row['grade']=='B')\n //If so, increment tempgpa by 3 times the sum of the credit hours\n $tempgpa+=3*$row['sum(credit_hours)'];\n //Is the grade a C?\n else if ($row['grade']=='C')\n //If so, increment tempgpa by 2 times the sum of the credit hours\n $tempgpa+=2*$row['sum(credit_hours)'];\n //Is the grade a D?\n else if ($row['grade']=='D')\n //If so, increment tempgpa by the sum of the credit hours\n $tempgpa+=1*$row['sum(credit_hours)'];\n //Increment chours by the sum of the credit hours\n $chours+=$row['sum(credit_hours)'];\n }\n //Divide tempgpa by chours to get the student's GPA\n\tif($chours == 0) return 0;\n \telse return round($tempgpa/$chours,2);\n}", "private function load_target_grade($id)\r\n {\r\n global $DB;\r\n $sql = \"SELECT * FROM {block_bcgt_target_grades} WHERE id = ?\";\r\n $record = $DB->get_record_sql($sql, array($id));\r\n if($record)\r\n {\r\n $this->extract_params($record);\r\n }\r\n }", "function getGrade() {\n return $this->fulfillment['grade_result'];\n }", "function retrieveSubmissionGrades($submit_id)\n{\n global $CFG, $PDOX;\n if ( $submit_id === false ) return false;\n $grades_received = $PDOX->allRowsDie(\n \"SELECT grade_id, points, note, displayname, email, rating\n FROM {$CFG->dbprefix}peer_grade AS G\n JOIN {$CFG->dbprefix}lti_user as U\n ON G.user_id = U.user_id\n WHERE G.submit_id = :SID\n ORDER BY points DESC\",\n array( ':SID' => $submit_id)\n );\n return $grades_received;\n}", "public function get_grades() {\n return $this->grades;\n }", "public function getGrads()\n {\n return $this->hasMany(Grade::className(), ['gradId' => 'GradId'])->viaTable('mitgliedergrade', ['MitgliedId' => 'MitgliederId']);\n }", "protected /*array<int, int>*/ function getGrades(/*int*/ $aid)\n\t{\n\t\t$query = $this->db->prepare(\"\n\t\t\tSELECT * FROM `grades` WHERE `assignmentid` = :aid;\n\t\t\")->execute(array(\n\t\t\t':aid' => $aid\n\t\t));\n\n\t\t$grades = array();\n\n\t\tforeach($query as $row)\n\t\t\t$grades[$row['studentid']] = $row['grade'];\n\n\t\treturn $grades;\n\t}", "function scorm_get_grade_method_array(){\n return array (GRADESCOES => get_string('gradescoes', 'scorm'),\n GRADEHIGHEST => get_string('gradehighest', 'scorm'),\n GRADEAVERAGE => get_string('gradeaverage', 'scorm'),\n GRADESUM => get_string('gradesum', 'scorm'));\n}", "public function getAllGpa() {\n $academicYears = StudentRegisterCourse::query()\n ->where('student_id', $this->id)\n ->select('academic_year_id')\n ->distinct('academic_year_id')\n ->pluck('academic_year_id')\n ->toArray();\n foreach ($academicYears as $item) {\n $terms = StudentRegisterCourse::query()\n ->where('student_id', $this->id)\n ->where('academic_year_id', $item)\n ->select('term_id')\n ->distinct('term_id')\n ->pluck('term_id')\n ->toArray();\n foreach ($terms as $term) {\n $gpaCalculator = new GpaCalculator($this, $item, $term);\n $gpa = $gpaCalculator->getGPA();\n $this->storeGpa($this->id, $item, $term, $gpa);\n }\n }\n }", "function getGradepoints()\n {\n\t$struct = array('title' => array(),\n\t\t\t'quiz' => array('section' => array(), 'weight' => array(), 'scored' => array(), 'completed' => array()),\n\t\t\t'weight' => array(),\n\t\t\t'points' => array(),\n\t\t\t'completed' => array()\n\t\t\t);\n\t\n\t$courses = $this->DB->database_select('course', '*');\n\t$enrolled = $this->DB->database_select('users', array('enrolled'), array('uid' => session_get('uid')), 1);\n\t$enrolled = explode(',', $enrolled['enrolled']);\n\t\n\t$quizzes_completed = $this->DB->database_select('users', array('quizzes_completed'),\n\t\t\t\t\t\t\tarray('uid' => session_get('uid')), 1);\n\t$quizzes_completed = explode(',', $quizzes_completed['quizzes_completed']);\n\t\n\t$index = 0;\n\tfor($c = 0; $c < count($courses); $c++)\n\t{\n\t\t\n\t\t//If the user is not even enrolled in the course, then they definitely have not performed in it. Skip course\n\t\t\n\t\tif(!in_array($courses[$c]['cid'], $enrolled))\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t\n\t\t$courseWeight = 0;\n\t\t$struct['title'][] = $courses[$c]['course_title'];\n\t\t$course_points_earned = 0;\n\t\t\n\t\t\n\t\t//Get all the quizzes associated with course\n\t\t\n\t\t$quizzes = $this->DB->database_select('quiz', 'qid', array('quiz_course' => $courses[$c]['cid']));\n\t\t\n\t\tfor($i = 0; $i < count($quizzes); $i++)\n\t\t{\n\t\t\t//User has not completed quiz\n\t\t\t\n\t\t\tif(!in_array($quizzes[$i]['qid'], $quizzes_completed))\n\t\t\t{\n\t\t\t\t$struct['quiz']['completed'][$c][] = 'incomplete';\n\t\t\t\t$struct['completed'][$c] = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$quizWeight = 0;\n\t\t\t$quiz = $this->DB->database_select('quiz_content', 'qcid', array('qid' => $quizzes[$i]['qid']));\n\t\t\t\n\t\t\t//Add points that user scored in quiz\n\t\t\t$points_earned = $this->pointsScored($quizzes[$i]['qid']); \n\t\t\t\n\t\t\t//Add to total course points scored\n\t\t\t$course_points_earned += $points_earned;\n\t\t\t\n\t\t\t//Determine weight of quiz questions\n\t\t\tfor($j = 0; $j < count($quiz); $j++)\n\t\t\t{\n\t\t\t\t$quizWeight += $this->quizWeight($quiz[$j]['qcid']);\n\t\t\t}\n\t\t\t\n\t\t\t//Add total question weight to quiz weight\n\t\t\t\n\t\t\t$struct['quiz']['weight'][$index][] = $quizWeight;\n\t\t\t$struct['quiz']['scored'][$index][] = $points_earned;\n\t\t\t\n\t\t\t//User has completed quiz or not?\n\t\t\t$struct['quiz']['completed'][$index][] = 'completed';\n\t\t\t\n\t\t\t//Add total quiz weight to quiz score\n\t\t\t\n\t\t\t$courseWeight += $quizWeight;\n\t\t\t\n\t\t}\n\t\t\n\t\t$struct['weight'][$index] = $courseWeight;\n\t\t$struct['points'][$index] = $course_points_earned;\n\t\t\n\t\t\n\t\tif(!isset($struct['completed'][$index]))\n\t\t{\n\t\t\t$struct['completed'][$index] = 'complete';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$struct['completed'][$index] = 'incomplete';\n\t\t}\n\t\t$index++;\n\t}\n\t\n\treturn $struct;\n }", "public function getGradeAttribute()\n {\n if (is_null($this->scores)) {\n return;\n } \n\n return [];\n }", "function calculateTermQualityPoints($clid,$semester,$year){\n //Initialize the temporary variables\n $totalhours=0;\n //Query to return the student's grades and credit hours\n $result = mysql_query(\"Select grade, sum(credit_hours) FROM(( Select grade, credit_hours FROM take T, class Cl WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'CR' and T.grade <> 'NC' and T.grade <> 'W' and T.clid = '$clid' and Cl.section_num = T.section_num and Cl.semester = T.semester and Cl.year = T.year and Cl.course_num = T.course_num and Cl.course_dept = T.course_dept and Cl.credit_hours IS NOT NULL and T.semester='$semester' and T.year='$year') UNION ALL (Select T.grade,Co.credit_hours FROM take T,course Co WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'NC' and T.grade <> 'W' and T.grade <> 'CR' and T.clid = '$clid' and T.course_dept = Co.course_dept and T.course_num = Co.course_num and T.semester='$semester' and T.year='$year' and NOT EXISTS(select * from class Cl WHERE Cl.course_dept = Co.course_dept and Cl.course_num = Co.course_num and Cl.credit_hours IS NOT NULL))) AS result GROUP BY grade;\") or die(mysql_error());\n //Find the quality points per class\n while($row = mysql_fetch_array($result)){\n //Is the grade an A?\n if($row['grade'] == 'A')\n //If so, increment totalhours by four times the sum of the credit hours\n $totalhours+=4*$row['sum(credit_hours)'];\n //Is the grade a B?\n else if ($row['grade']=='B')\n //If so, increment totalhours by 3 times the sum of the credit hours\n $totalhours+=3*$row['sum(credit_hours)'];\n //Is the grade a C?\n else if ($row['grade']=='C')\n //If so, increment totalhours by 2 times the sum of the credit hours\n $totalhours+=2*$row['sum(credit_hours)'];\n //Is the grade a D?\n else if ($row['grade']=='D')\n //If so, increment totalhours by the sum of the credit hours\n $totalhours+=1*$row['sum(credit_hours)'];\n }\n return $totalhours;\n}", "function preGradingSetup($cID, $tID, $subs){\n\t$questions = Contest :: get_contest_questions($cID);\n\t\n\t// Get an array of unsubmitted questions \n\t$newQuests = filter_questions($questions, Submission :: get_submissions_by_team_and_contest($tID, $cID));\n\t\n\t$answer_array = array(); // Array of answers for each question\n\tforeach($newQuests as $quest){\n\t\t$quest_answer = array(\n\t\t\t'folder' => '',\n\t\t\t'file' => '',\n\t\t\t'watch' => '',\n\t\t\t'qid' => ''\n\t\t);\n\t\t\n\t\t$folderID = File_Functions :: get_folder_for_question_team($tID, $quest);\n\t\t$fileID = File_Functions :: first_file($folderID);\n\t\t$info = File_Functions :: retrieve_file($fileID);\n\t\t\n\t\t$quest_answer['qid'] = $quest;\n\t\t$quest_answer['folder'] = $info['folder'];\n\t\t$quest_answer['file'] = $info['name'].'.'.$info['extension'];\n\t\t\n\t\t$answer_array[] = $quest_answer;\n\t}\n\t\t\n\t\tgradeMultipleQuest($tID, $cID, $answer_array, $subs);\n\t\t\n\t\n}", "function calculateTermGpa($clid,$semester,$year){\n //Initialize the temporary variables\n $tempgpa=0;\n $chours=0;\n //Query to return the student's grades and credit hours for a semester\n $result = mysql_query(\"Select grade, sum(credit_hours) FROM(( Select grade, credit_hours FROM take T, class Cl WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'CR' and T.grade <> 'NC' and T.grade <> 'W' and T.clid = '$clid' and Cl.section_num = T.section_num and Cl.semester = T.semester and Cl.year = T.year and Cl.course_num = T.course_num and Cl.course_dept = T.course_dept and Cl.credit_hours IS NOT NULL and T.semester='$semester' and T.year='$year') UNION ALL (Select T.grade,Co.credit_hours FROM take T,course Co WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'NC' and T.grade <> 'W' and T.grade <> 'CR' and T.clid = '$clid' and T.course_dept = Co.course_dept and T.course_num = Co.course_num and T.semester='$semester' and T.year='$year' and NOT EXISTS(select * from class Cl WHERE Cl.course_dept = Co.course_dept and Cl.course_num = Co.course_num and Cl.credit_hours IS NOT NULL))) AS result GROUP BY grade;\") or die(mysql_error());\n //Calculate the GPA\n while($row = mysql_fetch_array($result)){\n //Is the grade an A?\n if($row['grade'] == 'A')\n //If so, increment tempgpa by four times the sum of the credit hours\n $tempgpa+=4*$row['sum(credit_hours)'];\n //Is the grade a B?\n else if ($row['grade']=='B')\n //If so, increment tempgpa by 3 times the sum of the credit hours\n $tempgpa+=3*$row['sum(credit_hours)'];\n //Is the grade a C?\n else if ($row['grade']=='C')\n //If so, increment tempgpa by 2 times the sum of the credit hours\n $tempgpa+=2*$row['sum(credit_hours)'];\n //Is the grade a D?\n else if ($row['grade']=='D')\n //If so, increment tempgpa by the sum of the credit hours\n $tempgpa+=1*$row['sum(credit_hours)'];\n //Increment chours by the sum of the credit hours\n $chours+=$row['sum(credit_hours)'];\n }\n //Divide tempgpa by chours to get the student's GPA\n\tif($chours == 0) return 0;\n \telse return round($tempgpa/$chours,2);\n}", "function meetsPrerequisite($clid, $course_dept,$course_num,$semester,$year,$section){\n\t$meetsPrereqSet = mysql_query(\"select * from ((select prim_key from requisite R,take T where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.type='P' and T.clid='$clid' and T.course_num=R.req_course_num and T.course_dept=R.req_course_dept and (T.grade <= R.grade or T.grade is null) and T.grade <> 'W' and T.grade <> 'I' and T.grade <> 'F') union all (select prim_key from requisite R,spec_cred S where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.type='P' and S.clid='$clid' and S.course_num=R.req_course_num and S.course_dept=R.req_course_dept and (S.grade <= R.grade or S.grade is null) and S.grade <> 'W' and S.grade <> 'I' and S.grade <> 'F') union all (select prim_key from requisite R,take T,counts_for C where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.type='P' and T.clid='$clid' and T.course_num=C.course_num and T.course_dept=C.course_dept and C.sub_course_num=R.course_num and C.sub_course_dept=R.course_dept and (T.grade <= R.grade or T.grade is null) and T.grade <> 'W' and T.grade <> 'I' and T.grade <> 'F') union all (select prim_key from requisite R,spec_cred S,counts_for C where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.type='P' and S.clid='$clid' and S.course_num=C.course_num and S.course_dept=C.course_dept and C.sub_course_num=R.course_num and C.sub_course_dept=R.course_dept and (S.grade <= R.grade or S.grade is null) and S.grade <> 'W' and S.grade <> 'I' and S.grade <> 'F') union all (select prim_key from class_requisite R,take T where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.type='P' and R.semester='$semester' and R.year='$year' and R.section_num='$section' and T.clid='$clid' and T.course_num=R.req_course_num and T.course_dept=R.req_course_dept and (T.grade <= R.grade or T.grade is null) and T.grade <> 'W' and T.grade <> 'I' and T.grade <> 'F') union all (select prim_key from class_requisite R,spec_cred S where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.semester='$semester' and R.year='$year' and R.section_num='$section' and R.type='P' and S.clid='$clid' and S.course_num=R.req_course_num and S.course_dept=R.req_course_dept and (S.grade <= R.grade or S.grade is null) and S.grade <> 'W' and S.grade <> 'I' and S.grade <> 'F') union all (select prim_key from class_requisite R,take T,counts_for C where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.semester='$semester' and R.year='$year' and R.section_num='$section' and R.type='P' and T.clid='$clid' and T.course_num=C.course_num and T.course_dept=C.course_dept and C.sub_course_num=R.course_num and C.sub_course_dept=R.course_dept and (T.grade <= R.grade or T.grade is null) and T.grade <> 'W' and T.grade <> 'I' and T.grade <> 'F') union all (select prim_key from class_requisite R,spec_cred S,counts_for C where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.semester='$semester' and R.year='$year' and R.section_num='$section' and R.type='P' and S.clid='$clid' and S.course_num=C.course_num and S.course_dept=C.course_dept and C.sub_course_num=R.course_num and C.sub_course_dept=R.course_dept and (S.grade <= R.grade or S.grade is null) and S.grade <> 'W' and S.grade <> 'I' and S.grade <> 'F')) as result group by prim_key having count(*)=(select count(*) from requisite R where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.type='P' and R.prim_key=result.prim_key);\") or die(mysql_error());\n\t$act_composite=calculateAct($clid);\n\t$ACTquery=mysql_query(\"select * from course C,student S where S.clid='$clid' and (C.act_composite='$act_composite' or C.act_math=S.act_math or C.act_english=S.act_english or C.act_reading=S.act_reading or C.act_science=S.act_science);\") or die(mysql_error());\n\tif((mysql_fetch_array($meetsPrereqSet)) or (mysql_fetch_array($ACTquery))) return true;\n\telse return false;\n\n}", "public function getVarGrade();", "public function getMgfSelectionGrades()\n {\n return $this->hasMany(MgfSelectionGrade::className(), ['criterion_id' => 'id']);\n }", "protected /*array<int, int>*/ function getAllGrades($studentid) {\n\t\t$query = $this->db->prepare(\"SELECT * FROM `grades` WHERE `studentid` = ?;\")->execute([$studentid]);\n\t\t$grades = array();\n\n\t\tforeach ($query as $row) {\n\t\t\t$grades[(int) $row['assignmentid']] = (int) $row['grade'];\n\t\t}\n\n\t\treturn $grades;\n\t}", "public function update_qualification_award($qualID, $targetGradeID)\n\t{ \n global $DB;\n logAction(LOG_MODULE_GRADETRACKER, LOG_ELEMENT_GRADETRACKER_QUALIFICATION, LOG_VALUE_GRADETRACKER_UPDATED_QUAL_AWARD, $this->studentID, $qualID, null, null, null);\n\n $courseID = -1;\n $course = Qualification::get_user_course($qualID, $this->studentID);\n if($course)\n {\n $courseID = $course->courseid;\n }\n \n\t\t$obj = new stdClass();\n\t\t$obj->bcgtqualificationid = $qualID;\n\t\t$obj->userid = $this->studentID;\n\t\t//todo\n //breakdown\n $obj->bcgtbreakdownid = -1;\n $obj->bcgttargetgradesid = $targetGradeID;\n $obj->courseid = $courseID;\n $obj->warning = '';\n $obj->type = 'CETA';\n\t\t//lets find out if the user has one inserted before?\n $record = $DB->get_record_sql('SELECT * FROM {block_bcgt_user_award} WHERE userid = ? \n AND bcgtqualificationid = ? AND courseid = ?', array($this->studentID, $qualID, $courseID));\n\t\tif($record)\n\t\t{\n $id = $record->id;\n $obj->id = $id;\n return $DB->update_record('block_bcgt_user_award', $obj);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $DB->insert_record('block_bcgt_user_award', $obj);\n\t\t}\n\t}", "function get_all_gradable_items() {\n\n global $CFG;\n \n $sql = \"SELECT a.id, a.name, a.description as summary, a.course, c.id as cmid\n FROM {$CFG->prefix}assignment a\n INNER JOIN {$CFG->prefix}course_modules c\n ON a.id = c.instance\n WHERE c.module = {$this->mainobject->modulesettings['assignment']->id}\n AND c.visible = 1\n AND a.course IN ({$this->mainobject->course_ids})\n ORDER BY a.id\";\n\n $assignments = get_records_sql($sql);\n $this->assessments = $assignments;\n \n }", "public function getAll()\n {\n // $now = Carbon::now();\n return\n DB::table('grades')\n ->select(\n 'id',\n 'eff_begin as effBegin',\n 'eff_end as effEnd',\n 'code',\n 'name',\n 'ordinal',\n 'bottom_rate as bottomRate',\n 'mid_rate as midRate',\n 'top_rate as topRate'\n )\n ->where([\n ['tenant_id', $this->requester->getTenantId()],\n ['company_id', $this->requester->getCompanyId()]\n ])\n ->get();\n }", "public static function supports_mygrades() {\n return true;\n }", "private function compare_grades($grade1, $grade2)\n {\n $retval = new stdClass();\n $progress = null;\n $gradeDiff = null;\n $ucasDiff = null;\n $target = null;\n \n $lenience = get_config('bcgt', 'alvlvalenience');\n \n \n if($grade1 && $grade2 && $grade1->get_ranking() && $grade2->get_ranking())\n {\n $ranking1 = $grade1->get_ranking();\n $ranking2 = $grade2->get_ranking();\n if($ranking1 - $ranking2 > 0)\n {\n //the higher the rank the higher the grade: SO:\n //if this is a posituve value then its something like:\n //A - B > 0\n //which means we are behind target (as its targetGrade - Actual)\n $progress = Project::BEHIND;\n $gradeDiff = $ranking1 - $ranking2;\n $ucasDiff = $grade1->get_ucas_points() - $grade2->get_ucas_points();\n $target = -1;\n }\n elseif($ranking2 - $ranking1 > 0)\n {\n //C - A < 0\n //which means we are ahead target (as its targetGrade - Actual)\n $progress = Project::AHEAD;\n $gradeDiff = $ranking2 - $ranking1;\n $ucasDiff = $grade2->get_ucas_points() - $grade1->get_ucas_points();\n $target = 1;\n }\n else\n {\n $progress = Project::ON;\n $gradeDiff = 0;\n $ucasDiff = 0;\n $target = 0;\n }\n }\n \n // We are using a lenience score\n if ($lenience > 0)\n {\n \n // The difference falls within this lenience score\n if ($gradeDiff <= $lenience)\n {\n \n $progress = Project::ON;\n $gradeDiff = 0;\n $target = 0;\n $ucasDiff = 0;\n \n }\n \n }\n \n $retval->progress = $progress;\n $retval->gradeDiff = $gradeDiff;\n $retval->ucasDiff = $ucasDiff;\n $retval->target = $target;\n return $retval;\n }", "function ychange_get_class_grade_options($flip = false)\n{\n $options = [];\n\n foreach ( range(1, 12) as $grade )\n {\n $options[$grade] = $grade;\n }\n\n $options['other'] = elgg_echo('ychange:class_grade:other');\n\n return $flip ? array_flip($options) : $options;\n}", "public function getAllReportingData($students, $elements)\n {\n \n global $DB;\n \n if (!$students || !$elements) return false;\n \n $data = array();\n \n // Some overal variables for counting\n $totalStudents = count($students);\n $totalWithAspirational = 0;\n \n $aspGrades = '-';\n \n \n // Loop students and find all their targets\n foreach($students as $student)\n {\n\n $this->loadStudent($student->id);\n\n $quals = $this->getStudentsQualifications();\n $courses = $this->getStudentsCoursesWithoutQualifications();\n\n\n $a = array();\n if ($quals)\n {\n foreach($quals as $qual)\n {\n\n $grade = $this->getAspirationalTargetGrade($qual->get_id());\n if (is_array($grade)) $grade = reset($grade);\n\n if ($grade && isset($grade->grade) && $grade->grade)\n {\n $a[] = $qual->get_display_name(false) . ' [' . $grade->grade . ']';\n }\n\n }\n\n }\n\n if ($courses)\n {\n foreach($courses as $course)\n {\n\n $grade = $this->getAspirationalTargetGradeCourse($course->id);\n if (is_array($grade)) $grade = reset($grade);\n\n if ($grade && isset($grade->grade) && $grade->grade)\n {\n $a[] = $course->fullname . ' [' . $grade->grade . ']';\n }\n\n }\n\n }\n\n\n // We can't get any overalls here, so only bother once we're looking at individual students\n if ($totalStudents == 1)\n {\n $aspGrades = implode(\",\\n \", $a);\n }\n \n if (!empty($a))\n {\n $totalWithAspirational++;\n }\n\n\n }\n \n \n // Totals\n $data['reports:bcgt_target_grades:aspgrades'] = $aspGrades;\n $data['reports:bcgt_target_grades:percentwithaspgrades'] = ($totalWithAspirational) ? round( ($totalWithAspirational / $totalStudents) * 100, 2 ) : 0;\n\n \n $names = array();\n $els = array();\n \n foreach($elements as $element)\n {\n $record = $DB->get_record(\"lbp_plugin_report_elements\", array(\"id\" => $element));\n $names[] = $record->getstringname;\n $els[$record->getstringname] = $record->getstringcomponent;\n }\n \n $return = array();\n foreach($names as $name)\n {\n if (isset($data[$name])){\n $newname = \\get_string($name, $els[$name]);\n $return[\"{$newname}\"] = $data[$name];\n }\n }\n \n return $return;\n \n }", "function scorm_grade_user($scorm, $userid, $time=false) {\n // and so whatgrade and grademethod are combined in grademethod 10s are whatgrade\n // and 1s are grademethod\n $whatgrade = intval($scorm->grademethod / 10);\n\n // insure we dont grade user beyond $scorm->maxattempt settings\n $lastattempt = scorm_get_last_attempt($scorm->id, $userid);\n if($scorm->maxattempt != 0 && $lastattempt >= $scorm->maxattempt){\n $lastattempt = $scorm->maxattempt;\n }\n\n switch ($whatgrade) {\n case FIRSTATTEMPT:\n return scorm_grade_user_attempt($scorm, $userid, 1, $time);\n break;\n case LASTATTEMPT:\n return scorm_grade_user_attempt($scorm, $userid, scorm_get_last_attempt($scorm->id, $userid), $time);\n break;\n case HIGHESTATTEMPT:\n $maxscore = 0;\n $attempttime = 0;\n for ($attempt = 1; $attempt <= $lastattempt; $attempt++) {\n $attemptscore = scorm_grade_user_attempt($scorm, $userid, $attempt, $time);\n if ($time) {\n if ($attemptscore->score > $maxscore) {\n $maxscore = $attemptscore->score;\n $attempttime = $attemptscore->time;\n }\n } else {\n $maxscore = $attemptscore > $maxscore ? $attemptscore: $maxscore;\n }\n }\n if ($time) {\n $result = new stdClass();\n $result->score = $maxscore;\n $result->time = $attempttime;\n return $result;\n } else {\n return $maxscore;\n }\n break;\n case AVERAGEATTEMPT:\n $lastattempt = scorm_get_last_attempt($scorm->id, $userid);\n $sumscore = 0;\n for ($attempt = 1; $attempt <= $lastattempt; $attempt++) {\n $attemptscore = scorm_grade_user_attempt($scorm, $userid, $attempt, $time);\n if ($time) {\n $sumscore += $attemptscore->score;\n } else {\n $sumscore += $attemptscore;\n }\n }\n\n if ($lastattempt > 0) {\n $score = $sumscore / $lastattempt;\n } else {\n $score = 0;\n }\n\n if ($time) {\n $result = new stdClass();\n $result->score = $score;\n $result->time = $attemptscore->time;\n return $result;\n } else {\n return $score;\n }\n break;\n }\n}", "function questionnaire_get_user_grades($questionnaire, $userid=0) {\n global $DB;\n $params = array();\n $usersql = '';\n if (!empty($userid)) {\n $usersql = \"AND u.id = ?\";\n $params[] = $userid;\n }\n\n $sql = \"SELECT a.id, u.id AS userid, r.grade AS rawgrade, r.submitted AS dategraded, r.submitted AS datesubmitted\n FROM {user} u, {questionnaire_attempts} a, {questionnaire_response} r\n WHERE u.id = a.userid AND a.qid = $questionnaire->id AND r.id = a.rid $usersql\";\n return $DB->get_records_sql($sql, $params);\n}", "function ros_get_typer_grades_adv($roshineid, $exerciseid, $userid=0, $orderby=-1, $desc=false) {\n global $DB, $CFG;\n $params = array();\n $toreturn = array();\n $gradestblname = $CFG->prefix.\"roshine_grades\";\n $userstblname = $CFG->prefix.\"user\";\n $exertblname = $CFG->prefix.\"roshine_exercises\";\n $atttblname = $CFG->prefix.\"roshine_attempts\";\n $sql = \"SELECT \".$gradestblname.\".id, \"\n .$userstblname.\".firstname, \"\n .$userstblname.\".lastname, \"\n .$userstblname.\".id as u_id, \"\n .$gradestblname.\".pass, \"\n .$gradestblname.\".mistakes, \"\n .$gradestblname.\".timeinseconds, \"\n .$gradestblname.\".hitsperminute, \"\n .$atttblname.\".ros_suspicion, \"\n .$gradestblname.\".fullhits, \"\n .$gradestblname.\".precisionfield, \"\n .$gradestblname.\".timetaken, \"\n .$exertblname.\".exercisename, \"\n .$gradestblname.\".wpm\".\n \" FROM \".$gradestblname.\n \" LEFT JOIN \".$userstblname.\" ON \".$gradestblname.\".userid = \".$userstblname.\".id\".\n \" LEFT JOIN \".$exertblname.\" ON \".$gradestblname.\".exercise = \".$exertblname.\".id\".\n \" LEFT JOIN \".$atttblname.\" ON \".$atttblname.\".id = \".$gradestblname.\".attemptid\".\n \" WHERE (roshine=\".$roshineid.\") AND (exercise=\".$exerciseid.\" OR \".$exerciseid.\"=0) AND\".\n \" (\".$gradestblname.\".userid=\".$userid.\" OR \".$userid.\"=0)\";\n if ($orderby == 0 || $orderby == -1) {\n $oby = \" ORDER BY \".$gradestblname.\".id\";\n } else if ($orderby == 1) {\n $oby = \" ORDER BY \".$userstblname.\".firstname\";\n } else if ($orderby == 2) {\n $oby = \" ORDER BY \".$userstblname.\".lastname\";\n } else if ($orderby == 3) {\n $oby = \" ORDER BY \".$atttblname.\".ros_suspicion\";\n } else if ($orderby == 4) {\n $oby = \" ORDER BY \".$gradestblname.\".mistakes\";\n } else if ($orderby == 5) {\n $oby = \" ORDER BY \".$gradestblname.\".timeinseconds\";\n } else if ($orderby == 6) {\n $oby = \" ORDER BY \".$gradestblname.\".hitsperminute\";\n } else if ($orderby == 7) {\n $oby = \" ORDER BY \".$gradestblname.\".fullhits\";\n } else if ($orderby == 8) {\n $oby = \" ORDER BY \".$gradestblname.\".precisionfield\";\n } else if ($orderby == 9) {\n $oby = \" ORDER BY \".$gradestblname.\".timetaken\";\n } else if ($orderby == 10) {\n $oby = \" ORDER BY \".$exertblname.\".exercisename\";\n } else if ($orderby == 11) {\n $oby = \" ORDER BY \".$gradestblname.\".pass\";\n } else if ($orderby == 12) {\n $oby = \" ORDER BY \".$gradestblname.\".wpm\";\n } else {\n $oby = \"\";\n }\n $sql .= $oby;\n if ($desc) {\n $sql .= \" DESC\";\n }\n if ($grades = $DB->get_records_sql($sql, $params)) {\n return $grades;\n }\n return false;\n}", "private function setQuality($sks = 0, $final = 0)\r\n\t{\r\n\t\tif($this->setGrade($final) == 'A')\r\n\t\t\treturn ($sks * 4);\r\n\t\telseif ($this->setGrade($final) == 'B')\r\n\t\t\treturn ($sks * 3);\r\n\t\telseif ($this->setGrade($final) == 'C')\r\n\t\t\treturn ($sks * 2);\r\n\t\telseif ($this->setGrade($final) == 'D')\r\n\t\t\treturn ($sks * 1);\r\n\t\telse\r\n\t\t\treturn ($sks * 0);\r\n\t}", "function lettergrade($score)\n{\n\t\t\tif\t($score >= 96.5)\t\t\t\t\t{\t$lettergrade = 'A+';\t}\n\telse\tif\t($score >= 93.5 and $score < 96.5)\t{\t$lettergrade = 'A';\t\t}\n\telse\tif\t($score >= 89.5 and $score < 93.5)\t{\t$lettergrade = 'A-';\t}\n\n\telse\tif\t($score >= 86.5 and $score < 89.5)\t{\t$lettergrade = 'B+';\t}\n\telse\tif\t($score >= 83.5 and $score < 86.5)\t{\t$lettergrade = 'B';\t\t}\n\telse\tif\t($score >= 79.5 and $score < 83.5)\t{\t$lettergrade = 'B-';\t}\n\n\telse\tif\t($score >= 76.5 and $score < 79.5)\t{\t$lettergrade = 'C+';\t}\n\telse\tif\t($score >= 73.5 and $score < 76.5)\t{\t$lettergrade = 'C';\t\t}\n\telse\tif\t($score >= 69.5 and $score < 73.5)\t{\t$lettergrade = 'C-';\t}\n\n\telse\tif\t($score >= 66.5 and $score < 69.5)\t{\t$lettergrade = 'D+';\t}\n\telse\tif\t($score >= 63.5 and $score < 66.5)\t{\t$lettergrade = 'D';\t\t}\n\telse\tif\t($score >= 59.5 and $score < 63.5)\t{\t$lettergrade = 'D-';\t}\n\n\telse\tif\t($score < 59.5)\t\t\t\t\t{\t$lettergrade = 'F';\t}\n\n\telse\tif\t($score == NULL)\t\t\t\t{\t$lettergrade = '';\t}\n\n\treturn $lettergrade;\n}", "function ros_get_typergradesfull($sid, $orderby=-1, $desc=false) {\n global $DB, $CFG;\n $params = array();\n $toreturn = array();\n $gradestblname = $CFG->prefix.\"roshine_grades\";\n $userstblname = $CFG->prefix.\"user\";\n $exertblname = $CFG->prefix.\"roshine_exercises\";\n $atttblname = $CFG->prefix.\"roshine_attempts\";\n $sql = \"SELECT \".$gradestblname.\".id, \"\n .$userstblname.\".firstname, \"\n .$userstblname.\".lastname, \"\n .$userstblname.\".id as u_id, \"\n .$gradestblname.\".pass, \"\n .$atttblname.\".ros_suspicion, \"\n .$gradestblname.\".mistakes, \"\n .$gradestblname.\".timeinseconds, \"\n .$gradestblname.\".hitsperminute, \"\n .$gradestblname.\".fullhits, \"\n .$gradestblname.\".precisionfield, \"\n .$gradestblname.\".timetaken, \"\n .$exertblname.\".exercisename, \"\n .$gradestblname.\".wpm\".\n \" FROM \".$gradestblname.\n \" LEFT JOIN \".$userstblname.\" ON \".$gradestblname.\".userid = \".$userstblname.\".id\".\n \" LEFT JOIN \".$exertblname.\" ON \".$gradestblname.\".exercise = \".$exertblname.\".id\".\n \" LEFT JOIN \".$atttblname.\" ON \".$atttblname.\".id = \".$gradestblname.\".attemptid\".\n \" WHERE roshine=\".$sid;\n if ($orderby == 0 || $orderby == -1) {\n $oby = \" ORDER BY \".$gradestblname.\".id\";\n } else if ($orderby == 1) {\n $oby = \" ORDER BY \".$userstblname.\".firstname\";\n } else if ($orderby == 2) {\n $oby = \" ORDER BY \".$userstblname.\".lastname\";\n } else if ($orderby == 3) {\n $oby = \" ORDER BY \".$atttblname.\".ros_suspicion\";\n } else if ($orderby == 4) {\n $oby = \" ORDER BY \".$gradestblname.\".mistakes\";\n } else if ($orderby == 5) {\n $oby = \" ORDER BY \".$gradestblname.\".timeinseconds\";\n } else if ($orderby == 6) {\n $oby = \" ORDER BY \".$gradestblname.\".hitsperminute\";\n } else if ($orderby == 7) {\n $oby = \" ORDER BY \".$gradestblname.\".fullhits\";\n } else if ($orderby == 8) {\n $oby = \" ORDER BY \".$gradestblname.\".precisionfield\";\n } else if ($orderby == 9) {\n $oby = \" ORDER BY \".$gradestblname.\".timetaken\";\n } else if ($orderby == 10) {\n $oby = \" ORDER BY \".$exertblname.\".exercisename\";\n } else if ($orderby == 12) {\n $oby = \" ORDER BY \".$gradestblname.\".wpm\";\n } else {\n $oby = \"\";\n }\n $sql .= $oby;\n if ($desc) {\n $sql .= \" DESC\";\n }\n if ($grades = $DB->get_records_sql($sql, $params)) {\n return $grades;\n }\n return false;\n}", "function gradingStudents($grades)\n{\n $revisedScores = [];\n for ($i = 0; $i < count($grades); $i++) {\n $remainder = $grades[$i] % 5;\n if ($grades[$i] < 38 || $remainder <= 2) {\n $revisedScores[$i] = $grades[$i];\n } else {\n $revisedScores[$i] = $grades[$i] + (5 - $remainder);\n }\n }\n return $revisedScores;\n\n}", "public function grades($courseToClassId = 0){\n\n\t\t\t$this->session->unset_userdata('courseToClassById');\n\t\t $courseToClassById = $this->User_model->getCourseToClassById($courseToClassId);\t\n\t\t $this->session->set_userdata($courseToClassById);\n\n\t\t //getting class Id:\n\t\t $class_id = $courseToClassById['courseToClassById'][0]['class_id'];\n\n\t\t //getting course Id:\n\t\t $course_id = $courseToClassById['courseToClassById'][0]['course_id'];\n\n\t\t\t$this->session->unset_userdata('classNameById');\n\t\t $classNameById = $this->User_model->getClassNameById($class_id);\t\n\t\t $this->session->set_userdata($classNameById);\n\n\t\t\t$this->session->unset_userdata('courseNameById');\n\t\t $courseNameById = $this->User_model->getCourseNameById($course_id);\t\n\t\t $this->session->set_userdata($courseNameById);\n\n\t\t\t$this->session->unset_userdata('marksCourseAndClass');\n\t\t $marksCourseAndClass = $this->User_model->getmarksCourseAndClass($course_id,$class_id);\t\n\t\t $this->session->set_userdata($marksCourseAndClass);\n\n\t\t\t$this->session->unset_userdata('studentsByClassId');\n\t\t $studentsByClassId = $this->User_model->getstudentsByClassId($class_id);\t\n\t\t $this->session->set_userdata($studentsByClassId);\n\n\t\t $this->session->unset_userdata('profile');\n\t\t $profile = $this->User_model->getProfile($this->session->userdata('teacher_id'));\n\t\t $this->session->set_userdata($profile);\n\n\t\t $this->session->unset_userdata('messages');\n\t\t $messages = $this->User_model->getMessages();\n\t\t $this->session->set_userdata($messages);\n\n\t\t $this->session->unset_userdata('notifications');\n\t\t $notifications = $this->User_model->getNotifications();\n\t\t $this->session->set_userdata($notifications);\n\n\t\t\t$this->load->view('user/grades.php');\n\n\t\t}", "public function getClassGrades($courseId){\n\t\t\t\n\t\t\t//construct query to grab peer reviews done for\n\t\t\t//the currently active course\n\t\t\t$query = \"SELECT * FROM review WHERE forClass='\" . $courseId . \"'\";\n\t\t\t//echo $query;\n\t\t\t//execute query\n\t\t\t$result = $this->db->query($query);\n\t\t\t\n\t\t\t//check the result to see if it worked\n\t\t\tif($result){\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\t//query failed\n\t\t\telse{\n\t\t\t\techo 'Error getting class grades!';\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "function hasCreditFor($clid,$course_dept,$course_num)\n{\n\t// Check take and spec_cred for the highest grade for the course.\n\t$CreditQuery = mysql_query(\"SELECT result.grade FROM ((SELECT T.grade FROM take T WHERE T.clid = '$clid' and T.course_dept = '$course_dept' and T.course_num = '$course_num' and T.grade is not NULL and T.grade != 'I') UNION \t\t(SELECT S.grade FROM spec_cred S WHERE S.clid = '$clid' and S.course_dept = '$course_dept' and S.course_num = '$course_num')) AS result ORDER BY grade LIMIT 1;\") or die(mysql_error());\n\n\t// Check spec_cred to see if the student has tested out of a class but doesn't have credit\n\t$NoCreditQuery = mysql_query(\"SELECT grade FROM spec_cred WHERE clid = '$clid' and course_dept = '$course_dept' and course_num = '$course_num' and grade = 'NA';\") or die(mysql_error());\n\n\t// Check counts_for to see if the student has taken a course that substitutes for the course.\n\t$CountsForQuery = mysql_query(\"SELECT * FROM ((SELECT C.course_dept,C.course_num,T.grade FROM take T,counts_for C WHERE T.clid = '$clid' and C.sub_course_dept = '$course_dept' and C.sub_course_num = '$course_num' and T.grade \t\tis not NULL and T.grade != 'I' and T.course_dept = C.course_dept and T.course_num = C.course_num) UNION (SELECT C.course_dept,C.course_num,S.grade FROM spec_cred S,counts_for C WHERE S.clid = '$clid' and C.sub_course_dept = \n\t'$course_dept' and C.sub_course_num = '$course_num' and S.grade is not NULL and S.grade != 'I' and S.course_dept = C.course_dept and S.course_num = C.course_num)) as result order by course_dept,course_num limit 1;\") or \t\tdie(mysql_error());\n\n\t$grade = mysql_result($CreditQuery, 0);\n\n\tif(mysql_fetch_array($NoCreditQuery) or $grade == \"CR\") return true;\n\telse\n\t{\n\t\tif(isset($grade)) return $grade;\n\t\telse\n\t\t{\t\n\t\t\t$substitute_course = mysql_fetch_array($CountsForQuery);\n\t\t\tif(isset($substitute_course)) return $substitute_course;\n\t\t\telse return false;\n\t\t}\n\t}\n}", "function grade_vendamensal($con, $codestabelec, $codproduto){\r\n\t/*\r\n\t * Tratamento feito para o Mihara (gambiarra)\r\n\t * Apagar em breve.\r\n\t * Murilo Feres (13/08/2017)\r\n\t */\r\n\tif(param(\"SISTEMA\", \"CODIGOCW\", $con) == \"1238\"){\r\n\t\t$query = \"SELECT * FROM(SELECT ano, mes, SUM(quantidade) AS quantidade \";\r\n\t\t$query .= \"FROM consvendames \";\r\n\t\t$query .= \"WHERE codproduto = \".$codproduto.\" \";\r\n\t\t$query .= \" AND ((ano = \".(date(\"Y\") - 1).\" AND mes >= \".date(\"m\").\") OR (ano = \".date(\"Y\").\" AND mes <= \".date(\"m\").\")) \";\r\n\t\tif(strlen($codestabelec) > 0){\r\n\t\t\tif(in_array((int) $codestabelec, array(4, 5))){\r\n\t\t\t\t$codestabelec = \"4, 5\";\r\n\t\t\t\t$query .= \" AND (codestabelec != 4 OR (mes < 8 AND ano = 2017) OR ano < 2017) \";\r\n\t\t\t}\r\n\t\t\tif(in_array((int) $codestabelec, array(3, 8))){\r\n\t\t\t\t$codestabelec = \"3, 8\";\r\n\t\t\t\t$query .= \" AND (codestabelec != 3 OR (mes < 6 AND ano = 2018) OR ano < 2018) \";\r\n\t\t\t}\r\n\t\t\t$query .= \" AND codestabelec IN (\".$codestabelec.\") \";\r\n\t\t}\r\n\t\t$query .= \"GROUP BY ano, mes \";\r\n\t\t$query .= \"ORDER BY ano, mes) AS tmp ORDER BY ano ASC, mes ASC \";\r\n\t}else{\r\n\t\t$query = \"SELECT * FROM(SELECT ano, mes, SUM(quantidade) AS quantidade \";\r\n\t\t$query .= \"FROM consvendames \";\r\n\t\t$query .= \"WHERE codproduto = \".$codproduto.\" \";\r\n\t\t$query .= \" AND ((ano = \".(date(\"Y\") - 1).\" AND mes >= \".date(\"m\").\") OR (ano = \".date(\"Y\").\" AND mes <= \".date(\"m\").\")) \";\r\n\t\tif(strlen($codestabelec) > 0){\r\n\t\t\t$query .= \" AND codestabelec IN (\".$codestabelec.\") \";\r\n\t\t}\r\n\t\t$query .= \"GROUP BY ano, mes \";\r\n\t\t$query .= \"ORDER BY ano, mes) AS tmp ORDER BY ano ASC, mes ASC \";\r\n\t}\r\n\t$res = $con->query($query);\r\n\t$arr = $res->fetchAll(2);\r\n\t$ano = date(\"Y\");\r\n\t$mes = date(\"m\");\r\n\t$html = \"<table style=\\\"font-size:11px; height:100%\\\">\";\r\n\tfor($i = 12; $i > -1; $i--){\r\n\t\t$quantidade = 0;\r\n\t\tforeach($arr as $row){\r\n\t\t\tif($row[\"ano\"] == $ano && $row[\"mes\"] == $mes){\r\n\t\t\t\t$quantidade = $row[\"quantidade\"];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$html .= \"<tr><td style=\\\"background-color:\".($i % 2 == 0 ? \"#DDD\" : \"#EEE\").\"; width:60%\\\">\".$ano.\" \".month_description($mes, FALSE).\"</td>\";\r\n\t\t$html .= \"<td style=\\\"background-color:\".($i % 2 == 0 ? \"#EEE\" : \"#FFF\").\"; text-align:right\\\">\".number_format($quantidade, 2, \",\", \".\").\"</td></tr>\";\r\n\t\t$mes--;\r\n\t\tif($mes == 0){\r\n\t\t\t$mes = 12;\r\n\t\t\t$ano--;\r\n\t\t}\r\n\t}\r\n\t$html .= \"</table>\";\r\n\treturn $html;\r\n}", "function escape_get_user_grades($escape, $userid=0) {\n global $CFG, $DB;\n\n $params = array(\"escapeid\" => $escape->id,\"escapeid2\" => $escape->id);\n\n if (!empty($userid)) {\n $params[\"userid\"] = $userid;\n $params[\"userid2\"] = $userid;\n $user = \"AND u.id = :userid\";\n $fuser = \"AND uu.id = :userid2\";\n }\n else {\n $user=\"\";\n $fuser=\"\";\n }\n\n if ($escape->retake) {\n if ($escape->usemaxgrade) {\n $sql = \"SELECT u.id, u.id AS userid, MAX(g.grade) AS rawgrade\n FROM {user} u, {escape_grades} g\n WHERE u.id = g.userid AND g.escapeid = :escapeid\n $user\n GROUP BY u.id\";\n } else {\n $sql = \"SELECT u.id, u.id AS userid, AVG(g.grade) AS rawgrade\n FROM {user} u, {escape_grades} g\n WHERE u.id = g.userid AND g.escapeid = :escapeid\n $user\n GROUP BY u.id\";\n }\n unset($params['escapeid2']);\n unset($params['userid2']);\n } else {\n // use only first attempts (with lowest id in escape_grades table)\n $firstonly = \"SELECT uu.id AS userid, MIN(gg.id) AS firstcompleted\n FROM {user} uu, {escape_grades} gg\n WHERE uu.id = gg.userid AND gg.escapeid = :escapeid2\n $fuser\n GROUP BY uu.id\";\n\n $sql = \"SELECT u.id, u.id AS userid, g.grade AS rawgrade\n FROM {user} u, {escape_grades} g, ($firstonly) f\n WHERE u.id = g.userid AND g.escapeid = :escapeid\n AND g.id = f.firstcompleted AND g.userid=f.userid\n $user\";\n }\n\n return $DB->get_records_sql($sql, $params);\n}", "public function get_all_grade_letters($courseid) {\n global $remotedb;\n $sql = \"SELECT l.letter, con.id\n FROM {grade_letters} l\n JOIN {context} con ON l.contextid = con.id AND con.contextlevel=50\n AND con.instanceid=?\";\n $params = array($courseid);\n $letters = $remotedb->get_records_sql($sql, $params);\n $out = '';\n if ($letters) {\n foreach ($letters as $letter) {\n $out .= $letter->letter . \", \";\n }\n } else {\n $defaultletters = grade_get_letters();\n $revdef = array_reverse($defaultletters);\n foreach ($revdef as $letter) {\n $out .= $letter . \", \";\n }\n }\n return chop($out, ', ');\n }", "function ChangeGrades ($grades) {\n $hunt_division = mysql_result(@mysql_query(\"SELECT `hunt_division` FROM `hunts` WHERE `hunt_id` = '$this->hunt_id'\", $this->ka_db), 0, 'hunt_division');\n if (($this->Allowed('allhunts') == true) || (($this->Allowed('hunts') == true) && ($this->CheckDivision($hunt_division) == true))) {\n $grades_str = base64_encode(serialize($grades));\n if (@mysql_query (\"UPDATE `hunt_grades` SET `grades`='$grades_str' WHERE `hunt_id`='\".$this->hunt_id.\"' LIMIT 1\", $this->ka_db))\n return $this->IsGraded();\n else {\n $this->roster_error = \"Unsuccessful update query.\";\n return false;\n }\n } else {\n $this->roster_error = \"You do not have access to this function.\";\n return false;\n }\n }", "public function getMitgliedergrades()\n {\n return $this->hasMany(Mitgliedergrade::className(), ['MitgliedId' => 'MitgliederId']);\n }", "protected function _grade($score)\n\t{\n\t\tforeach ($this->grades as $max => $grade)\n\t\t{\n\t\t\tif ($max === 'default')\n\t\t\t\tcontinue;\n\n\t\t\tif ($score <= $max)\n\t\t\t\treturn $grade;\n\t\t}\n\n\t\treturn $this->grades['default'];\n\t}", "private function setGrade($final = 0)\r\n\t{\r\n\t\tif($final >= 80)\r\n\t\t\treturn 'A';\r\n\t\telseif ($final >= 70)\r\n\t\t\treturn 'B';\r\n\t\telseif ($final >= 60)\r\n\t\t\treturn 'C';\r\n\t\telseif ($final >= 40)\r\n\t\t\treturn 'D';\r\n\t\telse\r\n\t\t\treturn 'E';\r\n\t\t\r\n\t}", "public function extract_grades(&$output, $testmode = false) {\n global $CFG, $SITE, $DB;\n\n // General setup \n\n if ($testmode == 'test') {\n } else {\n $output .= \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\\n<graderecords>\\n\";\n }\n\n $testclause = '';\n if ($testmode == 'test') {\n $testclause = ' LIMIT 0,30 ';\n }\n\n /// get communications in forums\n\n // set extraction boundaries\n $toclause = '';\n if (!empty($this->parms->to)) {\n $toclause = \" AND gg.timecreated <= {$this->parms->to} \";\n }\n\n $fromclause = '';\n if (!empty($this->parms->from)) {\n $fromclause = \" AND gg.timecreated > {$this->parms->from} \";\n }\n\n $sql = \"\n SELECT\n finalgrade,\n userid,\n courseid,\n itemtype,\n itemmodule,\n iteminstance,\n gg.locked,\n overridden\n FROM\n {grade_grades} gg,\n {grade_items} gi\n WHERE\n gg.itemid = gi.id\n $toclause\n $fromclause\n $testclause\n \";\n\n $rs = $DB->get_recordset_sql($sql);\n if ($rs) {\n\n // $i = 0; DO NOT : continue numbering\n $i = 0;\n foreach ($rs as $u) {\n\n $u->host = $SITE->shortname;\n $u->from = $this->parms->from;\n $u->to = $this->parms->to;\n\n boardz_get_user_info($u);\n\n $course = $DB->get_record('course', array('id' => $u->courseid));\n boardz_get_additional_course_info($u, $course);\n\n // cleanup record\n\n unset($u->itemtype);\n unset($u->userid);\n // produce communication records\n\n if ($testmode == 'test') {\n $output .= htmlentities(recordtoxml($u, $i, 'graderecord', ''), ENT_QUOTES, 'UTF-8');\n } else {\n $output .= recordtoxml($u, $i, 'graderecord', '');\n }\n $i++;\n }\n $rs->close();\n\n if ($i > 0) {\n if ($testmode == 'test') {\n $output .= htmlentities(recordtoxml($r, $i, 'graderecord', ''), ENT_QUOTES, 'UTF-8');\n } else {\n $output .= recordtoxml($r, $i, 'graderecord', '');\n }\n }\n }\n\n if ($testmode == 'test') {\n $output .= htmlentities(\"\\n</graderecords>\");\n } else {\n $output .= \"\\n</graderecords>\";\n }\n\n }", "function questionnaire_grades($questionnaireid) {\n return null;\n}", "function gradeVar($grades)\n {\n if (count($grades) == 0) {\n return null;\n }\n $mean = gradeMean($grades);\n $sumSquares = 0;\n foreach ($grades as $grade) {\n $sumSquares += pow($grade - $mean, 2);\n }\n return $sumSquares / count($grades);\n }", "function grade($user) {\n $nid = (int) $this->getInstanceId();\n\n $result = reset(quiz_get_score_data(array($nid), $user->uid));\n if ($result && ($result->percent_score >= $result->percent_pass)) {\n $this->getFulfillment()->setGrade($result->percent_score)->setComplete()->save();\n }\n else {\n $this->getFulfillment()->setGrade($result->percent_score)->save();\n }\n }", "public static function __gradeParser($score,$unit,$code=''){\r\n if($score >= 69){\r\n self::$_grades = 5;\r\n self::$_totalGrade[] = self::$_grades*$unit;\r\n self::__setUnitPF($score, $unit);\r\n }\r\n if($score > 59 && $score < 69){\r\n self::$_grades = 4;\r\n self::$_totalGrade[] = self::$_grades*$unit;\r\n self::__setUnitPF($score, $unit);\r\n }\r\n if($score > 49 && $score < 59){\r\n self::$_grades = 3;\r\n self::$_totalGrade[] = self::$_grades*$unit;\r\n self::__setUnitPF($score, $unit);\r\n }\r\n if($score > 44 && $score < 50){\r\n self::$_grades = 2;\r\n self::$_totalGrade[] = self::$_grades*$unit;\r\n self::__setUnitPF($score, $unit);\r\n }\r\n if($score > 39 && $score < 45){\r\n self::$_grades = 1;\r\n self::$_totalGrade[] = self::$_grades*$unit;\r\n self::__setUnitPF($score, $unit);\r\n }\r\n if($score >= 0 && $score < 40){\r\n self::$_grades = 0;\r\n self::$_totalGrade[] = self::$_grades*$unit;\r\n self::__setUnitPF($score, $unit);\r\n }\r\n self::__setRemarks($code, $score);\r\n return self::$_grades;\r\n }", "function _makeLetterGrade( $percent, $course_period_id = 0, $staff_id = 0, $ret = 'TITLE' )\n{\n\tglobal $_BETHEL;\n\n\t$course_period_id = $course_period_id ? $course_period_id : UserCoursePeriod();\n\n\tif ( ! $staff_id )\n\t{\n\t\tif ( User( 'PROFILE' ) === 'teacher' )\n\t\t{\n\t\t\t$staff_id = User( 'STAFF_ID' );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$staff_id = DBGetOne( \"SELECT TEACHER_ID\n\t\t\t\tFROM COURSE_PERIODS\n\t\t\t\tWHERE COURSE_PERIOD_ID='\" . $course_period_id . \"'\" );\n\t\t}\n\t}\n\n\t$gradebook_config = ProgramUserConfig( 'Gradebook', $staff_id );\n\n\t// Save courses in $_BETHEL['_makeLetterGrade']['courses'] global var.\n\tif ( ! isset( $_BETHEL['_makeLetterGrade']['courses'][ $course_period_id ] ) )\n\t{\n\t\t$_BETHEL['_makeLetterGrade']['courses'][ $course_period_id ] = DBGet( \"SELECT DOES_BREAKOFF,GRADE_SCALE_ID\n\t\t\tFROM COURSE_PERIODS\n\t\t\tWHERE COURSE_PERIOD_ID='\" . $course_period_id . \"'\" );\n\t}\n\n\t$does_breakoff = $_BETHEL['_makeLetterGrade']['courses'][ $course_period_id ][1]['DOES_BREAKOFF'];\n\n\t$grade_scale_id = $_BETHEL['_makeLetterGrade']['courses'][ $course_period_id ][1]['GRADE_SCALE_ID'];\n\n\t$percent *= 100;\n\n\t// If Teacher Grade Scale.\n\tif ( $does_breakoff === 'Y'\n\t\t&& is_array( $gradebook_config ) )\n\t{\n\t\tif ( $gradebook_config['ROUNDING'] === 'UP' )\n\t\t{\n\t\t\t$percent = ceil( $percent );\n\t\t}\n\t\telseif ( $gradebook_config['ROUNDING'] === 'DOWN' )\n\t\t{\n\t\t\t$percent = floor( $percent );\n\t\t}\n\t\telseif ( $gradebook_config['ROUNDING'] === 'NORMAL' )\n\t\t{\n\t\t\t$percent = round( $percent );\n\t\t}\n\t}\n\telse\n\t\t$percent = round( $percent, 2 ); // School default.\n\n\tif ( $ret === '%' )\n\t{\n\t\treturn $percent;\n\t}\n\n\t// Save grades in $_BETHEL['_makeLetterGrade']['grades'] global var.\n\tif ( ! isset( $_BETHEL['_makeLetterGrade']['grades'][ $grade_scale_id ] ) )\n\t{\n\t\t$_BETHEL['_makeLetterGrade']['grades'][ $grade_scale_id ] = DBGet( \"SELECT TITLE,ID,BREAK_OFF,COMMENT\n\t\t\tFROM REPORT_CARD_GRADES\n\t\t\tWHERE SYEAR='\" . UserSyear() . \"'\n\t\t\tAND SCHOOL_ID='\" . UserSchool() . \"'\n\t\t\tAND GRADE_SCALE_ID='\" . $grade_scale_id . \"'\n\t\t\tORDER BY BREAK_OFF IS NOT NULL DESC,BREAK_OFF DESC,SORT_ORDER\" );\n\t}\n\n\t// Fix error invalid input syntax for type numeric\n\t// If Teacher Grade Scale.\n\tif ( $does_breakoff === 'Y'\n\t\t&& is_array( $gradebook_config ) )\n\t{\n\t\tforeach ( (array) $_BETHEL['_makeLetterGrade']['grades'][ $grade_scale_id ] as $grade )\n\t\t{\n\t\t\tif ( is_numeric( $gradebook_config[ $course_period_id . '-' . $grade['ID'] ] )\n\t\t\t\t&& $percent >= $gradebook_config[ $course_period_id . '-' . $grade['ID'] ] )\n\t\t\t{\n\t\t\t\t// FJ use Report Card Grades comments.\n\t\t\t\t// return $ret=='ID' ? $grade['ID'] : $grade['TITLE'];\n\t\t\t\treturn $grade[ $ret ];\n\t\t\t}\n\t\t}\n\t}\n\n\tforeach ( (array) $_BETHEL['_makeLetterGrade']['grades'][ $grade_scale_id ] as $grade )\n\t{\n\t\tif ( $percent >= $grade['BREAK_OFF'] )\n\t\t{\n\t\t\t// FJ use Report Card Grades comments.\n\t\t\t// return $ret=='ID' ? $grade['ID'] : $grade['TITLE'];\n\t\t\treturn $grade[ $ret ];\n\t\t}\n\t}\n}", "public static function gradingStudents ($grades) {\n\n\t\t/**\n * @var int[] $newGrade array temporary hold the new grade\n * @var int[] $roundedGrades array have the new grade\n */\n\n\t $roundedGrades = [];\n\n \tfor ($i = 0; $i < count($grades); $i++) {\n\n \tif ($grades[$i] % 5 > 2 && $grades[$i] > 37 && $grades[$i] <= 100) {\n\n \t$newGrade = $grades[$i] + (5 - ($grades[$i] % 5));\n \t} \t\n\n \telse {\n\n \t$newGrade = $grades[$i]; \n \t}\n\n \t//Push the element of $newGrade to $roundedGrades\n \tarray_push($roundedGrades, $newGrade);\n \t}\n\n \treturn $roundedGrades;\n }", "public function getGradesForClass($class_id) {\n return $this->get('get_grades_for_class', ['class_id' => $class_id]);\n }", "public function getSearchGrades($osuId, $courseId){\n\t\t\t\n\t\t\t//construct query to grab peer reviews done both by AND for\n\t\t\t//the student in the currently active course\n\t\t\t$query = \"SELECT * FROM review WHERE reviewFor='\" . $osuId . \"'AND forClass='\" . $courseId . \"' OR reviewBy='\" . $osuId . \"' AND forClass='\" . $courseId . \"'\";\n\t\t\t//echo $query;\n\t\t\t//execute query\n\t\t\t$result = $this->db->query($query);\n\t\t\t\n\t\t\t//check the result to see if it worked\n\t\t\tif($result){\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\t//query failed\n\t\t\telse{\n\t\t\t\techo 'Error getting student grades!';\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "function gradingStudents($grades) {\n // Write your code here\n $isRoundedGrade = [];\n for ($i = 0; $i < count($grades); $i++) {\n $difference = IsMultipleOfFive($grades[$i]);\n $finalGrade = $difference + $grades[$i];\n \n if (($difference < 3) && ($finalGrade >= 40)) {\n array_push($isRoundedGrade,$finalGrade);\n } else {\n array_push($isRoundedGrade,$grades[$i]);\n }\n }\n return $isRoundedGrade;\n}", "function gradeHigh($grades)\n {\n if (count($grades) == 0) {\n return null;\n }\n return max($grades);\n }", "public function get_grade($acquired_mark) {\n\t\techo get_grade($acquired_mark);\n\t}", "function getAllClassStudentScores($classList){ // class list can have multipvle values\n $allAssessments = getAllAssessments(); \n $classGradeLevel = getClassInfo($_POST['choice']); \n foreach ($classList as $value) { \n $totalAttempts=0;\n $totalSuccess = 0; \n $bestAssessmentScore = 0; \n $bestAssessmentScoreID=\"N/A\"; \n $bestAssessmentScoreCat = \"\";\n $latestTestID = 'None'; \n $latestTestCat = \"\";\n $latestTestDate = strtotime(\"4/15/2000\"); // random early date\n $arr1 =array();\n $info= getStudentInfo($value['accountID']);\n $email = $info['email'];\n $name = $info['name'];\n \n foreach ($allAssessments as $item) {\n if(checkIfResultsExist($email,$item['ID'])){\n $arr1[$item['ID']] = getStudentTestScoreData($email,$item['ID']);\n if($arr1[$item[\"ID\"]] > $bestAssessmentScore){\n $bestAssessmentScore =$arr1[$item[\"ID\"]];\n $bestAssessmentScoreID = $item[\"ID\"];\n $category = getCatNameLevel($item['catID']);\n $bestAssessmentScoreCat = $category['name'].\" \". $category['level'];\n }\n $totalSuccess += $arr1[$item[\"ID\"]];\n $totalAttempts += (getStudentTestMissedData($email,$item['ID']) +$arr1[$item[\"ID\"]] );\n $date_time = new DateTime($item['start_date']);\n $formated_date = $date_time->format('m/d/Y');\n $newtestDate = strtotime($formated_date);\n if($newtestDate > $latestTestDate){\n $latestTestDate = $newtestDate;\n $cat = getCatNameLevel($item['catID']);\n $latestTestCat = $cat['name'].\" \". $cat['level'];\n $latestTestID = \" ID:\". $item['ID'];\n }\n }\n\n }\n unset($item);\n if(!checkForTeacher($value['accountID'])){\n $avgScore = getTermAverage($totalSuccess,$totalAttempts);\n $arr1['average'] = utf8_encode($avgScore); // had to utf encode beceause json erros\n \n $arr1[\"totalmatched\"] = $totalSuccess;\n $arr1[\"totaltried\"] = $totalAttempts;\n $arr1[\"bestScore\"] = $bestAssessmentScore . \" (\".$bestAssessmentScoreCat . \" ID:\" . $bestAssessmentScoreID . \")\";\n $arr1[\"gradeLevel\"] = $classGradeLevel['gradeLevel'];\n $arr1[\"email\"] = $email;\n if($latestTestDate == strtotime(\"4/15/2000\")) {\n $arr1['lastTest'] = $latestTestID;\n } else {$arr1['lastTest'] = $latestTestCat. \" (\". $latestTestID . \") taken on \" . date(\"m/d/Y\",$latestTestDate);}\n $arr[$name] = $arr1;\n }\n \n}\nunset($value);\nreturn($arr);\n}", "public function grade($user = NULL) { }", "function questionnaire_update_grades($questionnaire=null, $userid=0, $nullifnone=true) {\n global $CFG, $DB;\n\n if (!function_exists('grade_update')) { // Workaround for buggy PHP versions.\n require_once($CFG->libdir.'/gradelib.php');\n }\n\n if ($questionnaire != null) {\n if ($graderecs = questionnaire_get_user_grades($questionnaire, $userid)) {\n $grades = array();\n foreach ($graderecs as $v) {\n if (!isset($grades[$v->userid])) {\n $grades[$v->userid] = new stdClass();\n if ($v->rawgrade == -1) {\n $grades[$v->userid]->rawgrade = null;\n } else {\n $grades[$v->userid]->rawgrade = $v->rawgrade;\n }\n $grades[$v->userid]->userid = $v->userid;\n } else if (isset($grades[$v->userid]) && ($v->rawgrade > $grades[$v->userid]->rawgrade)) {\n $grades[$v->userid]->rawgrade = $v->rawgrade;\n }\n }\n questionnaire_grade_item_update($questionnaire, $grades);\n } else {\n questionnaire_grade_item_update($questionnaire);\n }\n\n } else {\n $sql = \"SELECT q.*, cm.idnumber as cmidnumber, q.course as courseid\n FROM {questionnaire} q, {course_modules} cm, {modules} m\n WHERE m.name='questionnaire' AND m.id=cm.module AND cm.instance=q.id\";\n if ($rs = $DB->get_recordset_sql($sql)) {\n foreach ($rs as $questionnaire) {\n if ($questionnaire->grade != 0) {\n questionnaire_update_grades($questionnaire);\n } else {\n questionnaire_grade_item_update($questionnaire);\n }\n }\n $rs->close();\n }\n }\n}", "function game_calculate_best_attempt($game, $attempts) {\n\n switch ($game->grademethod) {\n\n case GAME_ATTEMPTFIRST:\n foreach ($attempts as $attempt) {\n return $attempt;\n }\n break;\n\n case GAME_GRADEAVERAGE: // need to do something with it :-)\n case GAME_ATTEMPTLAST:\n foreach ($attempts as $attempt) {\n $final = $attempt;\n }\n return $final;\n\n default:\n case GAME_GRADEHIGHEST:\n $max = -1;\n foreach ($attempts as $attempt) {\n if ($attempt->sumgrades > $max) {\n $max = $attempt->sumgrades;\n $maxattempt = $attempt;\n }\n }\n return $maxattempt;\n }\n}", "function game_calculate_best_score($game, $attempts) {\n\n switch ($game->grademethod) {\n\n case GAME_GRADEMETHOD_FIRST:\n foreach ($attempts as $attempt) {\n return $attempt->score;\n }\n break;\n\n case GAME_GRADEMETHOD_LAST:\n foreach ($attempts as $attempt) {\n $final = $attempt->score;\n }\n return $final;\n\n case GAME_GRADEMETHOD_AVERAGE:\n $sum = 0;\n $count = 0;\n foreach ($attempts as $attempt) {\n $sum += $attempt->score;\n $count++;\n }\n return (float)$sum/$count;\n\n default:\n case GAME_GRADEMETHOD_HIGHEST:\n $max = 0;\n foreach ($attempts as $attempt) {\n if ($attempt->score > $max) {\n $max = $attempt->score;\n }\n }\n return $max;\n }\n}", "function Grade($score){\n if($score < 40){\n $grd = 'F';\n }elseif ($score >=40 && $score < 45) {\n $grd = 'D2';\n }\n elseif ($score >=45 && $score < 50) {\n $grd = 'D1';\n }\n elseif ($score >=50 && $score < 55) {\n $grd = 'C2';\n }\n elseif ($score >=55 && $score < 60) {\n $grd = 'C1';\n }\n elseif ($score >=60 && $score < 65) {\n $grd = 'B2';\n }\n elseif ($score >=65 && $score < 70) {\n $grd = 'B1';\n }\n elseif ($score >=70 && $score < 75) {\n $grd = 'A2';\n }\n elseif ($score >=75 && $score < 100) {\n $grd = 'A1';\n }else{\n $grd = 'F';\n }\n return $grd;\n}", "function exam_take_grade_submit($form, &$form_state) {\n \n ExamInstance::storeMessage('Entered', 'exam_take_grade_submit');\n \n // Get the exam object \n $vExamInstanceID = $_SESSION['exam']['pExamInstanceID']; \n ExamInstance::storeMessage('$vExamInstanceID = ' . $vExamInstanceID . '.', 'exam_take_grade_submit');\n $vExamTitleURL = $_SESSION['exam']['pExamTitleURL'];\n ExamInstance::storeMessage('$vExamTitleURL = ' . $vExamTitleURL . '.', 'exam_take_grade_submit');\n \n // Clean up the database a little.\n // First, specify the \"isChosen\" values for each answer. I did not \n // do this as the answers were being selected for two reasons.\n // One, I could not figure out how to use the Drupal Forms API to \n // treat each answer individually in a way that seemed efficient.\n // Two, a workaround to update the table through each selected\n // answer would have placed an undue drag on system performance\n // with additional update statements on each question answered.\n // So instead, we captured the data along the way in the \n // question_instance table, and now we will just run one quick \n // update to spread the answers through the answer_instance table\n // The data model doubles the storage of information as a \n // mechanism to help flag potential errors in the system.\n // Here is the original UPDATE statement:\n // UPDATE answer_instance AS A\n // SET A.isChosen = 1\n // WHERE CONCAT(A.question_instance_id, A.answer_letter) IN \n // (SELECT CONCAT(B.question_instance_id, B.selected_answer_letter) theAnswer\n // FROM question_instance B\n // WHERE B.exam_instance_id = 1\n // AND B.selected_answer_letter IS NOT NULL); \n\n ExamInstance::storeMessage('UPDATE statement about to execute.' . $vExamTitleURL . '.', 'exam_take_grade_submit'); \n \n $vUpdateStatement =\n 'UPDATE answer_instance AS A\n SET A.isChosen = 1\n WHERE CONCAT(A.question_instance_id, A.answer_letter) IN \n (SELECT CONCAT(B.question_instance_id, B.selected_answer_letter) theAnswer\n FROM question_instance B\n WHERE B.exam_instance_id = :eiid\n AND B.selected_answer_letter IS NOT NULL)';\n $num_updated = db_query($vUpdateStatement, array(':eiid' => $vExamInstanceID));\n\n ExamInstance::storeMessage('UPDATE statement done.' . $vExamTitleURL . '.', 'exam_take_grade_submit'); \n \n //\n // Determine the grade\n //\n // First, update the database to indicate which \n // questions were answered correctly.\n $vUpdateStatement = \n 'UPDATE question_instance AS A \n JOIN answer_instance AS B \n ON (CONCAT(A.question_instance_id, A.selected_answer_letter) = CONCAT(B.question_instance_id,B.answer_letter))\n SET A.answeredCorrectly = CASE WHEN B.is_correct = 1 THEN 1 ELSE 0 END\n WHERE A.selected_answer_number IS NOT NULL\n AND A.exam_instance_id = :eiid';\n $num_updated = db_query($vUpdateStatement, array(':eiid' => $vExamInstanceID));\n \n // Next, grade the overall exam.\n $vUpdateStatement = \n 'UPDATE exam_instance \n SET numberCorrect = \n (SELECT COUNT(CASE WHEN B.answeredCorrectly = 1 THEN 1 END)\n FROM question_instance AS B\n WHERE B.exam_instance_id = :eiid)\n , numberWrong = \n (SELECT COUNT(CASE WHEN C.answeredCorrectly = 0 THEN 1 END)\n FROM question_instance AS C\n WHERE C.exam_instance_id = :eiid)\n , numberUnanswered = \n (SELECT COUNT(CASE WHEN D.answeredCorrectly IS NULL THEN 1 END)\n FROM question_instance AS D\n WHERE D.exam_instance_id = :eiid)\n , grade = \n (SELECT ROUND((COUNT(CASE WHEN B.answeredCorrectly = 1 THEN 1 END)\n / \n COUNT(*)*100),2) \n AS grade\n FROM question_instance AS B\n WHERE B.exam_instance_id = :eiid)\n , graded = 1\n WHERE exam_instance_id = :eiid';\n $num_updated = db_query($vUpdateStatement, array(':eiid' => $vExamInstanceID));\n \n $form_state['redirect'] = array('exam/grade/' . $vExamTitleURL);\n \n}", "public function getSolutions()\n {\n }", "function print_grades($feedback = false) {\n global $CFG;\n\n $this->load_grades();\n\n $retval = '';\n\n /// Whether this plugin is entitled to update export time\n if ($expplugins = explode(\",\", $CFG->gradeexport)) {\n if (in_array('xml', $expplugins)) {\n $export = true;\n } else {\n $export = false;\n }\n } else {\n $export = false;\n }\n\n /// Calculate file name\n $downloadfilename = clean_filename(\"{$this->course->shortname} $this->strgrades.xml\");\n\n $tempfilename = $CFG->dataroot . MD5(microtime()) . $downloadfilename;\n if (!$handle = fopen($tempfilename, 'w+b')) {\n error(\"Could not create a temporary file into which to dump the XML data.\");\n return false;\n }\n\n /// time stamp to ensure uniqueness of batch export\n fwrite($handle, '<results batch=\"xml_export_'.time().'\">'.\"\\n\");\n\n foreach ($this->columnidnumbers as $index => $idnumber) {\n\n // studentgrades[] index should match with corresponding $index\n foreach ($this->grades as $studentid => $studentgrades) {\n fwrite($handle, \"\\t<result>\\n\");\n\n // state can be new, or regrade\n // require comparing of timestamps in db\n\n $params = new object();\n $params->idnumber = $idnumber;\n // get the grade item\n $gradeitem = new grade_item($params);\n\n // we are trying to figure out if this is a new grade, or a regraded grade\n // only relevant if this grade for this user is already exported\n\n // get the grade_grade for this user\n $params = new object();\n $params->itemid = $gradeitem->id;\n $params->userid = $studentid;\n\n $grade_grade = new grade_grade($params);\n\n // if exported, check grade_history, if modified after export, set state to regrade\n $status = 'new';\n if (!empty($grade_grade->exported)) {\n //TODO: use timemodified or something else instead\n/* if (record_exists_select('grade_history', 'itemid = '.$gradeitem->id.' AND userid = '.$studentid.' AND timemodified > '.$grade_grade->exported)) {\n $status = 'regrade';\n } else {\n $status = 'new';\n }*/\n } else {\n // never exported\n $status = 'new';\n }\n\n fwrite($handle, \"\\t\\t<state>$status</state>\\n\");\n // only need id number\n fwrite($handle, \"\\t\\t<assignment>$idnumber</assignment>\\n\");\n // this column should be customizable to use either student id, idnumber, uesrname or email.\n fwrite($handle, \"\\t\\t<student>$studentid</student>\\n\");\n fwrite($handle, \"\\t\\t<score>{$studentgrades[$index]}</score>\\n\");\n if ($feedback) {\n fwrite($handle, \"\\t\\t<feedback>{$this->comments[$studentid][$index]}</feedback>\\n\");\n }\n fwrite($handle, \"\\t</result>\\n\");\n\n // timestamp this if needed\n if ($export) {\n $grade_grade->exported = time();\n // update the time stamp;\n $grade_grade->update();\n }\n }\n }\n fwrite($handle, \"</results>\");\n fclose($handle);\n\n require_once($CFG->libdir . '/filelib.php');\n\n header(\"Content-type: text/xml; charset=UTF-8\");\n header(\"Content-Disposition: attachment; filename=\\\"$downloadfilename\\\"\");\n\n readfile_chunked($tempfilename);\n\n unlink($tempfilename);\n\n exit();\n }", "function econsole_grades($econsoleid) {\r\n return NULL;\r\n}", "public function getStudentGrades($osuId, $courseId){\n\t\t\t\n\t\t\t//construct query to grab peer reviews done for the current student\n\t\t\t//in the currently active course\n\t\t\t$query = \"SELECT * FROM review WHERE reviewFor='\" . $osuId . \"' AND forClass='\" . $courseId . \"'\";\n\t\t\t//execute query\n\t\t\t$result = $this->db->query($query);\n\t\t\t\n\t\t\t//check the result to see if it worked\n\t\t\tif($result){\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\t//query failed\n\t\t\telse{\n\t\t\t\techo 'Error getting student grades!';\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "private function getResults($gid)\n\t{\n\t\t$arr = array();\n\t\t$sid = $_SESSION['uid'];\n\t\t$db = Db::getLink();\n\t\t$stmt = $db->prepare(\n\t\t\t\"SELECT `assessment`.`name` , `results`.`grade`, `assessment`.`isDraft`\n\t\t\tFROM `results`\n\t\t\tLEFT JOIN `assessment` ON `assessment`.`id` = `results`.`aid`\n\t\t\tWHERE `results`.`sid` = ? AND `assessment`.`moid` IN\n\t\t\t(SELECT `group`.`moid` FROM `group` WHERE `group`.`id` = ?);\"\n\t\t);\n\t\t$stmt->bind_param('ii', $sid, $gid);\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($aname, $grade, $isDraft);\n\t\twhile ($stmt->fetch()) {\n\t\t\tif($isDraft) {\n\t\t\t\t$arr[$aname] = 'Not published';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$arr[$aname] = $grade . '%';\n\t\t\t}\n\t\t}\n\t\treturn $arr;\n\t}", "function show_classes( $student )\n{\n\n\t$psid = $student->getPsid();\n\t$pword = file(\"quotes3.txt\");\n\t$pass = rtrim( $pword[0] );\n\t$db = new mysqli('localhost', 'BeersA', $pass , 'BeersA');\n\t\n\tif ( $db->connect_error):\n\t\tdie (\" Could not connect to db: \" . $db->connect_error);\n\tendif;\n\n\t$result = $db->query(\"select * from Courses where Courses.psid = '$psid' order by Courses.Term\");\n\t\n\techo \"<br/>Here are the classes taken ( term by term ), with the respective grades:<br/>\";\n\t\n\t$rows = $result->num_rows;\n\tfor( $i = 0; $i < $rows; $i++ )\n\t{\n\t\t$row = $result->fetch_array();\n\t\techo \"Term: \". $row['Term'] . \" Class: \".$row['Department'].$row['Class_Number'].\" Grade: \".$row['Grade'].\"<br/>\";\n\t\n\t}\n\n\t$result = $db->query(\"select * from Courses where Courses.psid = '$psid' order by Courses.Department, Courses.Class_Number\");\n\n\techo \"<br/>Here are the classes taken ( alphabetically ), with the respective grades:<br/>\";\n\t\n\t$rows = $result->num_rows;\n\t\n\tfor( $i = 0; $i < $rows; $i++ )\n\t{\n\t\t$row = $result->fetch_array();\n\t\techo \"Term: \". $row['Term'] . \" Class: \".$row['Department'].$row['Class_Number'].\" Grade: \".$row['Grade'].\"<br/>\";\t\n\t}\n\t\n\t/* Report card approach:\n\t\t1. get all the courses that the student has taken\n\t\t2. query for the course number and id in the reqs table\n\t\t3. store solution in array keyed by the req.requirement\n\t\t\ta.) if the req is an elective then number them until 5\n\t\t4.) query distinct for each req\n\t\t5.) search req array for the key of the requirement, if found print with grades, else N\n\t*/\n\t\n\techo \"<br/>Here is the progress on required courses:<br/>\";\n\t$coursesTaken = $student->getCourses();\n\t$requiredCourses = array();\n\t$electiveCount = 0;\n\tfor ( $i = 0; $i < count( $coursesTaken ); $i++ )\n\t{\n\t\t$currNumber = $coursesTaken[$i]->getNumber();\n\t\t$currDepartment = $coursesTaken[$i]->getDepartment();\n\t\t$result = $db->query(\"select * from Reqs where Reqs.Class_Number = '$currNumber' and Reqs.Department = '$currDepartment'\");\n\t\t\n\t\t$rows = $result->num_rows;\n\t\t\n\t\t\n\t\t\n\t\tif ( $rows >0 )\n\t\t{\n\t\t\tif ( $coursesTaken[$i]->getGPA() >= 2.00 )\n\t\t\t{\n\t\t\t\t$req = $result->fetch_array();\n\t\t\t\t\n\t\t\t\tif ( preg_match ( \"/CSElec/\", $req['Requirement'] ) )\n\t\t\t\t{\n\t\t\t\t\tif ( $electiveCount < 5 )\n\t\t\t\t\t{\t\n\t\t\t\t\t\t$electiveCount++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$courseString = \"S - Req: CSElec\".$electiveCount. \" \". $coursesTaken[$i];\n\t\t\t\t\t\t$requiredCourses[\"CSElec$electiveCount\"] = $courseString;\n\n\t\t\t\t\t}\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\t$courseString = \"S - Req: \".$req['Requirement']. \" \". $coursesTaken[$i];\n\t\t\t\t\t$requiredCourses[$req['Requirement']] = $courseString;\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"Course denied: $coursesTaken[$i]</br>\";\n\t\t\t\t$courseString = \"N - Req: \".$req['Requirement'].\"</br>\";\n\t\t\t\t$requiredCourses[$req['Requirement']] = $courseString;\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t}\n\n\t$result = $db->query(\"select distinct Requirement from Reqs\");\n\t\n\t$rows = $result->num_rows;\n\t\n\tfor ( $i = 0; $i < $rows; $i++ )\n\t{\n\t\t$req = $result->fetch_array();\n\t\tif( array_key_exists( $req['Requirement'], $requiredCourses ) )\n\t\t{\n\t\t\techo $requiredCourses[$req['Requirement']];\n\t\t\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\techo \"N - \" . $req['Requirement'] . \"</br>\";\n\t\t\n\t\t}\n\t\n\t\n\t\n\t}\n\t\n\treturn ;\n\t\t\n}", "public function getGradeById($id = 0)\n {\n if ($id === 0)\n {\n $query = $this->db->get('grade');\n return $query->result_array();\n }\n\n $query = $this->db->get_where('grade', array('grade_id' => $id));\n return $query->row_array();\n }", "function _Fselectbestteacher4course($_Mgroupteachers,&$_Mrow,$_Mcourseid,$_Mcoursecode,$_Mcourseunits,$_Mcoursepart,$_Mcoursepartunits,&$_Mcheckedteachersids,$_Mgroupteachercount,$_Mslotcnst,$_Mgroupregedscheduledcourses,$_Mgroupregedcounter)\n{\n\t$_Mteacherfound=false;\n\tif($_Mcourseunits>$_Mcoursepartunits)\n\t{\n\t\t//if(count($_Mgroupregedscheduledcourses)>0) this array is initialized when before this time any course is schedule,and if this is the first time,its empty\n\t\t{\n\t\t\t$_Mteacherid=_Fgetothercoursepartteacher($_Mcourseid,$_Mcoursepart,$_Mgroupregedscheduledcourses);\n\t\t\tif($_Mteacherid>0)\n\t\t\t{\n\t\t\t\tif(!($GLOBALS['_Motherpartteacherchecked']))\n\t\t\t\t{\n\t\t\t\t\tfor($i=0 ; $i<count($_Mgroupteachers) ; $i++)\n\t\t\t\t\tif($_Mgroupteachers[$i]['teacherID']==$_Mteacherid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$_Mrow1=$_Mgroupteachers[$i];\n\t\t\t\t\t\t$_Mselectedteacherid=$_Mteacherid;\n\t\t\t\t\t\t$_Mteacherfound=true;break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif(!($_Mteacherfound))\n\t{\n\t\tif(count($_Mcheckedteachersids)==$_Mgroupteachercount)\n\t\t\treturn false;\n\t\t$_Mselectedteacherid=0;$_Mselectedteacherprior=6;$_Mrow1='';\n\t\tfor($i=0 ; $i<$_Mgroupteachercount ;$i++)\n\t\t{\n\t\t\t$_Mtrow=$_Mgroupteachers[$i];\n\t\t\tif(!(in_array($_Mtrow['teacherID'],$_Mcheckedteachersids)))\n\t\t\t{\n\t\t\t\t$_Mteachercourses=explode(\",\",$_Mtrow[\"teachercourseids\"]);\n\t\t\t\t//changed courseid to coursecode 8711\n\t\t\t\t//$_Mindex=array_search($_Mcourseid,$_Mteachercourses);\n\t\t\t\t$_Mindex=array_search($_Mcoursecode,$_Mteachercourses);\n\t\t\t\tif($_Mindex!==false)\n\t\t\t\t{\n\t\t\t\t\t$_Mteachercoursepriors=explode(\",\",$_Mtrow[\"teachercoursepriors\"]);\n\t\t\t\t\t//to check the teachers prior to teach course,teachers total prior should be added\n\t\t\t\t\t//a weight should be calculated(total p & course p) for teachers priority to teach course\n\t\t\t\t\t//if( ($_Mteachercoursepriors[$_Mindex]>=$_Mselectedteacherprior)& ohhhhhh only a =\n\t\t\t\t\tif ((($GLOBALS['_Mcheckteachersmaxslotcnst'])&& \n\t\t\t\t\t (($GLOBALS['_Mgroupteachers'][$i]['teachercurslots']+$_Mcourseunits)<=$GLOBALS['_Mgroupteachers'][$i]['teachermaxslots']) ) \n\t\t\t\t\t ||(!($GLOBALS['_Mcheckteachersmaxslotcnst']))||($GLOBALS['_Mgroupteachers'][$i]['teachermaxslots']==0) )\n\t\t\t\t\t{ \n\t\t\t\t\t\tif( ($_Mteachercoursepriors[$_Mindex]<$_Mselectedteacherprior)&\n\t\t\t\t\t \t(($_Mslotcnst=='')||(_Fstatushastime4slots($_Mtrow['times'],$_Mslotcnst))) )//if slotcnst is '' no has checking needed\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_Mselectedteacherid=$_Mtrow['teacherID'];\n\t\t\t\t\t\t\t$_Mselectedteacherprior=$_Mteachercoursepriors[$_Mindex];\n\t\t\t\t\t\t\t$_Mrow1=$_Mtrow;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse _Fcreatereport(\"===>teacher isnot best \",$GLOBALS['_Mgroup1']->getgroupid(),$_Mcourseid,'',$_Mtrow['teacherID'],$_Mtrow[\"teacherfamily\"],$_Mcoursepart);\n\t\t\t\t\t}\n\t\t\t\t\telse _Fcreatereport(\"===>curslots:{$GLOBALS['_Mgroupteachers'][$i]['teachercurslots']} - max: {$GLOBALS['_Mgroupteachers'][$i]['teachermaxslots']}\",$GLOBALS['_Mgroup1']->getgroupid(),$_Mcourseid,'',$_Mtrow['teacherID'],$_Mtrow[\"teacherfamily\"],$_Mcoursepart);\n\t\t\t\t\t$GLOBALS['_Mnoteacherhasthiscourse']=false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_Fcreatereport(\"===>teacher hasnot course \",$GLOBALS['_Mgroup1']->getgroupid(),$_Mcourseid,'',$_Mtrow['teacherID'],$_Mtrow[\"teacherfamily\"],$_Mcoursepart);\n\t\t\t\t\tarray_push($_Mcheckedteachersids,$_Mtrow['teacherID']);\n\t\t\t\t}\n\t\t\t }\n\t\t}\n\t}\n\t$_Mrow=$_Mrow1;\n\tif($_Mselectedteacherid)\n\t{array_push($_Mcheckedteachersids,$_Mselectedteacherid);return true;}\n\telse\n\t\treturn false;\n}", "public function setGrade($arr)\n\t{\n\t}", "function alternatives()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->array_query( $questionArray, \"SELECT ID FROM eZQuiz_Alternative WHERE QuestionID='$this->ID' ORDER BY ID\" );\r\n\r\n for ( $i = 0; $i < count( $questionArray ); $i++ )\r\n {\r\n $returnArray[$i] = new eZQuizAlternative( $questionArray[$i][$db->fieldName( \"ID\" )], true );\r\n }\r\n return $returnArray;\r\n }", "public static function __getTotalGrade(){\r\n return @array_sum(self::$_totalGrade);\r\n }", "function grade_to_percentage($gradeval, $grademin, $grademax) {\n if ($grademin >= $grademax) {\n debugging(\"The minimum grade ($grademin) was higher than or equal to the maximum grade ($grademax)!!! Cannot proceed with computation.\");\n }\n $offset_value = $gradeval - $grademin;\n $offset_max = $grademax - $grademin;\n $factor = 100 / $offset_max;\n $percentage = $offset_value * $factor;\n return $percentage;\n }", "public function getGradedGradeable() {\n return $this->graded_gradeable;\n }", "public function grades()\n {\n return $this->hasMany('App\\Model\\Grade', 'student_id');\n }", "public function getQuality()\r\n\t{\r\n\t\tif($this->getGrade() == 'A')\r\n\t\t\treturn ($this->sks * 4);\r\n\t\telseif ($this->getGrade() == 'B')\r\n\t\t\treturn ($this->sks * 3);\r\n\t\telseif ($this->getGrade() == 'C')\r\n\t\t\treturn ($this->sks * 2);\r\n\t\telseif ($this->getGrade() == 'D')\r\n\t\t\treturn ($this->sks * 1);\r\n\t\telse\r\n\t\t\treturn ($this->sks * 0);\r\n\t}", "function homework_individual()\n {\n \tglobal $db, $PLACEWEB_CONFIG, $problems_array, $equations_array;\n \t\n\t\t$sql = \"SELECT * FROM smartroom_hw\";\n\t\t\t//$result = mysql_query($query, $db) or die('Error count query:'.mysql_error());\n\t\t\t//$homework = mysql_fetch_array($result, MYSQL_ASSOC);\n\t\t\n\t\t$homework = mysql_query($sql, $db) or die('An error happened');\n\n\t\t$hwIndividualCollection = array();\n\t\t\n\t\t//while ($hw = mysql_fetch_array($result, MYSQL_ASSOC))\n\t\twhile(($hw=mysql_fetch_assoc($homework)) != null) \n\t\t{\n\t\t\t//print_r($hw);\n\t\t\t\n\t\t\t// clean up space after comma\n\t\t\t$cleaned_db_principles = trim($hw['principles']);\n\t\t\t$cleaned_db_principles = str_replace(', ', ',', $cleaned_db_principles);\n\t\t\t\n\t\t\t$probPrinciplesNames = explode(\",\", $cleaned_db_principles);\n\t\t\t$probEquationsIs = explode(\",\", $hw['equations']);\n\n\t\t\t$probPrinciplesInTargetFormat = array();\n\t\t\t$probEquationsInTargetFormat = array();\n\n\t\t\tforeach($probPrinciplesNames as $pn)\n\t\t\t{\n\t\t\t\t// some clean up\n\t\t\t\t$pn = stripcslashes($pn);\n\t\t\t\t$pn=trim($pn);\n\t\t\t\n\t\t\t\t// formatting to expected format\n\t\t\t\t$probPrinciplesNames = array(\n\t\t\t\t\t'name'=>$pn\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t// add ony if not empty\n\t\t\t\tif($pn){\n\t\t\t\t\t$probPrinciplesInTargetFormat[]=$probPrinciplesNames;\n\t\t\t\t}\n\t\t\t} // end loop principles\n\t\t\t\n\t\t\t// build equations array\n\t\t\tfor ($i=0;$i<count($probEquationsIs);$i++) \n\t\t\t{\n\t\t\t\t// index = EQ_ID - 1\n\t\t\t\t$index = $probEquationsIs[$i]-1;\n\t\t\t\t// get equation expression\n\t\t\t\t$probEquationsNames= array(\n\t\t\t\t\t'name'=>$equations_array[$i]['name']\n\t\t\t\t);\n\t\t\t\t//echo \"<br/>\".$probEquationsIs[$i].'. ---'.addslashes($equations_array[$index]['name']);\n\t\t\t\t$probEquationsInTargetFormat[]=$probEquationsNames;\n\t\t\t}\n\t\t\t\n\t\t\t$hwIndividual = array(\n\t\t\t\t'studentId'=>$hw['username'],\n\t\t\t\t'problemName'=>$hw['problem_name'],\n\t\t\t\t'principles'=>$probPrinciplesInTargetFormat,\n\t\t\t\t'equations'=>$probEquationsInTargetFormat,\n\t\t\t);\n\t\t\t\n\t\t\t$hwIndividualCollection[]=$hwIndividual;\n\t\t}\n\t\t\n\t\techo json_encode($hwIndividualCollection);\n }", "public function getEvaluations($studentId, $areaId, $reinforceId, $includeSpecialities):array\n\t{\n\t\t$schoolModel = new SchoolViewModel();\n\t\t$course = $this->dao->getActiveCourse();\n\t\t$trimestre = $this->dao->getActiveTrimestre();\n\t\t$student = $this->dao->getById(\"Student\", $studentId);\n\t\t$classroom = $student->getClassroom($course, $trimestre);\n\t\t$degree = $classroom->getLevel()->getCycle()->getDegree();\n\t\t$evaluation['trimestre'] = $trimestre->getNumber();\n\t\t$evaluation['peds'] = $this->getPartialEvaluationDescriptions();\n\t\t$evaluation['geds'] = $this->getGlobalEvaluationDescriptions();\n\t\t$evaluation['classroom'] = $schoolModel->getClassroom($classroom->getId());\n\t\t$evaluation['student']['name'] = $student->getName() . \" \" . $student->getSurnames();\n\t\t$evaluation['previousTrimestres'] = $schoolModel->getPreviousTrimestres(); \n\t\t\n\t\t//les qualificacions de reforç no han de sortir al formulari general d'entrada\n\t\tif ($reinforceId == null) {\n\t\t\t$evaluation['scopes'] = $this->getScopesData($studentId, $classroom, $areaId);\n\t\t\t$observation = $student->getCourseObservation($course, $trimestre);\n\t\t\t$observationText = $observation != null ? $observation->getText() : '';\n\t\t\t$evaluation['observation'] = trim(stripcslashes($observationText),'\"');\n\n\t\t//les qualificacions de reforç surten a part de les generals\n\t\t} else {\n\t\t\t$reinforceClassroom = $this->dao->getById(\"ReinforceClassroom\", $reinforceId);\n\t\t\t$evaluation['reinforce'] = $schoolModel->getReinforceClassroom($reinforceId);\n\t\t\t$observation = $student->getCourseObservation($course, $trimestre, $reinforceClassroom);\n\t\t\tif ($observation == null) {\n\t\t\t\t$evaluation['reinforce']['observation']['id'] = null;\n\t\t\t\t$evaluation['reinforce']['observation']['text'] = '';\n\t\t\t} else {\n\t\t\t\t$evaluation['reinforce']['observation']['id'] = $observation->getId();\n\t\t\t\t$evaluation['reinforce']['observation']['text'] = $observation->getText();\n\t\t\t}\n\t\t}\n\t\treturn $evaluation;\n\t}", "public function getHighGrade();", "function emarking_calculate_grade($emarking, $totalscore, $totalrubricscore) {\n if (isset($emarking->adjustslope) && $emarking->adjustslope) {\n $finalgrade = min($emarking->grade,\n ((($emarking->adjustslopegrade - $emarking->grademin) / $emarking->adjustslopescore) * $totalscore) +\n $emarking->grademin);\n } else {\n $finalgrade = ((($emarking->grade - $emarking->grademin) / $totalrubricscore) * $totalscore) + $emarking->grademin;\n }\n return $finalgrade;\n}", "function grades($nilai)\r\n\r\n{\r\n if($nilai <= 100 ) { $grade = \"A\"; }\r\n if($nilai < 80 ) { $grade = \"B\"; }\r\n if($nilai < 70 ) { $grade = \"C\"; }\r\n if($nilai < 60 ) { $grade = \"D\"; }\r\n if($nilai < 50 ) { $grade = \"E\"; }\r\n\r\n return $grade;\r\n}", "function languagelesson_calculate_user_lesson_grade($lessonid, $userid) {\n global $DB;\n $attemptscores = $DB->get_records('languagelesson_attempts', array('lessonid'=>$lessonid, 'userid'=>$userid), null, 'id,score');\n $lessonscore = 0;\n foreach ($attemptscores as $score) {\n $lessonscore += $score->score;\n }\n $DB->set_field('languagelesson_grades', 'grade', $lessonscore, array('lessonid'=>$lessonid, 'userid'=>$userid));\n \n return $lessonscore;\n}", "function calculateGPAHours($clid){\n\t$result = mysql_query(\"Select sum(credit_hours) FROM(( Select credit_hours FROM take T, class Cl WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'NC' and T.grade <> 'CR' and T.grade <> 'W' and T.clid = '$clid' and Cl.section_num = T.section_num and Cl.semester = T.semester and Cl.year = T.year and Cl.course_num = T.course_num and Cl.course_dept = T.course_dept and Cl.credit_hours IS NOT NULL) UNION ALL (Select Co.credit_hours FROM spec_cred S, course Co WHERE S.grade IS NOT NULL and S.grade <> 'I' and S.grade <> 'NC' and S.grade <> 'CR' and S.grade <> 'W' and !S.transfer and S.clid = '$clid' and S.course_dept = Co.course_dept and S.course_num = Co.course_num) UNION ALL (Select Co.credit_hours FROM take T,course Co WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'NC' and T.grade <> 'CR' and T.grade <> 'W' and T.clid = '$clid' and T.course_dept = Co.course_dept and T.course_num = Co.course_num and NOT EXISTS(select * from class Cl WHERE Cl.course_dept = Co.course_dept and Cl.course_num = Co.course_num and Cl.credit_hours IS NOT NULL))) AS result;\") or die(mysql_error());\n\t$hours = mysql_result($result,0);\n\tif($hours == NULL) return 0;\n\telse return $hours;\n}", "public function get_grade() {\n return $this->grade;\n }", "function costcentre_export_grades($centre, $course, $datefrom, $dateto) {\n global $CFG, $DB;\n\n $primcc = get_string('courses_costcentrefieldname', 'report_costcentre');\n $seccc = get_string('courses_secondarycostcentrefieldname', 'report_costcentre');\n\n $staffcat = $DB->sql_concat_join(\"' '\", array(\"ue.courseid\", \"u.id\"));\n $sql = \" SELECT x.id, x.uid, x.firstname, x.lastname, x.primarycc, x.secondarycc, x.courseid, x.fullname, \n MAX(x.timemodified) as timemodified\n FROM\n (SELECT $staffcat as id , u.id as uid, u.firstname, u.lastname, \n pri.data AS primarycc,\n sec.data as secondarycc, ue.courseid AS courseid, ue.fullname, 0 as timemodified\n FROM {user} u\n INNER JOIN (SELECT c1.id as courseid, ue1.userid, c1.fullname, c1.visible\n FROM {enrol} e1\n JOIN {user_enrolments} ue1 ON ue1.enrolid = e1.id\n JOIN {course} c1 on c1.id = e1.courseid\n GROUP BY 1, 2) ue ON u.id = ue.userid\n LEFT JOIN {user_info_data} pri ON u.id = pri.userid AND pri.fieldid = \n (SELECT id FROM {user_info_field} WHERE shortname = ?) \n LEFT JOIN {user_info_data} sec ON u.id = sec.userid AND sec.fieldid = \n (SELECT id FROM {user_info_field} WHERE shortname = ?)\n \n WHERE (pri.data = ? OR sec.data = ?)\n AND ue.visible = 1 AND u.suspended = 0 AND u.deleted = 0\n UNION \n SELECT $staffcat as id , u.id as uid, u.firstname, u.lastname, pri.data AS primarycc,\n sec.data as secondarycc, ue.courseid AS courseid, ue.fullname, fbc.timemodified\n FROM {user} u\n INNER JOIN (SELECT c1.id as courseid, ue1.userid, c1.fullname, c1.visible\n FROM {enrol} e1\n JOIN {user_enrolments} ue1 ON ue1.enrolid = e1.id\n JOIN {course} c1 on c1.id = e1.courseid\n GROUP BY 1, 2) ue ON u.id = ue.userid\n LEFT JOIN {user_info_data} pri ON u.id = pri.userid AND pri.fieldid = \n (SELECT id FROM {user_info_field} WHERE shortname = ?) \n LEFT JOIN {user_info_data} sec ON u.id = sec.userid AND sec.fieldid = \n (SELECT id FROM {user_info_field} WHERE shortname = ?)\n LEFT JOIN (SELECT fc.userid, fb.course, fc.timemodified\n FROM {feedback_completed} fc\n INNER JOIN {feedback} fb ON fb.id = fc.feedback) AS fbc ON fbc.userid = u.id AND fbc.course = ue.courseid \n WHERE (pri.data = ? OR sec.data = ?)\n AND ue.visible = 1 AND u.suspended = 0 AND u.deleted = 0\n ORDER BY 4,3,7 ) as x \";\n\n if ($course != '0') {\n $sql .=\" WHERE ((x.timemodified > ? AND x.timemodified < ? ) OR (x.timemodified < 1) )\n AND x.courseid = ? \";\n $sql .=\"GROUP BY 4,3,7,2 ORDER BY 4,3,2 \";\n $users = $DB->get_records_sql($sql, array($primcc,\n $seccc,\n $centre, $centre,\n $primcc,\n $seccc,\n $centre, $centre,\n $datefrom, $dateto, $course));\n } else {\n $sql .=\" WHERE (x.timemodified > ? AND x.timemodified < ?) OR (x.timemodified < 1) \";\n $sql .=\" GROUP BY 4,3,7,2 ORDER BY 4,3,2 \";\n $users = $DB->get_records_sql($sql, array($primcc,\n $seccc,\n $centre, $centre,\n $primcc,\n $seccc,\n $centre, $centre, $datefrom, $dateto));\n }\n\n // CSV file creation and Data Export to CSV File.\n @header('Content-Disposition: attachment; filename='.'csvexport_'.date(\"Ymd\").'.csv');\n @header('Content-Type: text/csv');\n\n $csvhead = array(get_string('courses_pcostcentre', 'report_costcentre'));\n $csvhead[] = get_string('courses_scostcentre', 'report_costcentre');\n $csvhead[] = get_string('courses_lastname', 'report_costcentre');\n $csvhead[] = get_string('courses_firstname', 'report_costcentre');\n $csvhead[] = get_string('courses_course', 'report_costcentre');\n $csvhead[] = get_string('courses_status', 'report_costcentre');\n $csvhead[] = get_string('courses_completiondate', 'report_costcentre');\n $csvheading = implode(',', $csvhead);\n echo $csvheading;\n echo \"\\n\";\n if ($users) {\n\n // Looping through query output to write into CSV file.\n foreach ($users as $u) {\n // Added to change the date format.\n $printarray = array(str_replace(',', ' ', $u->primarycc));\n $printarray[] = str_replace(',', ' ', $u->secondarycc);\n $printarray[] = str_replace(',', ' ', $u->lastname);\n $printarray[] = str_replace(',', ' ', $u->firstname);\n $printarray[] = str_replace(',', ' ', $u->fullname);\n\n if ($u->timemodified == '0') {\n $status = get_string('courses_notcompleted', 'report_costcentre');\n $compdate = get_string('courses_notcompleted', 'report_costcentre');\n } else {\n $status = get_string('courses_completed', 'report_costcentre');\n $compdate = date('d/m/Y', $u->timemodified);\n }\n\n $printarray[] = str_replace(',', ' ', $status);\n $printarray[] = str_replace(',', ' ', $compdate);\n $line = implode(',', $printarray);\n echo $line;\n echo \"\\n\";\n }\n\n } else {\n $printarray = array(str_replace(',', ' ', get_string('courses_norecords', 'report_costcentre')));\n $line = implode(',', $printarray);\n echo $line;\n echo \"\\n\";\n }\n\n // Kill the process once export is completed.\n exit;\n}", "function quiz_get_newgraded_states($attemptidssql, $idxattemptq = true, $fields='qs.*'){\n global $CFG, $DB;\n if ($attemptidssql && is_array($attemptidssql)){\n list($usql, $params) = $DB->get_in_or_equal($attemptidssql);\n $gradedstatesql = \"SELECT $fields FROM \" .\n \"{question_sessions} qns, \" .\n \"{question_states} qs \" .\n \"WHERE qns.attemptid $usql AND \" .\n \"qns.newest = qs.id\";\n $gradedstates = $DB->get_records_sql($gradedstatesql, $params);\n } else if ($attemptidssql && is_object($attemptidssql)){\n $gradedstatesql = \"SELECT $fields FROM \" .\n $attemptidssql->from.\",\".\n \"{question_sessions} qns, \" .\n \"{question_states} qs \" .\n \"WHERE qns.attemptid = qa.uniqueid AND \" .\n $attemptidssql->where.\" AND \".\n \"qns.newest = qs.id\";\n $gradedstates = $DB->get_records_sql($gradedstatesql, $attemptidssql->params);\n } else {\n return array();\n }\n if ($idxattemptq){\n return quiz_report_index_by_keys($gradedstates, array('attempt', 'question'));\n } else {\n return $gradedstates;\n }\n}", "public function setGradeTest($grade)\n\t{\n\t\tarray_push($this->grades, intval($grade));\n\t}", "public function grade() \n {\n if (permission::permitted('grades')=='fail'){ return redirect()->route('denied'); }\n\n $data = table::grade()->get();\n return view('admin.fields.grade', compact('data'));\n }", "function get_grade_letters() {\n global $COURSE;\n $context = get_context_instance(CONTEXT_COURSE, $COURSE->id);\n $letters = grade_get_letters($context);\n }", "public function dataprovider_learningobjectives() {\n // Array for storing our runs.\n $runs = array();\n\n // Records that we will be re-using.\n $sufficientgraderecord = array(\n 'classid' => 100,\n 'grade' => 100,\n 'completestatusid' => STUSTATUS_NOTCOMPLETE,\n 'locked' => 0\n );\n $sufficientgraderecordcompleted = array(\n 'classid' => 100,\n 'grade' => 100,\n 'completestatusid' => STUSTATUS_PASSED,\n 'locked' => 1\n );\n $insufficientgraderecord = array(\n 'classid' => 100,\n 'grade' => 0,\n 'completestatusid' => STUSTATUS_NOTCOMPLETE,\n 'locked' => 0\n );\n\n $sufficientlograderecord = array(\n 'completionid' => 1,\n 'classid' => 100,\n 'grade' => 100,\n 'locked' => 0\n );\n $insufficientlograderecord = array(\n 'completionid' => 1,\n 'classid' => 100,\n 'grade' => 0,\n 'locked' => 0\n );\n\n // Arrays specifying user ids.\n $firstuser = array('userid' => 103);\n $seconduser = array('userid' => 104);\n\n /*\n * run with sufficient enrolment grade but insufficient required LO grade\n */\n\n // Each user has an enrolment record with a sufficient grade.\n $enrolments = array();\n $enrolments[] = array_merge($sufficientgraderecord, $firstuser);\n $enrolments[] = array_merge($sufficientgraderecord, $seconduser);\n\n // Each user has an LO grade record with an insufficient grade.\n $logrades = array();\n $logrades[] = array_merge($insufficientlograderecord, $firstuser);\n $logrades[] = array_merge($insufficientlograderecord, $seconduser);\n\n // Each user has a matching in progress and unlocked record.\n $expectedenrolments = array();\n $expectedenrolments[] = array_merge($sufficientgraderecord, $firstuser);\n $expectedenrolments[] = array_merge($sufficientgraderecord, $seconduser);\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n /*\n * run with insufficient enrolment grade but sufficient required LO grade\n */\n\n // Each user has an enrolment record with an insufficient grade.\n $enrolments = array();\n $enrolments[] = array_merge($insufficientgraderecord, $firstuser);\n $enrolments[] = array_merge($insufficientgraderecord, $seconduser);\n\n // Each user has an LO grade record with a sufficient grade.\n $logrades = array();\n $logrades[] = array_merge($sufficientlograderecord, $firstuser);\n $logrades[] = array_merge($sufficientlograderecord, $seconduser);\n\n // Each user has a matching in progress and unlocked record.\n $expectedenrolments = array();\n $expectedenrolments[] = array_merge($insufficientgraderecord, $firstuser);\n $expectedenrolments[] = array_merge($insufficientgraderecord, $seconduser);\n\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n /*\n * run with sufficient enrolment grade and sufficient required LO grade\n */\n\n // Each user has an enrolment record with a sufficient grade.\n $enrolments = array();\n $enrolments[] = array_merge($sufficientgraderecord, $firstuser);\n $enrolments[] = array_merge($sufficientgraderecord, $seconduser);\n\n // Each user has an LO grade record with a sufficient grade.\n $logrades = array();\n $logrades[] = array_merge($sufficientlograderecord, $firstuser);\n $logrades[] = array_merge($sufficientlograderecord, $seconduser);\n\n // Each user has a matching passed and locked record.\n $expectedenrolments = array();\n $expectedenrolments[] = array_merge($sufficientgraderecordcompleted, $firstuser);\n $expectedenrolments[] = array_merge($sufficientgraderecordcompleted, $seconduser);\n\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n // Return all data.\n return $runs;\n }", "public function prepare_grade_breakdown($userid);", "public function getGrade($marks){\n if($marks != null){\n if($marks >= 80 && $marks < 100){\n return 'A';\n } else if($marks >=75){\n return 'A-';\n } else if($marks >= 70){\n return 'B+';\n } else if($marks >= 65){\n return 'B';\n } else if($marks >= 60){\n return 'B-';\n } else if($marks >= 55){\n return 'C+';\n } else if($marks >= 50){\n return 'C';\n } else if($marks >= 45){\n return 'C-';\n } else if($marks >= 40){\n return 'D+';\n } else if($marks >= 35){\n return 'D';\n } else if($marks >= 30){\n return 'D-';\n } else{\n return 'E';\n }\n }\n }", "public function displayGrades($classId) {\r\n $this->db->where(['stream_id'=>$classId]);\r\n $grades = $this->db->get('grade_config');\r\n foreach ($grades->result() as $grades){\r\n $scoreRanges[]=$grades;\r\n }\r\n $params['grades'] = $scoreRanges; \r\n $data = 'config/display_grades';\r\n $this->load->view($data,$params);\r\n }", "public function grades()\n {\n $grades = DB::table('grade_level')->get();\n\n return view('grades.id', ['grade_level' => $grades]);\n }", "public function dataprovider_learningobjectivetimegraded() {\n // Array for storing our runs.\n $runs = array();\n\n // Run with one enrolment having a time graded on and LO and one without.\n $enrolments = array();\n $enrolments[] = array(\n 'userid' => 103,\n 'classid' => 100,\n 'grade' => 100,\n 'completestatusid' => STUSTATUS_NOTCOMPLETE,\n 'locked' => 0\n );\n $enrolments[] = array(\n 'userid' => 104,\n 'classid' => 100,\n 'grade' => 100,\n 'completestatusid' => STUSTATUS_NOTCOMPLETE,\n 'locked' => 0\n );\n $logrades = array();\n $logrades[] = array(\n 'userid' => 103,\n 'completionid' => 1,\n 'classid' => 100,\n 'grade' => 100,\n 'locked' => 0,\n 'timegraded' => 1000000000\n );\n $logrades[] = array(\n 'userid' => 103,\n 'completionid' => 2,\n 'classid' => 100,\n 'grade' => 100,\n 'locked' => 0,\n 'timegraded' => 1\n );\n $expectedenrolments = array(\n array(\n 'userid' => 103,\n 'classid' => 100,\n 'grade' => 100,\n 'completestatusid' => STUSTATUS_PASSED,\n 'completetime' => 1000000000,\n 'locked' => 1\n ),\n array(\n 'userid' => 104,\n 'classid' => 100,\n 'grade' => 100,\n 'completestatusid' => STUSTATUS_PASSED,\n 'locked' => 1\n )\n );\n\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n // Return all data.\n return $runs;\n }" ]
[ "0.58966136", "0.58272326", "0.56131667", "0.55722725", "0.55668163", "0.556094", "0.5555101", "0.5512875", "0.5497926", "0.5493892", "0.5478224", "0.5461942", "0.54542917", "0.5452086", "0.5437226", "0.54304546", "0.5428293", "0.5398376", "0.5385681", "0.538399", "0.5375686", "0.537548", "0.5365092", "0.5294813", "0.5285447", "0.52805644", "0.5272786", "0.52601373", "0.52320033", "0.5218501", "0.5181365", "0.5155877", "0.51416445", "0.51141393", "0.5099777", "0.50691676", "0.50605685", "0.50599664", "0.505509", "0.5054439", "0.50413275", "0.5038598", "0.5035829", "0.5025976", "0.5015172", "0.5014778", "0.49950352", "0.49917778", "0.4981541", "0.49735773", "0.4961179", "0.49508333", "0.49481305", "0.49388915", "0.49359336", "0.49348435", "0.49309093", "0.49285445", "0.49229583", "0.49113953", "0.4907988", "0.49013242", "0.4900961", "0.48952284", "0.48942253", "0.4888238", "0.4886948", "0.48825583", "0.48786834", "0.48727193", "0.4863261", "0.48619998", "0.48582384", "0.48489264", "0.48255587", "0.48240405", "0.48231345", "0.4814265", "0.48098266", "0.48032084", "0.48005855", "0.4798481", "0.47848436", "0.4777108", "0.47746965", "0.47727808", "0.47724676", "0.47705173", "0.4770223", "0.47668377", "0.47652477", "0.47645572", "0.47575042", "0.47432524", "0.4739158", "0.47360888", "0.4713253", "0.47124863", "0.47121134", "0.47118068" ]
0.5308148
23
This function builds the header and the content. HEADER The header comes from $this>header If the header is a split header (more than one row), ($this>has_split_header()) Then the header object is an array of rows. Each row is an array of objects. Each object has colCount and content as properties $this>header = array($row0 = array(new stdClass(colCount, content), new stdClass(colCount, content)),$row1 = array(...)) Else the header is an array of TH CONTENTS BODY The body comes from $this>data $this>data is an array or rows $this>data = array(row0, row1, row2.....) Each row is an array or cells. $row0 = array(cell0, cell1, cell 2) If cell is an object Then it will take the colspan, content and class properties and create a td with these Else its a string Its JUST the html content of the TD
function display_report() { $out = '<div>'; $out .= '<table id="resultsTable">'; $out .= '<thead>'; if(isset($this->header)) { if(!$this->has_split_header()) { $out .= '<tr>'; foreach($this->header AS $head) { $out .= '<th>'.$head.'</th>'; } $out .= '</tr>'; } else { //foreach row foreach($this->header AS $row) { $out .= '<tr>'; foreach($row AS $rowObj) { $columnCount = isset($rowObj->colCount) ? $rowObj->colCount : 1; $columnContent = $rowObj->content; $out .= '<th colspan="'.$columnCount.'">'.$columnContent.'</th>'; } $out .= '</tr>'; } } } $out .= '</thead>'; $out .= '<tbody>'; if(isset($this->data)) { foreach($this->data AS $row) { $out .= '<tr>'; foreach($row AS $cell) { if(is_a($cell, 'stdClass')) { $out .= $this->build_cell($cell); } else { $out .= '<td>'.$cell.'</td>'; } } $out .= '</tr>'; } } //count the last row // $out .= '<tr>'; // for($i=0;$i<count($row);$i++) // { // $out .= '<td class="emptyrow"><div class="emptycell">X</div></td>'; // } // $out .= '</tr>'; $out .= '</tbody>'; $out .= '</table>'; $out .= '</div>'; return $out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function buildHeader()\n {\n $month_name = $this->monthLabels[$this->month - 1] . ' ' . $this->year;\n $vclass = strtolower($this->view);\n $h = \"<table class='\" . $this->tableClass . \" \" . $vclass . \"'>\";\n $h .= \"<thead>\";\n $h .= \"<tr class='\" . $this->headClass . \"'>\";\n $cs = 5;\n if ($this->view == 'week' || $this->view == 'day') {\n $h .= \"<th>&nbsp;</th>\";\n }\n if ($this->view == 'day') {\n $cs = 1;\n }\n\n if ($this->nav) {\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->prevClass . \"' href='\" . $this->prevLink() . \"'>\" . $this->prevIco . \"</a>\";\n $h .= \"</th>\";\n $h .= \"<th colspan='$cs'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->nextClass . \"' href='\" . $this->nextLink() . \"'>\" . $this->nextIco . \"</a>\";\n $h .= \"</th>\";\n } else {\n $h .= \"<th colspan='7'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n }\n $h .= \"</tr>\";\n $h .= \"</thead>\";\n\n $h .= \"<tbody>\";\n if ($this->view != 'day' && $this->view != 'week') {\n $h .= \"<tr class='\" . $this->labelsClass . \"'>\";\n\n for ($i = 0; $i <= 6; $i++) {\n $h .= \"<td>\";\n $h .= $this->dayLabels[$i];\n $h .= \"</td>\";\n }\n\n $h .= \"</tr>\";\n }\n if ($this->view == 'day' || $this->view == 'week') {\n $h .= self::getWeekDays();\n }\n\n $this->html .= $h;\n }", "private function render_data()\n\t{\n\t\t// create if the headers exists\n\t\t// 2 header style table\n\t\tif(count($this->headers) == 2 && isset($this->headers[0][0]) && isset($this->headers[1][0]) )\n\t\t{\n\t\t\t// generate the column headers\n\t\t\t$html = '<tr><th></th>';\n\t\t\tforeach($this->headers[0] as $header)\n\t\t\t\t$html .= \"<th>$header</th>\";\n\t\t\t$html .= '</tr>';\n\t\t\t\n\t\t\t// generate the row headers and the data\n\t\t\tfor($i=0; $i<count($this->headers[1]); $i++)\n\t\t\t{\n\t\t\t\t// the header\n\t\t\t\t$html .= \"<tr><th>{$this->headers[1][$i]}</th>\";\n\t\t\t\t\n\t\t\t\t// and now the data\n\t\t\t\tforeach($this->data[$i] as $datum)\n\t\t\t\t\t$html .= \"<td>$datum</td>\";\n\t\t\t\t\n\t\t\t\t$html .= '</tr>';\n\t\t\t}\n\t\t\treturn $html;\n\t\t}//end if\n\t\t\n\t\t// 1 header style table\n\t\tif(count($this->headers) > 0 && isset($this->headers[0]) && !is_array($this->headers[0]) )\n\t\t{\n\t\t\t// generate the column headers\n\t\t\t$html = '<tr>';\n\t\t\tforeach($this->headers as $header)\n\t\t\t\t$html .= \"<th>$header</th>\";\n\t\t\t$html .= '</tr>';\n\t\t\t\n\t\t\t// generate the data\n\t\t\tfor($i=0; $i<count($this->data); $i++)\n\t\t\t{\n\t\t\t\tforeach($this->data[$i] as $datum)\n\t\t\t\t\t$html .= \"<td>$datum</td>\";\n\t\t\t\t\n\t\t\t\t$html .= '</tr>';\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}//end if\n\t\t\n\t\treturn '';\n\t}", "private function buildHeader()\n\t{\n\t\tif ($this->hide_header)\n\t\t\treturn;\n\n\t\techo '<thead><tr>';\n\n\t\t// Get field names of result\n\t\t$headers = $this->_db->fieldNameArray($this->result);\n\t\t$this->column_count = count($headers);\n\n\t\t// Add a blank column if the row number is to be shown\n\t\tif ($this->show_row_number)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header\">&nbsp;</td>';\n\t\t}\n\n\t\t// Show checkboxes\n\t\tif ($this->show_checkboxes)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header tbl-checkall\"><input type=\"checkbox\" name=\"checkall\" onclick=\"tblToggleCheckAll'.$this->_clsnumber.'()\"></td>';\n\t\t}\n\n\t\t// Loop through each header and output it\n\t\tforeach ($headers as $t)\n\t\t{\n\t\t\t// Skip column if hidden\n\t\t\tif (in_array($t, $this->hidden))\n\t\t\t{\n\t\t\t\t$this->column_count--;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check for header caption overrides\n\t\t\tif (array_key_exists($t, $this->header))\n\t\t\t\t$header = $this->header[$t];\n\t\t\telse\n\t\t\t\t$header = $t;\n\n\t\t\tif ($this->hide_order)\n\t\t\t\techo '<td class=\"tbl-header\">' . $header; // Prevent the user from changing order\n\t\t\telse {\n\t\t\t\tif ($this->order and $this->order['Column'] == $t)\n\t\t\t\t\t$order = ($this->order['Order'] == self::ORDER_ASC)\n\t\t\t\t\t? self::ORDER_DESC\n\t\t\t\t\t: self::ORDER_ASC;\n\t\t\t\telse\n\t\t\t\t\t$order = self::ORDER_ASC;\n\n\t\t\t\techo '<td class=\"tbl-header\"><a href=\"javascript:;\" onclick=\"tblSetOrder'.$this->_clsnumber.'(\\'' . $t . '\\', \\'' . $order . '\\')\">' . $header . \"</a>\";\n\n\t\t\t\t// Show the user the order image if set\n\t\t\t\tif ($this->order and $this->order['Column'] == $t)\n\t\t\t\t\techo '&nbsp;<img src=\"images/sort_' . strtolower($this->order['Order']) . '.gif\" class=\"tbl-order\">';\n\t\t\t}\n\n\t\t\t// Add filters if allowed and only if the column type is not \"special\"\n\t\t\tif ($this->allow_filters and !empty($t)){\n\t\t\t\t\t\n\t\t\t\tif (!in_array($this->type[$t][0], array(\n\t\t\t\t\t\tself::TYPE_ARRAY,\n\t\t\t\t\t\tself::TYPE_IMAGE,\n\t\t\t\t\t\tself::TYPE_FUNCTION,\n\t\t\t\t\t\tself::TYPE_DATE,\n\t\t\t\t\t\tself::TYPE_CHECK,\n\t\t\t\t\t\tself::TYPE_CUSTOM,\n\t\t\t\t\t\tself::TYPE_PERCENT\n\t\t\t\t)))\n\t\t\t\t{\n\t\t\t\t\tif ($this->filter['Column'] == $t and !empty($this->filter['Value']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$filter_display = 'block';\n\t\t\t\t\t\t$filter_value = $this->filter['Value'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$filter_display = 'none';\n\t\t\t\t\t\t$filter_value = '';\n\t\t\t\t\t}\n\t\t\t\t\techo '<a href=\"javascript:;\" onclick=\"tblShowHideFilter'. $this->_clsnumber .'(\\'' . $t . '\\')\"> filter </a>\n\t\t\t\t\t<br><div class=\"tbl-filter-box\" id=\"'.$this->_clsnumber.'filter-' . $t . '\" style=\"display:' . $filter_display . '\">\n\t\t\t\t\t<input type=\"text\" size=\"6\" id=\"'.$this->_clsnumber.'filter-value-' . $t . '\" value=\"'.$filter_value.'\">&nbsp;\n\t\t\t\t\t<a href=\"javascript:;\" onclick=\"tblSetFilter'.$this->_clsnumber.'(\\'' . $t . '\\')\">filter</a></div>';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\n\t\t\techo '</td>';\n\t\t}\n\n\t\t// If we have controls, add a blank column\n\t\tif (count($this->controls) > 0)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header\">&nbsp;</td>';\n\t\t}\n\n\t\techo '</tr></thead>';\n\t}", "public function makeTable($header, $data) {\n $this->SetFillColor(255, 0, 0);\n $this->SetTextColor(255);\n $this->SetDrawColor(128, 0, 0);\n $this->SetLineWidth(.3);\n $this->SetFont('', 'B');\n // Header\n $w = array(10, 25, 40, 10, 25, 15, 60, 10, 10, 10, 10, 10, 10, 10, 10, 10);\n for ($i = 0; $i < count($header); $i++)\n if ($i == 0) {\n $this->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);\n } else {\n $this->Cell($w[$i], 7, $header[$i], 1, 0, 'L', true);\n }\n $this->Ln();\n // Color and font restoration\n $this->SetFillColor(224, 235, 255);\n $this->SetTextColor(0);\n $this->SetFont('');\n // Data\n $fill = false;\n\n foreach ($data as $row) {\n $this->nr++;\n $this->Cell($w[0], 6, $this->nr, 'LR', 0, 'C', $fill);\n $this->Cell($w[1], 6, $row['article'], 'LR', 0, 'L', $fill);\n $this->Cell($w[2], 6, $row['brand'], 'LR', 0, 'L', $fill);\n $this->Cell($w[3], 6, $row['inch'], 'LR', 0, 'L', $fill);\n $this->Cell($w[4], 6, $row['size'], 'LR', 0, 'L', $fill);\n $this->Cell($w[5], 6, $row['lisi'], 'LR', 0, 'L', $fill);\n $this->Cell($w[6], 6, $row['design'], 'LR', 0, 'L', $fill);\n $this->Cell($w[7], 6, $row['onhand'], 'LR', 0, 'C', $fill);\n $this->Cell($w[8], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[9], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[10], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[11], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[12], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[13], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[14], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[15], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Ln();\n $fill = !$fill;\n }\n // Closing line\n $this->Cell(array_sum($w), 0, '', 'T');\n }", "private function getHeaders(){\n\t\t$thead=\"\";\n\t\tif(!empty($this->headers)){\n\t\t\t$thead=\"<thead>\";\n\t\t\t$thead.=\"<tr>\";\n\t\t\t$headerNumber=0;\n\t\t\t$fieldNumber=0;\n\t\t\t$count=count($this->headers)-1;\n\t\t\t\n\t\t\t//Busca si hay columnas anteriores a agregar\n\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t$thead.=\"<th>{$col[\"header\"]}</th>\";\n\t\t\t\t\t$headerNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Busca las columnas declaradas\n\t\t\tforeach($this->headers as $name){\n\t\t\t\tif($this->headerSortable){\n\t\t\t\t\tif($this->order!==\"\"&&!empty($this->order)){\n\t\t\t\t\t\t$order=explode('|',$this->order);\n\t\t\t\t\t\tif(is_array($order)&&$fieldNumber==$order[0]){\n\t\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-\".$order[1];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-both\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-both\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$thead.=\"<th {$this->id}-column-header class=\\\"$classSortable\\\" onclick=\\\"javascript:{$this->id}Reorder($fieldNumber);\\\" {$this->id}_field_number=\\\"$fieldNumber\\\">$name</th>\";\n\t\t\t\t}else{\n\t\t\t\t\t$thead.=\"<th {$this->id}-column-header>$name</th>\";\n\t\t\t\t}\n\t\t\t\t$fieldNumber++;\n\t\t\t\t$headerNumber++;\n\t\t\t}\n\t\t\t\n\t\t\t//Busca si hay columnas posteriores a agregar\n\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t$thead.=\"<th>{$col[\"header\"]}</th>\";\n\t\t\t\t\t$headerNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$thead.=\"</tr>\";\n\t\t\t\n\t\t\t//Guardamos el numero total de columnas\n\t\t\t$this->cols=$headerNumber;\n\t\t\t\n\t\t\t\n\t\t\t$tfilter=\"\";\n\t\t\t$type=\"\";\n\t\t\tif($this->headerFilterable){\n\t\t\t\t$cols=count($this->fields)-1;\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<=$cols;$i++){\n\t\t\t\t\t$meClass=velkan::$config[\"datagrid\"][\"filters\"][\"inputClass\"];\n\t\t\t\t\t\n\t\t\t\t\t$type=\"\";\n\t\t\t\t\tif(!empty($this->types)){\n\t\t\t\t\t\t$type=$this->types[$i];\n\t\t\t\t\t}\n\t\t\t\t\t$value=\"\";\n\t\t\t\t\tif(!empty($this->filters)){\n\t\t\t\t\t\tforeach($this->filters as $filter){\n\t\t\t\t\t\t\tif($filter[0]==$i){\n\t\t\t\t\t\t\t\t$value=$filter[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$tfilter.=\"<th class='velkan-grid-column-filter'>\";\n\t\t\t\t\t\n\t\t\t\t\tswitch($type){\n\t\t\t\t\t\tcase \"date\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_DATE));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"datetime\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_DATETIME));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"time\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_TIME));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$tfilter.=\"<input type='search' name='grid{$this->id}Filter[]' $type value=\\\"$value\\\">\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$tfilter.=\"</th>\";\n\t\t\t\t}\n\t\t\t\t$display=($this->ShowFilters?\"\":\"style='display:none'\");\n\t\t\t\t\n\t\t\t\t$filterPrepend=\"\";\n\t\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t\t$filterPrepend.=\"<th>&nbsp;</th>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$filterAppend=\"\";\n\t\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t\t$filterAppend.=\"<th>&nbsp;</th>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tfilter=\"<tr id='grid{$this->id}Filters' $display>{$filterPrepend}{$tfilter}{$filterAppend}</tr>\";\n\t\t\t}\n\t\t\t\n\t\t\tif($type!=\"\"){\n\t\t\t\t$jss=new generalJavaScriptFunction();\n\t\t\t\t$jss->registerFunction(\"applyFormats\");\n\t\t\t}\n\t\t\t\n\t\t\t$thead.=\"$tfilter</thead>\";\n\t\t}\n\t\t\n\t\treturn $thead;\n\t}", "public static function create_table_head()\n\t{\n\t\t\n\t\tif (!static::$columns)\n\t\t{\n\t\t\treturn static::$template['wrapper_start'].'<tr><th>No columns config</th></tr>'.static::$template['wrapper_end'];\n\t\t}\n\n\t\t$table_head = static::$template['wrapper_start'];\n\t\t$table_head .= '<tr>';\n\t\t\n\t\tforeach(static::$columns as $column)\n\t\t{\n\t\t\t$sort_key \t= (is_array($column) ? isset($column[1]) ? $column[1] : strtolower($column[0]) : $column);\n\t\t\t$col_attr\t= (is_array($column) && isset($column[2]) ? $column[2] : array());\n\t\t\t\n\t\t\t$new_direction = static::$direction;\n\t\t\t\n\t\t\tif(static::$sort_by == $sort_key)\n\t\t\t{\n\t\t\t\t$active_class_name = static::$template['col_class_active'].' '.static::$template['col_class_active'].'_'.$new_direction;\n\t\t\t\tif(isset($col_attr['class']))\n\t\t\t\t{\n\t\t\t\t\t$col_attr['class'] .= ' '.$active_class_name;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$col_attr['class'] = $active_class_name;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$new_direction = (static::$direction == 'asc' ? 'desc' : 'asc');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(is_array($column) && (!isset($column[1]) || isset($column[1]) && $column[1] !== false)){\n\t\t\t\t\n\t\t\t\t$url \t\t\t= rtrim(static::$base_url, '/').(static::$current_page ? '/'.static::$current_page : '');\n\t\t\t\t$url \t\t\t.= '/'.$sort_key.static::$uri_delimiter.$new_direction;\n\t\t\t\t\n\t\t\t\t$cell_content \t= rtrim(static::$template['link_start'], '> ').' href=\"'.$url.'\">';\n\t\t\t\t$cell_content \t.= $column[0];\n\t\t\t\t$cell_content \t.= static::$template['link_end'];\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tif(is_array($column))\n\t\t\t\t{\n\t\t\t\t\t$column = $column[0];\n\t\t\t\t}\n\t\t\t\t$cell_content = static::$template['nolink_start'].$column.static::$template['nolink_end'];\t\n\t\t\t}\n\t\t\t\n\t\t\t$table_head .= html_tag(static::$template['col_tag'], $col_attr, $cell_content);\n\t\t\t\n\t\t}\n\t\t\n\t\t$table_head .= '</tr>';\n\t\t$table_head .= static::$template['wrapper_end'];\n\n\t\treturn $table_head;\n\t}", "protected function getTableHeader() {\n $newDirection = ($this->sortDirection == 'asc') ? 'desc' : 'asc';\n\n $tableHeaderData = array(\n 'title' => array(\n 'link' => $this->getLink('title', ($this->sortField == 'title') ? $newDirection : $this->sortDirection),\n 'name' => 'Title',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n 'document_type' => array(\n 'link' => $this->getLink('type', $this->sortField == 'document_type' ? $newDirection : $this->sortDirection),\n 'name' => 'Type',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n 'date' => array(\n 'link' => $this->getLink('date', $this->sortField == 'date' ? $newDirection : $this->sortDirection),\n 'name' => 'Date',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n );\n\t\t\n // insert institution field in 3rd column, if this is search results\n if($this->uri == 'search') {\n $tableHeaderData = array_slice($tableHeaderData, 0, 2, true) +\n array('institution' => array(\n 'link' => $this->getLink('institution', $this->sortField == 'institution' ? $newDirection : $this->sortDirection),\n 'name' => 'Institution',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n )) +\n array_slice($tableHeaderData, 2, count($tableHeaderData)-2, true);\n }\n\t\t\n return $tableHeaderData;\n }", "public function buildHeader() {\n return [\n ['data' => t('Teaching format'), 'class' => ['align-middle']],\n ['data' => t('Event'), 'class' => ['align-middle']],\n ['data' => t('Tutor'), 'class' => ['align-middle']],\n ['data' => t('Location'), 'class' => ['align-middle']],\n ['data' => t('Room'), 'class' => ['align-middle']],\n [\n 'data' => t('Date/time'),\n 'field' => 'time.field_event_time_value',\n 'sort' => 'desc',\n 'class' => ['align-middle'],\n ],\n ['data' => t('Registration status'), 'class' => ['align-middle']],\n ];\n }", "public function generateHtmlTableData($header,$result,$class=null,$sumColumn=null)\n\t{\n\t\t$addClass=$columns=null;\n\t\tif($class)$addClass='class=\"'.$class.'\"';\n\t\t$tableContent= \"<table $addClass >\";\n\t\t$tableContent=$tableContent.\"<tr>\";\n\t\t\t\tforeach($header as $title)\n\t\t\t\t $tableContent=$tableContent. \"<th> $title </th>\";\n\t\t$tableContent=$tableContent.\"</tr>\";\n\t\tif($result){ $i=0;\n\t\t\t foreach($result as $row) {\n\t\t\t\t\tif($i==0){$columns=array_keys($this->objectToArray($row));$i++;}\n\t\t\t\t $tableContent=$tableContent.\"<tr>\";\n\t\t\t foreach ( $row as $key=>$data) {\n\t\t\t\t\t if(is_float($data)) $data=$this->numFormat($data);\n\t\t\t\t\t\tif(is_numeric($data)) { $numView=explode('.',$data);\n\t\t\t\t\t\t\tif(isset($numView[1])) $data=$this->numFormat($data); }\n\t\t\t\t\t\t$tableContent=$tableContent.\"<td>$data</td>\"; }\n\t\t\t\t$tableContent=$tableContent.\"</tr>\"; }}\n\t\tif($sumColumn)\n\t\t{\n\t\t\tif($columns){\n\t\t\t$tableContent=$tableContent.\"<tr>\";\n\n\t\t\tforeach($columns as $dataColumn){\n\t\t\t\t$total=$tddata=null;\n\t\t\t\tforeach( $sumColumn as $column)\n\t\t\t\t\tif($column==$dataColumn){\n\t\t\t\t\t\t$total=(float)0;\n\t\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t\t$value=(float)$row->$column;\n\t\t\t\t\t\t\t$total=$total+$value;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t if($total)\n\t\t\t\t$tddata=\"<b>\".$this->numFormat($total).\"</b>\";\n\t\t\t $tableContent=$tableContent.\"<td style='color:#FF0000;'>\".$tddata.\"</td>\";\n\t\t\t}\n\t\t\t$tableContent=$tableContent.\"</tr>\"; }\n\t\t}\n\t\t//print_r($columns);\n\t\t$tableContent=$tableContent.\"</table>\";\n\n\t\treturn $tableContent;\n\t}", "function Header()\n\t{\n\t\t$this->SetFont('Arial','',12);\n\t\t$this->MultiCell(190,5,nombre_empresa(),'0','C');\n\t\t$this->SetFont('Arial','',10);\n\t\t$this->MultiCell(190,5,tipo_serv(),'0','C');\n\t\t$this->SetFont('Arial','B',10);\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->MultiCell(190,7,strtoupper(_('listado de clientes para cortes')),'0','C');\n\t\t$this->SetFont('Arial','B',8);\n\t\t$this->SetX(133);\n\t\t$this->Cell(12,5,strtoupper(_('fecha')).': ',0,0,'L');\n\t\t$this->SetFont('Arial','',8);\n\t\t$this->Cell(18,5,date(\"d/m/Y\"),0,0,'L');\n\t\t$this->SetFont('Arial','B',8);\n\t\t$this->Cell(12,5,strtoupper(_('hora')).': ',0,0,'L');\n\t\t$this->SetFont('Arial','',8);\n\t\t$this->Cell(18,5,date(\"h:i:s A\"),0,0,'L');\n\t\t$this->Ln();\t\t\n\t}", "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 }", "private function generate_columns_header($p_edit,&$p_resultat,&$p_result_header)\r\n\t\t{\r\n\t\t\t// Create a new line\r\n\t\t\t$html = '<tr id=\"tr_header_title_'.$this->c_id.'\">';\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Create the first column (checkbox and edit button)\r\n\t\t\t ====================================================================*/\t\r\n\t\t\t$html .= '<td align=\"left\" id=\"header_th_0__'.$this->c_id.'\" class=\"__'.$this->c_theme.'__cell_opt_h\"><div id=\"th0_'.$this->c_id.'\"></div></td>';\r\n\t\t\t$html .= '<td></td>';\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t// Quantify of order clause\r\n\t\t\t$qtt_order = $this->get_nbr_order();\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Display the resize cursor or not\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tif($this->c_mode != __CMOD__)\r\n\t\t\t{\r\n\t\t\t\t$cursor = ' cur_resize';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$cursor = '';\r\n\t\t\t}\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Browse all columns\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tforeach($this->c_columns as $key_col => $val_col)\r\n\t\t\t{\r\n\t\t\t\tif($val_col['display'])\r\n\t\t\t\t{\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Define order icon\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($this->c_columns[$key_col]['order_by'] != false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// An order clause is defined\r\n\t\t\t\t\t\tif($this->c_columns[$key_col]['order_by'] == __ASC__)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// ASC icon\r\n\t\t\t\t\t\t\t$class_order = ' __'.$this->c_theme.'_ico_sort-ascend __'.$this->c_theme.'_ico';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// DESC icon\r\n\t\t\t\t\t\t\t$class_order = ' __'.$this->c_theme.'_ico_sort-descend __'.$this->c_theme.'_ico';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Display the number of order only if there is more than one order clause\r\n\t\t\t\t\t\t($qtt_order > 1) ? $order_prio = $this->c_columns[$key_col]['order_priority'] : $order_prio = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// No order clause defined\r\n\t\t\t\t\t\t$class_order = '';\r\n\t\t\t\t\t\t$order_prio = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Order column\r\n\t\t\t\t\t$html .= '<td class=\"__'.$this->c_theme.'_bloc_empty'.$class_order.'\"><span class=\"__vimofy_txt_mini_ vimofy_txt_top\">'.$order_prio.'</span></td>';\r\n\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Define order icon\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($this->c_mode != __CMOD__)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$onmousedown = 'onmousedown=\"vimofy_resize_column_start('.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t\t$ondblclick = 'ondblclick=\"vimofy_mini_size_column('.$key_col.',\\''.$this->c_id.'\\');\" ';\r\n\t\t\t\t\t\t$lib_redim = $this->hover_out_lib(17,17);\r\n\t\t\t\t\t\t$event = $this->hover_out_lib(40,40).' onmousedown=\"vimofy_move_column_start(event,'.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$onmousedown = '';\r\n\t\t\t\t\t\t$ondblclick = '';\r\n\t\t\t\t\t\t$lib_redim = '';\r\n\t\t\t\t\t\t$event = $this->hover_out_lib(40,40).' onmousedown=\"click_column_order(\\''.$this->c_id.'\\','.$key_col.');\"';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*===================================================================*/\r\n\r\n\t\t\t\t\t// Column title\r\n\t\t\t\t\t$html .= '<td align=\"left\" class=\"__'.$this->c_theme.'__cell_h nowrap\" id=\"header_th_'.$key_col.'__'.$this->c_id.'\"><div '.$event.' class=\"align_'.$this->c_columns[$key_col]['alignment'].' __'.$this->c_theme.'_column_title\" id=\"th'.$key_col.'_'.$this->c_id.'\"><span id=\"span_'.$key_col.'_'.$this->c_id.'\">'.$this->c_columns[$key_col]['name'].'</span></div></td>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Display other column\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($p_edit != false) $html .= '<td style=\"padding:0;margin:0;\"></td>';\r\n\r\n\t\t\t\t\t$html .= '<td '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t$html .= '<td '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__sep_h'.$cursor.'\"></td>';\r\n\t\t\t\t\t$html .= '<td id=\"right_mark_'.$key_col.'_'.$this->c_id.'\" '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$html .= '</tr>';\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Input for search on the column\r\n\t\t\t ====================================================================*/\t\r\n\t\t\t// Create a new line\r\n\t\t\t$html .= '<tr id=\"tr_header_input_'.$this->c_id.'\">';\r\n\t\t\t\r\n\t\t\t// Create the first column (checkbox and edit button)\r\n\t\t\t$html .= '<td align=\"left\" class=\"__'.$this->c_theme.'__cell_opt_h\"><div id=\"thf0_'.$this->c_id.'\" class=\"__'.$this->c_theme.'__vimofy_version\" onclick=\"window.open(\\'vimofy_bugs\\');\">v'.$this->c_software_version.'</div></td>';\r\n\t\t\t\r\n\t\t\t// Id column display counter\r\n\t\t\t$id_col_display = 0;\r\n\t\t\t\r\n\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Browse all columns\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tforeach($this->c_columns as $key_col => $val_col)\r\n\t\t\t{\r\n\t\t\t\tif($val_col['display'])\r\n\t\t\t\t{\r\n\t\t\t\t\tif($id_col_display == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= '<td id=\"th_0_c'.$key_col.'_'.$this->c_id.'\"></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= '<td id=\"th_0_c'.($key_col).'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*if(isset($this->c_columns[$key_col]))\r\n\t\t\t\t\t{*/\r\n\t\t\t\t\t\t$onmousedown = 'onmousedown=\"vimofy_resize_column_start('.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t\t$ondblclick = 'ondblclick=\"vimofy_mini_size_column('.$key_col.',\\''.$this->c_id.'\\');\" ';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t\t * Define the filter value\r\n\t\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\t\t$filter_input_value = '';\r\n\t\t\t\t\t\t$state_filter_input = '';\r\n\t\t\t\t\t\tif(isset($val_col['filter']['input']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// A filter was defined by the user\r\n\t\t\t\t\t\t\t$filter_input_value = $val_col['filter']['input']['filter'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// No filter was defined by the user\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Check if vimofy was in edit mode\r\n\t\t\t\t\t\t\tif($p_edit != false && !isset($val_col['rw_flag']) || ($p_edit != false && isset($val_col['rw_flag']) && $val_col['rw_flag'] != __FORBIDEN__))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// The vimofy was in edit mode, search all same value in the column\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Place the cursor on the first row of the recordset\r\n\t\t\t\t\t\t\t\tif($this->c_obj_bdd->rds_num_rows($p_result_header) > 0)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$this->c_obj_bdd->rds_data_seek($p_result_header,0);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// TODO Use a DISTINCT QUERY - Vimofy 1.0\r\n\t\t\t\t\t\t\t\t$key_cold_line = 0;\r\n\t\t\t\t\t\t\t\t$last_value = '';\r\n\t\t\t\t\t\t\t\t$flag_same = false;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\twhile($row = $this->c_obj_bdd->rds_fetch_array($p_result_header))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif($key_cold_line > 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($last_value == $row[$val_col['sql_as']])\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$flag_same = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$flag_same = false;\r\n\t\t\t\t\t\t\t\t\t\t\t// The value is not the same of the previous, stop browsing data \r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$flag_same = true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t$last_value = $row[$val_col['sql_as']];\r\n\t\t\t\t\t\t\t\t\t$key_cold_line = $key_cold_line + 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif($flag_same)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$filter_input_value = $last_value;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$filter_input_value = '';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif($p_edit != false && isset($val_col['rw_flag']) && $val_col['rw_flag'] == __FORBIDEN__)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$state_filter_input = 'disabled';\t\t\t\t\t\t\t\t\t// Disable the input because the edition of column is forbiden\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(isset($val_col['filter']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_on __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isset($val_col['lov']) && isset($val_col['is_lovable']) && $val_col['is_lovable'] == true)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_lovable __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(isset($val_col['lov']))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_no_icon __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t\t * Menu button oncontextmenu\r\n\t\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\t\tif($this->c_type_internal_vimofy == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Principal vimofy, diplay internal vimofy\r\n\t\t\t\t\t\t\t$oncontextmenu = 'vimofy_display_internal_vim(\\''.$this->c_id.'\\',__POSSIBLE_VALUES__,'.$key_col.');return false;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Internal vimofy, doesn't display other internal vimofy\r\n\t\t\t\t\t\t\t$oncontextmenu = 'return false;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= '<td id=\"th_1_c'.$key_col.'_'.$this->c_id.'\" class=\"__vimofy_unselectable\" style=\"width:20px;\"><div style=\"width:20px;margin:0;\" '.$this->hover_out_lib(21,21).' oncontextmenu=\"'.$oncontextmenu.'\" class=\"'.$class_btn_menu.'\" onclick=\"vimofy_toggle_header_menu(\\''.$this->c_id.'\\','.$key_col.');\" id=\"th_menu_'.$key_col.'__'.$this->c_id.'\"></div></td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_2_c'.$key_col.'_'.$this->c_id.'\" align=\"left\" class=\"__'.$this->c_theme.'__cell_h\">';\r\n\t\t\t\t\t\t$html .= '<div style=\"margin:0 3px;\"><input value=\"'.str_replace('\"','&quot;',$filter_input_value).'\" class=\"__'.$this->c_theme.'__input_h full_width\" '.$state_filter_input.' id=\"th_input_'.$key_col.'__'.$this->c_id.'\" type=\"text\" style=\"margin: 2px 0;\" size=1 onkeyup=\"if(document.getElementById(\\'chk_edit_c'.$key_col.'_'.$this->c_id.'\\'))document.getElementById(\\'chk_edit_c'.$key_col.'_'.$this->c_id.'\\').checked=true;vimofy_input_keydown(event,this,\\''.$this->c_id.'\\','.$key_col.');\" onchange=\"vimofy_col_input_change(\\''.$this->c_id.'\\','.$key_col.');\"/></div>';\r\n\t\t\t\t\t\tif($p_edit != false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif($state_filter_input == '')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '<td style=\"width:10px;padding:0;margin:0;\"><input '.$this->hover_out_lib(76,76).' type=\"checkbox\" id=\"chk_edit_c'.$key_col.'_'.$this->c_id.'\" style=\"height:11px;width:11px;margin: 0 5px 0 2px;display:block;\"/></td>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '<td style=\"width:0;padding:0;margin:0;\"></td>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= '</td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_3_c'.$key_col.'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_4_c'.$key_col.'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__sep_h'.$cursor.'\"></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$id_col_display = $id_col_display + 1;\r\n\t\t\t\t//}\r\n\t\t\t}\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t$html .= '<td id=\"th_0_c'.($key_col+1).'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t$html.= '<td><div style=\"width:200px\"></div></td>';\r\n\t\t\t$html .= '</tr>';\r\n\t\t\t/*===================================================================*/\r\n\r\n\t\t\t// Place the cursor on the first row of the recordset\r\n\t\t\tif($this->c_obj_bdd->rds_num_rows($p_resultat) > 0)\r\n\t\t\t{\r\n\t\t\t\t$this->c_obj_bdd->rds_data_seek($p_resultat,0);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\treturn $html;\r\n\t\t}", "static function generateTableHeaderHTML()\n\t{\n\t\techo \"<tr class='exTableRow'>\\n\";\n\t\techo \"<th class='exTableColLineNum'>Item #</th>\\n\";\n\t\techo \"<th class='exTableColDesc'>Description of Work</th>\\n\";\n\t\techo \"<th class='exTableColAmount'>Amount</th>\\n\";\n\t\techo \"</tr>\\n\";\n\t}", "function FancyTable($header, $data)\n{\n $this->SetFillColor(255,0,0);\n $this->SetTextColor(255);\n $this->SetDrawColor(128,0,0);\n $this->SetLineWidth(.3);\n $this->SetFont('','B');\n // Header\n $w = array(40, 35, 40, 45);\n for($i=0;$i<count($header);$i++)\n $this->Cell($w[$i],7,$header[$i],1,0,'C',true);\n $this->Ln();\n // Color and font restoration\n $this->SetFillColor(224,235,255);\n $this->SetTextColor(0);\n $this->SetFont('');\n // Data\n $fill = false;\n foreach($data as $row)\n {\n $this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);\n $this->Cell($w[1],6,$row[1],'LR',0,'L',$fill);\n $this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);\n $this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);\n $this->Ln();\n $fill = !$fill;\n }\n // Closing line\n $this->Cell(array_sum($w),0,'','T');\n}", "function Table_Headers($header,$w)\r\n{\r\n //Colors, line width and bold font\r\n $this->SetFillColor(153,153,153);\r\n $this->SetTextColor(0);\r\n $this->SetDrawColor(128,0,0);\r\n $this->SetLineWidth(.3);\r\n $this->SetFont('Arial','B','7');\r\n\t\r\n //Header\r\n\t\r\n\t//Output table header\r\n for($i=0;$i<count($header);$i++)\r\n $this->Cell($w[$i],5,$header[$i],1,0,'C',1);\r\n $this->Ln();\r\n}", "function getTable($array, $firstLineHeader = true, $lastLineFooter = true, $withTableStructure = true)\n{\n\t$ret = '';\n\n\t$rows = count($array);\n\t$cols = isset($array[0]) ? count($array[0]) : 0;\n\t$i = 0;\n\n\tif($firstLineHeader)\n\t{\n\t\t$ret .= '<tr class=\"tableHeaderRow\">';\n\t\tfor($j = 0; $j < $cols; $j++)\n\t\t{\n\t\t\tif($j == ($cols - 1))\n\t\t\t\t$ret .= '<td class=\"tableHeaderCellR\">';\n\t\t\telse if($j == 0)\n\t\t\t\t$ret .= '<td class=\"tableHeaderCellL\">';\n\t\t\telse\n\t\t\t\t$ret .= '<td class=\"tableHeaderCell\">';\n\n\t\t\t$ret .= $array[$i][$j] . '</td>' . \"\\n\";\n\t\t}\n\t\t$ret .= '</tr>' . \"\\n\";\n\n\t\t$i++;\n\t}\n\n\tfor(; $i < $rows; $i++)\n\t{\n\t\t$ret .= '<tr class=\"tableRow\">';\n\t\tfor($j = 0; $j < $cols; $j++)\n\t\t{\n\t\t\tif($j == ($cols - 1))\n\t\t\t{\n\t\t\t\tif($i == ($rows - 1) && $lastLineFooter)\n\t\t\t\t\t$ret .= '<td class=\"tableCellBR\">';\n\t\t\t\telse if($i == 0)\n\t\t\t\t\t$ret .= '<td class=\"tableCellTR\">';\n\t\t\t\telse\n\t\t\t\t\t$ret .= '<td class=\"tableCellR\">';\n\t\t\t}\n\t\t\telse if($j == 0)\n\t\t\t{\n\t\t\t\tif($i == ($rows - 1) && $lastLineFooter)\n\t\t\t\t\t$ret .= '<td class=\"tableCellBL\">';\n\t\t\t\telse if($i == 0)\n\t\t\t\t\t$ret .= '<td class=\"tableCellTL\">';\n\t\t\t\telse\n\t\t\t\t\t$ret .= '<td class=\"tableCellL\">';\n\t\t\t}\n\t\t\telse if($i == ($rows - 1) && $lastLineFooter)\n\t\t\t\t$ret .= '<td class=\"tableCellB\">';\n\t\t\telse if($i == 0)\n\t\t\t\t$ret .= '<td class=\"tableCellT\">';\n\t\t\telse\n\t\t\t\t$ret .= '<td class=\"tableCell\">';\n\n\t\t\t$ret .= $array[$i][$j] . '</td>' . \"\\n\";\n\t\t}\n\t\t$ret .= '</tr>' . \"\\n\";\n\t}\n\n\tif($withTableStructure)\n\t\t$ret = '<p/><table class=\"tableMain\">' . $ret . '</table>';\n\n\treturn $ret;\n}", "function prepareDefaultHeader()\n {\n $this->formatBuffer .= \"p.normalText, li.normalText, div.normalText{\\n\";\n $this->formatBuffer .= \" mso-style-parent: \\\"\\\";\\n\";\n $this->formatBuffer .= \" margin: 0cm;\\n\";\n $this->formatBuffer .= \" margin-bottom: 6pt;\\n\";\n $this->formatBuffer .= \" mso-pagination: widow-orphan;\\n\";\n $this->formatBuffer .= \" font-size: {$this->fontSize}pt;\\n\";\n $this->formatBuffer .= \" font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \" mso-fareast-font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \"}\\n\\n\";\n \n $this->formatBuffer .= \"table.normalTable{\\n\";\n $this->formatBuffer .= \" mso-style-name: \\\"Tabela com grade\\\";\\n\";\n $this->formatBuffer .= \" mso-tstyle-rowband-size: 0;\\n\";\n $this->formatBuffer .= \" mso-tstyle-colband-size: 0;\\n\";\n $this->formatBuffer .= \" border-collapse: collapse;\\n\";\n $this->formatBuffer .= \" mso-border-alt: solid windowtext {$this->tableBorderAlt}pt;\\n\";\n $this->formatBuffer .= \" mso-yfti-tbllook: 480;\\n\";\n $this->formatBuffer .= \" mso-padding-alt: 0cm {$this->tablePaddingAltRight}pt 0cm {$this->tablePaddingAltLeft}pt;\\n\";\n $this->formatBuffer .= \" mso-border-insideh: {$this->tableBorderInsideH}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-border-insidev: {$this->tableBorderInsideV}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-para-margin: 0cm;\\n\";\n $this->formatBuffer .= \" mso-para-margin-bottom: .0001pt;\\n\";\n $this->formatBuffer .= \" mso-pagination: widow-orphan;\\n\";\n $this->formatBuffer .= \" font-size: {$this->fontSize}pt;\\n\";\n $this->formatBuffer .= \" font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \"}\\n\";\n $this->formatBuffer .= \"table.normalTable td{\\n\";\n $this->formatBuffer .= \" border: solid windowtext 1.0pt;\\n\";\n $this->formatBuffer .= \" border-left: none;\\n\";\n $this->formatBuffer .= \" mso-border-left-alt: solid windowtext .5pt;\\n\";\n $this->formatBuffer .= \" mso-border-alt: solid windowtext .5pt;\\n\";\n $this->formatBuffer .= \" padding: 0cm 5.4pt 0cm 5.4pt;\\n\";\n $this->formatBuffer .= \"}\\n\\n\";\n \n $this->formatBuffer .= \"table.tableWithoutGrid{\\n\";\n $this->formatBuffer .= \" mso-style-name: \\\"Tabela sem grade\\\";\\n\";\n $this->formatBuffer .= \" mso-tstyle-rowband-size: 0;\\n\";\n $this->formatBuffer .= \" mso-tstyle-colband-size: 0;\\n\";\n $this->formatBuffer .= \" border-collapse: collapse;\\n\";\n $this->formatBuffer .= \" border: none;\\n\";\n $this->formatBuffer .= \" mso-border-alt: none;\\n\";\n $this->formatBuffer .= \" mso-yfti-tbllook: 480;\\n\";\n $this->formatBuffer .= \" mso-padding-alt: 0cm {$this->tablePaddingAltRight}pt 0cm {$this->tablePaddingAltLeft}pt;\\n\";\n $this->formatBuffer .= \" mso-border-insideh: {$this->tableBorderInsideH}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-border-insidev: {$this->tableBorderInsideV}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-para-margin: 0cm;\\n\";\n $this->formatBuffer .= \" mso-para-margin-bottom: .0001pt;\\n\";\n $this->formatBuffer .= \" mso-pagination: widow-orphan;\\n\";\n $this->formatBuffer .= \" font-size: {$this->fontSize}pt;\\n\";\n $this->formatBuffer .= \" font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \"}\\n\\n\";\n \n if ($this->cssFile != '') {\n if (file_exists($this->cssFile))\n $this->formatBuffer .= file_get_contents($this->cssFile);\n }\n }", "function Header() {\r\n\r\n $this->setPrintFooter(false);\r\n //$this->setFooterData(array(0,64,0), array(0,64,128));\r\n //$this->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);\r\n //$this->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM);\r\n\r\n $this->SetXY(5,5);\r\n\r\n\r\n if ($this->objParam->getParametro('desde') == '' && $this->objParam->getParametro('hasta') != '') {\r\n $cabecera_datos = ' <td style=\"width: 200px; text-align: center; vertical-align: middle; height: 42px;\"><strong>Departamento:</strong> Contabilidad <br /><strong>Desde: </strong>01/01/'.$this->objParam->getParametro('gestion').' <strong>Hasta:</strong> '.$this->objParam->getParametro('hasta').'<br /><strong>Gesti&oacute;n:</strong>'.$this->objParam->getParametro('gestion').'</td>\r\n ';\r\n } elseif ($this->objParam->getParametro('hasta') == '' && $this->objParam->getParametro('desde') != '') {\r\n $cabecera_datos = '\r\n <td style=\"width: 200px; text-align: center; vertical-align: middle; height: 42px;\"><strong>Departamento:</strong> Contabilidad <br /><strong>Desde: </strong>'.$this->objParam->getParametro('desde').' <strong>Hasta:</strong> 31/12/'.$this->objParam->getParametro('gestion').'<br /><strong>Gesti&oacute;n:</strong> '.$this->objParam->getParametro('gestion').'</td>\r\n\r\n ';\r\n } elseif ($this->objParam->getParametro('hasta') != '' && $this->objParam->getParametro('desde') != '') {\r\n $cabecera_datos = '\r\n <td style=\"width: 200px; text-align: center; vertical-align: middle; height: 42px;\"><strong>Departamento:</strong> Contabilidad <br /><strong>Desde: </strong>'.$this->objParam->getParametro('desde').' <strong>Hasta:</strong> '.$this->objParam->getParametro('hasta').'<br /><strong>Gesti&oacute;n:</strong> '.$this->objParam->getParametro('gestion').'</td>\r\n ';\r\n } elseif ($this->objParam->getParametro('hasta') == '' && $this->objParam->getParametro('desde') == '') {\r\n $cabecera_datos = '\r\n <td style=\"width: 200px; text-align: center; vertical-align: middle; height: 42px;\"><strong>Departamento:</strong> Contabilidad <br /><strong>Desde: </strong> 01/01/'.$this->objParam->getParametro('gestion').' <strong>Hasta:</strong> 31/12/'.$this->objParam->getParametro('gestion').'<br /><strong>Gesti&oacute;n:</strong> '.$this->objParam->getParametro('gestion').'</td>\r\n ';\r\n }\r\n\r\n\r\n $cabecera = '<font size=\"8\">\r\n <table style=\"height: 20px;\" border = \"1\" cellspacing=\"0\" cellpadding=\"2\" >\r\n <tbody>\r\n <tr style=\"height: 40px;\">\r\n <td style=\"width: 100px; height: 42px;\">&nbsp;<img style=\"width: 80px;\" align=\"middle\" src=\"../../../lib/imagenes/Logo_libro_mayor.jpg\" alt=\"Logo\"></td>\r\n <td style=\"width: 655px; text-align: center; vertical-align: middle; height: 42px;\"><h1>REPORTE <br>LIBRO MAYOR</h1></td>\r\n '.$cabecera_datos.'\r\n </tr>\r\n </tbody>\r\n </table>\r\n </font>\r\n ';\r\n\r\n $this->writeHTML($cabecera, true, 0, true, 0);\r\n\r\n //$this->SetAutoPageBreak(true, 2);\r\n\r\n }", "function outputFormat(array $headers, array $cells, $result, $content_name) {\necho '<h3>'.ucfirst($content_name).' Content</h3>';\necho '<table>';\nforeach ($headers as $val) {\necho '<th>'.$val.'</th>';\n}\nwhile($row = mysqli_fetch_array($result))\n {\n echo '<tr>';\n foreach ($cells as $val) {\n echo '<td>'.$row[$val].'</td>';\n }\n echo '</tr>';\n }\n echo '</table>';\n}", "private function getBody(){\n\t\t$tbody=\"\";\n\t\t$tfilter=\"\";\n\t\t\n\t\tif($this->renderEmptyBody){\n\t\t\treturn \"<tbody></tbody>\";\n\t\t}\n\t\t\n\t\t//Si tiene un llamado a la base de datos, obtenemos los datos\n\t\tif($this->hasCallToDataBase){\n\t\t\t$this->getData();\n\t\t}\n\t\t\n\t\tif(!empty($this->data)){\n\t\t\tforeach($this->data as $dataRow){\n\t\t\t\t$tbody.=\"<tr>\";\n\t\t\t\t$counter=0;\n\t\t\t\t\n\t\t\t\t/*Buscamos si el grid tiene alguna columna adicional al principio*/\n\t\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t\t$counter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach($dataRow as $key=>$data){\n\t\t\t\t\tif(!empty($this->bindedTypes)){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$type=$this->bindedTypes[$key];\n\t\t\t\t\t\t$parameter=$this->bindedTypesParams[$key];\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch ($type){\n\t\t\t\t\t\t\tcase 'progressbar':\n\t\t\t\t\t\t\t\t$bar=new progressbar(array(\"id\"=>$key));\n\t\t\t\t\t\t\t\t$pje=$data*100;\n\t\t\t\t\t\t\t\t$bar->setBars(array($pje));\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$tbody.=\"<td>\".$bar->render(true).\"</td>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"link\":\n\t\t\t\t\t\t\t\t$link=new link();\n\t\t\t\t\t\t\t\t$link->replaceFields($dataRow, $parameter);\n\t\t\t\t\t\t\t\t$link->setDisplay($data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$tbody.=\"<td>\".$link->render(true).\"</td>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$tbody.=\"<td>$data</td>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$tbody.=\"<td>$data</td>\";\n\t\t\t\t\t}\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/*Buscamos si el grid tiene alguna columna adicional al final*/\n\t\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t\t$counter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tbody.=\"</tr>\";\n\t\t\t}\n\t\t\t\n\t\t\tif($tfilter!=\"\"){\n\t\t\t\t$tbody=$tfilter.$tbody;\n\t\t\t}\n\t\t\t\n\t\t\t$tbody=\"<tbody>$tbody</tbody>\";\n\t\t}else{\n\t\t\t$tbody=\"<tbody><tr><td colspan=\\\"{$this->cols}\\\"><div class=\\\"alert alert-error\\\">\".velkan::$lang[\"grid_msg\"][\"noDataFound\"].\"</div></td></tr></tbody>\";\n\t\t}\n\t\t\n\t\treturn $tbody;\n\t}", "function constructTableHead() {\n\n $header = '<tr><th>Country</th>';\n if (isset($_GET['pop'])) {\n $header .= '<th>Total Population</th>';\n }\n if (isset($_GET['birth'])) {\n $header .= '<th>Birth Rate</th>';\n }\n if (isset($_GET['death'])) {\n $header .= '<th>Death Rate</th>';\n }\n\n $header .= '</tr>';\n return $header;\n }", "public function buildHeaderFields() {}", "function draw_header(){\r\n\t\t$out_multiple_search='';\r\n\r\n\t\t$arr_width=explode(',',$this->width);\r\n\t\t$out='<thead><tr id=\"'.$this->id.'_sort\">';\r\n\r\n\t\t$arr_sort=explode('_',$this->sort);\r\n\t\t$arr_header=explode(',',$this->header);\r\n\r\n\t\t$column=1;\r\n\t\tfor($i=0; $i<count($arr_header);$i++){\r\n\r\n\t\t\tif($this->sort_init!==false and $this->sort_init[$i]!='f'){\r\n\t\t\t\t\t$out.='<th'.(($this->width!='' and $arr_width[$i]>0) ? ' width=\"'.$arr_width[$i].'\"' : '').' onclick=\"'.$this->change_tags($this->get_url($i+1)).'\"><span'.($arr_sort[$i]=='f' ? ' class=\"no_sort' : ' class=\"sort').(substr($arr_sort[$i],-1)=='a' ? '_asc' : (substr($arr_sort[$i],-1)=='d' ? '_desc' : '')).'\"></span>'.$arr_header[$i].'</th>';\r\n\t\t\t}else{\r\n\t\t\t\t$out.='<th'.(($this->width!='' and $arr_width[$i]>0) ? ' width=\"'.$arr_width[$i].'\"' : '').'><span></span>'.$arr_header[$i].'</th>';\r\n\t\t\t}\r\n\r\n\t\t\tif($this->multiple_search_init===true or $this->multiple_search_init=='hide' or (strpos($this->multiple_search_init,'hide')!==false and $this->multiple_search_init[$i]=='t') or $this->multiple_search_init[$i]=='t')\r\n\t\t\t\t$out_multiple_search.='<th><input type=\"text\" id=\"'.$this->id.'_multiple_search'.($i+1).'\" name=\"'.$this->id.'_multiple_search[]'.'\" value=\"'.$this->multiple_search[$i].'\" onkeyup=\"ctMultiSearch(\\''.$this->id.'\\');\" /></a></th>';\r\n\t\t\telse\r\n\t\t\t\t$out_multiple_search.='<th></th>';\r\n\t\t}\r\n\r\n\r\n\t\t$out.='</tr>';\r\n\r\n\t\tif($this->multiple_search_init===true or strpos($this->multiple_search_init,'hide')!==false or strpos($this->multiple_search_init,'t')!==false)\r\n\t\t\t$out.='<tr id=\"'.$this->id.'_multiple_search\"'.(($this->multiple_search_init!==true and strpos($this->multiple_search_init,'hide')!==false) ? ' style=\"display: none;\"' : '').'>'.$out_multiple_search.'</tr>';\r\n\r\n\t\t$out.'</thead>';\r\n\r\n\t\treturn $out;\r\n\t}", "protected function getTableHeader() {\n /** @var \\Drupal\\webform\\WebformInterface $webform */\n $webform = $this->getEntity();\n $header = [];\n $header['title'] = $this->t('Title');\n\n $header['key'] = [\n 'data' => $this->t('Key'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ];\n $header['type'] = [\n 'data' => $this->t('Type'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ];\n $header['correct_answer'] = $this->t('Answer');\n $header['weight'] = $this->t('Weight');\n $header['operations'] = $this->t('Operations');\n// $header['answer'] = [\n// 'data' => $this->t('Answer'),\n// 'class' => [RESPONSIVE_PRIORITY_LOW],\n// ];\n//\n// $header['required'] = [\n// 'data' => $this->t('Required'),\n// 'class' => ['webform-ui-element-required', RESPONSIVE_PRIORITY_LOW],\n// ];\n// $header['parent'] = $this->t('Parent');\n// $header['operations'] = [\n// 'data' => $this->t('Operations'),\n// 'class' => ['webform-ui-element-operations'],\n// ];\n return $header;\n }", "public function getHtml()\n {\n $header = new TableHeader($this);\n $header->addText('Dokument');\n $header->addText('Ersteller');\n $header->addEmpty();\n\n\n $fileReader = new FileReader();\n\n $contentLogModel = new ContentLogModel();\n $fileReader->addFieldByModel($contentLogModel);\n\n $userModel = new UserModel();\n $fileReader->addFieldByModel($userModel);\n\n $join = new ModelJoin($fileReader);\n $join->externalModel = $contentLogModel;\n $join->type = $fileReader->model->id;\n $join->externalType = $contentLogModel->dataId;\n\n $join = new ModelJoin($fileReader);\n $join->externalModel = $userModel;\n $join->type = $contentLogModel->userCreatedId;;\n $join->externalType = $userModel->id;\n\n $fileReader->filter->andEqual($contentLogModel->parentId, $this->dataId);\n $fileReader->filter->andEqual($contentLogModel->contentTypeId, (new FileTemplateStatus())->contentId);\n\n\n foreach ($fileReader->getData() as $fileRow) {\n\n $row = new TableRow($this);\n\n if (!$fileRow->delete) {\n $row->addHyperlink($fileRow->file->getUrl(), $fileRow->file->getFilename());\n\n } else {\n\n $stroke = new Strike($row);\n $stroke->content = $fileRow->file->getFilename();\n\n }\n // show image bzw. detail ansicht\n\n $userDisplay = $fileRow->getModelValue($userModel->displayName);\n $dateTimeCreated = new DateTime($fileRow->getModelValue($contentLogModel->dateTimeCreated));\n\n $row->addText($userDisplay . ' ' . $dateTimeCreated->getShortDateTimeLeadingZeroFormat());\n\n if (!$fileRow->delete) {\n $site = clone(FileDeleteSite::$site);\n $site->addParameter(new FileParameter($fileRow->id));\n $site->addParameter(new DataIdParameter($this->dataId));\n $row->addIconSite($site);\n } else {\n $row->addEmpty();\n }\n\n\n }\n\n return parent::getHtml();\n\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}", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "function getTable(){\n\t\t\tglobal $page, $tableContent, $tableHeadings;\n\t\t\t// reset current page content\n\t\t\t$page = \"\";\n\t\t\t\n\t\t\t$page = '<div class=\"tableContainer\"><table class=\"twoCol\">';\n\t\t\t\n\t\t\t// make sure we have a header row, else skip\n\t\t\t/*\n\t\t\t$headerSize = count($tableHeadings);\n\t\t\tif($headerSize > 0){\n\t\t\t\t\n\t\t\t\t$page = $page . '<tr class = \"tableHeader\">';\n\t\t\t\t\n\t\t\t\tforeach ($tableHeadings as $h){\n\t\t\t\t\t$page = $page . '<td class = \"headerCell\">' . $h . '</td>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t}\n\t\t\t*/\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t$page = $page . '<tr class = \"tableHeader\">';\n\t\t\t\t\n\t\t\t\tforeach (array_keys($tableContent[0]) as $h){\n\t\t\t\t\t\n\t\t\t\t\t$page = $page . '<th class = \"headerCell\">' . $h . '</th>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\n\t\t\t\n\t\t\t// make sure we have table content to print\n\t\t\t\n\t\t\t$contentSize = count($tableContent);\n\t\t\t\n\t\t\tfor($i = 0; $i < $contentSize; $i++){\n\t\t\t\t$rowSize = count($tableContent[$i]);\n\t\t\t\t\n\t\t\t\t// vary row depending on odd/even\n\t\t\t\tif($i % 2){\n\t\t\t\t\t$page = $page . ('<tr class = \"odd\">');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$page = $page . ('<tr class = \"even\">');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// now build row content\n\t\t\t\t$oddevenCount = 0;\n\t\t\t\tforeach ($tableContent[$i] as $row){\n\t\t\t\t\t\n\t\t\t\t\t// vary cell tag depending on odd/even\n\t\t\t\t\tif($oddevenCount % 2){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$page = $page . '<td class = \"odd\">';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$page = $page . '<td class = \"even\">';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// add content\n\t\t\t\t\t$page = $page . $row;\n\t\t\t\t\t\n\t\t\t\t\t// close cell tag\n\t\t\t\t\t$page = $page . '</td>';\n\t\t\t\t\t$oddevenCount += 1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// close row tag\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$page = $page . ('</table></div>');\n\t\t\t\n\t\t\treturn $page;\n\t\t}", "function header() {\n //\n //Get the fields in this sql \n $cols= $this->fields->get_array();\n //\n //Loop through the fields and display the <tds>\n foreach ($cols as $col) {\n //\n $name= is_null($col->alias) ? $col->to_str():$col->alias;\n echo \"<th>$name</th>\"; \n }\n }", "function table_from_array(&$data_array, $has_header = TRUE, $class = \"\", $id = \"\", $text_limit_to_trim = null) {\n if ((count($data_array) == 0) || (count(current($data_array)) == 0)) {\n trigger_error(\"Array to build HTML table is empty\", E_USER_NOTICE);\n return FALSE;\n }\n $table_object = new html_classes\\table($class, $id);\n\n foreach ($data_array as $row_index => $row_data) {\n if ($has_header && ($row_index === 0)) {\n $thead = $table_object->append_thead();\n $tr = $thead->append_tr();\n } else {\n if (!isset($tbody)) {\n $tbody = $table_object->append_tbody();\n }\n $tr = $tbody->append_tr();\n }\n foreach ($row_data as $col_index => $col_value) {\n if ($has_header && ($row_index === 0)) {\n $tr->append_th($col_value);\n } else {\n if (!is_object($col_value)) {\n if (is_numeric($col_value)) {\n if (is_float($col_value)) {\n $col_value = number_format($col_value, 2);\n } else {\n $col_value = number_format($col_value);\n }\n }\n if (is_numeric($text_limit_to_trim) && strlen($col_value) > $text_limit_to_trim) {\n $col_value = substr($col_value, 0, $text_limit_to_trim) . \"...\";\n }\n } else {\n if (is_numeric($text_limit_to_trim) && strlen($col_value->get_value()) > $text_limit_to_trim) {\n $col_value->set_value(substr($col_value->get_value(), 0, $text_limit_to_trim) . \"...\");\n }\n// d($col_value->get_value());\n }\n $tr->append_td($col_value);\n }\n }\n }\n// \\var_dump($table_object);\n return $table_object;\n}", "function getTable(){\n\t\t\tglobal $page, $tableContent, $tableHeadings, $idName, $URL;\n\t\t\t// reset current page content\n\t\t\t$page = \"\";\n\t\t\t\n\t\t\t$page = '<div class=\"tableContainer\"><table class=\"twoCol\">';\n\t\t\t\n\t\t\t\t\n\t\t\t\t$page = $page . '<tr class = \"tableHeader\">';\n\t\t\t\t$page = $page . '<td class = \"headerCell\"></td>';\n\t\t\t\t\n\t\t\t\tforeach (array_keys($tableContent[0]) as $h){\n\t\t\t\t\t\n\t\t\t\t\t$page = $page . '<td class = \"headerCell\">' . $h . '</td>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\n\t\t\t\n\t\t\t// make sure we have table content to print\n\t\t\t\n\t\t\t$contentSize = count($tableContent);\n\t\t\t\n\t\t\tfor($i = 0; $i < $contentSize; $i++){\n\t\t\t\t$rowSize = count($tableContent[$i]);\n\t\t\t\t\n\t\t\t\t// vary row depending on odd/even\n\t\t\t\tif($i % 2){\n\t\t\t\t\t$page = $page . ('<tr class = \"odd\">');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$page = $page . ('<tr class = \"even\">');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// now build row content\n\t\t\t\t$oddevenCount = 1;\n\t\t\t\t$view = '<td class = \"even\">\n\t\t\t\t<a href=\"' . $URL . '?id=' . $tableContent[$i][$idName] . '\">\n\t\t\t\tVIEW</a></td>';\n\t\t\t\t$page = $page . $view;\n\t\t\t\t\n\t\t\t\tforeach ($tableContent[$i] as $row){\n\t\t\t\t\t\n\t\t\t\t\t// vary cell tag depending on odd/even\n\t\t\t\t\tif($oddevenCount % 2){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$page = $page . '<td class = \"even\">';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$page = $page . '<td class = \"odd\">';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// add content\n\t\t\t\t\t$page = $page . $row;\n\t\t\t\t\t\n\t\t\t\t\t// close cell tag\n\t\t\t\t\t$page = $page . '</td>';\n\t\t\t\t\t$oddevenCount += 1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// close row tag\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$page = $page . ('</table></div>');\n\t\t\t\n\t\t\treturn $page;\n\t\t}", "function headers()\n {\n // Maintain URL params for pagination\n if (empty($this->params['pass'])) {\n $this->params['pass'] = array();\n }\n $options = array(\n 'url' => array_merge($this->tableOptions['url'], $this->params['named'], $this->params['pass']),\n //'model' => $this->defaultModel\n );\n if (!empty($this->tableOptions['ajax'])) {\n $options['update'] = $this->tableOptions['ajax']['mh-update'];\n $options['indicator'] = $this->tableOptions['ajax']['mh-indicator'];\n $options['before'] = $this->Js->get($options['indicator'])->effect('fadeIn', array('buffer' => false));\n $options['complete'] = $this->Js->get($options['indicator'])->effect('fadeOut', array('buffer' => false));\n }\n\n\n $this->Paginator->options($options);\n\n $lines = array();\n foreach ($this->Columns as $field => $Column) {\n $lines[] = $headerHTML[] = $Column->header();\n }\n\n $row = $this->Html->tag('tr', implode(chr(10), $lines));\n\n return $this->Html->tag('thead', $row);\n }", "function Header() {\r\n $this->Image($this->logourl, 6, 5, 12,12);\r\n $this->SetFont('courier', '', 8);\r\n $this->SetY(11);\r\n $this->SetX(19);\r\n// $this->SetTextColor(224,17,36);\r\n $this->SetTextColor(1,152,74);\r\n $this->SetFont('courier', 'B', 10);\r\n $this->Cell(55, 4, $this->companyname, 0, 0, 'L');\r\n $this->SetY(14);\r\n $this->SetX(19);\r\n $this->SetFont('courier', 'B', 8);\r\n// $this->SetTextColor(1,152,74);\r\n $this->SetTextColor(224,17,36);\r\n $this->Cell(55, 4, $this->companyaddress, 0, 0, 'L');\r\n $this->SetTextColor(0);\r\n $this->SetY(10);\r\n $this->SetX(130);\r\n// $this->Cell(75, 4, 'Department : ' . $this->dataheader[0], 0, 0, 'R', false);\r\n \r\n $this->SetFont('courier', 'B', 14);\r\n \r\n $this->SetY(12);\r\n $this->SetX(5);\r\n $this->Cell(200, 6, $this->metadata['Title'], 0, 0, 'C');\r\n $this->SetY(18);\r\n $this->SetFont('courier', '', 8);\r\n $this->Cell(200, 5, $this->dataheader[0], 0, 0, 'C');\r\n// $this->Cell(200, 5, 'test', 0, 0, 'C');\r\n $this->SetY(22);\r\n \r\n $this->SetFont('courier', 'B', 8);\r\n $this->Ln(1);\r\n }", "public function makeTable($headings, $content);", "function get_table($table_format, $table_data, $meta = null)\n{\n\t$meta_defaults = [\n\t\t'alt_class' => 'alt',\n\t\t'caption' => '',\n\t\t'class' => 'datatable',\n\t\t'extra_html' => '',\n\t\t'init_sort_column' => null,\n\t\t'no_data' => 'There is no data',\n\t\t'sortable' => false,\n\t\t'totals' => false,\n\t];\n\n\t$opts = array_merge($meta_defaults, $meta);\n\n\tif ( ! is_array($table_data) || (0 == count($table_data))) {\n\t\treturn $opts['no_data'];\n\t}\n\n\t$opts['caption'] = ('' != $opts['caption']) ? '<caption>'.$opts['caption'].'</caption>' : '';\n\n\t// start building the header\n\t$headhtml = '\n\t\t\t<thead>\n\t\t\t<tr>';\n\n\t$total_cols = $sort_types = [];\n\tforeach ($table_format as $col) {\n\t\t// test for SPECIAL data first\n\t\tif ( ! is_array($col[TYPE]) && ('SPECIAL_' == substr($col[TYPE], 0, 8))) {\n\t\t\t${$col[TYPE]}[] = $col; // will be named either SPECIAL_CLASS or SPECIAL_HTML\n\t\t}\n\t\telse {\n\t\t\t$sort_types[] = (isset($col[SORT])) ? $col[SORT] : null;\n\n\t\t\tif ( ! is_array($col[HEADER])) {\n\t\t\t\t$headhtml .= '\n\t\t\t\t<th>'.$col[HEADER].'</th>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$headhtml .= '\n\t\t\t\t<th title=\"'.$col[HEADER][1].'\">'.$col[HEADER][0].'</th>';\n\t\t\t}\n\n\t\t\t// do some stuff for the totals row\n\t\t\tif ($opts['totals'] && isset($col[TOTAL])) {\n\t\t\t\tif ((false != $col[TOTAL]) && ('total' != strtolower($col[TOTAL]))) {\n\t\t\t\t\t// test if we have any [[[meta_vars]]]\n\t\t\t\t\t// and make a total entry for those matches if any VALID ones are found\n\t\t\t\t\t// if the code is eval'd, we'll do that when we put the total row on\n\t\t\t\t\tif (preg_match_all('/\\\\[\\\\[\\\\[(\\\\w+)\\\\]\\\\]\\\\]/i', $col[TOTAL], $matches, PREG_PATTERN_ORDER)) {\n\t\t\t\t\t\tforeach ($matches[1] as $match) {\n\t\t\t\t\t\t\tif (in_array($match, array_keys(reset($table_data))) && ! in_array($match, $total_cols)) {\n\t\t\t\t\t\t\t\t$total_cols[] = $match;\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\telse {\n\t\t\t\t\t\t$total_cols[] = $col[TOTAL];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$total_cols = array_unique($total_cols);\n\n\t$headhtml .= '\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t';\n\n\t// start building the body\n\t$bodyhtml = '<tbody>\n\t\t\t';\n\n\t// start placing the data in the table\n\t$i = 0;\n\tforeach ($table_data as $rkey => $row) {\n\t\tif ( ! is_array($row)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// clear out previous data\n\t\t$classes = false;\n\n\t\t// run our special class code\n\t\t// this code adds a class (or not) to the table row based on field contents\n\t\tif (isset($SPECIAL_CLASS)) {\n\t\t\tforeach ($SPECIAL_CLASS as $SP_CLASS_USE) {\n\t\t\t\t$SP_CLASS_USE[CODE] = replace_meta($row, $SP_CLASS_USE[CODE]);\n\n#\t\t\t\tcall('$do_it = (bool) ('.$SP_CLASS_USE[CODE].');');\n\t\t\t\teval('$do_it = (bool) ('.$SP_CLASS_USE[CODE].');');\n\n\t\t\t\tif ($do_it && ! empty($SP_CLASS_USE[TRU])) {\n\t\t\t\t\t$classes[] = massage_data($row, $SP_CLASS_USE[TRU]);\n\t\t\t\t}\n\n\t\t\t\tif ( ! $do_it && ! empty($SP_CLASS_USE[FALS])) {\n\t\t\t\t\t$classes[] = massage_data($row, $SP_CLASS_USE[FALS]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// run our special html code\n\t\t// this code adds html (or not) to the table row based on field contents\n\t\t$spec_html = '';\n\t\tif (isset($SPECIAL_HTML)) {\n\t\t\tforeach ($SPECIAL_HTML as $SP_HTML_USE) {\n\t\t\t\tforeach ($SP_HTML_USE as $key => $col) {\n\t\t\t\t\t$SP_HTML_USE[$key] = replace_meta($row, $col);\n\t\t\t\t}\n\n#\t\t\t\tcall('$do_it = (bool) ('.$SP_HTML_USE[CODE].');');\n\t\t\t\teval('$do_it = (bool) ('.$SP_HTML_USE[CODE].');');\n\n\t\t\t\tif ($do_it && ! empty($SP_HTML_USE[TRU])) {\n\t\t\t\t\t$spec_html .= ' '.massage_data($row, $SP_HTML_USE[TRU]);\n\t\t\t\t}\n\n\t\t\t\tif ( ! $do_it && ! empty($SP_HTML_USE[FALS])) {\n\t\t\t\t\t$spec_html .= ' '.massage_data($row, $SP_HTML_USE[FALS]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (1 === ($i % 2) && ! empty($opts['alt_class'])) {\n\t\t\t$classes[] = $opts['alt_class'];\n\t\t}\n\n\t\t$class = (is_array($classes)) ? ' class=\"'.implode(' ', $classes).'\"' : '';\n\n\t\t$bodyhtml .= '<tr'.$class.$spec_html.'>';\n\n\t\t// don't just start outputting the data\n\t\t// output it in the order specified by the table_format\n\t\tforeach ($table_format as $ckey => $col) {\n\t\t\tif ( ! is_array($col)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! is_array($col[TYPE]) && ('SPECIAL_' == substr($col[TYPE], 0, 8))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$col[EXTRA] = (isset($col[EXTRA])) ? ' '.trim($col[EXTRA]) : '';\n\n\t\t\t$bodyhtml .= '\n\t\t\t\t<td'.$col[EXTRA].'>';\n\t\t\tif (is_null($col[FIELD])) {\n\t\t\t\t// we don't want to show anything in this column\n\t\t\t\t// do nothing\n\t\t\t}\n\t\t\telseif (isset($row[$col[FIELD]])) {\n\t\t\t\t// we have normal data\n\t\t\t\t$bodyhtml .= $row[$col[FIELD]];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$bodyhtml .= massage_data($row, $col[FIELD]);\n\t\t\t}\n\n\t\t\t$bodyhtml .= '</td>';\n\t\t}\n\n\t\t// grab the totals\n\t\tif ($opts['totals'] && (0 != count($total_cols))) {\n\t\t\tforeach ($total_cols as $total_col) {\n\t\t\t\tif ('__total' == $total_col) {\n\t\t\t\t\t$totals[$total_col] = 'Total';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$totals[$total_col] += $row[$total_col];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$bodyhtml .= '\n\t\t\t</tr>';\n\n\t\t++$i;\n\t}\n\n\t$bodyhtml .= '\n\t\t\t</tbody>';\n\n\t// start building the footer\n\tif ($opts['totals'] && (0 != count($totals))) {\n\t\t$foothtml = '\n\t\t\t<tfoot>\n\t\t\t<tr>';\n\n\t\tforeach ($table_format as $ckey => $col) {\n\t\t\tif ( ! is_array($col)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ('SPECIAL_' == substr($col[TYPE], 0, 8)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$foothtml .= '\n\t\t\t\t<td>';\n\t\t\tif (is_null($col[TOTAL])) {\n\t\t\t\t$foothtml .= '--';\n\t\t\t}\n\t\t\telseif (isset($totals[$col[TOTAL]])) {\n\t\t\t\t// we have normal data\n\t\t\t\t$foothtml .= $totals[$col[TOTAL]];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$foothtml .= massage_data($totals, $col[TOTAL]);\n\t\t\t}\n\n\t\t\t$foothtml .= '</td>';\n\t\t}\n\n\t\t$foothtml .= '\n\t\t\t</tr>\n\t\t\t</tfoot>';\n\t}\n\telse {\n\t\t$foothtml = '';\n\t}\n\n\t// build the sortable script\n\tif ($opts['sortable']) {\n\t\t$table_id = get_table_id( );\n\t\t$opts['extra_html'] .= ' id=\"'.$table_id.'\"';\n\n\t\t$sort_script = get_sort_script($table_id, $sort_types, $opts['alt_class'], $opts['init_sort_column']);\n\t}\n\telse {\n\t\t$sort_script = '';\n\t}\n\n\t$html = '\n\t\t<table class=\"'.$opts['class'].'\" '.$opts['extra_html'].'>\n\t\t\t'.$opts['caption']\n\t\t\t.$headhtml\n\t\t\t.$foothtml\n\t\t\t.$bodyhtml.'\n\t\t</table>'\n\t\t.$sort_script;\n\n\treturn $html;\n}", "public function Header(){\n $ci =& get_instance();\n // Select Arial bold 15\n $this->AddFont('Futura-Medium');\n $this->SetFont('Futura-Medium','',16);\n // Move to the right\n //$this->Cell(80);\n // Framed title\n // Logo\n $this->Image(asset_url() . \"images/logo.png\",11,5,0,20);\n $this->Ln(15);\n $this->Cell(0,10,\"GetYourGames\",0,1,'L');\n $this->SetFont('Futura-Medium','',12);\n $this->Cell(0,10,site_url(),0,1,\"L\");\n $this->Ln(5);\n $this->SetFont('Futura-Medium','',18);\n $this->Cell(0,10,utf8_decode($this->title),0,1,'C');\n // Line break\n $this->Ln(10);\n $this->SetFont('Futura-Medium','',11);\n $this->Cell(15,10,utf8_decode('#'),'B',0,'C');\n $this->Cell(100,10,utf8_decode($ci->lang->line('table_product')),'B',0,'L');\n $this->Cell(30,10,utf8_decode($ci->lang->line('table_qty')),'B',0,'L');\n $this->Cell(40,10,utf8_decode($ci->lang->line('table_subtotal')),'B',1,'L');\n\n $this->Ln(2);\n }", "function ImprovedTable($header,$data)\n{\n\t//Anchuras de las columnas\n\t$w=array(60,30,20,35,35);\n\t//Cabeceras\n\t$l = mysql_connect(\"localhost\",\"pmm\",\"guhAf2eh\");\n\t//$l = mysql_connect(\"DBSERVER\",\"root\",\"root\");\n\tmysql_select_db(\"pmm_dbpruebas\", $l);\n\t//mysql_select_db(\"pmm_dbweb\", $l);\n\t$s = \"SELECT CONCAT_WS(' ',nombre,paterno,materno) AS cliente, d.calle, d.poblacion, d.estado, d.pais\n\tFROM catalogocliente cc\n\tINNER JOIN direccion d ON cc.id = d.codigo\n\tWHERE d.facturacion='SI'\n\tLIMIT 0,100\";\t\n\t$r = mysql_query($s,$l) or die($s);\n\t\n\tfor($i=0;$i<count($header);$i++)\n\t\t$this->Cell($w[$i],7,$header[$i],1,0,'C');\n\t$this->Ln();\n\t//Datos\t\n\t\twhile($row = mysql_fetch_array($r)){\n\t\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');\n\t\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');\n\t\t\t$this->Ln();\n\t\t}\n\t/*foreach($data as $row)\n\t{\n\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');\n\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');\n\t\t$this->Ln();\n\t}*/\n\t//Lnea de cierre\n\t$this->Cell(array_sum($w),0,'','T');\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 function Header(){\n if(count($this->_groups)){\n $this->SetFont('Arial','B',8);\n $this->SetDrawColor(160,160,160);\n $this->SetTextColor(160,160,160);\n $grp = array();\n foreach(array_keys($this->_groups) as $field){\n if(empty($this->_groups[$field][\"currentMsg\"])||!$this->_changePage){\n $grp[] = \"{grp_$field}\";\n }else{\n $grp[] = $this->_groups[$field][\"currentMsg\"];\n }\n }\n $grp = join($grp,\" / \");\n $this->Cell(0,4,$grp,'B',1,'L');\n $this->Ln(4);\n }\n $date = new Date();\n $this->SetTextColor(100);\n $this->SetFillColor(245);\n $this->SetY(4);\n $this->SetFont('Arial','B',10);\n //$str = \"Elaborado el \".$date->getYear().\" - \".$date->getMonthName().\" - \".$date->getDay().\" del \".date(\"H:i:s\");\n $this->ln();\n $this->ln();\n $this->ln();\n $this->ln();\n $str = \"Fecha: \".$date->getYear().\" - \".$date->getMonth().\" - \".$date->getDay();\n $x = $this->GetStringWidth($str);\n $this->Cell($x+10,5,$str,0,0,'L');\n // $this->Cell(0,5,Session::getData(\"nomcaj\"),\"B\",\"R\",'R');\n $this->ln();\n $this->ln();\n $this->ln();\n $this->SetTextColor(0);\n $this->SetFont('Arial','B',12);\n if(is_array($this->_titulo)){\n foreach($this->_titulo as $titulo){\n $w=$this->GetStringWidth($titulo);\n $this->SetX(($this->w - $w) / 2);\n $this->Cell($w,5,$titulo,0,1,'C');\n }\n }else{\n $w=$this->GetStringWidth($this->_titulo);\n $this->SetX(($this->w - $w) / 2);\n $this->Cell($w,5,$this->_titulo,0,1,'C');\n }\n $this->Ln();\n $this->Ln();\n $this->SetTextColor(100);\n $this->SetFont('Arial','',9);\n $this->Cell(0,2,'',0,1,'C');\n //$this->Image(\"public/img/portal/logo_mercurio_report.jpg\",14,11,60,13);\n //$this->Image(\"public/img/portal/logo_sys_report.jpg\",140,11,60,15);\n if(!count($this->_groups)||$this->_changePage){\n $this->__Header();\n $this->_changePage = false;\n }else{\n $this->__Header();\n }\n }", "public function Header() {\r\n $this->SetTextColor(0,0,0);\r\n $this->SetDrawColor(0,0,0);\r\n /* definimos variables con titulo y subtitulo */\r\n $titulo=\"Coordinación de Calidad\";\r\n $subtitulo=\"Reporte Diario de Sustancias Químicas \";\r\n /* posicionamos el puto de insercion 2mm. debajo\r\n del borde del papel */\r\n $this->SetY(8);\r\n /* escribimos el titulo con la fuente que se establezca\r\n por el método opcion SetHeaderFont */\r\n $this->SetFont('helvetica', 'B', 14);\r\n\r\n $this->Cell(0, 5,$titulo,0,1,'C');\r\n /* modificamos tipografia para el subtitulo\r\n e insertamos este */\r\n $this->SetFont('helvetica', '', 12);\r\n $this->Cell(0, 2,$subtitulo,0,1,'C');\r\n /* trazamos un rectangulo sombreado que por sus dimensiones\r\n ocupará el area de texto de la pagina */\r\n \r\n /*trazamos una linea roja debajo del encabezado */\r\n $this->Line(15,30,195,30); \r\n /* insertamos una imagen de fondo con 15% de opacidad */\r\n \r\n $this->Image('logo.png',0,0,30,30,\r\n '','','N','','','L');\r\n /* recuperamos la opacidad por defecto */\r\n \r\n }", "function ImprovedTable($header, $data)\n\t{\n\t\t//$this ->Ln(20);\n\t\t\n\t\t$contador = 0;\n\t\t$w = array(40, 40, 30, 30);\n\t\t// Cabeceras\n\t\tfor($i=0;$i<count($header);$i++)\n\t\t\t$this->Cell($w[$i],7,$header[$i],1,0,'C');\n\t\t\n\t\t$this->Ln();\n\t\t// Datos\n\t\t$this->SetFont('Arial','',12);\n\t\tforeach($data as $row)\n\t\t{\n\t\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t\t$this->Cell($w[2],6,$row[2],'LR',0,'L');\n\t\t\t$this->Cell($w[3],6,$row[3],'LR',0,'R');\n\t\t\t$this->Ln();\n\t\t\t$contador++;\n\t\t\tif($contador == 46){\n\t\t\t\t$this-> AddPage();\n\t\t\t\t$contador = 0;\n\t\t\t}\n\t\t}\n\t\t// Línea de cierre\n\t\t$this->Cell(array_sum($w),0,'','T');\n\t}", "private function generate_html_header()\n {\n $header = \"<!DOCTYPE html> <html lang=\\\"en\\\"> <head> <meta charset=\\\"UTF-8\\\"> <title>Test statistics</title> <style> table{ border: 1px solid black; margin: 10px 20px; } thead{ background-color:lightgray; } .status{ width: 180px; } #stats{font-size:23px;} .test-name{ min-width: 400px; padding-left: 20px; color:blue; text-decoration: underline; } h1,p{ margin-left: 20px; } .success{ background: lawngreen; } .failed{ background: red; } #detail{ margin-left: 20px; } #input{ min-height: 250px; width: 300px; } #parse_output{ min-height: 400px; width: 500px; } #detail{ display: none; } .status_text_pass{ color:green; font-size: 25px; } .status_text_failed{ color:red; font-size:25px; } </style> </head> <body> <h1>Test statistics</h1><p id=\\\"stats\\\">Success: <span id=\\\"correct\\\"></span>/<span id=\\\"all\\\"></span></p> <p>For test detail click on test name</p> <table> <thead> <tr> <th>Test Name</th> <th>Pass/Fail</th> </tr> </thead> <tbody> </tbody> </table> <div id=\\\"detail\\\"> <h2><span id=\\\"test_name\\\"></span> detail</h2> <h3 id=\\\"status_text\\\"></h3><h3>Input:</h3> <textarea disabled id=\\\"input\\\"></textarea> <h3>Parse output:</h3> <textarea disabled id=\\\"parse_output\\\"></textarea> <h3>Interpret input</h3><span id=\\\"interpret_input\\\"></span> <h3>Reference output</h3><span id=\\\"ref_output\\\"></span> <h3>Interpret output</h3><span id=\\\"interpret_output\\\"></span> <h3>Reference return code:</h3> <span id=\\\"ref_return_code\\\"></span> <h3>Parse return code:</h3> <span id=\\\"parse_return_code\\\"></span> <h3>Interpret return code:</h3> <span id=\\\"interpret_return_code\\\"></span> </div> </body> <script> var tests = [\";\n return $header;\n }", "protected function renderHeaderCellContent()\n\t{\n\t\t$name = $this->name;\n\t\tif (substr_compare($name, '[]', -2, 2) === 0) {\n\t\t\t$name = substr($name, 0, -2);\n\t\t}\n\t\tif (substr_compare($name, ']', -1, 1) === 0) {\n\t\t\t$name = substr($name, 0, -1) . '_all]';\n\t\t} else {\n\t\t\t$name .= '_all';\n\t\t}\n\n\t\t$id = $this->grid->options['id'];\n\n$_allSelectJs = <<< JS\n\t$('.select-on-check-all').on('click', function(){\n\t\tvar rows = table.rows({ 'search': 'applied' }).nodes();\n\t\t$('input[type=\"checkbox\"]', rows).prop('checked', this.checked);\n\t});\n\n\t$('#$id tbody').on('change', 'input[type=\"checkbox\"]', function(){\n\t\tif(!this.checked){\n\t\t\tvar el = $('.select-on-check-all').get(0);\n\t\t\tif(el && el.checked && ('indeterminate' in el)){\n\t\t\t\tel.indeterminate = true;\n\t\t\t}\n\t\t}\n\t});\nJS;\n\n\t\t$this->grid->getView()->registerJs($_allSelectJs);\n\n\t\tif ($this->header !== null || !$this->multiple) {\n\t\t\treturn parent::renderHeaderCellContent();\n\t\t} else {\n\t\t\treturn Html::checkBox($name, false, ['class' => 'select-on-check-all']);\n\t\t}\n\t}", "private function buildBody()\n {\n $day = 1;\n $now_date = $this->year . '-' . $this->month . '-01';\n $startingDay = date('N', strtotime('first day of this month', strtotime($now_date)));\n //Add the following line if you want to start the week with monday instead of sunday. Or change the number to suit your needs.\n //$startingDay = $startingDay - 1;\n $monthLength = $this->daysMonth[$this->month - 1];\n if ($this->month == 2 && ((($this->year % 4) == 0) && ((($this->year % 100) != 0) || (($this->year % 400) == 0)))) {\n $monthLength = $monthLength + 1;\n }\n $h = \"<tr>\";\n for ($i = $startingDay == 7 ? 1 : 0; $i < 9; $i++) {\n for ($j = 0; $j <= 6; $j++) {\n $currDate = $this->getDayDate($day);\n $class = $this->getTdClass($day);\n $h .= \"<td data-datetime='$currDate' $class>\";\n $h .= $this->dateWrap[0];\n if ($day <= $monthLength && ($i > 0 || $j >= $startingDay)) {\n $h .= $this->dayWrap[0];\n $h .= $this->getEventSearchLink($day);\n $h .= $this->dayWrap[1];\n $h .= $this->buildEvents($currDate);\n $day++;\n } else {\n $h .= \"&nbsp;\";\n }\n $h .= $this->dateWrap[1];\n $h .= \"</td>\";\n }\n // stop making rows if we've run out of days\n if ($day > $monthLength) {\n break;\n } else {\n $h .= \"</tr>\";\n $h .= \"<tr>\";\n }\n }\n $h .= \"</tr>\";\n $h .= \"</tbody>\";\n $h .= \"</table>\";\n $this->html .= $h;\n }", "public static function getContentTable($content)\r\n\t{\r\n\t\tpreg_match_all(\"/<(h[\\d]+)[^>]*>(.*)<\\/(\\s*)\\\\1(\\s*)>/i\", $content, $found_headers, PREG_SET_ORDER);\r\n\t\t\r\n\t\tif (count($found_headers) == 0) return array(\"\", $content);\r\n\t\telse\r\n\t\t{\r\n\t\t\t$num_of_headers = 0;\r\n\t\r\n\t\t\tfor ($i = 0; $i < count($found_headers); $i++)\r\n\t\t\t{\r\n\t\t\t\t$div_id = \"_header_\" . $num_of_headers++;\r\n\t\t\t\t\r\n\t\t\t\tif ($i == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$content_table = \"<div id=\\\"toc\\\">\\n<fieldset id=\\\"toc\\\"><legend>\". _AT(\"table_of_contents\").\"</legend>\\n\";\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t$content = str_replace($found_headers[$i][0], '<div id=\"'.$div_id.'\">'.$found_headers[$i][0].'</div>', $content);\r\n\t\t\t\t$content_table .= '<a href=\"'.$_SERVER[\"REQUEST_URI\"].'#'.$div_id.'\" class=\"'.$found_headers[$i][1].'\">'. $found_headers[$i][2].\"</a>\\n\";\r\n\t\r\n\t\t\t\tif ($i == count($found_headers) - 1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$content_table .= \"</fieldset></div><br />\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn array($content_table, $content);\r\n\t\t}\r\n\t}", "function BorderlessTable($header, $data)\n\t{\n\t $this->SetFillColor(128,128,128);\n\t $this->SetTextColor(255);\n\t $this->SetDrawColor(0,0,0);\n\t $this->SetLineWidth(.3);\n\t // Color and font restoration\n\t $this->SetFillColor(224,235,255);\n\t $this->SetTextColor(0);\n\t $this->SetFont('Arial','',12);\n\t // Data\n\t $this->SetWidths(array(40, 65, 50, 60, ));\n\t foreach($data as $row){\n\t\t$this->BorderlessRow($row);\n\t }\n\t // Closing line\n\t // $this->Cell(array_sum($w),0,'','T');\n\t}", "function tableheader_open($colspan = 1, $align = null, $rowspan = 1, $classes = null) {\n $class = 'class=\"col'.$this->_counter['cell_counter']++;\n if(!is_null($align)) {\n $class .= ' '.$align.'align';\n }\n if($classes !== null) {\n if(is_array($classes)) $classes = join(' ', $classes);\n $class .= ' ' . $classes;\n }\n $class .= '\"';\n $this->doc .= '<th '.$class;\n if($colspan > 1) {\n $this->_counter['cell_counter'] += $colspan - 1;\n $this->doc .= ' colspan=\"'.$colspan.'\"';\n }\n if($rowspan > 1) {\n $this->doc .= ' rowspan=\"'.$rowspan.'\"';\n }\n $this->doc .= '>';\n }", "function toHtml()\n {\n require_once 'HTML/Table.php';\n $table = new HTML_Table(null, 0, true);\n $table->updateAttributes($this->getAttributes());\n\n $tbody = $table->getBody();\n $tbody->setAutoGrow(true);\n $tbody->setAutoFill('');\n\n $thead = $table->getHeader();\n $thead->setAutoGrow(true);\n $thead->setAutoFill('');\n \n $tfoot = $table->getFooter();\n $tfoot->setAutoGrow(true);\n $tfoot->setAutoFill('');\n \n if (isset($this->_footer) && is_array($this->_footer) && count($this->_footer)) {\n $footer = $this->_footer;\n } elseif (is_string($this->_footer)) {\n $last_column = array_pop(array_keys($this->_columnNames));\n $footer = array($last_column => $this->_footer);\n if (isset($this->_footerAttributes['@all'])) {\n if (isset($this->_footerAttributes[$last_column])) {\n $this->_footerAttributes[$last_column] = array_merge($this->_footerAttributes['@all'], $this->_footerAttributes[$last_column]);\n } else {\n $this->_footerAttributes[$last_column] = $this->_footerAttributes['@all'];\n }\n unset($this->_footerAttributes['@all']);\n }\n }\n\n $col = 0;\n if ($this->_columnNames) {\n foreach ($this->_columnNames as $key => $value) {\n $thead->setHeaderContents(0, $col, $value, $this->_columnAttributes[$key]);\n if (isset($footer)) {\n if (isset($footer[$key])) {\n $attributes = isset($this->_footerAttributes['@all']) ? $this->_footerAttributes['@all'] : array();\n if (isset($this->_footerAttributes[$key])) $attributes = array_merge($attributes, $this->_footerAttributes[$key]);\n if (isset($col_spanned)) {\n $tfoot->setCellContents(0, $col_spanned, $footer[$key]);\n $tfoot->setCellAttributes(0, $col_spanned, array_merge($attributes, array('colspan' => $key - $col_spanned + 1)));\n unset($col_spanned);\n } else {\n $tfoot->setCellContents(0, $col, $footer[$key]);\n if (!empty($attributes)) $tfoot->setCellAttributes(0, $col, $attributes);\n }\n } else {\n if (!isset($col_spanned)) $col_spanned = $key;\n }\n }\n ++$col;\n }\n }\n if (!empty($this->_rows)) {\n $row = 0;\n foreach (array_keys($this->_rows) as $key) {\n $col = 0;\n foreach (array_keys($this->_rows[$key]) as $key2) {\n $tbody->setCellContents($row, $col, $this->_rows[$key][$key2]->toHTML());\n $attributes = isset($this->_rowAttributes[$key]['@all']) ? $this->_rowAttributes[$key]['@all'] : array();\n if (isset($this->_rowAttributes[$key][$key2])) $attributes = array_merge($attributes, $this->_rowAttributes[$key][$key2]);\n if (!empty($attributes)) $tbody->setCellAttributes($row, $col, $attributes); \n ++$col;\n }\n if (isset($this->_rowAttributes[$key]['@row'])) $tbody->setRowAttributes($row, $this->_rowAttributes[$key]['@row'], true);\n ++$row;\n }\n } elseif (isset($this->_emptyText)) {\n $tbody->setCellContents(0, 0, $this->_emptyText);\n $tbody->setCellAttributes(0, 0, array('align' => 'center', 'colspan' => count($this->_columnNames)));\n }\n\n return $table->toHTML();\n }", "private function makeCalendarHead()\n\t{\n\t\tif(strlen($this->headerStr) < 1) {\n\t\t\t$head = \"\\t<tr>\\n\\t\\t<th colspan=\\\"7\\\" class=\\\"headerString\\\">\";\n\t\t\tif(!is_null($this->curDay)) {\n\t\t\t\t$head .= $this->curDayName.' the '.$this->curDayS.' of '.$this->curMonthName.', '.$this->curYear;\n\t\t\t} else {\n\t\t\t\t$head .= $this->curMonthName.', '.$this->curYear;\n\t\t\t}\n\t\t\t$head .= \"</th>\\n\\t</tr>\\n\";\n\t\t} else {\n\t\t\t$head = $this->headerStr;\n\t\t}\n\t\t\n\t\t$this->calWeekDays .= $head;\n\t\t$this->outArray['head'] = $head;\n\t}", "public function createHeader() {\n\t\t$header = new PHPWord_Section_Header($this->_sectionCount);\n\t\t$this->_header = $header;\n\t\treturn $header;\n\t}", "function Header()\n {\n\n\n //list($r, $b, $g) = $this->xheadercolor;\n $this->setY(5);\n //$this->SetFillColor($r, $b, $g);\n //$this->SetTextColor(0 , 0, 0);\n //$this->Cell(0,20, '', 0,1,'C', 1);\n //$this->Text(15,26,$this->xheadertext );\n \n \n // get the current page break margin\n $bMargin = $this->getBreakMargin();\n // get current auto-page-break mode\n $auto_page_break = $this->AutoPageBreak;\n // disable auto-page-break\n $this->SetAutoPageBreak(false, 0);\n // set bacground image\n $img_file = WWW_ROOT.'/img/Resul_Agua.jpg';\n $this->Image($img_file, 0, 0, 216, 279, '', '', '', false, 300, '', false, false, 0);\n // restore auto-page-break status\n $this->SetAutoPageBreak($auto_page_break, $bMargin);\n // set the starting point for the page content\n $this->setPageMark();\n \n\n $this->writeHTML($this->xheadertext, true, false, true, false, '');\n\n // Transformacion para la rotacion de el numero de orden y el contenedor de la muestra\n $this->StartTransform();\n //$this->SetFont('freesans', '', 5);\n $this->SetFont('', '', 5);\n $this->Rotate(-90, 117, 117);\n //$tcpdf->Rect(39, 50, 40, 10, 'D');\n $this->Text(5, 30, 'Software Asistencial Médico \"SAM\" V.1.1 ® - https://samsalud.info ®');\n // Stop Transformation\n $this->StopTransform();\n\n // if ( $this->variable == 1 )\n // {\n // draw jpeg image x, y ancho, alto\n // $this->Image(WWW_ROOT.'/img/BORRADOR.png', 40, 60, 450, 250, '', '', '', true, 72);\n\n // restore full opacity\n $this->SetAlpha(0);\n // }\n\n }", "public function Header()\n {\n // Set custom header and footer\n $this->setCustomHeader();\n\n if (array_key_exists($this->category, $this->categories)) {\n $title = $this->categories[$this->category]['name'];\n } else {\n $title = '';\n }\n\n $this->SetTextColor(0, 0, 0);\n $this->SetFont($this->currentFont, 'B', 18);\n\n if (0 < PMF_String::strlen($this->customHeader)) {\n $this->writeHTMLCell(0, 0, '', '', $this->customHeader);\n $this->Ln();\n $this->writeHTMLCell(0, 0, '', '', html_entity_decode($title, ENT_QUOTES, 'utf-8'), 0, 0, false, true, 'C');\n } else {\n $this->MultiCell(0, 10, html_entity_decode($title, ENT_QUOTES, 'utf-8'), 0, 'C', 0);\n $this->SetMargins(PDF_MARGIN_LEFT, $this->getLastH() + 5, PDF_MARGIN_RIGHT);\n }\n }", "function generateTitle($header, $data)\n\t{\n\t\t$this->SetFillColor(63,73,204);\n\t\t$this->SetTextColor(255);\n\t\t$this->SetDrawColor(18,0,0);\n\t\t$this->SetLineWidth(.1);\n\t\t$this->SetFont('','B');\n\t\t// Header\n\t\t$w = array(70, 25, 30, 20,30,35,25);\n\t\tfor($i=0;$i<count($header);$i++)\n\t\t\t$this->Cell($w[$i],7,$header[$i],1,0,'C',true);\n\t\t$this->Ln();\n\t\t// Color and font restoration\n\t\t$this->SetFillColor(224,235,255);\n\t\t$this->SetTextColor(0);\n\t\t$this->SetFont('');\n\t\t// Data\n\t\t$fill = false;\n\t\tforeach($data as $row)\n\t\t{\n\t\t\t$this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);\n/*\t\t\t$this->Cell($w[1],6,$row[1],'LR',0,'C',$fill);\n\t\t\t$this->Cell($w[2],6,$row[2],'LR',0,'C',$fill);\n\t\t\t$this->Cell($w[3],6,$row[3],'LR',0,'C',$fill);\n\t\t\t$this->Cell($w[4],6,$row[4],'LR',0,'C',$fill);\n\t\t\t$this->Cell($w[5],6,$row[5],'LR',0,'C',$fill);*/\n\t\t\t$this->Ln();\n\t\t\t$fill = !$fill;\n\t\t}\n\t\t// Closing line\n\t\t$this->Cell(array_sum($w),0,'','T');\n\t}", "public function Header()\r\n\t{\r\n\t\t$this->Ln();\r\n\t\t$this->SetFont('Arial','',14);\r\n\t\t$this->Cell(170,7,\"Date :: \". $this->today_date ,1,0,'C');\r\n\t\t$this->Ln();\r\n\t\t$this->SetFont('Arial','',14); \r\n\t\t$this->MultiCell(170,8,\"Room Things Report \\n\".$this->title,1,'C');\r\n\t\t$this->Ln(5);\r\n\r\n\t}", "function table_header($addon = FALSE, $message = FALSE) {\n\t\n\tglobal $langName, $langSurname, $langUsername, $langEmail, $langFaculty, $langTel;\n\tglobal $langDate, $langComments, $langActions;\n\tglobal $langDateRequest_small;\n\n\t$string = \"\";\n\tif ($addon) { \n\t\t$rowspan=2;\n\t\t$datestring = \"<th align='center' colspan='2'>$langDate</th>\n\t\t<th scope='col' rowspan='$rowspan' align='center'>$langComments</th>\n\t\t<th scope='col' rowspan='$rowspan' align='center'>$langActions</th>\n\t\t</tr><tr>\n\t\t<th>$langDateRequest_small</th>\n\t\t<th>$message</th>\";\n\t} else {\n\t\t$rowspan=1;\n\t\t$datestring = \"<th scope='col' align='center'>$langDate<br />$langDateRequest_small</th>\n\t\t<th scope='col' align='center'>$langComments</th>\n\t\t<th scope='col' align='center'>$langActions</th>\";\n\t}\n\n\t$string .= \"<thead><tr>\n\t<th scope='col' colspan='2' rowspan='$rowspan' class='left'>&nbsp;&nbsp;$langName $langSurname</th>\n\t<th scope='col' width='20' rowspan='$rowspan' class='left'>$langUsername</th>\n\t<th scope='col' rowspan='$rowspan' class='left'>$langEmail</th>\n\t<th scope='col' rowspan='$rowspan' class='left'>$langFaculty</th>\n\t<th scope='col' rowspan='$rowspan' align='center'>$langTel</th>\";\n\t$string .= $datestring; \n\t$string .= \"</tr></thead>\";\n\nreturn $string;\n}", "function Header(){\n\t\t$linha = 5;\n\t\t// define o X e Y na pagina\n\t\t$this->SetXY(10,10);\n\t\t// cria um retangulo que comeca na coordenada X,Y e\n\t\t// tem 190 de largura e 265 de altura, sendo neste caso,\n\t\t// a borda da pagina\n\t\t$this->Rect(10,10,190,265);\n\t\t\n\t\t// define a fonte a ser utilizada\n\t\t$this->SetFont('Arial', 'B', 8);\n\t\t$this->SetXY(11,11);\n\t\t\n\t\t// imprime uma celula com bordas opcionais, cor de fundo e texto.\n\t\t$agora = date(\"G:i:s\");\n\t\t$hoje = date(\"d/m/Y\");\n\t\t$this->Cell(10,$linha,$agora,0,0,'C');\n\t\t$this->Cell(150,$linha,'..:: Fatec Bauru - Relatorio de Cursos da Fatec ::..',0,0,'C');\n\t\t$this->Cell(30,$linha,$hoje,0,0,'C');\n\t\t\n\t\t// quebra de linha\n\t\t$this->ln();\n\t\t$this->SetFillColor(232,232,232);\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->SetFont('Arial', 'B', 8);\n\n\t\t$this->Cell(10,4,'ID','LTR',0,'C',1);\n\t\t$this->Cell(140,4,'Nome do Curso','LTR',0,'C',1);\n\t\t$this->Cell(40,4,'Periodo','LTR',0,'C',1);\n\t}", "public function buildTable()\n {\n\n $view = View::getActive();\n\n // Creating the Head\n $head = '<thead class=\"ui-widget-header\" >'.NL;\n $head .= '<tr>'.NL;\n\n $head .= '<th >Project Name</th>'.NL;\n //$head .= '<th>File</th>'.NL;\n $head .= '<th >Description</th>'.NL;\n $head .= '<th style=\"width:165px\" >Nav</th>'.NL;\n\n $head .= '</tr>'.NL;\n $head .= '</thead>'.NL;\n //\\ Creating the Head\n\n // Generieren des Bodys\n $body = '<tbody class=\"ui-widget-content\" >'.NL;\n\n $num = 1;\n foreach ($this->data as $key => $row) {\n $rowid = $this->name.\"_row_$key\";\n\n $body .= \"<tr class=\\\"row$num\\\" id=\\\"$rowid\\\" >\";\n\n $urlConf = 'index.php?c=Daidalos.Projects.genMask&amp;objid='.urlencode($key);\n $linkConf = '<a title=\"GenMask\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlConf.'\">'\n .Wgt::icon('daidalos/bdl_mask.png' , 'xsmall' , 'build').'</a>';\n\n $urlGenerate = 'index.php?c=Genf.Bdl.build&amp;objid='.urlencode($key);\n $linkGenerate = '<a title=\"Code generieren\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlGenerate.'\">'\n .Wgt::icon('daidalos/parser.png' , 'xsmall' , 'build').'</a>';\n\n\n $urlDeploy = 'index.php?c=Genf.Bdl.deploy&amp;objid='.urlencode($key);\n $linkDeploy = '<a title=\"Deploy the Project\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlDeploy.'\">'\n .Wgt::icon('genf/deploy.png' , 'xsmall' , 'deploy').'</a>';\n\n $urlRefreshDb = 'index.php?c=Genf.Bdl.refreshDatabase&amp;objid='.urlencode($key);\n $linkRefreshDb = '<a title=\"Refresh the database\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlRefreshDb.'\">'\n .Wgt::icon('daidalos/db_refresh.png' , 'xsmall' , 'sync db').'</a>';\n\n $urlSyncDb = 'index.php?c=Genf.Bdl.syncDatabase&amp;objid='.urlencode($key);\n $linkSyncDb = '<a title=\"Sync the database with the model\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlSyncDb.'\">'\n .Wgt::icon('daidalos/db_sync.png' , 'xsmall' , 'sync db').'</a>';\n\n $urlPatchDb = 'index.php?c=Genf.Bdl.createDbPatch&amp;objid='.urlencode($key);\n $linkPatchDb = '<a title=\"Create an SQL Patch to alter the database\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlPatchDb.'\" >'\n .Wgt::icon('genf/dump.png' , 'xsmall' , 'create alter patch').'</a>';\n\n $urlClean = 'index.php?c=Genf.Bdl.clean&amp;objid='.urlencode($key);\n $linkClean = '<a title=\"Projekt cleanen\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlClean.'\">'\n .Wgt::icon('genf/clean.png' , 'xsmall' , 'clean').'</a>';\n\n $body .= '<td valign=\"top\" >'.$row[0].'</td>'.NL;\n //$body .= '<td valign=\"top\" >'.$row[1].'</td>'.NL;\n $body .= '<td valign=\"top\" >'.$row[2].'</td>'.NL;\n $body .= '<td valign=\"top\" align=\"center\" >'.$linkConf.' | '.$linkGenerate.$linkDeploy.' | '.$linkSyncDb.' '.$linkRefreshDb.' '.$linkPatchDb.' | '.$linkClean.'</td>'.NL;\n\n $body .= '</tr>'.NL;\n\n $num ++;\n if ($num > $this->numOfColors)\n $num = 1;\n\n }// ENDE FOREACH\n\n $body .= \"</tbody>\".NL;\n //\\ Generieren des Bodys\n\n $html ='<table id=\"table_'.$this->name.'\" class=\"full\" >'.NL;\n $html .= $head;\n $html .= $body;\n $html .= '</table>'.NL;\n\n return $html;\n\n }", "public function header($Arr_Labels=false)\n\t{\n\t\t$this->Arr_Labels = $Arr_Labels;\n\n $Int_Column = 0;\n if ($Arr_Labels)\n {\n\t foreach ($Arr_Labels as $Str_Field => $Str_Label)\n\t\t\t{\n $Str_Column = $Str_Label;\n $this->Obj_Doc->getActiveSheet()->setCellValueByColumnAndRow($Int_Column, 1, $Str_Column);\n\t\t\t\t$Int_Column++;\n\t }\n\t\t}\n\t\telseif (isset($this->Arr_Data[0]))\n\t\t{\n\t foreach ($this->Arr_Data[0] as $Str_Field => $Str_Label)\n\t\t\t{\n\t\t\t\t$Int_Column++;\n $Str_Column = Inflector::humanize($Str_Field);\n $this->Obj_Doc->getActiveSheet()->setCellValueByColumnAndRow($Int_Column, 1, $Str_Column);\n\t }\n\t\t}\n\n\t\t//Set the worksheet styles.\n $this->Obj_Doc->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);\n //$this->Obj_Doc->getActiveSheet()->getStyle('A1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);\n //$this->Obj_Doc->getActiveSheet()->getStyle('A1')->getFill()->getStartColor()->setRGB('ffffff');\n $this->Obj_Doc->getActiveSheet()->duplicateStyle( $this->Obj_Doc->getActiveSheet()->getStyle('A1'), 'B1:'.$this->Obj_Doc->getActiveSheet()->getHighestColumn().'1');\n\n\t\tfor ($i = 1; $i <= $Int_Column; $i++)\n\t\t{\n $this->Obj_Doc->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setAutoSize(true);\n }\n\n\t\treturn $this;\n\t}", "protected function makeHeader()\n {\n }", "public static function htmlTable ($array, $tableHeadingSubstitutions = array (), $class = 'lines', $keyAsFirstColumn = true, $uppercaseHeadings = false, $allowHtml = false /* true/false/array(field1,field2,..) */, $showColons = false, $addCellClasses = false, $addRowKeyClasses = false, $onlyFields = array (), $compress = false, $showHeadings = true, $encodeEmailAddress = true)\r\n\t{\r\n\t\t# Check that the data is an array\r\n\t\tif (!is_array ($array)) {return $html = \"\\n\" . '<p class=\"warning\">Error: the supplied data was not an array.</p>';}\r\n\t\t\r\n\t\t# Return nothing if no data\r\n\t\tif (empty ($array)) {return '';}\r\n\t\t\r\n\t\t# Assemble the data cells\r\n\t\t$dataHtml = '';\r\n\t\tforeach ($array as $key => $value) {\r\n\t\t\tif (!$value || !is_array ($value)) {return $html = \"\\n\" . '<p class=\"warning\">Error: the supplied data was not a multi-dimensional array.</p>';}\r\n\t\t\t$headings = $value;\r\n\t\t\t$dataHtml .= \"\\n\\t\" . '<tr' . ($addRowKeyClasses ? ' class=\"' . htmlspecialchars ($key) . '\"' : '') . '>';\r\n\t\t\tif ($keyAsFirstColumn) {\r\n\t\t\t\t$thisCellClass = ($addCellClasses ? htmlspecialchars ($key) . ((is_array ($addCellClasses) && isSet ($addCellClasses[$key])) ? ' ' . $addCellClasses[$key] : '') : '') . ($keyAsFirstColumn ? ($addCellClasses ? ' ' : '') . 'key' : '');\r\n\t\t\t\t$dataHtml .= ($compress ? '' : \"\\n\\t\\t\") . (strlen ($thisCellClass) ? \"<td class=\\\"{$thisCellClass}\\\">\" : '<td>') . \"<strong>{$key}</strong></td>\";\r\n\t\t\t}\r\n\t\t\t$i = 0;\r\n\t\t\tforeach ($value as $valueKey => $valueData) {\r\n\t\t\t\tif ($onlyFields && !in_array ($valueKey, $onlyFields)) {continue;}\t// Skip if not in the list of onlyFields if that is supplied\r\n\t\t\t\t$i++;\r\n\t\t\t\t$data = $array[$key][$valueKey];\r\n\t\t\t\t$thisCellClass = ($addCellClasses ? htmlspecialchars ($valueKey) . ((is_array ($addCellClasses) && isSet ($addCellClasses[$valueKey])) ? ' ' . $addCellClasses[$valueKey] : '') : '') . ((($i == 1) && !$keyAsFirstColumn) ? ($addCellClasses ? ' ' : '') . 'key' : '');\r\n\t\t\t\t$htmlAllowed = (is_array ($allowHtml) ? (in_array ($valueKey, $allowHtml)) : $allowHtml);\t// Either true/false or an array of permitted fields where HTML is allowed\r\n\t\t\t\t$cellContents = ($htmlAllowed ? $data : htmlspecialchars ($data));\r\n\t\t\t\t$dataHtml .= ($compress ? '' : \"\\n\\t\\t\") . (strlen ($thisCellClass) ? \"<td class=\\\"{$thisCellClass}\\\">\" : '<td>') . ($encodeEmailAddress ? self::encodeEmailAddress ($cellContents) : $cellContents) . (($showColons && ($i == 1) && $data) ? ':' : '') . '</td>';\r\n\t\t\t}\r\n\t\t\t$dataHtml .= ($compress ? '' : \"\\n\\t\") . '</tr>';\r\n\t\t}\r\n\t\t\r\n\t\t# Construct the heading HTML\r\n\t\t$headingHtml = '';\r\n\t\tif ($tableHeadingSubstitutions !== false) {\r\n\t\t\t$headingHtml .= \"\\n\\t\" . '<tr>';\r\n\t\t\tif ($keyAsFirstColumn) {$headingHtml .= \"\\n\\t\\t\" . '<th></th>';}\r\n\t\t\t$columns = array_keys ($headings);\r\n\t\t\tforeach ($columns as $column) {\r\n\t\t\t\tif ($onlyFields && !in_array ($column, $onlyFields)) {continue;}\t// Skip if not in the list of onlyFields if that is supplied\r\n\t\t\t\t$columnTitle = (empty ($tableHeadingSubstitutions) ? $column : (isSet ($tableHeadingSubstitutions[$column]) ? $tableHeadingSubstitutions[$column] : $column));\r\n\t\t\t\t$headingHtml .= \"\\n\\t\\t\" . ($addCellClasses ? '<th class=\"' . $column . ((is_array ($addCellClasses) && isSet ($addCellClasses[$column])) ? ' ' . $addCellClasses[$column] : '') . '\">' : '<th>') . ($uppercaseHeadings ? ucfirst ($columnTitle) : $columnTitle) . '</th>';\r\n\t\t\t}\r\n\t\t\t$headingHtml .= \"\\n\\t\" . '</tr>';\r\n\t\t}\r\n\t\t\r\n\t\t# Construct the overall heading\r\n\t\t$html = \"\\n\\n\" . \"<table class=\\\"{$class}\\\">\";\r\n\t\tif ($showHeadings) {$html .= $headingHtml;}\r\n\t\t$html .= $dataHtml;\r\n\t\t$html .= \"\\n\" . '</table>';\r\n\t\t\r\n\t\t# Return the HTML\r\n\t\treturn $html;\r\n\t}", "public function Header() {\n\t\t$x = 0;\n\t\t$dx = 0;\n\t\tif ($this->rtl) {\n\t\t\t$x = $this->w + $dx;\n\t\t} else {\n\t\t\t$x = 0 + $dx;\n\t\t}\n\n\t\t// print the fancy header template\n\t\tif($this->print_fancy_header){\n\t\t\t$this->printTemplate($this->header_xobjid, $x, 0, 0, 0, '', '', false);\n\t\t}\n\t\tif ($this->header_xobj_autoreset) {\n\t\t\t// reset header xobject template at each page\n\t\t\t$this->header_xobjid = false;\n\t\t}\n\t\t\n\t\t$this->y = $this->header_margin;\n\t\t$this->SimpleHeader();\n\t\t//$tmpltBase = $this->MakePaginationTemplate();\n\t\t//echo $tmpltBase;die();\n\t\t//echo('trying to print header template: ');\n\t\t//$this->printTemplate($tmpltBase, $x, $this->y, 0, 0, '', '', false);\n\t\t//die();\n\t}", "function RowHeadFoot($data) {\n $nb = 0;\n for ($i = 0; $i < count($data); $i++)\n $nb = max($nb, $this->NbLines($this->widths[$i], $data[$i]));\n $h = 5 * $nb;\n //Issue a page break first if needed\n $this->CheckPageBreak($h);\n //Draw the cells of the row\n for ($i = 0; $i < count($data); $i++) {\n $w = $this->widths[$i];\n $a = isset($this->aligns[$i]) ? $this->aligns[$i] : 'L';\n //Save the current position\n $x = $this->GetX();\n $y = $this->GetY();\n //Draw the border\n $this->Rect($x, $y, $w, $h);\n //Print the text\n $this->SetFont('Arial', 'B', 7);\n $this->SetFillColor(203, 203, 203);\n $this->MultiCell($w, 5, $data[$i], 1, $a, true);\n //Put the position to the right of the cell\n $this->SetXY($x + $w, $y);\n }\n //Go to the next line\n $this->Ln($h);\n }", "public function generateDataTable($header,$result,$class=null,$sumColumn=null,$tableStyle='htmltable') {\n\t\tif($tableStyle!='htmltable')\n\t\t\treturn 'Style : '.$tableStyle.' not supported !';\n\n\t\tif($tableStyle=='htmltable')\n\t\t\t{\n\t\t\t$returnTable=$this->generateHtmlTableData($header,$result,$class,$sumColumn);\n\t\t\treturn $returnTable;\n\t\t\t}\n\n\t\treturn $tableContent;\n\t}", "public function renderTableHeader() {\n $cells = [];\n foreach ($this->columns as $column) {\n /* @var $column Column */\n $cells[] = $column->renderHeaderCell();\n }\n $content = $this->html()->tag('table-row', array('content' => implode('', $cells)), $this->headerRowOptions);\n\n if ($this->filterPosition == self::FILTER_POS_HEADER) {\n $content = $this->renderFilters() . $content;\n } elseif ($this->filterPosition == self::FILTER_POS_BODY) {\n $content .= $this->renderFilters();\n }\n\n return \"<thead>\\n\" . $content . \"\\n</thead>\";\n }", "function table_table_header_row($values)\n{\n\t$cells=new ocp_tempcode();\n\tforeach ($values as $value)\n\t{\n\t\t$cells->attach(do_template('TABLE_TABLE_HEADER_ROW_CELL',array('_GUID'=>'5002f54ccddf7259f3460d8c0759fd1a','VALUE'=>$value)));\n\t}\n\n\treturn do_template('TABLE_TABLE_HEADER_ROW',array('_GUID'=>'2f4095b8d30f50f34fdd6acf8dd566b1','CELLS'=>$cells));\n}", "public function buildHeader() {\n $header['label'] = $this->t('Label');\n $header['workflow'] = $this->t('Workflow');\n $header['status'] = $this->t('Status');\n $header['transition'] = $this->t('Transitions');\n $header['roles'] = $this->t('Email Roles');\n $header['author'] = $this->t('Email Author');\n $header['emails'] = $this->t('Adhoc Emails');\n return $header + parent::buildHeader();\n }", "public function getTableHeader()\n {\n $tableHead = null;\n $tableHead .= \"<thead>\";\n $tableHead .= \"<tr>\";\n $tableHead .= \"<th>Vecka</th>\";\n $tableHead .= \"<th>Måndag</th>\";\n $tableHead .= \"<th>Tisdag</th>\";\n $tableHead .= \"<th>Onsdag</th>\";\n $tableHead .= \"<th>Torsdag</th>\";\n $tableHead .= \"<th>Fredag</th>\";\n $tableHead .= \"<th>Lördag</th>\";\n $tableHead .= \"<th>Söndag</th>\";\n $tableHead .= \"</tr>\";\n $tableHead .= \"</thead>\";\n\n return $tableHead;\n }", "private function makeTDHeader($type,$header): void {\r\n\t\t$str_d = ($this->bCollapsed) ? ' style=\"display:none\"' : '';\r\n\t\techo '<tr'.$str_d.'>\r\n\t\t\t\t<td class=\"dBug_clickable_row dBug_'.$type.'Key\">' . $header . '</td>\r\n\t\t\t\t<td>';\r\n\t}", "public function docHeaderContent() {}", "public function getHeaderHTML()\n\t{\n\t\tif(!is_array($this->elements['header'])){\n\t\t\t// Headers are optional\n\t\t\treturn false;\n\t\t}\n\n\t\t# Header buttons can also be defined outside of the header key when defining modal vales.\n\t\t$this->elements['header']['buttons'] = array_merge($this->elements['header']['buttons'] ?: [], $this->buttons ?: []);\n\n\t\t# Add the required Bootstrap header class very first\n\t\t$this->elements['header']['class'] = str::getAttrArray($this->elements['header']['class'], \"modal-header\", $this->elements['header']['only_class']);\n\n\t\t# Draggable\n\t\t$this->elements['header']['class'][] = $this->draggable ? \"modal-header-draggable\" : false;\n\n\t\t# Styles\n\t\t$this->elements['header']['style'] = str::getAttrArray($this->elements['header']['style'], NULL, $this->elements['header']['only_style']);\n\n\t\t# Dropdown buttons\n\t\tif($this->elements['header']['buttons']){\n\t\t\t$buttons = Button::get($this->elements['header']);\n\t\t}\n\n\t\t# Button(s) in a row\n\t\t$button = Button::generate($this->elements['header']['button']);\n\n\t\tif($button){\n\t\t\t$button = \"<div class=\\\"btn-float-right\\\">{$button}</div>\";\n\t\t}\n\n\t\t# Accent\n\t\t$this->elements['header']['class'][] = str::getColour($this->accent, \"bg\");\n\n\t\t# Icon\n\t\tif(!$icon = Icon::generate($this->elements['header']['icon'])){\n\t\t\t//the icon attribute can either be in the header or in the main modal\n\t\t\t$icon = Icon::generate($this->icon);\n\t\t}\n\n\t\t# Badge\n\t\t$badge = Badge::generate($this->elements['header']['badge']);\n\n\t\t# ID\n\t\t$id = str::getAttrTag(\"id\", $this->elements['header']['id']);\n\n\t\t# Style\n\t\t$style = str::getAttrTag(\"style\", $this->elements['header']['style']);\n\n\t\t# Title colour\n\t\t$class[] = str::getColour($this->elements['header']['colour']);\n\n\t\t# Script\n\t\t$script = str::getScriptTag($this->elements['header']['script']);\n\n\t\t# The header title itself\n\t\t$title = $this->elements['header']['header'] . $this->elements['header']['title'] . $this->elements['header']['html'];\n\n\t\t# Title class\n\t\tif(!empty(array_filter($class))){\n\t\t\t$title_class = str::getAttrTag(\"class\", $class);\n\t\t\t$title = \"<span{$title_class}>$title</span>\";\n\t\t}\n\n\t\t# The div class\n\t\t$class = str::getAttrTag(\"class\", $this->elements['header']['class']);\n\n\t\t# If the modal can be dismissed\n\t\tif($this->dismissible !== false){\n\t\t\t$dismiss = <<<EOF\n<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\" title=\"Close this window\"></button>\nEOF;\n\t\t}\n\n\t\treturn <<<EOF\n<div{$id}{$class}{$style}>\n\t<div class=\"container\">\n \t\t<div class=\"row\">\n \t\t<div class=\"col-auto modal-title\">\n \t\t\t{$icon}{$title}{$badge}\n \t\t</div>\n \t\t<div class=\"col\">\n \t\t\t{$buttons}{$button}{$dismiss}\n \t\t</div>\n \t</div>\n\t</div>{$script}\n</div>\nEOF;\n\t}", "private function makeTableHeader($type,$header,$colspan=2): void {\r\n\t\tif(!$this->bInitialized) {\r\n\t\t\t$header = ' (' . $header . ') ';\r\n\t\t\t$this->bInitialized = true;\r\n\t\t}\r\n\t\t$str_i = ($this->bCollapsed) ? 'style=\"font-style:italic\" ' : '';\r\n\t\t\r\n\t\techo '<table class=\"dBug_table dBug_'.$type.'\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th '.$str_i.' class=\"dBug_clickable_table dBug_' . $type . 'Header\" colspan=\"' . $colspan . '\">' . $header . '</th>\r\n\t\t\t\t</tr>';\r\n\t}", "function create_pool_header()\n{\n $header =\n \"<thead>\n <tr>\n <th scope='col' class='rounded-company'>Pool</th>\n <th scope='col' class='rounded-q1'>Priority</th>\n <th scope='col' class='rounded-q1' colspan='2'>URL</th>\n <th scope='col' class='rounded-q1'>Gets</th>\n <th scope='col' class='rounded-q1'>Accepts</th>\n <th scope='col' class='rounded-q1'>Rejects</th>\n <th scope='col' class='rounded-q1'>Discards</th>\n <th scope='col' class='rounded-q1'>Stales</th>\n <th scope='col' class='rounded-q1'>Get Fails</th>\n <th scope='col' class='rounded-q1'>Rem fails</th>\n </tr>\n </thead>\";\n\n return $header;\n}", "protected function create_header_cell($content, $collCount)\n {\n return $this->create_cell(array('content'=>$content,'colCount'=>$collCount));\n }", "function print_header(){\n\t\tglobal $worksheet, $xlsRow;\n\t\tglobal $heading_name,$ORG_TITLE;\n\t\t\n\t\t$worksheet->set_column(0, 0, 5);\n\t\t$worksheet->set_column(1, 1, 40);\n\t\t$worksheet->set_column(2, 2, 27);\n\t\t$worksheet->set_column(3, 3, 25);\n\t\t$worksheet->set_column(4, 4, 12);\n\t\t$worksheet->set_column(5, 5, 5);\n\t\t$worksheet->set_column(6, 6, 4);\n\t\t$worksheet->set_column(7, 7, 4);\n\t\t$worksheet->set_column(8, 8, 4);\n\t\t$worksheet->set_column(9, 9, 4);\n\t\t$worksheet->set_column(10, 10, 4);\n\t\t$worksheet->set_column(11, 11, 4);\n\t\t$worksheet->set_column(12, 12, 18);\n\t\t$worksheet->set_column(13, 13, 25);\n\t\t$worksheet->set_column(14, 14, 5);\n\t\t$worksheet->set_column(15, 15, 8);\n\t\t$worksheet->set_column(16, 16, 28);\n\t\t$worksheet->set_column(17, 17, 15);\n\t\t$worksheet->set_column(18, 18, 20);\n\t\t$worksheet->set_column(19, 19, 12);\n\t\t$worksheet->set_column(20, 20, 8);\n\t\t$worksheet->set_column(21, 21, 12);\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"(1)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"(2)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 3, \"(3)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"(4)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"(5)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"(6)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 9, \"(7)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 12, \"(8)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 13, \"(9)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 14, \"(10)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 15, \"(11)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 16, \"(12)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 17,\"(13)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 18, \"(14)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 19, \"(15)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 20, \"(16)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 21, \"(17)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"ชื่อส่วนราชการ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 3, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"เลข\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\",0));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 9, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"L\", 0));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 12, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 13, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 14, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 15, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 16, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 17, \"พื้นที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 18, \"วุฒิการศึกษา/\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 19, \"อัตรา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 20, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 21, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ลำดับ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"ชื่อ-สกุล\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"ประจำตัว\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"เพศ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"เกิด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 9, \"บรรจุ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 12, \"หมวด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 13, \"ชื่อตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 14, \"ชั้น\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 15, \"ตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 16, \"ส่วนกลาง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 17, \"ปฏิบัติงาน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 18, \"ประกาศนียบัตร\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 19, \"เงินเดือน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 20, \"ปีที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\t\t\n\t\t$worksheet->write($xlsRow, 21, \"หมายเหตุ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\t\t\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 1, \"$ORG_TITLE\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"เขต/แขวง/ศูนย์\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 4, \"ประชาชน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"ว\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"ด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 8, \"ป\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 9, \"ว\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 10, \"ด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 11, \"ป\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 12, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 13, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 14, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 15, \"เลขที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 16, \"/ภูมิภาค\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 17, \"(จังหวัด)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 18, \"เฉพาะทาง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 19, \"ปัจจุบัน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 20, \"เกษียณ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 21, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t}", "public function generateHeaders()\n {\n // set our headers first.\n if ( $this->from !== null )\n {\n $this->setHeader( \"From\", ezcMailTools::composeEmailAddress( $this->from ) );\n }\n\n if ( $this->to !== null )\n {\n $this->setHeader( \"To\", ezcMailTools::composeEmailAddresses( $this->to ) );\n }\n if ( count( $this->cc ) )\n {\n $this->setHeader( \"Cc\", ezcMailTools::composeEmailAddresses( $this->cc ) );\n }\n if ( count( $this->bcc ) && $this->options->stripBccHeader === false )\n {\n $this->setHeader( \"Bcc\", ezcMailTools::composeEmailAddresses( $this->bcc ) );\n }\n\n $this->setHeader( 'Subject', $this->subject, $this->subjectCharset );\n\n $this->setHeader( 'MIME-Version', '1.0' );\n $this->setHeader( 'User-Agent', 'eZ Components' );\n $this->setHeader( 'Date', date( 'r' ) );\n $idhost = $this->from != null && $this->from->email != '' ? $this->from->email : 'localhost';\n if ( is_null( $this->messageId ) )\n {\n $this->setHeader( 'Message-Id', '<' . ezcMailTools::generateMessageId( $idhost ) . '>' );\n }\n else\n {\n $this->setHeader( 'Message-Id', $this->messageID );\n }\n\n // if we have a body part, include the headers of the body\n if ( is_subclass_of( $this->body, \"ezcMailPart\" ) )\n {\n return parent::generateHeaders() . $this->body->generateHeaders();\n }\n return parent::generateHeaders();\n }", "private function makeTableData(array $inputData)\n {\n // Empty template table elements.\n $td = new HtmlNode(kind: 'td');\n $th = new HtmlNode(kind: 'th');\n $span = new HtmlLeaf(kind: 'span');\n // Add dummy entries to fill last row\n $this->addDummyEntries($inputData);\n // Wrap top level nodes with table data or table header elements.\n $colCount = 1;\n $nodeCount = 1;\n $tableData = [];\n foreach ($inputData as $chunk) {\n $td_tmp = ($nodeCount <= $this->nCols & $this->enableHeaders)\n ? clone $th : clone $td;\n ++$nodeCount;\n // Check if input is of type htmlLeaf\n if ($chunk instanceof HtmlLeaf) {\n $td_tmp->appendChild($chunk);\n } else {\n $td_tmp->appendChild($span)->setContent(\"$chunk\");\n }\n\n // Reset $colCount at end of table row.\n $colCount = ($colCount == $this->nCols + 1) ? 1 : $colCount;\n // Style td and th\n $td_tmp->setAttributes(['class' => 'col' . $colCount]);\n $tableData[] = $td_tmp;\n ++$colCount;\n }\n return $tableData;\n }", "function outputHeader()\n {\n global $application;\n\n $output = '';\n if (!is_array($this -> _attrs))\n return $output;\n\n // output error column\n if (is_array($this -> _Errors) && !empty($this -> _Errors))\n $output .= $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'header-error.tpl.html',\n array()\n );\n\n foreach($this -> _attrs as $k => $v)\n {\n if ($v != 'YES')\n continue;\n\n $template_contents = array(\n 'HeaderName' => getMsg('SYS', @$this -> _headermap[$k])\n );\n $this -> _Template_Contents = $template_contents;\n $application -> registerAttributes($this -> _Template_Contents);\n $output .= $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'header-cell.tpl.html',\n array()\n );\n }\n\n return $output;\n }", "function headerTable($conn)\n\t{\n\t\t$query = $conn->query(\"SELECT * FROM `tbl_transaction` NATURAL JOIN `tbl_guest` WHERE `transaction_id` LIKE $_REQUEST[transaction_id] \") or die(mysql_error());\n\t\t$fetch = $query->fetch_array();\n\n\t\t$this->SetFont(\"Times\",\"I\",9);\n\t\t$this->Cell(18,7,\"RefNo. \",0,0);\n\t\t$this->Cell(35,7,\": hr-\".$fetch['transaction_id'],0,0);\n\t\t$this->SetFont(\"Arial\",\"\",9);\n\t\t$this->Cell(26,7,\"Reservation Date \",0,0);\n\t\t$this->Cell(35,7,\": \".$fetch['reserve_date'],0,1);\n\t\t$this->Cell(18,7,\"Guest \",0,0);\n\t\t$this->Cell(35,7,\": \".$fetch['name'].' '.$fetch['surname'],0,0);\n\t\t$this->Cell(26,7,\"Email Address \",0,0);\n\t\t$this->Cell(35,7,\": \".$fetch['email_id'],0,1);\n\t\t$this->Cell(188,4,\"\",0,1);\n\t\t$this->Ln(4);\n\n\t\t//Reservation Details Title\n\t\t$this->SetFont(\"Arial\",\"U\",12);\n\t\t$this->Cell(35,10,\"Reservation Details\",0,1);\n\t\t//header\n\t\t$this->SetFont('Times','B',12);\n\t\t$this->Cell(41,10,'Room Type',1,0,'C');\n\t\t$this->Cell(22,10,'Room No.',1,0,'C');\n\t\t$this->Cell(25,10,'Check in',1,0,'C');\n\t\t$this->Cell(13,10,'Days',1,0,'C');\n\t\t$this->Cell(25,10,'Check out',1,0,'C');\n\t\t$this->Cell(22,10,'Extra bed',1,0,'C');\n\t\t$this->Cell(42,10,'Bill',1,1,'C');\n\t\t//$this->Cell(18,10,'Payment',1,1,'C');\n\t\t//$this->Ln();\n\t}", "public function Header() {\n $bMargin = $this->getBreakMargin();\n\n // Get current auto-page-break mode\n $auto_page_break = $this->AutoPageBreak;\n\n // Disable auto-page-break\n $this->SetAutoPageBreak(false, 0);\n\n // Define the path to the image that you want to use as watermark.\n\t\tif($this->headerImage!='')\n\t\t{\n\t\t\t $header_logo = './'.$this->headerImage;\n\t\t\t \n\t\t}else{\n\t\t\t $header_logo = './assets/logo/Assetswatch.png';\n\t\t}\n\t\tif($this->watermarkImage!='')\n\t\t{\n\t\t\t$img_file = './'.$this->watermarkImage;\n\t\t}else{\n\t\t\t $img_file = './assets/logo/water-mark.png';\n\t\t}\n \n\t\t// echo $header_logo.\"<br>\";\n\t\t// echo $img_file.\"<br>\";\n\t\t // exit();\n // Render the image\n\t\t$this->Image($header_logo, 135,5, 55, 18, '', '', '', false, 300, '', false, false, 0);\n $this->Image($img_file, 53,100, '100px', '100px', '', '', '', false, 300, '', false, false, 0);\n\t\t\n\t\tif($this->headerContent!='')\n\t\t{\n\t\t\t$this->Cell(0, 10,$this->headerContent , 0, false, 'L', 0, '', 0, false, 'T', 'M');\n\t\t}else{\n\t\t\t$this->Cell(0, 10,'' , 0, false, 'C', 0, '', 0, false, 'T', 'M');\n\t\t}\n // Restore the auto-page-break status\n $this->SetAutoPageBreak($auto_page_break, $bMargin);\n\n // Set the starting point for the page content\n $this->setPageMark();\n }", "public function constructTableForHeader($stri_img=\"\",$stri_titre=\"\") \n\t{ \n //- constructio de l'interface\n $obj_table=parent::constructTableForHeader(\"images/mvc_imbrication.png\");\n \n return $obj_table;\t\n\t}", "public function buildHeader() {\n $this->build = [\n // '#type' => 'page',.\n 'container' => [\n '#type' => 'html_tag',\n '#tag' => 'div',\n '#attributes' => [\n 'class' => 'container',\n ],\n 'page_header' => [\n '#type' => 'html_tag',\n '#tag' => 'h2',\n '#value' => $this->t('<a href=\"@site-audit-uri\">Site Audit</a> report for @site', [\n '@site-audit-uri' => 'https://drupal.org/project/site_audit',\n '@site' => $this->options['uri'],\n ]),\n '#attributes' => [\n 'id' => 'page-header',\n ],\n 'br' => [\n '#type' => 'html_tag',\n '#tag' => 'br',\n ],\n 'sub_head' => [\n '#type' => 'html_tag',\n '#tag' => 'small',\n '#value' => $this->t('Generated on @date_time', ['@date_time' => \\Drupal::service('date.formatter')->format(\\Drupal::time()->getRequestTime())]),\n ],\n ],\n ],\n ];\n if (is_array($this->report)) {\n // There are multiple reports.\n $this->build['container']['summary'] = [\n '#type' => 'html_tag',\n '#tag' => 'div',\n '#attributes' => [\n 'id' => 'summary',\n ],\n ];\n $this->build['container']['summary']['title'] = [\n '#type' => 'html_tag',\n '#tag' => 'h2',\n '#value' => $this->t('Summary'),\n ];\n $this->build['container']['summary']['links'] = [\n '#type' => 'html_tag',\n '#tag' => 'p',\n ];\n foreach ($this->report as $report) {\n $this->build['container']['summary']['links'][$report->getPluginId()] = [\n '#type' => 'html_tag',\n '#tag' => 'a',\n '#value' => $report->getLabel() . ' (' . $report->getPercent() . '%)',\n '#attributes' => [\n 'href' => '#' . $report->getPluginId(),\n 'class' => $this->getPercentCssClass($report->getPercent()),\n ],\n ];\n }\n }\n }", "function FancyTable($header,$data)\n\t\t{\n\t\t\t$this->SetFillColor(255,0,0);\n\t\t\t$this->SetTextColor(255);\n\t\t\t$this->SetDrawColor(128,0,0);\n\t\t\t$this->SetLineWidth(.1);\n\t\t\t//$this->SetFont('arial','','B');\n\t\t\t$this->SetFontSize(8);\n\t\t\t//$this->SetLeftMargin(20);\n\t\t\t//Header\n\t\t\tif ($_SESSION['klik']=='Vkupno'){\n\t\t\t\t$w=array(25,36,25,25,25,25); //tuka se kazuva kolku i kolkavi koloni imame\n\t\t\t\t$this->SetLeftMargin(22);\n\t\t\t}\n\t\t\telseif ($_SESSION['klik']==\"Vkupno_saldo\"){\n\t\t\t\t$w=array(17,34,23,25,23,23,23,23);\n\t\t\t}\n\t\t\telseif($_SESSION['klik']=='Analitika'){\n\t\t\t\tif ($_SESSION['totfin']==1){\n\t\t\t\t\t$w=array(40,30,30,30,30);\n\t\t\t\t\t$this->SetLeftMargin(24);\n\t\t\t\t}else{\n\t\t\t\t\t$w=array(25,25,40,25,25,25,25);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor($i=0;$i<count($header);$i++)\n\t\t\t\t$this->Cell($w[$i],6,$header[$i],1,0,'C',true);\n\t\t\t$this->Ln();\n\t\t\t//Color and font restoration\n\t\t\t$this->SetFillColor(224,235,255);\n\t\t\t$this->SetTextColor(0);\n\t\t\t//$this->SetFont('Arial');\n\t\t\t$this->SetFontSize(8);\n\t\t\t//Data\n\t\t\t$fill=false;\n\t\t\t\n\t\t\tif ($_SESSION['klik']=='Vkupno'){\n\t\t\tforeach($data as $row)\n\t\t\t\t{ //tuka gi pravime kolonite\n\t\t\t\t$this->Cell($w[0],6,$row[1],'LR',0,'C',$fill);\n\t\t\t\t$this->Cell($w[1],6,$row[0],'LR',0,'C',$fill);\n\t\t\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[4],6,number_format($row[4]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[5],6,number_format($row[5]),'LR',0,'R',$fill);\n\t\t\t\t$this->Ln();\n\t\t\t\t$fill=!$fill;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($_SESSION['klik']==\"Vkupno_saldo\"){\n\t\t\t\tforeach($data as $row)\n\t\t\t\t{ //tuka gi pravime kolonite\n\t\t\t\t$this->Cell($w[0],6,$row[1],'LR',0,'C',$fill);\n\t\t\t\t$this->Cell($w[1],6,$row[0],'LR',0,'C',$fill);\n\t\t\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[4],6,number_format($row[4]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[5],6,number_format($row[5]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[6],6,number_format($row[6]),'LR',0,'R',$fill);\n\t\t\t\t$this->Cell($w[7],6,number_format($row[7]),'LR',0,'R',$fill);\n\t\t\t\t$this->Ln();\n\t\t\t\t$fill=!$fill;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($_SESSION['klik']=='Analitika'){\n\t\t\t\tif ($_SESSION['totfin']==1){\n\t\t\t\t\tforeach($data as $row)\n\t\t\t\t\t{ //tuka gi pravime kolonite\n\t\t\t\t\t$this->Cell($w[0],6,$row[4],'LR',0,'C',$fill);\n\t\t\t\t\t$this->Cell($w[1],6,number_format($row[7]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Cell($w[2],6,number_format($row[8]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Cell($w[3],6,number_format($row[9]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Cell($w[4],6,number_format($row[10]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Ln();\n\t\t\t\t\t$fill=!$fill;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tforeach($data as $row)\n\t\t\t\t\t{ //tuka gi pravime kolonite\n\t\t\t\t\t$this->Cell($w[0],6,$row[3],'LR',0,'C',$fill);\n\t\t\t\t\t$this->Cell($w[1],6,$row[2],'LR',0,'C',$fill);\n\t\t\t\t\t$this->Cell($w[2],6,$row[4],'LR',0,'C',$fill);\n\t\t\t\t\t$this->Cell($w[3],6,number_format($row[7]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Cell($w[4],6,number_format($row[8]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Cell($w[5],6,number_format($row[9]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Cell($w[6],6,number_format($row[10]),'LR',0,'R',$fill);\n\t\t\t\t\t$this->Ln();\n\t\t\t\t\t$fill=!$fill;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t$this->Cell(array_sum($w),0,'','T');\n\t\t}", "function showHeader(){\n\t\t$header = \"\";\n\t\t// print the header row\n\t\t$header .= \"\t<tr>\\n\";\n\t\t// loop the fields\n\t\tforeach ($this->fields as $field) {\n\t\t\t// print each field\n\t\t\t$header .= \"\t\t<th>\".$field.\"</th>\\n\";\n\t\t}\n\t\t// end the header row\n\t\t$header .= \"\t</tr>\\n\";\n\t\treturn $header;\n\t}", "public function Header() {\r\n $this->varcave->logger->debug('Create PDF top header');\r\n\t\tif ($this->noheader){\r\n\t\t\treturn true;\r\n\t\t}\r\n // Logo\r\n\t\t$this->setFont($this->font, 'BI', 8, '', 'false');\r\n\t\t$this->Image($this->headerImg,4,4,170);\r\n\t\t\r\n\t\t//text box after header image\r\n\t\t$this->RoundedRect(172,4,35,10,3.5,'D');\r\n\t\t$this->SetXY(173,5);\r\n\t\t$this->cell(0,3, LNE::pdf_caveRef . ': ' . $this->cavedata['caveRef'],0);\r\n\t\t$this->SetXY(173,9);\r\n\t\t//If pagegroup is on set group page number, or set a global PDF page number \r\n\t\tif ( $this->pagegroups == false )\r\n\t\t{\r\n\t\t\t$this->cell(0,3,LNE::pdf_page. ': '. $this->getAliasNumPage() . '/' . $this->getAliasNbPages(),0);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->cell(0,3,LNE::pdf_page .': '. $this->getPageGroupAlias(). '-'.$this->getPageNumGroupAlias() ,0);\r\n\t\t}\r\n\t\t\r\n }", "public function renderTableHeader()\n {\n $cells = [];\n foreach ($this->columns as $column) {\n /* @var $column Column */\n $cells[] = $column->renderHeaderCell();\n }\n $content = Html::tag('tr', implode('', $cells), $this->headerRowOptions);\n if ($this->filterPosition === self::FILTER_POS_HEADER) {\n $content = $this->renderFilters() . $content;\n } elseif ($this->filterPosition === self::FILTER_POS_BODY) {\n $content .= $this->renderFilters();\n }\n\n return \"<thead>\\n\" . $content . \"\\n</thead>\";\n }", "function drawHeader(){\n switch ($this->doing){\n case 'budget_byProjects':\n case 'myguests':\n if (!(@$this->t instanceof b_table)){\n\t$this->dbg('CANCEL header');\n\t$this->t = new b_table_dummy();\n }\n break;\n\n default:\n parent::drawHeader();\n break;\n }\n }", "protected function buildDomainObject($row) {\n\t\t$header = new Header();\n\t\t$header->setId($row['header_id']);\n\t\t$header->setText($row['header_text']);\n\t\treturn $header;\n\t}", "function Header()\n\t{\n\t\tglobal $TAHUN;\n\t\tglobal $gelom;\n\t\tglobal $np;\n\t\t$this->Image('umg.jpg',2.5,0.7,1.8,1.8);\t\n\t\t$this->SetY(1);\n\t\t$this->SetFont('Times','',10);\t\t\n\t\tif($np=='1') { $test= 'BEBAS TEST'; }\n\t\tif($np=='2') { $test= 'TEST'; }\n\t\t$this->Cell(19,0.5,'UNIVERSITAS MUHAMMADIYAH GRESIK',0,0,'C'); \t\t\n\t\t$this->Ln();\n\t\t$this->Cell(19,0.5,'DAFTAR '.$test.' CALON MAHASISWA BARU',0,0,'C');\t\t\t\t\n\t\t$this->Ln();\n\t\t$this->Cell(19,0.5,'TAHUN '.$TAHUN.' GELOMBANG '.$gelom,0,0,'C');\t\t\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('Arial','B',8);\n\t\t$this->Ln();\n\t\t$this->Cell(1.2,0.5,'No','LBRT',0,'C');\n\t\t$this->Cell(2.8,0.5,'Nomor Pendaftaran','LBRT',0,'C');\n\t\tif($np=='1') \n\t\t{ \n\t\t\t$this->Cell(10.8,0.5,'Nama Calon Mahasiswa','LBRT',0,'C');\n\t\t}\n\t\tif($np=='2') \n\t\t{ \n\t\t\t$this->Cell(2.8,0.5,'Nomor Ujian','LBRT',0,'C');\n\t\t\t$this->Cell(8,0.5,'Nama Calon Mahasiswa','LBRT',0,'C');\n\t\t}\n\t\t$this->Cell(4.2,0.5,'Jurusan','LBRT',0,'C');\n\t\t$this->Ln();\n\t}", "public function render()\n\t{\n\n\t\t$table = \"<table\";\n\n\t\t// Add all attributes\n\t\tforeach ($this->attributes as $key => $value) {\n\t\t\t$table .= ' ' . $key . '=\"' . $value .'\"';\n\t\t}\n\n\t\t$table .= \">\"; // Close table\n\n\t\t// Add the head\n\t\tif ($this->showHeadRow) {\n\t\t\t$table .= \"<thead><tr>\";\n\n\t\t\t// Show the number header.\n\t\t\tif ($this->showNumberColumn) {\n\t\t\t\t$table .= \"<th>#</th>\";\n\t\t\t}\n\n\t\t\tforeach ($this->columns as $column) {\n\t\t\t\t$columnHeadTitle = isset($column['headTitle']) ? $column['headTitle'] : $column[0];\n\t\t\t\t$table .= \"<th>\" . $columnHeadTitle . \"</th>\";\n\t\t\t}\n\n\t\t\t$table .= \"</tr></thead>\"; // finish head\n\t\t}\n\n\t\t// Body\n\t\t$table .= \"<tbody>\";\n\n\t\t$row = $this->numberColumnOffset;\n\n\t\tif (count($this->data) == 0) {\n\t\t\t// Show a no data entry\n\t\t\t$colspan = count($this->columns) + ($this->showNumberColumn ? 1 : 0);\n\t\t\t$table .= '<tr><td colspan=\"'.$colspan.'\"><p align=\"center\" style=\"font-weight:bold;\">Keine Einträge</p></td></tr>';\n\t\t}\n\t\telse {\n\t\t\tforeach ($this->data as $dataObject) {\n\n\t\t\t\t// Row attributes\n\t\t\t\t$attributes = $this->rowAttributes;\n\t\t\t\tif (!is_array($attributes)) {\n\t\t\t\t\tif (is_callable($this->rowAttributes)) {\n\t\t\t\t\t\t$callable = $this->rowAttributes;\n\t\t\t\t\t\t$attributes = $callable($dataObject);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$attributeString = '';\n\t\t\t\tif ($attributes) {\t\t// Add attributes if we have some\n\t\t\t\t\tforeach ($attributes as $attributeName => $attributeValue) {\n\t\t\t\t\t\t$attributeString .= $attributeName . '=\"' . $attributeValue . '\" ' ;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->rowIdDataMethod) {\n\t\t\t\t\t// method name or closure?\n\t\t\t\t\t$id = '';\n\t\t\t\t\tif (is_string($this->rowIdDataMethod)) {\n\t\t\t\t\t\t$id = $dataObject->{$this->rowIdDataMethod}(); // Call the row data method\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$rf = new \\ReflectionFunction($this->rowIdDataMethod);\n\t\t\t\t\t\tif ($rf->isClosure()) {\n\t\t\t\t\t\t\t// we got a closure\n\t\t\t\t\t\t\t$closure = $this->rowIdDataMethod;\n\t\t\t\t\t\t\t$id = $closure($dataObject);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t$table .= '<tr id=\"'. $id .'\" ' . $attributeString . '>'; // Start row with id\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$table .= \"<tr \". $attributeString .\">\";\t// Start row without id\n\t\t\t\t}\n\n\t\t\t\t// Number?\n\t\t\t\tif ($this->showNumberColumn) {\n\t\t\t\t\t$table .= \"<td>\" . $row . \"</td>\";\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->columns as $column) {\n\t\t\t\t\t$dataMethod = isset($column['dataMethod']) ? $column['dataMethod'] : $column[1];\n\t\t\t\t\tif (is_string($dataMethod)) {\n\t\t\t\t\t\t// Just call the method an insert the return value into the table cell\n\t\t\t\t\t\t$table .= \"<td>\". $dataObject->$dataMethod() .\"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$rf = new \\ReflectionFunction($dataMethod);\n\t\t\t\t\t\tif ($rf->isClosure()) {\n\n\t\t\t\t\t\t\t// Call the closure and get the result\n\t\t\t\t\t\t\t$value = $dataMethod($dataObject, $this);\n\n\t\t\t\t\t\t\t$table .= \"<td>\". $value .\"</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$table .= \"</tr>\";\t// End the table row\n\t\t\t\t$row++;\n\t\t\t}\n\n\t\t\t// Render the footer row\n\t\t\t$table = $this->renderFooter($table);\n\n\t\t}\n\n\t\t$table .= \"</tbody>\";\n\n\t\t$table .= \"</table>\";\n\t\treturn $table;\n\t}", "private function createHeaders($headers) {\r\n $html = '<tr class=\"ctable-headertag\">';\r\n foreach ($headers as $index => $header) {\r\n $html .= '<th>' . $header . '</th>';\r\n }\r\n $html .= '</tr>';\r\n return $html;\r\n\r\n }", "private function setTableHeader($row){\n\t\t$header_data=false;\n\t\tif($this->header){\n\t\t\t$header_data=$this->header;\n\t\t}\n\t\telse{\n\t\t\tif(!empty($row) && is_array($row) && count($row)){\n\t\t\t\tforeach($row as $i => $v){\n\t\t\t\t\t$header_data[$i]=$i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!empty($header_data)){\n\t\t\t$this->table_header.=_N_T.'<tr>';\n\t\t\t$this->table_header.=_N_T_T.'<th class=\"th.LineNum\">#</th>';\n\t\t\tforeach($header_data as $name => $value){\n\t\t\t\t$this->table_header.=_N_T_T.'<th nowrap=\"nowrap\">'.$value.$this->getOrderBy($name).'</th>';\n\t\t\t}\n\t\t\t$this->table_header.=_N_T.'</tr>';\n\t\t}\n\t\treturn $this;\n\t}", "static function generateTableHeaderHTML()\n\t{\n\t\techo \"<p class=left>Description:</p>\\n\";\n\t}", "static function generateTableHeaderHTML($a_div)\n\t{\n\t\techo \"<tr class='inTableRow'>\\n\";\n//\t\techo \"<th class='inTableColTaskID'>Task ID</th>\\n\";\n\t\techo \"<th class='inTableColTaskName'>{$a_div}</th>\\n\";\n\t\techo \"<th>Subcontractor</th>\\n\";\n\t\techo \"<th class='chTableColAmount'>Amount</th>\\n\";\n\t\techo \"<th>Notes</th>\\n\";\n\t\techo \"</tr>\\n\";\n\t}", "public function buildTable($data, $layout = null)\n {\n $resultHead = $result = '';\n if (is_array($data)) {\n $tableLayout = is_array($layout) ? $layout : $this->getTableLayout();\n $rowCount = 0;\n foreach ($data as $tableRow) {\n if ($rowCount % 2) {\n $layout = isset($tableLayout['defRowOdd']) ? $tableLayout['defRowOdd'] : $tableLayout['defRow'];\n } else {\n $layout = isset($tableLayout['defRowEven']) ? $tableLayout['defRowEven'] : $tableLayout['defRow'];\n }\n $rowLayout = isset($tableLayout[$rowCount]) ? $tableLayout[$rowCount] : $layout;\n $rowResult = '';\n if (is_array($tableRow)) {\n $cellCount = 0;\n foreach ($tableRow as $tableCell) {\n $cellWrap = isset($layout[$cellCount]) ? $layout[$cellCount] : $layout['defCol'];\n $cellWrap = isset($rowLayout['defCol']) ? $rowLayout['defCol'] : $cellWrap;\n $cellWrap = isset($rowLayout[$cellCount]) ? $rowLayout[$cellCount] : $cellWrap;\n $rowResult .= $cellWrap[0].$tableCell.$cellWrap[1];\n ++$cellCount;\n }\n }\n $rowWrap = isset($layout['tr']) ? $layout['tr'] : ['<tr>', '</tr>'];\n $rowWrap = isset($rowLayout['tr']) ? $rowLayout['tr'] : $rowWrap;\n\n if (isset($tableLayout['headRows']) && in_array($rowCount, $tableLayout['headRows'])) {\n $resultHead .= $rowWrap[0].$rowResult.$rowWrap[1];\n } else {\n $result .= $rowWrap[0].$rowResult.$rowWrap[1];\n }\n ++$rowCount;\n }\n if (isset($tableLayout['headRows'])) {\n $result = '<thead>'.$resultHead.'</thead><tbody>'.$result.'</tbody>';\n } else {\n $result = $resultHead.$result;\n }\n $tableTag = '<table class=\"table table-striped table-hover table-condensed\">';\n $tableWrap = isset($tableLayout['table']) ? $tableLayout['table'] : [$tableTag, '</table>'];\n $result = $tableWrap[0].$result.$tableWrap[1];\n }\n\n return $result;\n }", "function build_html_table_top(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '\n\t\t\t\t\t<table style=\"border: 1px solid #FFFFFF; width:100%; table-layout: fixed;\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 11%;\"><font color=\"ffd700\">Date Visited</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 11%;\"><font color=\"ffd700\">IP Address</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 7%;\"><font color=\"ffd700\">OS</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 7%;\"><font color=\"ffd700\">Browser Name</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 8%;\"><font color=\"ffd700\">Browser Version</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 15%;\"><font color=\"ffd700\">Referer Page</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 15%;\"><font color=\"ffd700\">Request Page</font></th>\n\t\t\t\t\t\t</tr>';\n\t\t\t\t\t\t\n\t\treturn $output;\n\t\t\n\t}", "public function makeTableView($headings, $content, $idFieldName, $viewURL);", "function DisplayTableHeader()\n{\n\t$pdf = $GLOBALS['pdf'];\n\t$width_col_no = $GLOBALS['width_col_no'];\n\t$sync_name_index = $GLOBALS['sync_name_index'];\n\t$collectionWidth = $GLOBALS['collectionWidth'];\n\t$totalWidth = $GLOBALS['totalWidth'];\n\n\t//setkan font jadi bold untuk header\n\t$pdf->SetFont('helvetica','B',9);\n\n\t//koleksi tinggi column header\n\t$header_cols_height = array();\n\n\t//tinggi untuk column 'No'\n\t$header_cols_height[] = $pdf->getNumLines('No',$width_col_no);\n\n\t//dapatkan tinggi untuk setiap column\n\tforeach ($sync_name_index as $key => $value)\n\t{\n\t\t$width_converted = GetAndConvertColumnWidth($value, $sync_name_index, $collectionWidth, $totalWidth, $pdf);\n\t\t$header_cols_height[] = $pdf->getNumLines($value,$width_converted);\n\t}\n\n\t//cari siapa paling tinggi\n\t$max_height = max($header_cols_height);\n\n\t//display\n\t$pdf->SetFillColor(211,211,211);\n\n\t$pdf->MultiCell($w=$width_col_no, $h=5*$max_height+3, $txt='No', $border=1, $align='L', $fill=1, $ln=0, $x='', $y='', $reseth=true, $stretch=0, $ishtml=true, $autopadding=true, $maxh=$h, $v='M');\n\tforeach ($sync_name_index as $key => $value)\n\t{\n\t\t$width_converted = GetAndConvertColumnWidth($value, $sync_name_index, $collectionWidth, $totalWidth, $pdf);\n\t\t$pdf->MultiCell($w=$width_converted, $h=5*$max_height+3, $txt=$value, $border=1, $align='C', $fill=1, $ln=0, $x='', $y='', $reseth=true, $stretch=0, $ishtml=true, $autopadding=true, $maxh=$h, $v='M');\n\t}\n\n\t//reset font\n\t$pdf->SetFont('helvetica','',9);\n\t$pdf->Ln();\n}", "private function createCells($data){\r\n $html = '';\r\n foreach ($data AS $index => $row) {\r\n $html .= '<tr class=\"ctable-rows\">';\r\n foreach ($row as $rownr => $data) {\r\n $html .= '<td>' . $data . '</td>';\r\n }\r\n $html .= '</tr>';\r\n }\r\n return $html;\r\n }", "abstract protected function getRowsHeader(): array;", "public function addTableHeader($data, $params = array(), $cell_end = 'H') {\n // offset\n $offset = 0;\n if (isset($params['offset']))\n $offset = is_numeric($params['offset']) ? (int)$params['offset'] : PHPExcel_Cell::columnIndexFromString($params['offset']);\n\n // font name\n if (isset($params['font']))\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getFont()->setName($params['font']);\n\n // font size\n if (isset($params['size']))\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getFont()->setSize($params['size']);\n\n // bold\n if (isset($params['bold']))\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getFont()->setBold($params['bold']);\n\n // italic\n if (isset($params['italic']))\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getFont()->setItalic($params['italic']);\n\n // horizontal\n if (isset($params['horizontal'])) {\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getAlignment()->setHorizontal($params['horizontal']);\n }\n\n // text color\n if (isset($params['text_color'])) {\n $this->_xls->getActiveSheet()->getStyle(sprintf('A3:%s3', $cell_end))->getFont()->getColor()->setRGB($params['text_color']);\n }\n\n // fill color\n if (isset($params['fill_color'])) {\n $this->_xls->getActiveSheet()->getStyle(sprintf('A3:%s3', $cell_end))->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setRGB($params['fill_color']);\n }\n\n // set internal params that need to be processed after data are inserted\n $this->_tableParams = array(\n 'header_row' => $this->_row,\n 'offset' => $offset,\n 'row_count' => 0,\n 'auto_width' => array(),\n 'filter' => array(),\n 'wrap' => array(),\n 'horizontal' => false,\n 'fill_color' => false,\n 'text_color' => false,\n );\n\n if( !empty($data) ) {\n foreach ($data as $d) {\n $child = Common::hashEmptyField($d, 'child');\n\n // set label\n $this->_xls->getActiveSheet()->setCellValueByColumnAndRow($offset, $this->_row, $d['label']);\n\n // set width\n if (isset($d['width']) && is_numeric($d['width']))\n $this->_xls->getActiveSheet()->getColumnDimensionByColumn($offset)->setWidth((float)$d['width']);\n else\n $this->_tableParams['auto_width'][] = $offset;\n\n // filter\n if (isset($d['filter']) && $d['filter'])\n $this->_tableParams['filter'][] = $offset;\n\n // wrap\n if (isset($d['wrap']) && $d['wrap'])\n $this->_tableParams['wrap'][] = $offset;\n\n // fill color\n if (isset($d['fill_color']) && $d['fill_color'])\n $this->_tableParams['fill_color'][] = $offset;\n\n // text color\n if (isset($d['text_color']) && $d['text_color'])\n $this->_tableParams['text_color'][] = $offset;\n\n if( !empty($child) ) {\n $childRow = $this->_row+1;\n\n if( !isset($childOffset) ) {\n $childOffset = $offset;\n }\n\n foreach ($child as $key => $val) {\n $label = Common::hashEmptyField($val, 'label');\n $width = Common::hashEmptyField($val, 'width');\n\n $childOffsetAcii = 1+$childOffset;\n $childOffsetAcii = Common::getNameFromNumber($childOffsetAcii);\n $childPosition = sprintf('%s%s:%s%s', $childOffsetAcii, $childRow, $childOffsetAcii, $childRow);\n\n $this->_xls->getActiveSheet()->setCellValueByColumnAndRow($childOffset, $childRow, $label);\n \n if (isset($width) && is_numeric($width))\n $this->_xls->getActiveSheet()->getColumnDimensionByColumn($childOffset)->setWidth((float)$width);\n else\n $this->_tableParams['auto_width'][] = $childOffset;\n\n // text color\n if (isset($params['text_color'])) {\n $this->_xls->getActiveSheet()->getStyle($childPosition)->getFont()->getColor()->setRGB($params['text_color']);\n }\n\n // fill color\n if (isset($params['fill_color'])) {\n $this->_xls->getActiveSheet()->getStyle($childPosition)->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setRGB($params['fill_color']);\n }\n\n // horizontal\n if (isset($params['horizontal'])) {\n $this->_xls->getActiveSheet()->getStyle($childRow)->getAlignment()->setHorizontal($params['horizontal']);\n }\n\n $childOffset++;\n }\n }\n\n if( !empty($d['rowspan']) ) {\n $rowspan = $d['rowspan']-1;\n $default = 1+$offset;\n $row = $this->_row;\n $cell_end = $row+$rowspan; // Acii A\n\n $default = Common::getNameFromNumber($default);\n $this->_xls->getActiveSheet()->mergeCells(__('%s%s:%s%s', $default, $row, $default, $cell_end));\n // $this->_row += $rowspan;\n // $offset++;\n }\n if( !empty($d['colspan']) ) {\n $colspan = $d['colspan']-1;\n $default = 1+$offset;\n $dimensi = $default+$colspan; // Acii A\n $row = $this->_row;\n\n $default = Common::getNameFromNumber($default);\n $cell_end = Common::getNameFromNumber($dimensi);\n\n $this->_xls->getActiveSheet()->mergeCells(__('%s%s:%s%s', $default, $row, $cell_end, $row));\n \n $offset += $colspan;\n // $this->_row ++;\n }\n\n $offset++;\n }\n }\n\n $child = Set::extract('/child', $data);\n\n if ( !empty($child) ) {\n $this->_row++;\n }\n \n $this->_row++;\n\n return $this;\n }" ]
[ "0.72196996", "0.7174281", "0.7061431", "0.70035684", "0.67965704", "0.6398219", "0.63580745", "0.6276241", "0.6273534", "0.6235406", "0.6232775", "0.6153025", "0.61525357", "0.6145799", "0.6129893", "0.61240304", "0.6113651", "0.6098646", "0.607836", "0.60606176", "0.60572624", "0.60476136", "0.60165054", "0.60082036", "0.60063833", "0.6000388", "0.5999256", "0.59976804", "0.59922206", "0.5991171", "0.59876245", "0.5981596", "0.5978648", "0.59673023", "0.59661144", "0.5963181", "0.59609723", "0.5956889", "0.5955098", "0.5927352", "0.5917299", "0.59154004", "0.59034556", "0.5894725", "0.58812445", "0.58756673", "0.58730155", "0.58680403", "0.5863015", "0.58576566", "0.58574784", "0.5847663", "0.58472884", "0.5840377", "0.58360416", "0.5834569", "0.583259", "0.58316624", "0.58237046", "0.58183384", "0.58146983", "0.5814677", "0.580639", "0.5802282", "0.5791652", "0.5790722", "0.5785978", "0.5774294", "0.57707584", "0.57690006", "0.5761865", "0.5761105", "0.5759291", "0.5747293", "0.5746991", "0.57371217", "0.5732555", "0.5727588", "0.5727342", "0.57272846", "0.57242477", "0.5723267", "0.5702265", "0.5702067", "0.570156", "0.56999844", "0.5697156", "0.5694585", "0.5693977", "0.5686119", "0.56819797", "0.5678819", "0.5671576", "0.56692636", "0.5667407", "0.5663085", "0.565631", "0.5650634", "0.565034", "0.5632595" ]
0.59483683
39
Creates a cell for the build report
protected function create_cell($params = array()) { $cellObj = new stdClass(); if($params) { foreach($params AS $name=>$value) { $cellObj->$name = $value; } } return $cellObj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function buildReport();", "public function build_table()\n {\n if (count($this->properties) > 0)\n {\n foreach ($this->properties as $property => $values)\n {\n $contents = array();\n $contents[] = $property;\n \n if (! is_array($values))\n {\n $values = array($values);\n }\n \n if (count($values) > 0)\n {\n foreach ($values as $value)\n {\n $contents[] = $value;\n }\n }\n \n $this->addRow($contents);\n }\n \n $this->setColAttributes(0, array('class' => 'header'));\n }\n else\n {\n $contents = array();\n $contents[] = Translation::get('NoResults', null, Utilities::COMMON_LIBRARIES);\n $row = $this->addRow($contents);\n $this->setCellAttributes($row, 0, 'style=\"font-style: italic;text-align:center;\" colspan=2');\n }\n }", "function genrate_inspectorvehiclelogsheet_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(17,20,15,15,18,14,13,13,15,25,25);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+125);\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, ucfirst($vc_customer_name),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+25);\n\t\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(165, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(165, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\t\t}\n\t}\n\t\n\t\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0 ){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($c == 4 || $c == 7 || $c == 8 || $c == 1|| $c == 9){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n\t\t\t\tif($c==$length ){\n\n\t\t\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\n\t\t\t\t\t$this->SetY($y); //Reset the write point\n\n\t\t\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\n\t\t\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\n\t\t\t\t\t$this->SetY($y); //Reset the write point\n\n\t\t\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $LogDate = !empty ($val['VehicleLogDetail']['dt_log_date']) ? \n date('d M Y', strtotime($val['VehicleLogDetail']['dt_log_date'])):\n '';\n\t\t $vc_customer_name=\t\tucfirst($val['VehicleLogMaster']['vc_customer_name']);\n\t\t $vc_vehicle_reg_no=\t\t$val['VehicleDetail']['vc_vehicle_reg_no'];\n\t\t $vc_vehicle_lic_no=\t\t$val['VehicleLogDetail']['vc_vehicle_lic_no'];\n\t\t $vc_driver_name=\t\t$val['VehicleLogDetail']['vc_driver_name'];\n\t\t\t$StartOMet = \t\t\tisset($val['VehicleLogDetail']['nu_start_ometer']) ?$val['VehicleLogDetail']['nu_start_ometer']:'';\n\t\t $EndOMet = \t\t\t\tisset($val['VehicleLogDetail']['nu_end_ometer']) ?$val['VehicleLogDetail']['nu_end_ometer']:'';\n\t\t\t\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1){\n\t\t\t\n\t\t\t$origin = $val['VehicleLogDetail']['vc_other_road_orign_name'];\n\t\t\t$destination = $val['VehicleLogDetail']['vc_other_road_destination_name'];\n\t\t\t//$kmtravldnamroad = number_format($val['VehicleLogDetail']['nu_km_traveled']);\n\t\t\t$KmTraV = $val['VehicleLogDetail']['nu_other_road_km_traveled'];\n\t\t\t\n\t\t\t}else{\n\t\t\t\n\t\t\t$origin = $val['VehicleLogDetail']['vc_orign_name'];\n\t\t\t$destination = $val['VehicleLogDetail']['vc_destination_name'];\n\t\t\t$KmTraV = $val['VehicleLogDetail']['nu_km_traveled'];\n\t\t\t//$kmtrvldotheroad = number_format($val['VehicleLogDetail']['nu_other_road_km_traveled']);\n\t\t\t\n\t\t\t}\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1)\n\t\t\t$ch_road_type= 'Other Road';\n\t\t\telse\n\t\t\t$ch_road_type= 'Namibian Road';\n\t\t\t\t\t\t\t\n\t\t\t\n//\t\t\t$vc_orign_name =\t\t$val['VehicleLogDetail']['vc_orign_name'];\n\t//\t $vc_destination_name=\t$val['VehicleLogDetail']['vc_destination_name'];\n\t\t//\t$KmTraV = \t\t\t\tisset($val['VehicleLogDetail']['nu_km_traveled']) ?$val['VehicleLogDetail']['nu_km_traveled']:'';\n\t\t // $KmTravOth = \t\t\tisset($val['VehicleLogDetail']['nu_other_road_km_traveled']) ?$val['VehicleLogDetail']['nu_other_road_km_traveled']:'';\n\n\t\t\t$font_size = 7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$col[] = array('text' => $LogDate, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_driver_name, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='R';\n\t\t\t\n\t\t\t$col[] = array('text' => number_format($StartOMet), 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => number_format($EndOMet), 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $ch_road_type, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t$col[] = array('text' => $origin, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' =>$destination, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='R';\n\t\t\t\n\t\t\t$col[] = array('text' =>number_format($KmTraV), 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\n\t\t}\n\t\n\t}", "protected function set_up_blank_object()\n {\n return $this->create_cell(array('content'=>'','colCount'=>1));\n }", "function genrate_inspectorvehicleloghistory_pdf($columnsValues,$data,$vehicletype,$allconstants,$profile,$toDate=null,$fromDate=null,$vehiclelicno=null) {\n \n\t\t$columnwidtharrays = array(15,17,16,20,15,15,15,15,27,16,18);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vehicletype) && !empty($vehicletype)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Type :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(39, 8, $allconstants[$vehicletype],0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\n\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\n\t\t$c = 0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t \n\n\t\t if( $c == 0 || $c ==3 || $c ==6 || $c ==7|| $c ==9|| $c ==8){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 12, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 12, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 6, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $dt_log_date = \t\t\tdate('d M Y', strtotime($val['VehicleLogDetail']['dt_log_date']));\n\t\t $vc_vehicle_reg_no=\t\t$val['VehicleLogDetail']['vc_vehicle_reg_no'];\n\t\t $vc_vehicle_lic_no=\t\t$val['VehicleLogDetail']['vc_vehicle_lic_no'];\n\t\t $vc_driver_name= \t\t$val['VehicleLogDetail']['vc_driver_name'];\n\t\t $nu_start_ometer=\t\tnumber_format($val['VehicleLogDetail']['nu_start_ometer']);\n\t\t\t$nu_end_ometer = \t\tnumber_format($val['VehicleLogDetail']['nu_end_ometer']);\n\t\t\t\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1){\n\t\t\t\t\n\t\t\t\t$origin = $val['VehicleLogDetail']['vc_other_road_orign_name'];\n\t\t\t\t$destination = $val['VehicleLogDetail']['vc_other_road_destination_name'];\n\t\t\t\t$nu_km_traveled = number_format($val['VehicleLogDetail']['nu_other_road_km_traveled']);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\n\t\t\t\t$origin = $val['VehicleLogDetail']['vc_orign_name'];\n\t\t\t\t$destination = $val['VehicleLogDetail']['vc_destination_name'];\n\t\t\t\t$nu_km_traveled = number_format($val['VehicleLogDetail']['nu_km_traveled']);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1)\n\t\t\t\t$ch_road_type = 'Other Road';\n\t\t\telse\n\t\t\t\t$ch_road_type = 'Namibian Road';\n\t\t\t\t\t\t\t\n\t\t // $vc_orign_name = \t\t$val['VehicleLogDetail']['vc_orign_name'];\n\t\t // $vc_destination_name = \t$val['VehicleLogDetail']['vc_destination_name'];\n\t\t // $nu_km_traveled = \t\tnumber_format($val['VehicleLogDetail']['nu_km_traveled']);\n\t\t // $nu_other_road_km_traveled = number_format($val['VehicleLogDetail']['nu_other_road_km_traveled']);\n\t\t $dt_created_date =\t\tdate('d M Y', strtotime($val['VehicleLogDetail']['dt_created_date']));\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_log_date, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_driver_name, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_start_ometer, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_end_ometer, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t$col[] = array('text' => $ch_road_type, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $origin, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $destination, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_km_traveled, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t}\n\t}", "protected function buildExcelFile()\n {\n\n $width = array(\n 'A' => '1',\n 'B' => '2',\n 'C' => '2',\n 'D' => '2',\n 'E' => '2',\n 'F' => '1',\n 'G' => '2',\n 'H' => '3',\n );\n return Helpers::buildExcelFile($this->getFilename(), $this->getDataForExport(), $width);\n }", "function genrate_assessmenthistory_pdf($columnsValues,$data,$vehicletype,$allconstants,$profile,$toDate=null,$fromDate=null,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(9,15,15,14,15,14,13,12,13,27,12,17,13);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vehicletype) && !empty($vehicletype)) || \n\t\t(isset($vehiclelicno) && !empty($vehiclelicno))){\n\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Type :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(39, 8, $allconstants[$vehicletype],0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\t\t\t//vehiclelicno\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0 || $c == 8 || $c == 10 || $c == 11 || $c == 12 ){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 6);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $dt_created_date =\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no =\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no =\t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no = \t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t $vc_prtype_name =\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t\t$vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "function genrate_inspectorassessmenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(7,15,15,15,14,16,\n\t\t 12,13,12,12,21,11,\n\t\t\t\t\t\t\t\t 15,12);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+125);\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, ucfirst($vc_customer_name),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No.: ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t\n\t\t\t//$vehiclelicno\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t\tif($c==10){\n\t\t\t\n\t\t\t\t$this->SetFont('Arial', 'B', 5);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif( $c == 9 || $c == 11 || $c == 13 || $c == 12){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_customer_name = \tucfirst($val['AssessmentVehicleMaster']['vc_customer_name']);\n\t\t $dt_created_date=\t\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no=\t\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no= \t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no=\t\t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t\t$vc_prtype_name = \t\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t $vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om = \t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate =\t\t\t \tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable =\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[13], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t\n\t}", "public function createReport()\n {\n foreach($this->_data as $data)\n {\n //$data must have id and data elements\n //$data may also have config, header, footer, group\n\n $id=$data['id'];\n $format=isset($data['format'])?$data['format']:array();\n $config=isset($data['config'])?$data['config']:array();\n $group=isset($data['group'])?$data['group']:array();\n\n $configHeader=isset($config['header'])?$config['header']:$config;\n $configData=isset($config['data'])?$config['data']:$config;\n $configFooter=isset($config['footer'])?$config['footer']:$config;\n\n $config=array(\n 'header'=>$configHeader,\n 'data'=>$configData,\n 'footer'=>$configFooter\n );\n\n //set the group\n $this->_group=$group;\n\n $loadCollection=array();\n\n $nextRow=$this->objWorksheet->getHighestRow();\n if($nextRow>1)\n $nextRow++;\n $colIndex=-1;\n\n //form the header for data\n if(isset($data['header']))\n {\n $headerId='HEADER_'.$id;\n foreach($data['header'] as $k=>$v)\n {\n $colIndex++;\n $tag=\"{\".$headerId.\":\".$k.\"}\";\n $this->objWorksheet->setCellValueByColumnAndRow($colIndex,$nextRow,$tag);\n if(isset($config['header'][$k]['width']))\n $this->objWorksheet->getColumnDimensionByColumn($colIndex)->setWidth(pixel2unit($config['header'][$k]['width']));\n if(isset($config['header'][$k]['align']))\n $this->objWorksheet->getStyleByColumnAndRow($colIndex,$nextRow)->getAlignment()->setHorizontal($config['header'][$k]['align']);\n }\n\n if($colIndex>-1)\n {\n $this->objWorksheet->getStyle(PHPExcel_Cell::stringFromColumnIndex(0).$nextRow.':'.PHPExcel_Cell::stringFromColumnIndex($colIndex).$nextRow)->applyFromArray($this->_headerStyleArray);\n }\n\n //add header row to load collection\n $loadCollection[]=array('id'=>$headerId,'data'=>$data['header']);\n\n //move to next row for data\n $nextRow++;\n }\n\n\n //form the data repeating row\n $dataId='DATA_'.$id;\n $colIndex=-1;\n\n //form the template row\n if(count($data['data'])>0)\n {\n //we just need first row of data, to see array keys\n $singleDataRow=$data['data'][0];\n foreach($singleDataRow as $k=>$v)\n {\n $colIndex++;\n $tag=\"{\".$dataId.\":\".$k.\"}\";\n $this->objWorksheet->setCellValueByColumnAndRow($colIndex,$nextRow,$tag);\n if(isset($config['data'][$k]['align']))\n $this->objWorksheet->getStyleByColumnAndRow($colIndex,$nextRow)->getAlignment()->setHorizontal($config['data'][$k]['align']);\n }\n }\n\n //add this row to collection for load but with repeating\n $loadCollection[]=array('id'=>$dataId,'data'=>$data['data'],'repeat'=>true,'format'=>$format);\n $this->enableStripRows();\n\n //form the footer row for data if needed\n if(isset($data['footer']))\n {\n $footerId='FOOTER_'.$id;\n $colIndex=-1;\n $nextRow++;\n\n //formiraj template\n foreach($data['footer'] as $k=>$v)\n {\n $colIndex++;\n $tag=\"{\".$footerId.\":\".$k.\"}\";\n $this->objWorksheet->setCellValueByColumnAndRow($colIndex,$nextRow,$tag);\n if(isset($config['footer'][$k]['align']))\n $this->objWorksheet->getStyleByColumnAndRow($colIndex,$nextRow)->getAlignment()->setHorizontal($config['footer'][$k]['align']);\n }\n if($colIndex>-1)\n {\n $this->objWorksheet->getStyle(PHPExcel_Cell::stringFromColumnIndex(0).$nextRow.':'.PHPExcel_Cell::stringFromColumnIndex($colIndex).$nextRow)->applyFromArray($this->_footerStyleArray);\n }\n\n //add footer row to load collection\n $loadCollection[]=array('id'=>$footerId,'data'=>$data['footer'],'format'=>$format);\n }\n\n $this->load($loadCollection);\n $this->generateReport();\n }\n }", "function generateCell($type) {\n\t\t\n\t\tif($this->getV()) {\n\t\t\n\t\t\t$str = \"{v: \";\n\t\t\t\n\t\t\tif($type==\"string\") {\n\t\t\t\t$str.= \"'\".$this->escapeJSChars($this->getV()).\"',\";\n\t\t\t} elseif($type==\"boolean\") {\n\t\t\t\t$str.= \"'\".$this->getV().\"',\";\n\t\t\t} elseif($type==\"date\") {\n\t\t\t\t$str.= \"new Date(\".substr($this->getV(),0,4).\",\".(substr($this->getV(),5,2) - 1).\",\".substr($this->getV(),8,2).\"),\";\n\t\t\t} elseif($type==\"datetime\") {\n\t\t\t\t$str.= \"new Date(\".substr($this->getV(),0,4).\",\".(substr($this->getV(),5,2) - 1).\",\".substr($this->getV(),8,2).\",\".substr($this->getV(),11,2).\",\".substr($this->getV(),14,2).\",\".substr($this->getV(),17,2).\"),\";\n\t\t\t} elseif($type==\"timeofday\") {\n\t\t\t\t$str.= \"[\".substr($this->getV(),11,2).\",\".substr($this->getV(),14,2).\",\".substr($this->getV(),17,2).\"],\";\n\t\t\t} else {\t\t\n\t\t\t\t$str.= $this->escapeJSChars($this->getV()).\",\";\n\t\t\t}\n\t\t\t\n\t\t\tif($this->getF()) {\n\t\t\t\t$str.= \"f: '\".$this->getF().\"',\";\n\t\t\t}\t\t\n\t\t\t\n\t\t\tif($this->getClassName()) {\n\t\t\t\t$str.=\"p: {'className': '\".$this->getClassName().\"'},\";\n\t\t\t}\n\t\t\t\n\t\t\t$str = substr($str,0,-1);\n\t\t\t$str.= \"}\";\n\n\t\t} else {\n\t\t\n\t\t\t$str = \"\";\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $str;\n\t\t\n\t}", "function genrate_inspectorvehiclehistorypdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t \n\t\t$columnwidtharrays = array(10,30,26,26,23,18,20,20,16);\n\t\t\n\t\t$heightdynamic =8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, $vc_customer_name,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164 ,8, '',0,'','L',true);\t\t\t\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_customer_name =\t\tucfirst($val['CustomerProfile']['vc_customer_name']);\n\t\t $vc_vehicle_lic_no =\t\t$val['VehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no =\t\t$val['VehicleDetail']['vc_vehicle_reg_no'];\n\t\t $dt_created_date =\t\tdate('d M Y', strtotime($val['VehicleDetail']['dt_created_date']));\n\t\t $vc_prtype_name =\t\t$val['VEHICLETYPE']['vc_prtype_name'];\n\t\t $vc_v_rating =\t\tnumber_format($val['VehicleDetail']['vc_v_rating']);\n\t\t $vc_dt_rating =\t\tnumber_format($val['VehicleDetail']['vc_dt_rating']);\n\t\t $vc_rate =\t\tnumber_format($val['VehicleDetail']['vc_rate'],2,'.',',');\n\t\t\t\n\t\t\t$font_size=7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$alignvalue='R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_v_rating, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_dt_rating, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' =>$vc_rate, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t}", "public function generateReport()\n {\n\t\t$this->_lastColumn=$this->objWorksheet->getHighestColumn();//TODO: better detection\n\t\t$this->_lastRow=$this->objWorksheet->getHighestRow();\n foreach($this->_data as $data)\n\t\t{\n\t\t\tif(isset ($data['repeat']) && $data['repeat']==true)\n\t\t\t{\n\t\t\t\t//Repeating data\n\t\t\t\t$foundTags=false;\n\t\t\t\t$repeatRange='';\n\t\t\t\t$firstRow='';\n\t\t\t\t$lastRow='';\n\n\t\t\t\t$firstCol='A';//TODO: better detection\n\t\t\t\t$lastCol=$this->_lastColumn;\n\n\t\t\t\t//scan the template\n\t\t\t\t//search for repeating part\n\t\t\t\tforeach ($this->objWorksheet->getRowIterator() as $row)\n\t\t\t\t{\n\t\t\t\t\t$cellIterator = $row->getCellIterator();\n\t\t\t\t\t$rowIndex = $row->getRowIndex();\n\t\t\t\t\t//find the repeating range (one or more rows)\n\t\t\t\t\tforeach ($cellIterator as $cell)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cellval=trim($cell->getValue());\n\t\t\t\t\t\t$column = $cell->getColumn();\n\t\t\t\t\t\t//see if the cell has something for replacing\n\t\t\t\t\t\tif(preg_match_all(\"/\\{\".$data['id'].\":(\\w*|#\\+?-?(\\d*)?)\\}/\", $cellval, $matches))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this cell has replacement tags\n\t\t\t\t\t\t\tif(!$foundTags) $foundTags=true;\n\t\t\t\t\t\t\t//remember the first ant the last row\n\t\t\t\t\t\t\tif($rowIndex!=$firstRow)\n\t\t\t\t\t\t\t\t$lastRow=$rowIndex;\n\t\t\t\t\t\t\tif($firstRow=='')\n\t\t\t\t\t\t\t\t$firstRow=$rowIndex;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//form the repeating range\n\t\t\t\tif($foundTags)\n\t\t\t\t\t$repeatRange=$firstCol.$firstRow.\":\".$lastCol.$lastRow;\n\n\t\t\t\t//check if this is the last row\n\t\t\t\tif($foundTags && $lastRow==$this->_lastRow)\n\t\t\t\t\t$data['last']=true;\n\n\t\t\t\t//set initial format data\n\t\t\t\tif(! isset($data['format']))\n\t\t\t\t\t$data['format']=array();\n\n\t\t\t\t//set default step as 1\n\t\t\t\tif(! isset($data['step']))\n\t\t\t\t\t$data['step']=1;\n\n\t\t\t\t//check if data is an array\n\t\t\t\tif(is_array($data['data']))\n\t\t\t\t{\n\t\t\t\t\t//every element is an array with data for all the columns\n\t\t\t\t\tif($foundTags)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert repeating rows, as many as needed\n\t\t\t\t\t\t//check if grouping is defined\n\t\t\t\t\t\tif(count($this->_group))\n\t\t\t\t\t\t\t$this->generateRepeatingRowsWithGrouping($data, $repeatRange);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$this->generateRepeatingRows($data, $repeatRange);\n\t\t\t\t\t\t//remove the template rows\n\t\t\t\t\t\tfor($i=$firstRow;$i<=$lastRow;$i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->objWorksheet->removeRow($firstRow);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//if there is no data\n\t\t\t\t\t\tif(count($data['data'])==0)\n\t\t\t\t\t\t\t$this->addNoResultRow($firstRow,$firstCol,$lastCol);\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 //TODO\n\t\t\t\t //maybe an SQL query?\n\t\t\t\t //needs to be database agnostic\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//non-repeating data\n\t\t\t\t//check for additional formating\n\t\t\t\tif(! isset($data['format']))\n\t\t\t\t\t$data['format']=array();\n\n\t\t\t\t//check if data is an array or mybe a SQL query\n\t\t\t\tif(is_array($data['data']))\n\t\t\t\t{\n\t\t\t\t\t//array of data\n\t\t\t\t\t$this->generateSingleRow($data);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//TODO\n\t\t\t\t //maybe an SQL query?\n\t\t\t\t //needs to be database agnostic\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //call the replacing function\n $this->searchAndReplace();\n\n //generate heading if heading text is set\n if($this->_headingText!='')\n $this->generateHeading();\n\n }", "private function BuildCell($_RowNo, $_ColNo, $_Cell) {\r\n if(is_string($_Cell)) {\r\n $Len_ = strlen($_Cell);\r\n return(pack(\"S*\", 0x0204, $Len_ + 8, $_RowNo, $_ColNo, 0x00, $Len_).$_Cell);\r\n }\r\n if(is_int($_Cell))\r\n return(pack(\"S*\", 0x027E, 10, $_RowNo, $_ColNo, 0x00).pack(\"I\", ($_Cell<<2) | 2));\r\n if(is_float($_Cell))\r\n return(pack(\"S*\", 0x0203, 14, $_RowNo, $_ColNo, 0x00).pack(\"d\", $_Cell));\r\n if(is_bool($_Cell))\r\n return($this->BuildCell($_RowNo, $_ColNo, (int)($_Cell ? 1 : 0)));\r\n // Returns a null cell\r\n return(pack(\"S*\", 0x0201, 6, $_RowNo, $_ColNo, 0x17));\r\n }", "function helper_pdf_add_cell($pdf, $largura, $altura, $texto, $bordas, $pula_linha, $alinhamento){\n\t$pdf->Cell($largura, $altura, $texto, $bordas, $pula_linha, $alinhamento);\n}", "public function makeReport()\n {\n }", "private function Write_Monthly_Table() {\n\t\t$top = 445 + self::VERT_MARGIN;\n\t\t$left = self::HORZ_MARGIN;\n\t\t$label_width = 160;\n\t\t$table_left = $left + $label_width;\n\t\t$cell_width = 55;\n\t\t$row_height = 8.5;\n\t\t\n\t\t/**\n\t\t * Build label backgrounds\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($left, $top, $label_width + ($cell_width * 1), $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t/**\n\t\t * Add the strokes\n\t\t */\n\t\t$this->Rect_TL($table_left, $top, $cell_width, $row_height);\n\t//\t$this->Rect_TL($table_left + ($cell_width * 1), $top, $cell_width, $row_height);\n\t//\t$this->Rect_TL($table_left + ($cell_width * 2), $top, $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t/**\n\t\t * Add the labels\n\t\t */\n\t\t$this->Text_TL(\"CURRENT PERIOD\",\n\t\t\t$left, $top, \n\t\t\t$label_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['LEFT']}\");\n\t\t\n\t\t$this->Text_TL(\"PERIOD\",\n\t\t\t$table_left, $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");\n\t\t\n\t\t/*$this->Text_TL(\"WEEK\",\n\t\t\t$table_left + ($cell_width * 1), $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");\n\t\t\n\t\t$this->Text_TL(\"MONTH\",\n\t\t\t$table_left + ($cell_width * 2), $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");*/\n\t\t\t\n\t\t$current_row = 1;\n\t\t$totals = array(\n\t\t\t'weekly' => 0,\n\t\t\t'biweekly' => 0,\n\t\t\t'semimonthly' => 0,\n\t\t\t'monthly' => 0,\n\t\t);\n\t\tforeach ($this->data['period'] as $label => $values) {\n\t\t\t/**\n\t\t\t * Special processing\n\t\t\t */\n\t\t\tswitch ($label) {\n\t\t\t\tcase 'nsf$':\n\t\t\t\t\tcontinue 2;\n\t\t\t\tcase 'debit returns':\n//\t\t\t\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n//\t\t\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t\t\t$this->pdf->fill();\n\t\t\t\t\t\n//\t\t\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t\t\t$this->pdf->stroke();\n\t\t\t\t\t/*$percentage = $values['month']? number_format($values['month'] / $this->data['monthly']['total debited']['month'] * 100, 1):0;\n\t\t\t\t\t$this->Text_TL($percentage.'%',\n\t\t\t\t\t\t$table_left + ($cell_width * 3), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['CENTER']}\");*/\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'net cash collected':\n\t\t\t\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n\t\t\t\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t//$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t//$this->Rect_TL($table_left + ($cell_width * 2), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t$this->pdf->fill();\n\t\t\t\t\t\n\t\t\t\t\t//$this->Text_TL(number_format($this->data['period']['total debited']['span'] - $this->data['period']['debit returns']['span'], 2),\n\t\t\t\t\t$this->Text_TL(number_format($this->data['period']['total debited']['span'] - $this->data['period']['nsf$']['span'], 2),\n\t\t\t\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\t\t\n\t\t\t\t\t/*$this->Text_TL(number_format($this->data['monthly']['total debited']['week'] - $this->data['monthly']['debit returns']['week'], 2),\n\t\t\t\t\t\t$table_left + ($cell_width * 1), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\t$this->Text_TL(number_format($this->data['monthly']['total debited']['month'] - $this->data['monthly']['debit returns']['month'], 2),\n\t\t\t\t\t\t$table_left + ($cell_width * 2), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\t\t\tbreak;\n\t\t\t\t//FORBIDDEN ROWS!\n\t\t\t\tcase 'moneygram deposit':\n\t\t\t\t//case 'credit card payments':\n\t\t\t\t\tcontinue 2;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\t$format_decimals = 0;\n\t\t\tswitch ($label) {\n\t\t\t\tcase 'new customers':\n\t\t\t\tcase 'card reactivations':\n\t\t\t\tcase 'reactivated customers':\n\t\t\t\tcase 'refunded customers':\n\t\t\t\tcase 'resend customers':\n\t\t\t\tcase 'cancelled customers':\n\t\t\t\tcase 'paid out customers (ach)':\n\t\t\t\tcase 'paid out customers (non-ach)':\n\t\t\t\t\t$format_decimals = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$format_decimals = 2;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t\t$this->Rect_TL($left, $top + ($row_height * $current_row), $label_width, $row_height);\n\t\t\t$this->pdf->fill();\n\t\t\t\n\t\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t$this->Rect_TL($table_left + ($cell_width * 2), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t$this->pdf->stroke();\n\t\t\t\n\t\t\t$this->Text_TL(strtoupper($label),\n\t\t\t\t$left + $label_indent, $top + ($row_height * $current_row), \n\t\t\t\t$label_width - $label_indent, $row_height,\n\t\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\t\n\t\t\tif ($label != 'net cash collected') {\n\t\t\t\t$this->Text_TL(number_format($values['span'], $format_decimals),\n\t\t\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\n\t\t\t\t/*$this->Text_TL(number_format($values['week'], $format_decimals),\n\t\t\t\t\t$table_left + ($cell_width * 1), $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\n\t\t\t\t$this->Text_TL(number_format($values['month'], $format_decimals),\n\t\t\t\t\t$table_left + ($cell_width * 2), $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\t}\n\t\t\t\n\t\t\t$current_row++;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Advances in Collection\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($left, $top + ($row_height * $current_row), $label_width, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t$this->Text_TL(\"ADVANCES IN COLLECTION\",\n\t\t\t$left, $top + ($row_height * $current_row), \n\t\t\t$label_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['advances_collections'], 2),\n\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t/**\n\t\t * Advances in Active\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($table_left + ($cell_width * 4), $top + ($row_height * $current_row), $cell_width * 2, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t$this->Rect_TL($table_left + ($cell_width * 6), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t$this->Text_TL(\"ACTIVE ADVANCES OUT\",\n\t\t\t$table_left + ($cell_width * 4), $top + ($row_height * $current_row), \n\t\t\t$cell_width * 2, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['advances_active'], 2),\n\t\t\t$table_left + ($cell_width * 6), $top + ($row_height * $current_row), \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t}", "public function testCreateCell()\n {\n $object = new \\stdClass();\n $object->title = 'barfoo';\n $cell = $this->createFactory()->createCell('title', PropertyColumn::class, $object, []);\n\n $this->assertInstanceOf(Cell::class, $cell);\n $this->assertEquals('barfoo', $cell->value);\n $this->assertEquals('Property', $cell->getTemplate());\n }", "function display_report()\n {\n $out = '<div>';\n $out .= '<table id=\"resultsTable\">';\n $out .= '<thead>';\n if(isset($this->header))\n {\n if(!$this->has_split_header())\n {\n $out .= '<tr>';\n foreach($this->header AS $head)\n {\n $out .= '<th>'.$head.'</th>';\n } \n $out .= '</tr>';\n }\n else\n {\n //foreach row\n foreach($this->header AS $row)\n {\n $out .= '<tr>';\n foreach($row AS $rowObj)\n {\n $columnCount = isset($rowObj->colCount) ? $rowObj->colCount : 1;\n $columnContent = $rowObj->content;\n $out .= '<th colspan=\"'.$columnCount.'\">'.$columnContent.'</th>';\n }\n $out .= '</tr>';\n }\n } \n }\n $out .= '</thead>';\n $out .= '<tbody>';\n if(isset($this->data))\n {\n foreach($this->data AS $row)\n {\n $out .= '<tr>';\n foreach($row AS $cell)\n {\n if(is_a($cell, 'stdClass'))\n {\n $out .= $this->build_cell($cell);\n }\n else\n {\n $out .= '<td>'.$cell.'</td>';\n }\n } \n $out .= '</tr>';\n }\n }\n //count the last row\n// $out .= '<tr>';\n// for($i=0;$i<count($row);$i++)\n// {\n// $out .= '<td class=\"emptyrow\"><div class=\"emptycell\">X</div></td>';\n// }\n// $out .= '</tr>';\n $out .= '</tbody>';\n $out .= '</table>';\n $out .= '</div>';\n \n return $out;\n }", "public function Header()\r\n\t{\r\n\t\t$this->Ln();\r\n\t\t$this->SetFont('Arial','',14);\r\n\t\t$this->Cell(170,7,\"Date :: \". $this->today_date ,1,0,'C');\r\n\t\t$this->Ln();\r\n\t\t$this->SetFont('Arial','',14); \r\n\t\t$this->MultiCell(170,8,\"Room Things Report \\n\".$this->title,1,'C');\r\n\t\t$this->Ln(5);\r\n\r\n\t}", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: cell properties');\r\n\r\n $this->addElement('text', 'cellid', 'Id mask:', array('size' => 32));\r\n $this->addElement('text', 'cellclass', 'CSS class:', array('size' => 32));\r\n\r\n $cellvalue['min'] =& $this->createElement('text',\r\n 'min', 'minimum',\r\n array('size' => 4));\r\n $cellvalue['max'] =& $this->createElement('text',\r\n 'max', 'maximum',\r\n array('size' => 4));\r\n $cellvalue['inc'] =& $this->createElement('text',\r\n 'inc', 'increment',\r\n array('size' => 4));\r\n $this->addGroup($cellvalue, 'cellvalue', 'Value:', ' ');\r\n\r\n $cellsize['width'] =& $this->createElement('text',\r\n 'width', 'width',\r\n array('size' => 4));\r\n $cellsize['height'] =& $this->createElement('text',\r\n 'height', 'height',\r\n array('size' => 4));\r\n $cellsize['spacing'] =& $this->createElement('text',\r\n 'spacing', 'spacing',\r\n array('size' => 2));\r\n $cellsize['count'] =& $this->createElement('text',\r\n 'count', 'count',\r\n array('size' => 2));\r\n $this->addGroup($cellsize, 'cellsize', 'Size:', ' ');\r\n\r\n $cellcolor['active'] =& $this->createElement('text',\r\n 'active', 'active',\r\n array('size' => 7));\r\n $cellcolor['inactive'] =& $this->createElement('text',\r\n 'inactive', 'inactive',\r\n array('size' => 7));\r\n $cellcolor['bgcolor'] =& $this->createElement('text',\r\n 'bgcolor', 'background',\r\n array('size' => 7));\r\n $this->addGroup($cellcolor, 'cellcolor', 'Color:', ' ');\r\n\r\n $cellfont['family'] =& $this->createElement('text',\r\n 'family', 'family',\r\n array('size' => 32));\r\n $cellfont['size'] =& $this->createElement('text',\r\n 'size', 'size',\r\n array('size' => 2));\r\n $cellfont['color'] =& $this->createElement('text',\r\n 'color', 'color',\r\n array('size' => 7));\r\n $this->addGroup($cellfont, 'cellfont', 'Font:', ' ');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('apply','process'));\r\n }", "function printCell($data,$total,$col,$field,$file_name,$module,$data2,$incentive_ytd,$incentive_type,$period,$created_date,$modified_date){\n\t\t$j = 1;\n\t\t$total = $total;\n\t\t$field_count = count($field);\n\t\t$c_count = $field_count-1;\n\t\t$k = 0;\n\t\t\n\t\t// for view incentive 1\n\t\tif($module == 'view_incentive1'){\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A1', 'Employee');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A1')->setAutoSize(true);\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B1', $data2['employee']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A2', 'Incentive Type');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A2')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A2')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B2', $incentive_type);\n\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A3', 'Period');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A3')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A3')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B3', $period);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A4', 'Productivity %');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A4')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A4')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B4', $data2['productivity']);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('B4')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A5', 'Incentive Amount (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A5')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A5')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B5', $data2['eligible_incentive_amt']);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('B5')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C1', 'No. of Candidates Interviewed');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C1')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C1')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D1', $data2['interview_candidate']);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('D1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C2', 'Individual Contribution - YTD (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C2')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C2')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D2', $incentive_ytd);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('D2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C3', 'Created Date');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C3')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C3')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D3', $created_date);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C4', 'Modified Date');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C4')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C4')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D4', $modified_date);\n\n\t\t\t// iterate the multiple rows\n\t\t\tfor($i = 8; $i <= $total+7; $i++){\n\t\t\t\tfor($j = 0; $j < $field_count; $j++){\n\t\t\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue($col[$j] . $i, strip_tags($data[$k][$field[$j]]));\n\t\t\t\t}\n\t\t\t\t$k++;\n\t\t\t}\n\t\t\n\t\t}elseif($module == 'view_incentive2'){\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A1', 'Employee');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A1')->setAutoSize(true);\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B1', $data2['employee']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A2', 'Incentive Type');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A2')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A2')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B2', $incentive_type);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A3', 'Period');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A3')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A3')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B3', $period);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A4', 'Min. Performance Target (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A4')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A4')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B4', $data2['incentive_target_amt']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A5', 'Actual Individual Contribution (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A5')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A5')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B5', $data2['achievement_amt']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C1', 'Incentive Amount (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C1')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C1')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D1', $data2['eligible_incentive_amt']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C2', 'No. of Candidates Billed');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C2')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C2')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D2', $data2['candidate_billed']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C3', 'Individual Contribution - YTD (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C3')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C3')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D3', $incentive_ytd);\n\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C4', 'Created Date');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C4')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C4')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D4', $created_date);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C5', 'Modified Date');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C5')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C5')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D5', $modified_date);\n\t\t\n\t\t\t// iterate the multiple rows\n\t\t\tfor($i = 9; $i <= $total+8; $i++){\n\t\t\t\tfor($j = 0; $j < $field_count; $j++){\n\t\t\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue($col[$j] . $i, strip_tags($data[$k][$field[$j]]));\n\t\t\t\t}\n\t\t\t\t$k++;\n\t\t\t}\n\t\t}else{\n\t\t\tfor($i = 2; $i <= $total+1; $i++){\n\t\t\t\tfor($j = 0; $j < $field_count; $j++){ \n\t\t\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue($col[$j] . $i, strip_tags($data[$k][$field[$j]]));\n\t\t\t\t}\n\t\t\t\t$k++;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t// auto size for columns \n\t\tforeach(range('A',\"$col[$c_count]\") as $columnID) {\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension($columnID)->setAutoSize(true);\n\t\t}\t\n\t\t// set the header\n\t\t$this->setHeader($file_name);\n\t}", "public function CreateExcelReport(){\n\t\t$objPHPExcel = new PHPExcel();\n\n\t\t$rows = array();\n\t\t$row_count = 2; //counter to loop through the Excel spreadsheet rows\n\n\t\t$objPHPExcel->getProperties()->setCreator(\"dxLink\")\n\t\t\t\t\t\t\t ->setLastModifiedBy(\"dxLink\")\n\t\t\t\t\t\t\t ->setTitle(\"dxLink program evaluation feedback\")\n\t\t\t\t\t\t\t ->setSubject(\"dxLink program evaluation feedback\")\n\t\t\t\t\t\t\t ->setDescription(\"Generates all data from dxLink evaluation program form\")\n\t\t\t\t\t\t\t ->setKeywords(\"dxLink evaluation program form feedback\")\n\t\t\t\t\t\t\t ->setCategory(\"evaluation result file\");\n\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A1', 'First Name')\n\t\t\t\t ->setCellValue('B1', 'Last Name')\n\t\t\t\t ->setCellValue('C1', 'Program')\n\t\t\t\t ->setCellValue('D1', 'Question')\n\t\t\t\t ->setCellValue('E1', 'Answer')\n\t\t\t\t ->setCellValue('F1', 'Comment')\n\t\t\t\t ->setCellValue('G1', 'Date Posted');\n\n \t$sql = \"SELECT doctor_answers.question_id, doctor_answers.doctor_answer, DATE_FORMAT(doctor_answers.date_of_answer,'%Y-%m-%d') AS date_of_answer, doctor_answers.comments, doctors.first_name, doctors.last_name, program_sections.program_id \n\t\tFROM doctor_answers, doctors, program_sections, questions \n\t\tWHERE doctors.doctor_id = doctor_answers.doctor_id AND program_sections.program_section_id = doctor_answers.program_section_id AND program_sections.program_section_type = 'Evaluation form' AND questions.question_id = doctor_answers.question_id\n\t\tORDER BY doctor_answers.date_of_answer DESC\";\n\n $query = $this->con->prepare($sql);\n $query->execute();\n\n while($result_row = $query->fetch(PDO::FETCH_ASSOC) ){\n \t$fisrt_name = $result_row['first_name'];\n \t$last_name = $result_row['last_name'];\n \t$program_id = $result_row['program_id']; \n\t\t\t$question_id = $result_row['question_id']; \n\t\t\t$answer = $result_row['doctor_answer']; \n\t\t\t$date_posted = $result_row['date_of_answer'];\n\t\t\t$comment = $result_row['comments'];\n\t\t\t$program = $this->Get_Program($program_id);\n\t\t\t$question = $this->Get_question($question_id);\n\t\t\tarray_push($rows, array($fisrt_name, $last_name, $program, $question, $answer, $comment, $date_posted));\n }\n \n \n foreach ($rows as $row => $column) {\n\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A' . $row_count, $column[0])\n\t\t\t\t\t\t\t ->setCellValue('B' . $row_count, $column[1])\n\t\t\t\t\t\t\t ->setCellValue('C' . $row_count, $column[2])\n\t\t\t\t\t\t\t ->setCellValue('D' . $row_count, $column[3])\n\t\t\t\t\t\t\t ->setCellValue('E' . $row_count, $column[4])\n\t\t\t\t\t\t\t ->setCellValue('F' . $row_count, $column[5])\n\t\t\t\t\t\t\t ->setCellValue('G' . $row_count, $column[6]);\n\n\t\t\t$objPHPExcel->getActiveSheet()->getRowDimension($row_count)->setRowHeight(50); \n\n\t\t $row_count++;\t\t\n\t\t}\t\n\n\t\t//Set widths of all columns\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(25);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(25);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(60);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(60);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(110);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(110);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(25);\n\n\t\t//Fill design settings for first heading row\n\t\t$objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(30);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setARGB('FF808080');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G1')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G1')->getFont()->setSize(16);\n\t\t$objPHPExcel->getActiveSheet()->freezePane('A2');\n\n\t\t//Align all cells\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G' . $row_count)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:G' . $row_count)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\n\n\t\t// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\t\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->save('../Reports/dxLink_Evaluation_feedback_report.xlsx');\n\t\t\n\t\techo 'exported';\n\t\treturn true;\n\t}", "function genrate_inspectorpaymenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name) {\n\t\n\t\t$columnwidtharrays = array(10,24,26,26,28,26,25,24);\n\t\t\n\t\t$heightdynamic = 12;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, $vc_customer_name,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 7);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_assessment_no = \t$val['AssessmentVehicleMaster']['vc_assessment_no'];\n\t\t $vc_customer_name=\t\t$val['AssessmentVehicleMaster']['vc_customer_name'];\n\t\t $dt_assessment_date=\tdate('d-M-y', strtotime($val['AssessmentVehicleMaster']['dt_assessment_date']));\n\t\t $nu_total_payable_amount= number_format($val['AssessmentVehicleMaster']['nu_total_payable_amount'],2,'.',',');\n\t\t $vc_mdc_paid=\t\t\tnumber_format($val['AssessmentVehicleMaster']['vc_mdc_paid'],2,'.',',');\n\t\t\t$dt_received_date = \tdate('d M Y', strtotime($val['AssessmentVehicleMaster']['dt_received_date']));\n\t\t $vc_prtype_name = \t\t$val['PaymentStatus']['vc_prtype_name'];\n\n\t\t\t$font_size = 7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_assessment_date, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_total_payable_amount, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_mdc_paid, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_received_date, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t}", "public function compileReport()\n {\n $report = [\n 'config' => $this->config,\n ];\n\n foreach ($this->repos as $key => $repo) {\n $report['repos'][$key] = $repo->getStatus();\n }\n\n file_put_contents($this->reportFilePath, json_encode($report));\n }", "public function createExcelReport(\\PhpOffice\\PhpSpreadsheet\\Spreadsheet $spreadSheet){\n\t\t$wsResumen = new \\PhpOffice\\PhpSpreadsheet\\Worksheet\\Worksheet($spreadSheet, 'Resumen');\n\t\t$wsDatos = new \\PhpOffice\\PhpSpreadsheet\\Worksheet\\Worksheet($spreadSheet, 'Datos');\n\t\t//2. Escribe los datos sobre las hojas de cáculo\n\t\t//2.1. Escribe lo datos de la primera hoja\n\t\t//2.1.1. Inconsistencias por tipo\n\t\t$wsResumen->setCellValue(\"A3\",\"Inconsistencias por tipo\");\n\t\t$wsResumen->setCellValue(\"A4\",\"Desfase horario\");\n\t\t$wsResumen->setCellValue(\"A5\",\"Programación no coincide\");\n\t\t$wsResumen->setCellValue(\"A6\",\"Otros\");\n\t\t$wsResumen->setCellValue(\"A7\",\"Total\");\n\t\t//2.1.2. Inconsistencias por motivo\n\t\t$wsResumen->setCellValue(\"A9\",\"Inconsistencias por motivo\");\n\t\t$wsResumen->setCellValue(\"A10\",\"Origen\");\n\t\t$wsResumen->setCellValue(\"A11\",\"Error humano\");\n\t\t$wsResumen->setCellValue(\"A12\",\"Evento en vivo\");\n\t\t$wsResumen->setCellValue(\"A13\",\"Total\");\n\t\t//2.1.3. Inconsistencias por programadora\n\t\t$wsResumen->setCellValue(\"A15\",\"Inconsistencias por casa programadora\");\n\n\t\t//2.2. Escribe lo datos de la segunda hoja\n\t\t$wsDatos->setCellValue(\"A1\",\"Fecha-Hora Reporte\");\n\t\t$wsDatos->setCellValue(\"B1\",\"Fecha-Hora Evento\");\n\t\t$wsDatos->setCellValue(\"C1\",\"ID Evento\");\n\t\t$wsDatos->setCellValue(\"D1\",\"Título Evento\");\n\t\t$wsDatos->setCellValue(\"E1\",\"ID Canal\");\n\t\t$wsDatos->setCellValue(\"F1\",\"Nombre Canal\");\n\t\t$wsDatos->setCellValue(\"G1\",\"Casa Programadora\");\n\t\t$wsDatos->setCellValue(\"H1\",\"Tipo Error\");\n\t\t$wsDatos->setCellValue(\"I1\",\"Motivo Error\");\n\t\t$wsDatos->setCellValue(\"J1\",\"Desafase\");\n\t\t$wsDatos->setCellValue(\"K1\",\"Transmitiendo\");\n\t\t$wsDatos->setCellValue(\"L1\",\"Usuario\");\n\n\t\t$totals = $this->calculateTotals();\n\t\t$wsResumen = $this->setResumenPage($wsResumen,$totals);\n\t\t$wsDatos = $this->setDataPage($wsDatos);\t\t\n\t\t//Vincula las hojas al documento\n\t\t$spreadSheet->addSheet($wsResumen, 0);\n\t\t$spreadSheet->addSheet($wsDatos, 1);\n\t\treturn $spreadSheet;\n\n\n\t}", "function getCell() {\n \tglobal $synAbsolutePath;\n $ext = $this->translate($this->value);\n $mat=$this->translatePath($this->mat);\n $filename=$mat.$this->createFilename().\".\".$ext;\n $file_exists=file_exists($synAbsolutePath.$filename);\n $isImg=$this->isImage($filename);\n if ($ext and $file_exists and $isImg) $ret=\"<div style='overflow: hidden; height: 25px; display:inline;background: url($filename) no-repeat center;width: 100%' onMouseOver=\\\"openbox('$filename')\\\" onMouseOut=\\\"closebox()\\\"></div>\";\n else if ($ext and $file_exists and !$isImg) $ret=\"<span style='color: gray'>Document $ext</span>\";\n else if ($ext and !$file_exists) $ret=\"<span style='color: gray'>Error $ext</span>\";\n else $ret=\"<span style='color: gray'>Empty</span>\";\n return $ret;\n //die;\n }", "function _factoryDocument($node_id, $plan_category_id, $output_type = 'p') {\n $this->load->library('PHPExcel');\n $sheet = $this->phpexcel->setActiveSheetIndex(0);\n $sheet->setTitle('Results');\n $planTable = Doctrine_Core::getTable('Plan');\n $plans = $planTable->retrieveByNodeExport($node_id);\n\n $sheet->setCellValue('A1', $this->translateTag('General', 'version'))\n ->setCellValue('B1', $this->translateTag('General', 'description'))\n ->setCellValue('C1', $this->translateTag('General', 'category'))\n ->setCellValue('D1', $this->translateTag('General', 'charger'))\n ->setCellValue('E1', $this->translateTag('General', 'creation'))\n ->setCellValue('F1', $this->translateTag('General', 'commentary'));\n\n\n $rcount = 1;\n\n foreach ($plans as $plan) {\n $rcount++;\n $sheet->setCellValueExplicit('A' . $rcount, $plan->plan_version, PHPExcel_Cell_DataType::TYPE_STRING)\n ->setCellValueExplicit('B' . $rcount, $plan->plan_description, PHPExcel_Cell_DataType::TYPE_STRING)\n ->setCellValueExplicit('C' . $rcount, $plan->PlanCategory->plan_category_name, PHPExcel_Cell_DataType::TYPE_STRING)\n ->setCellValueExplicit('D' . $rcount, $plan->User->user_name, PHPExcel_Cell_DataType::TYPE_STRING)\n ->setCellValueExplicit('E' . $rcount, $plan->plan_datetime, PHPExcel_Cell_DataType::TYPE_STRING)\n ->setCellValueExplicit('F' . $rcount, $plan->plan_comments, PHPExcel_Cell_DataType::TYPE_STRING);\n }\n\n $sheet->getStyle('A1:F1')->getFont()->applyFromArray(array(\n 'bold' => true\n ));\n\n $sheet->getStyle('A1:F1')->getFill()->applyFromArray(array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'color' => array(\n 'rgb' => 'd9e5f4'\n )\n ));\n\n $sheet->getStyle('A1:F' . $rcount)->getBorders()->applyFromArray(array(\n 'allborders' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array(\n 'rgb' => '808080'\n )\n )\n ));\n\n if ($output_type == 'e') {\n $sheet->getColumnDimension('A')->setAutoSize(true);\n $sheet->getColumnDimension('B')->setAutoSize(true);\n $sheet->getColumnDimension('C')->setAutoSize(true);\n $sheet->getColumnDimension('D')->setAutoSize(true);\n $sheet->getColumnDimension('E')->setAutoSize(true);\n $sheet->getColumnDimension('F')->setAutoSize(true);\n\n $objWriter = PHPExcel_IOFactory::createWriter($this->phpexcel, 'Excel5');\n $extension = '.xls';\n } else {\n $sheet->getColumnDimension('A')->setWidth(20);\n $sheet->getColumnDimension('B')->setWidth(20);\n $sheet->getColumnDimension('C')->setWidth(30);\n $sheet->getColumnDimension('D')->setWidth(25);\n $sheet->getColumnDimension('E')->setWidth(35);\n $sheet->getColumnDimension('F')->setWidth(25);\n\n $this->phpexcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);\n $objWriter = PHPExcel_IOFactory::createWriter($this->phpexcel, 'PDF');\n $extension = '.pdf';\n }\n $file_name = $this->input->post('file_name') . $extension;\n $objWriter->save($this->app->getTempFileDir($file_name));\n\n\n $this->syslog->register('export_list_plan', array(\n $file_name\n )); // registering log\n\n return $file_name;\n }", "private function createCells($data){\r\n $html = '';\r\n foreach ($data AS $index => $row) {\r\n $html .= '<tr class=\"ctable-rows\">';\r\n foreach ($row as $rownr => $data) {\r\n $html .= '<td>' . $data . '</td>';\r\n }\r\n $html .= '</tr>';\r\n }\r\n return $html;\r\n }", "private function buildBody()\n {\n $day = 1;\n $now_date = $this->year . '-' . $this->month . '-01';\n $startingDay = date('N', strtotime('first day of this month', strtotime($now_date)));\n //Add the following line if you want to start the week with monday instead of sunday. Or change the number to suit your needs.\n //$startingDay = $startingDay - 1;\n $monthLength = $this->daysMonth[$this->month - 1];\n if ($this->month == 2 && ((($this->year % 4) == 0) && ((($this->year % 100) != 0) || (($this->year % 400) == 0)))) {\n $monthLength = $monthLength + 1;\n }\n $h = \"<tr>\";\n for ($i = $startingDay == 7 ? 1 : 0; $i < 9; $i++) {\n for ($j = 0; $j <= 6; $j++) {\n $currDate = $this->getDayDate($day);\n $class = $this->getTdClass($day);\n $h .= \"<td data-datetime='$currDate' $class>\";\n $h .= $this->dateWrap[0];\n if ($day <= $monthLength && ($i > 0 || $j >= $startingDay)) {\n $h .= $this->dayWrap[0];\n $h .= $this->getEventSearchLink($day);\n $h .= $this->dayWrap[1];\n $h .= $this->buildEvents($currDate);\n $day++;\n } else {\n $h .= \"&nbsp;\";\n }\n $h .= $this->dateWrap[1];\n $h .= \"</td>\";\n }\n // stop making rows if we've run out of days\n if ($day > $monthLength) {\n break;\n } else {\n $h .= \"</tr>\";\n $h .= \"<tr>\";\n }\n }\n $h .= \"</tr>\";\n $h .= \"</tbody>\";\n $h .= \"</table>\";\n $this->html .= $h;\n }", "public function buildTable()\n {\n\n $view = View::getActive();\n\n // Creating the Head\n $head = '<thead class=\"ui-widget-header\" >'.NL;\n $head .= '<tr>'.NL;\n\n $head .= '<th >Project Name</th>'.NL;\n //$head .= '<th>File</th>'.NL;\n $head .= '<th >Description</th>'.NL;\n $head .= '<th style=\"width:165px\" >Nav</th>'.NL;\n\n $head .= '</tr>'.NL;\n $head .= '</thead>'.NL;\n //\\ Creating the Head\n\n // Generieren des Bodys\n $body = '<tbody class=\"ui-widget-content\" >'.NL;\n\n $num = 1;\n foreach ($this->data as $key => $row) {\n $rowid = $this->name.\"_row_$key\";\n\n $body .= \"<tr class=\\\"row$num\\\" id=\\\"$rowid\\\" >\";\n\n $urlConf = 'index.php?c=Daidalos.Projects.genMask&amp;objid='.urlencode($key);\n $linkConf = '<a title=\"GenMask\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlConf.'\">'\n .Wgt::icon('daidalos/bdl_mask.png' , 'xsmall' , 'build').'</a>';\n\n $urlGenerate = 'index.php?c=Genf.Bdl.build&amp;objid='.urlencode($key);\n $linkGenerate = '<a title=\"Code generieren\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlGenerate.'\">'\n .Wgt::icon('daidalos/parser.png' , 'xsmall' , 'build').'</a>';\n\n\n $urlDeploy = 'index.php?c=Genf.Bdl.deploy&amp;objid='.urlencode($key);\n $linkDeploy = '<a title=\"Deploy the Project\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlDeploy.'\">'\n .Wgt::icon('genf/deploy.png' , 'xsmall' , 'deploy').'</a>';\n\n $urlRefreshDb = 'index.php?c=Genf.Bdl.refreshDatabase&amp;objid='.urlencode($key);\n $linkRefreshDb = '<a title=\"Refresh the database\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlRefreshDb.'\">'\n .Wgt::icon('daidalos/db_refresh.png' , 'xsmall' , 'sync db').'</a>';\n\n $urlSyncDb = 'index.php?c=Genf.Bdl.syncDatabase&amp;objid='.urlencode($key);\n $linkSyncDb = '<a title=\"Sync the database with the model\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlSyncDb.'\">'\n .Wgt::icon('daidalos/db_sync.png' , 'xsmall' , 'sync db').'</a>';\n\n $urlPatchDb = 'index.php?c=Genf.Bdl.createDbPatch&amp;objid='.urlencode($key);\n $linkPatchDb = '<a title=\"Create an SQL Patch to alter the database\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlPatchDb.'\" >'\n .Wgt::icon('genf/dump.png' , 'xsmall' , 'create alter patch').'</a>';\n\n $urlClean = 'index.php?c=Genf.Bdl.clean&amp;objid='.urlencode($key);\n $linkClean = '<a title=\"Projekt cleanen\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlClean.'\">'\n .Wgt::icon('genf/clean.png' , 'xsmall' , 'clean').'</a>';\n\n $body .= '<td valign=\"top\" >'.$row[0].'</td>'.NL;\n //$body .= '<td valign=\"top\" >'.$row[1].'</td>'.NL;\n $body .= '<td valign=\"top\" >'.$row[2].'</td>'.NL;\n $body .= '<td valign=\"top\" align=\"center\" >'.$linkConf.' | '.$linkGenerate.$linkDeploy.' | '.$linkSyncDb.' '.$linkRefreshDb.' '.$linkPatchDb.' | '.$linkClean.'</td>'.NL;\n\n $body .= '</tr>'.NL;\n\n $num ++;\n if ($num > $this->numOfColors)\n $num = 1;\n\n }// ENDE FOREACH\n\n $body .= \"</tbody>\".NL;\n //\\ Generieren des Bodys\n\n $html ='<table id=\"table_'.$this->name.'\" class=\"full\" >'.NL;\n $html .= $head;\n $html .= $body;\n $html .= '</table>'.NL;\n\n return $html;\n\n }", "function excel_export($template = 0) {\n $data = $this->ticket->get_all()->result_object();\n $this->load->helper('report');\n $rows = array();\n $row = array(lang('items_item_number'), lang('items_name'), lang('items_category'), lang('items_supplier_id'), lang('items_cost_price'), lang('items_unit_price'), lang('items_tax_1_name'), lang('items_tax_1_percent'), lang('items_tax_2_name'), lang('items_tax_2_percent'), lang('items_tax_2_cummulative'), lang('items_quantity'), lang('items_reorder_level'), lang('items_location'), lang('items_description'), lang('items_allow_alt_desciption'), lang('items_is_serialized'), lang('items_item_id'));\n\n $rows[] = $row;\n foreach ($data as $r) {\n $taxdata = $this->Item_taxes->get_info($r->ticket_id);\n if (sizeof($taxdata) >= 2) {\n $r->taxn = $taxdata[0]['ticket_id'];\n $r->taxp = $taxdata[0]['code_ticket'];\n $r->taxn1 = $taxdata[1]['destination_name'];\n $r->taxp1 = $taxdata[1]['ticket_type_name'];\n $r->cumulative = $taxdata[1]['cumulative'] ? 'y' : '';\n } else if (sizeof($taxdata) == 1) {\n $r->taxn = $taxdata[0]['name'];\n $r->taxp = $taxdata[0]['percent'];\n $r->taxn1 = '';\n $r->taxp1 = '';\n $r->cumulative = '';\n } else {\n $r->taxn = '';\n $r->taxp = '';\n $r->taxn1 = '';\n $r->taxp1 = '';\n $r->cumulative = '';\n }\n\n $row = array(\n $r->ticket_id,\n $r->code_ticket,\n $r->destination_name,\n $r->destination_name,\n $r->ticket_type_name,\n $r->unit_price,\n $r->taxn,\n $r->taxp,\n $r->taxn1,\n $r->taxp1,\n $r->cumulative,\n $r->quantity,\n $r->reorder_level,\n $r->location,\n $r->description,\n $r->allow_alt_description,\n $r->is_serialized ? 'y' : '',\n $r->item_id\n );\n\n $rows[] = $row;\n }\n\n $content = array_to_csv($rows);\n if ($template) {\n force_download('items_export_mass_update.csv', $content);\n } else {\n force_download('items_export.csv', $content);\n }\n exit;\n }", "public function create()\n {\n parent::create();\n\n $sheet = $this->add_sheet();\n\n $this->add_table($sheet, $this->database, $this->generate_table());\n }", "function krnEmit_reportTitleRow($appEmitter, $title, $colSpan) {\n $s1 = '<div class=\"draff-report-top-left\"></div>';\n $s2 = '<div class=\"draff-report-top-middle\">'.$title.'</div>';\n $s3 = '<div class=\"draff-report-top-right\">'.draff_dateTimeAsString(rc_getNow(),'M j, Y' ).'</div>';\n $appEmitter->row_start();\n $appEmitter->cell_block($s1 . $s2 . $s3 ,'draff-report-top', 'colspan=\"'.$colSpan.'\"');\n $appEmitter->row_end();\n}", "public function getquickCreateReport()\n\t{\n\t\tdate_default_timezone_set(config::$timezone);\n\t\t$today = date(\"Y-m-d\");\n\t\t$parameterr = array();\n\t\t$parameter['title'] = 'Today\\'s Created Orders';\n $parameter['orders'] = Order::where('from','=', $today)\n \t\t\t\t\t\t\t\t->get();\n\n\t\t$pdf = PDF::loadView('reports.order.getAllOrders',$parameter)\n\t\t\t\t\t->setPaper('a4')\n\t\t\t\t\t->setOrientation(config::$ORDER_REPORT_ORIENTATION)\n\t\t\t\t\t->setWarnings(false);\n\n\t\treturn $pdf->stream('Report On Today\\'s Created Orders.pdf');\n\t\t\n\t}", "public function render()\n {\n return new Row([], [\n new Column(['medium' => 6, 'class' => 'text-xs-center'], [\n new Card([], new CardBlock([], [\n new HeaderOne(\n ['class' => 'display-3'],\n vsprintf('%d', [\n count($this->report->getRan()),\n ])\n ),\n new Paragraph([],\n new Small(['class' => 'text-uppercase text-muted'], [\n 'Migrations ran so far',\n ])\n ),\n ])),\n ]),\n new Column(['medium' => 6, 'class' => 'text-xs-center'], [\n new Card([], new CardBlock([], [\n new HeaderOne(\n ['class' => 'display-3'],\n vsprintf('%d', [\n count($this->report->getIdle()),\n ])\n ),\n new Paragraph([],\n new Small(['class' => 'text-uppercase text-muted'], [\n 'Pending to be ran',\n ])\n ),\n ])),\n ]),\n ]);\n }", "public function generate_screen() {\n\t\t\t$bootstrap = new HTMLWriter();\n\t\t\t$content = '';\n\t\t\t$columns = array_keys($this->json['columns']);\n\t\t\t$count = 0; \n\t\t\t$array = array(); \n\t\t\tforeach ($this->json['columns'] as $column) {\n\t\t\t\tif ($column['sortavailable'] == 'n') { $array[] = $count; }\n\t\t\t\t$count++;\n\t\t\t}\n\t\t\t\n\t\t\t$tb = new Table(\"class=table table-striped table-bordered table-condensed table-excel|id=table\");\n\t\t\t$tb->tablesection('thead');\n\t\t\t\t$tb->tr();\n\t\t\t\tforeach($this->json['columns'] as $column) {\n\t\t\t\t\t$class = DplusWire::wire('config')->textjustify[$column['headingjustify']];\n\t\t\t\t\t$tb->th(\"class=$class\", $column['heading']);\n\t\t\t\t}\n\t\t\t$tb->closetablesection('thead');\n\t\t\t$tb->tablesection('tbody');\n\t\t\t\tforeach ($this->json['data']['lots'] as $lot) {\n\t\t\t\t\t$tb->tr();\n\t\t\t\t\tforeach($columns as $column) {\n\t\t\t\t\t\t$class = DplusWire::wire('config')->textjustify[$this->json['columns'][$column]['datajustify']];\n\t\t\t\t\t\t$tb->td(\"class=$class\", $lot[$column]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t$tb->closetablesection('tbody');\n\t\t\t$content = $tb->close();\n\t\t\treturn $content;\n\t\t}", "public function beginLabelSheet ()\r\n {\r\n $this->label_column = 1;\r\n $this->label_row = 1;\r\n return '\r\n <div class=\"labelpage\">\r\n <div class=\"labelrow\">\r\n <div class=\"labelbody\">';\r\n }", "public static function formatMonthlyBillsToPdfExport(Project $project, BillElectricitySource $electricity_bill)\n {\n return Excel::create($electricity_bill->date_covered.' '.$project->name, function($excel) use ($project, $electricity_bill) {\n $excel->setTitle($electricity_bill->date_covered.' '.$project->name);\n\n $developer = Developer::getCurrentDeveloper();\n $excel->setCompany($developer->name);\n\n $excel->setDescription(\"Electricity bills for \".$project->name.' '.$electricity_bill->date_covered);\n $excel->sheet($electricity_bill->date_covered, function($sheet) use ($project, $electricity_bill) {\n \n $properties = Property::leftJoin('bills_electricity_source_details','bills_electricity_source_details.property_id','=','properties.id')\n ->whereRaw(DB::raw('bills_electricity_source_details.bills_electricity_source_id = '.$electricity_bill->id))\n ->get();\n\n $sheet->setPageMargin(array(\n 0.25, 0.10, 0.25, 0.10\n ));\n\n $sheet->setBorder(\"A1:F\".(count($properties)+2), 'none');\n \n $sheet->row(1, array($project->name.' '.$electricity_bill->date_covered, \"\",\"\",\"\",\"\",\"\"));\n $sheet->row(2, array('PROPERTY','BILL','PAYMENT','DATE','REMARKS'));\n\n $sheet->cells('A2:E2', function($cells) {\n $cells->setAlignment('center');\n $cells->setFontWeight('bold');\n });\n\n $start = 3;\n for($i=$start;$i<count($properties)+$start;$i++){\n $sheet->row($i, array(\n $properties[$i-$start]->name,\n number_format($properties[$i-$start]->bill, 4, '.', ','),\n number_format($properties[$i-$start]->payment, 4, '.', ','),\n ($properties[$i-$start]->date_payment != '0000-00-00') ? $properties[$i-$start]->date_payment : \"\",\n $properties[$i-$start]->remarks));\n\n $sheet->cells('A'.$i.':E'.$i, function($cells){\n $cells->setAlignment('center');\n });\n }\n });\n });\n }", "protected function grid()\n {\n $grid = new Grid(new Report());\n $grid->model()->with(['company', 'room']);\n\n $grid->column('company.company_name', '公司当前名称')->display(function () {\n return $this->record->company->company_name;\n });\n $grid->column('room.title', '房间号')->display(function () {\n return $this->record->room->title;\n });\n $grid->column('company_name', '报表时公司名称');\n $grid->column('start_date', '租金起止日')->display(function () {\n return date('m-d', strtotime($this->start_date)) . '—' . date('m-d', strtotime($this->end_date));\n });\n $grid->column('year_month', '月度')->display(function () {\n return $this->year . '-' . $this->month;\n });\n $grid->column('electric_money', '电费');\n $grid->column('water_money', '水费');\n $grid->column('rent', '租金');\n $grid->column('status', '状态')->display(function () {\n if ($this->charged_at) {\n return '<span class=\"label label-success\">已缴费</span>';\n }\n if ($this->discounted_at) {\n return '<span class=\"label label-warning\">已减免</span>';\n } else {\n return '<span class=\"label label-danger\">未减免</span>';\n }\n });\n $grid->column('rent_discount', '减免额度')->display(function ($discount) {\n return ($discount * 100) . '%';\n });\n $grid->column('actual_rent', '减免后租金');\n $grid->column('total', '合计')->display(function () {\n return $this->actual_rent + $this->electric_money + $this->water_money;\n });\n $grid->column('bases', '水电详情')->expand(function ($model) {\n $bases = [[\n $model->pre_electric_base,\n $model->current_electric_base,\n $model->electric_amount,\n $model->electric_price,\n $model->pre_water_base,\n $model->current_water_base,\n $model->water_amount,\n $model->water_price,\n ]];\n\n return new Table([\n '上期电表数', '本期电表数', '用电量', '电单价',\n '上期水表数', '本期水表数', '用水量', '水单价'\n ], $bases);\n });\n $grid->column('charged_at', '缴费/扣款时间');\n $grid->column('charge_way', '方式');\n\n $grid->disableCreateButton();\n\n $grid->actions(function ($actions) {\n $row = $actions->row;\n if (!$row->discounted_at) { // 还没有减免\n if (Admin::user()->can('reports.discount')) {\n $actions->add(new DiscountButton);\n }\n $actions->disableEdit();\n } else if (!$row->charged_at) { // 还没有缴费,此时可以修改\n if (Admin::user()->can('reports.charge')) {\n $actions->add(new ChargeButton);\n }\n if (!Admin::user()->can('reports.edit')) {\n $actions->disableEdit();\n }\n } else {\n $actions->disableEdit();\n }\n $actions->disableDelete();\n $actions->disableView();\n });\n $grid->batchActions(function ($batch) {\n $batch->disableDelete();\n if (Admin::user()->can('reports.charge')) {\n $batch->add(new BatchCharge);\n }\n });\n $grid->tools(function (Grid\\Tools $tools) {\n if (Admin::user()->can('reports.generate')) {\n $tools->append(new Generate());\n }\n if (Admin::user()->can('reports.discount.import')) {\n $tools->append(new ImportDiscount());\n }\n $tools->append(new MonthReport());\n });\n\n $grid->expandFilter();\n\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n $filter->column(1 / 2, function ($filter) {\n $filter->where(function ($query) {\n $query->whereHas('record.company', function ($query) {\n $query->where('company_name', 'like', \"%{$this->input}%\");\n });\n }, '公司名');\n $filter->where(function ($query) {\n $arr = explode('-', $this->input);\n $query->where('year', $arr[0]);\n if (isset($arr[1])) {\n $query->where('month', $arr[1]);\n }\n }, '月度')->placeholder('支持:2020,2020-7');\n $filter->where(function ($query) {\n if ($this->input === 'undiscounted') {\n $query->whereNull('discounted_at');\n }\n if ($this->input === 'discounted') {\n $query->whereNotNull('discounted_at')->whereNull('charged_at');\n }\n if ($this->input === 'charged') {\n $query->whereNotNull('charged_at');\n }\n }, '状态')->radio([\n 'undiscounted' => '未减免&nbsp;&nbsp;&nbsp;',\n 'discounted' => '已减免&nbsp;&nbsp;&nbsp;',\n 'charged' => '已缴费&nbsp;&nbsp;&nbsp;',\n ]);\n });\n $filter->column(1 / 2, function ($filter) {\n $filter->where(function ($query) {\n $query->whereHas('record.room', function ($query) {\n $query->where('title', 'like', \"%{$this->input}%\");\n });\n }, '房间号');\n $filter->like('company_name', '原公司名');\n $filter->between('charged_at', '缴费时间')->date();\n });\n });\n return $grid;\n }", "public function cell() {\r\n\t\t$argKeys = ['cell', 'header', 'headerSort', 'skipId', 'cellOptions'];\r\n\t\t$totalArgs = count($argKeys);\r\n\t\t$totalArgKey = $lastArgKey = $totalArgs - 1;\r\n\t\t$args = func_get_args();\r\n\t\t$numArgs = count($args);\r\n\t\tfor ($i = $totalArgKey; $i > 0; $i--) {\r\n\t\t\tif (!empty($args[$i])) {\r\n\t\t\t\t$lastArgKey = $i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($lastArgKey < $totalArgKey) {\r\n\t\t\t// The last passed argument can always be cell options\r\n\t\t\tif (is_array($args[$lastArgKey])) {\r\n\t\t\t\t$args[$totalArgKey] = $args[$lastArgKey];\r\n\t\t\t\tfor ($i = $lastArgKey; $i < $totalArgKey; $i++) {\r\n\t\t\t\t\t$args[$i] = null;\r\n\t\t\t\t}\r\n\t\t\t\tksort($args);\r\n\t\t\t}\r\n\t\t}\r\n\t\textract(array_combine($argKeys, $args + array_fill(0, $totalArgs, null)));\r\n\t\t\r\n\t\t// Checks if the skipId is in the skip array\r\n\t\tif (!empty($skipId) && $this->_checkSkip($skipId)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$formAddCell = '&nbsp;';\r\n\t\tif ($this->getHeader) {\r\n\t\t\t$this->columnCount++;\r\n\t\t\t//Stores first instance of non-blank header\r\n\t\t\tif (!empty($header) && !$this->hasHeader) {\r\n\t\t\t\t$this->hasHeader = true;\r\n\t\t\t}\r\n\t\t\tif ($headerSort) {\r\n\t\t\t\tif ($headerSort === true) {\r\n\t\t\t\t\t$headerSort = null;\r\n\t\t\t\t}\r\n\t\t\t\t$header = $this->thSort($header, $headerSort);\r\n\t\t\t}\r\n\t\t\t$thOptions = isset($cellOptions['th']) ? $cellOptions['th'] : $cellOptions;\r\n\t\t\t$this->headers[] = [$header => $thOptions];\r\n\t\t\t\r\n\t\t}\r\n\t\t/*\r\n\t\tif ($editCell = Param::keyCheck($cellOptions, 'edit', true)) {\r\n\t\t\t$formAddCell = $editCell;\r\n\t\t\t$cell = $this->_editCell($cell, $editCell);\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\tif (is_array($cellOptions)) {\r\n\t\t\t$cell = [$cell, $cellOptions];\r\n\t\t}\r\n\t\t$this->row[] = $cell;\r\n\t\tif ($this->trCount == 0) {\r\n\t\t\t$this->formAddRow[] = $formAddCell;\r\n\t\t}\r\n\t}", "public function render()\n {\n return view('avored::system.components.table.cell');\n }", "public function buildHeader() {\n $this->build = [\n // '#type' => 'page',.\n 'container' => [\n '#type' => 'html_tag',\n '#tag' => 'div',\n '#attributes' => [\n 'class' => 'container',\n ],\n 'page_header' => [\n '#type' => 'html_tag',\n '#tag' => 'h2',\n '#value' => $this->t('<a href=\"@site-audit-uri\">Site Audit</a> report for @site', [\n '@site-audit-uri' => 'https://drupal.org/project/site_audit',\n '@site' => $this->options['uri'],\n ]),\n '#attributes' => [\n 'id' => 'page-header',\n ],\n 'br' => [\n '#type' => 'html_tag',\n '#tag' => 'br',\n ],\n 'sub_head' => [\n '#type' => 'html_tag',\n '#tag' => 'small',\n '#value' => $this->t('Generated on @date_time', ['@date_time' => \\Drupal::service('date.formatter')->format(\\Drupal::time()->getRequestTime())]),\n ],\n ],\n ],\n ];\n if (is_array($this->report)) {\n // There are multiple reports.\n $this->build['container']['summary'] = [\n '#type' => 'html_tag',\n '#tag' => 'div',\n '#attributes' => [\n 'id' => 'summary',\n ],\n ];\n $this->build['container']['summary']['title'] = [\n '#type' => 'html_tag',\n '#tag' => 'h2',\n '#value' => $this->t('Summary'),\n ];\n $this->build['container']['summary']['links'] = [\n '#type' => 'html_tag',\n '#tag' => 'p',\n ];\n foreach ($this->report as $report) {\n $this->build['container']['summary']['links'][$report->getPluginId()] = [\n '#type' => 'html_tag',\n '#tag' => 'a',\n '#value' => $report->getLabel() . ' (' . $report->getPercent() . '%)',\n '#attributes' => [\n 'href' => '#' . $report->getPluginId(),\n 'class' => $this->getPercentCssClass($report->getPercent()),\n ],\n ];\n }\n }\n }", "function createTourLogSheet($name, $data, &$workBook, $writeStats){\n\t$file = 0;\n\t$excel = 1;\n\t$cols = array('Tour ID', 'Date/Time', 'Majors', 'Student', 'Parent', 'People', 'School', 'Year', 'City', 'State', 'Email', 'Phone', 'Tour Status', 'Comments from Family', 'Comments from Ambassadors');\n\t$entries = array('id', 'tourTime', 'majorsOfInterest', 'studentName', 'parentName', 'numPeople', 'school', 'yearInSchool', 'city', 'state', 'email', 'phone', 'status', 'tourComments', 'ambComments');\n\n\t$tourDayCounts = array_fill(0, 7, 0);\n\t$tourWeekCounts = array_fill(0, 53, 0);\n\t$tourDateCounts = array_fill(0, 53, null);\n\t$weekStrings = array();\n\t$numSemesterTours = count($data);\n\t$timeStringLength = 0;\n\tif($excel)\n\t\t$tourSheet = & $workBook->add_worksheet($name. ' Tours');\n\tif($file)\n\t\tfwrite($f, \"\\nWorksheet: $name Tours\\n\");\n\t$numCols = count($cols);\n\tfor($col = 0; $col < $numCols; $col++){\n\t\t$colName = $cols[$col];\n\t\t$colRef = $entries[$col];\n\t\t$maxWidth = getTextWidth($colName);\n\t\tif($excel)\n\t\t\t$tourSheet->write_string(0, $col, $colName);\n\t\tif($file)\n\t\t\tfwrite($f, \"Row: 0, Col: $col, $colRef: $colName, width:$maxWidth\\t\");\n\n\t\tfor($tour = 0; $tour < $numSemesterTours; $tour++){\n\t\t\t$text = $data[$tour][$colRef];\n\t\t\t$width = getTextWidth($text);\n\t\t\tif($width > $maxWidth){\n\t\t\t\t$maxWidth = $width;\n\t\t\t}\n\n\t\t\tif($excel){\n\t\t\t\tif(is_numeric($text)){\n\t\t\t\t\t$tourSheet->write_number($tour + 1, $col, intval($text));\n\t\t\t\t} else {\n\t\t\t\t\t$tourSheet->write_string($tour + 1, $col, $text);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($file)\n\t\t\t\tfwrite($f, \"Row: $tour, Col: $col, val: $text, width: $width\\t\");\n\n\t\t\t/*\n\t\t\t //formats do not work at the moment\n\t\t\t if($col == 0){\n\t\t\t\t$tourSheet->set_row($tour + 1, NULL, $formatOffset + ($tour % 2));\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t\tif($file)\n\t\t\tfwrite($f, \"\\n\");\n\t\tif($excel)\n\t\t\t$tourSheet->set_column($col, $col, $maxWidth * (2.0/3.0));\n\t}\n\n\tfor($tour = 0; $tour < $numSemesterTours; $tour++){\n\t\tif($file)\n\t\t\tfwrite($f, \"Week 03: \".$tourWeekCounts[\"03\"].\"\\n\");\n\t\t//and now we add each tour to the stats\n\t\t$timestamp = strtotime($data[$tour]['tourTime']);\n\t\tif($file)\n\t\t\tfwrite($f, \"timestamp: $timestamp Time:\".$tour['tourTime'].\" Week: \".date('W', $timestamp).\"\\n\");\n\t\tif(($timestamp == false) || ($timestamp == -1)) continue;\n\t\t$tourDOW = intval(date('w', $timestamp));\n\t\t$tourDayCounts[\"$tourDOW\"] += 1;\n\t\t$tourWeek = intval(date('W', $timestamp));\n\t\t$tourWeekCounts[\"$tourWeek\"] += 1;\n\t\tif($tourDateCounts[\"$tourWeek\"] == null){\n\t\t\t$tourDateCounts[\"$tourWeek\"] = array_fill(0,7,0);\n\t\t}\n\t\t$tourDateCounts[\"$tourWeek\"][\"$tourDOW\"] += 1;\n\n\t\t//and create the date string for this week if it doesn't exist already\n\t\tif(!array_key_exists($tourWeek, $weekStrings)){\n\t\t\t$timeInfo = getdate($timestamp);\n\t\t\t$sunTimestamp = mktime(0,0,0, $timeInfo['mon'], $timeInfo['mday'] - $tourDOW, $timeInfo['year']);\n\t\t\t$satTimestamp = mktime(0,0,0, $timeInfo['mon'], $timeInfo['mday'] - $tourDOW + 6, $timeInfo['year']);\n\t\t\tif(date('M', $sunTimestamp) == date('M', $satTimestamp)){\n\t\t\t\t$timeStr = date('M j', $sunTimestamp) . ' - ' . date('j', $satTimestamp);\n\t\t\t} else {\n\t\t\t\t$timeStr = date('M j', $sunTimestamp) . ' - ' . date('M j', $satTimestamp);\n\t\t\t}\n\t\t\t$weekStrings[\"$tourWeek\"] = $timeStr;\n\t\t\t$tsl = getTextWidth($timeStr);\n\t\t\tif($tsl > $timeStringLength) $timeStringLength = $tsl;\n\t\t}\n\t}\n\n\tif(!$writeStats) return;\n\n\tif($excel)\n\t\t$statsSheet = &$workBook->add_worksheet($name.' Stats');\n\n\t//fill the column headers and set the the column widths\n\t$statsSheet->set_column(0, 0, $timeStringLength * (2.0/3.0));\n\t$statsSheet->write_string(0, 1, \"Monday\");\n\t$statsSheet->set_column(1, 1, getTextWidth(\"Monday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 2, \"Tuesday\");\n\t$statsSheet->set_column(2, 2, getTextWidth(\"Tuesday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 3, \"Wednesday\");\n\t$statsSheet->set_column(3, 3, getTextWidth(\"Wednesday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 4, \"Thursday\");\n\t$statsSheet->set_column(4, 4, getTextWidth(\"Thursday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 5, \"Friday\");\n\t$statsSheet->set_column(5, 5, getTextWidth(\"Friday\") * (2.0/3.0));\n\t$statsSheet->write_string(0, 6, \"Total\");\n\t$statsSheet->set_column(6, 6, getTextWidth(\"Total\") * (2.0/3.0));\n\n\t//then start populating all the data from the tours\n\t$numWeeks = count($tourDateCounts);\n\t$displayWeek = 0;\n\t//write the counts for each week\n\tfor($week = 0; $week < $numWeeks; $week++){\n\t\tif($file){\n\t\t\tfwrite($f, \"Week $week, Tours \".$tourWeekCounts[$week].\"\\n\");\n\t\t\tfor($i = 0; $i < 7; $i++){\n\t\t\t\tfwrite($f, \"Day $i, Tours \".$tourDateCounts[$week][$i].\"\\n\");\n\t\t\t}\n\t\t}\n\t\tif($tourWeekCounts[$week] == 0) continue;\n\t\t$statsSheet->write_string($displayWeek+1, 0, $weekStrings[$week]);\n\t\tfor($day = 1; $day < 6; $day++){\n\t\t\tif($excel)\n\t\t\t\t$statsSheet->write_number($displayWeek + 1, $day, $tourDateCounts[$week][$day]);\n\t\t\tif($file)\n\t\t\t\tfwrite($f, \"Week $week, Day $day, Tours \".$tourDateCounts[$week][$day].\"\\n\");\n\t\t}\n\t\t//write the totals for each week\n\t\tif($excel)\n\t\t\t$statsSheet->write_number($displayWeek + 1, 6, $tourWeekCounts[$week]);\n\t\tif($file)\n\t\t\tfwrite($f, \"Week $week, Total Tours \".$tourWeekCounts[$week].\"\\n\");\n\t\t$displayWeek++;\n\t}\n\t//then write the totals for the semester\n\tfor($day = 1; $day < 6; $day++){\n\t\tif($excel)\n\t\t\t$statsSheet->write_number($displayWeek + 1, $day, $tourDayCounts[$day]);\n\t\tif($file)\n\t\t\tfwrite($f, \"Day $day, Total Tours \".$tourDayCounts[$day].\"\\n\");\n\t}\n\n\tif($excel)\n\t\t$statsSheet->write_number($displayWeek + 1, 6, $numSemesterTours);\n\tif($file)\n\t\tfwrite($f, \"Total Tours: $numSemesterTours\\n\");\n\n\tunset($tourDayCounts);\n\tunset($tourWeekCounts);\n\tunset($tourDateCounts);\n\tunset($weekStrings);\n}", "function generateHTMLCell($type) {\n\t\t\n\t\t$str = \"\";\n\t\t\n\t\tif($this->getClassName()) {\n\t\t\t$str.=\"<td class=\\\"googleTableCell \".$this->getClassName().\"\\\">\";\n\t\t}\telse {\n\t\t\t$str.=\"<td class=\\\"googleTableCell\\\">\";\n\t\t}\n\t\t\n\t\tif($this->getV()) {\n\n\t\t\tif($type==\"string\") {\n\t\t\t\t$str.= $this->getV();\n\t\t\t} elseif($type==\"boolean\") {\n\t\t\t\t$str.= $this->getV();\n\t\t\t} elseif($type==\"date\") {\n\t\t\t\t$str.= substr($this->getV(),8,2).\"/\".(substr($this->getV(),5,2) - 1).\"/\".substr($this->getV(),0,4);\n\t\t\t} elseif($type==\"datetime\") {\n\t\t\t\t$str.= substr($this->getV(),8,2).\"/\".(substr($this->getV(),5,2) - 1).\"/\".substr($this->getV(),0,4).\" \".substr($this->getV(),11,2).\":\".substr($this->getV(),14,2).\":\".substr($this->getV(),17,2);\n\t\t\t} elseif($type==\"timeofday\") {\n\t\t\t\t$str.= substr($this->getV(),11,2).\":\".substr($this->getV(),14,2).\":\".substr($this->getV(),17,2);\n\t\t\t} else {\t\t\n\t\t\t\t$str.= $this->getV();\n\t\t\t}\t\t\n\n\t\t} else {\n\t\t\n\t\t\t$str.= \"&nbsp;\";\n\t\t\t\n\t\t}\n\t\t\n\t\t$str.= \"</td>\";\n\t\t\n\t\treturn $str;\n\t\t\n\t}", "function theme_hacked_report($data) {\n $output = '';\n\n if (!is_array($data)) {\n $output .= '<p>' . $data . '</p>';\n return $output;\n }\n\n $header = array();\n $rows = array();\n\n foreach ($data as $project) {\n if (!isset($project['hacked_status'])) {\n continue;\n }\n\n switch ($project['hacked_status']) {\n case HACKED_STATUS_UNHACKED:\n $class = 'ok';\n $icon = theme('image', 'misc/watchdog-ok.png', t('Unchanged'), t('Unchanged'));\n break;\n case HACKED_STATUS_HACKED:\n $class = 'error';\n $icon = theme('image', 'misc/watchdog-error.png', t('Changed'), t('Changed'));\n break;\n case HACKED_STATUS_UNCHECKED:\n default:\n $class = 'warning';\n $icon = theme('image', 'misc/watchdog-warning.png', t('Unchecked'), t('Unchecked'));\n break;\n }\n\n $row = '<div class=\"version-status\">';\n switch ($project['hacked_status']) {\n case HACKED_STATUS_UNHACKED:\n $row .= t('Unchanged');\n break;\n case HACKED_STATUS_HACKED:\n $row .= '<span class=\"not-current\">' . t('Changed!') . '</span>';\n break;\n case HACKED_STATUS_UNCHECKED:\n default:\n $row .= '<span class=\"\">' . t('Unchecked') . '</span>';\n break;\n }\n $row .= '<span class=\"icon\">' . $icon . '</span>';\n $row .= \"</div>\\n\";\n\n $row .= '<div class=\"project\">';\n if (isset($project['title'])) {\n if (isset($project['link'])) {\n $row .= l($project['title'], $project['link']);\n }\n else {\n $row .= check_plain($project['title']);\n }\n }\n else {\n $row .= check_plain($project['name']);\n }\n $row .= ' ' . check_plain($project['existing_version']);\n if ($project['install_type'] == 'dev' && !empty($project['datestamp'])) {\n $row .= ' <span class=\"version-date\">(' . format_date($project['datestamp'], 'custom', 'Y-M-d') . ')</span>';\n }\n $row .= \"</div>\\n\";\n\n\n $row .= \"<div class=\\\"versions\\\">\\n\";\n $row .= '<table class=\"version version-latest\">';\n $row .= '<tr>';\n\n $unreadable_message = \"\";\n if ($project['unreadable_count'] > 0) {\n $unreadable_message = ', ' . format_plural($project['unreadable_count'], '1 unreadable file', '@count unreadable files');\n }\n\n $row .= '<td class=\"version-title\">'. format_plural($project['changed_count'], '1 file changed', '@count files changed') . ', ' . format_plural($project['deleted_count'], '1 file deleted', '@count files deleted') . $unreadable_message . \"</td>\\n\";\n $row .= '</tr>';\n $row .= '</table>';\n $row .= '<table class=\"version version-latest\">';\n $row .= '<tr>';\n $row .= '<td class=\"version-title\">'. l(t('View details of changes'), 'admin/reports/hacked/' . $project['short_name']) .\"</td>\\n\";\n $row .= '</tr>';\n\n $row .= '</table>';\n $row .= \"</div>\\n\";\n\n /*\n if (isset($project['recommended'])) {\n if ($project['status'] != UPDATE_CURRENT || $project['existing_version'] !== $project['recommended']) {\n\n // First, figure out what to recommend.\n // If there's only 1 security update and it has the same version we're\n // recommending, give it the same CSS class as if it was recommended,\n // but don't print out a separate \"Recommended\" line for this project.\n if (!empty($project['security updates']) && count($project['security updates']) == 1 && $project['security updates'][0]['version'] === $project['recommended']) {\n $security_class = ' version-recommended version-recommended-strong';\n }\n else {\n $security_class = '';\n $version_class = 'version-recommended';\n // Apply an extra class if we're displaying both a recommended\n // version and anything else for an extra visual hint.\n if ($project['recommended'] !== $project['latest_version']\n || !empty($project['also'])\n || ($project['install_type'] == 'dev'\n && isset($project['dev_version'])\n && $project['latest_version'] !== $project['dev_version']\n && $project['recommended'] !== $project['dev_version'])\n || (isset($project['security updates'][0])\n && $project['recommended'] !== $project['security updates'][0])\n ) {\n $version_class .= ' version-recommended-strong';\n }\n $row .= theme('update_version', $project['releases'][$project['recommended']], t('Recommended version:'), $version_class);\n }\n\n // Now, print any security updates.\n if (!empty($project['security updates'])) {\n foreach ($project['security updates'] as $security_update) {\n $row .= theme('update_version', $security_update, t('Security update:'), 'version-security'. $security_class);\n }\n }\n }\n\n if ($project['recommended'] !== $project['latest_version']) {\n $row .= theme('update_version', $project['releases'][$project['latest_version']], t('Latest version:'), 'version-latest');\n }\n if ($project['install_type'] == 'dev'\n && $project['status'] != UPDATE_CURRENT\n && isset($project['dev_version'])\n && $project['recommended'] !== $project['dev_version']) {\n $row .= theme('update_version', $project['releases'][$project['dev_version']], t('Development version:'), 'version-latest');\n }\n }\n\n if (isset($project['also'])) {\n foreach ($project['also'] as $also) {\n $row .= theme('update_version', $project['releases'][$also], t('Also available:'), 'version-also-available');\n }\n }\n\n $row .= \"</div>\\n\"; // versions div.\n */\n\n $row .= \"<div class=\\\"info\\\">\\n\";\n if (!empty($project['extra'])) {\n $row .= '<div class=\"extra\">' . \"\\n\";\n foreach ($project['extra'] as $key => $value) {\n $row .= '<div class=\"' . $value['class'] . '\">';\n $row .= check_plain($value['label']) . ': ';\n $row .= theme('placeholder', $value['data']);\n $row .= \"</div>\\n\";\n }\n $row .= \"</div>\\n\"; // extra div.\n }\n\n $row .= '<div class=\"includes\">';\n sort($project['includes']);\n $row .= t('Includes: %includes', array('%includes' => implode(', ', $project['includes'])));\n $row .= \"</div>\\n\";\n\n $row .= \"</div>\\n\"; // info div.\n\n if (!isset($rows[$project['project_type']])) {\n $rows[$project['project_type']] = array();\n }\n $rows[$project['project_type']][] = array(\n 'class' => $class,\n 'data' => array($row),\n );\n }\n\n $project_types = array(\n 'core' => t('Drupal core'),\n 'module' => t('Modules'),\n 'theme' => t('Themes'),\n 'disabled-module' => t('Disabled modules'),\n 'disabled-theme' => t('Disabled themes'),\n );\n foreach ($project_types as $type_name => $type_label) {\n if (!empty($rows[$type_name])) {\n $output .= \"\\n<h3>\" . $type_label . \"</h3>\\n\";\n $output .= theme('table', $header, $rows[$type_name], array('class' => 'update'));\n }\n }\n drupal_add_css(drupal_get_path('module', 'update') . '/update.css');\n return $output;\n}", "public function build()\n {\n return $this->subject('Report a Probleam by Learner')->view('mails.sendReportProblem')->with(['description' => $this->description , 'problem' => $this->problem,'question' => $this->question]);\n }", "function CanvassSummaryReport($iFYID)\n{\n $pdf = new PDF_CanvassBriefingReport();\n\n $pdf->SetMargins(20, 20);\n\n $curY = 10;\n\n $pdf->SetFont('Times', '', 24);\n\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, gettext('Canvass Summary Report').' '.date(SystemConfig::getValue(\"sDateFormatLong\")));\n\n $pdf->SetFont('Times', '', 14);\n\n $curY += 10;\n\n $pdf->SetFont('Times', '', 12);\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchName'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchAddress'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchCity').', '.SystemConfig::getValue('sChurchState').' '.SystemConfig::getValue('sChurchZip'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchPhone').' '.SystemConfig::getValue('sChurchEmail'));\n $curY += 10;\n $pdf->SetFont('Times', '', 14);\n\n $pdf->SetAutoPageBreak(1);\n\n $pdf->Write(5, \"\\n\\n\");\n\n $sSQL = 'SELECT * FROM canvassdata_can WHERE can_FYID='.$iFYID;\n $rsCanvassData = RunQuery($sSQL);\n\n foreach ([gettext('Positive'), gettext('Critical'), gettext('Insightful'), gettext('Financial'), gettext('Suggestion'), gettext('WhyNotInterested')] as $colName) {\n $pdf->SetFont('Times', 'B', 14);\n\n $pdf->Write(5, $colName.' '.gettext('Comments').\"\\n\");\n //\t\t$pdf->WriteAt (SystemConfig::getValue(\"leftX\"), $curY, $colName . \" Comments\");\n $pdf->SetFont('Times', '', 12);\n while ($aDatum = mysqli_fetch_array($rsCanvassData)) {\n $str = $aDatum['can_'.$colName];\n if ($str != '') {\n $pdf->Write(4, $str.\"\\n\\n\");\n //\t\t\t\t$pdf->WriteAt (SystemConfig::getValue(\"leftX\"), $curY, $str);\n //\t\t\t\t$curY += SystemConfig::getValue(\"incrementY\");\n }\n }\n mysqli_data_seek($rsCanvassData, 0);\n }\n\n $pdf->Output('CanvassSummary'.date(SystemConfig::getValue(\"sDateFormatLong\")).'.pdf', 'D');\n}", "public function build()\n {\n\n $this->load();\n $this->html = $this->buildTable() ;\n\n return $this->html;\n\n }", "protected function RenderStatus_HTML_cells() {\n\t$qInStock = $this->QtyInStock();\n\t$out = \"<td>\"\n\t .$this->RenderPriceRange()\n\t .'</td><td>'\n\t .$this->CatalogOptionsList()\n\t .'</td>'\n\t ;\n\tif ($qInStock > 0) {\n\t $out .= \"<td>$qInStock in stock</td>\";\n\t}\n\treturn $out;\n }", "public function new_cell($css = '', $extras='') {\n\n $opts = '';\n\n if ($css == '') {\n $cssfirst = true;\n } else {\n $cssfirst = false;\n }\n\n // Close the previous cell if needed\n if ($this->_cellopen) {\n $this->end_cell();\n }\n\n // Check if column span was set via $this->set_colspan()\n if ($this->_colspan > 1) {\n $opts .= ' colspan=\"'.$this->_colspan.'\"';\n\n $this->_colspan = 0;\n }\n\n // Check if row span was set via $this->set_rowspan()\n if ($this->_rowspan > 1) {\n $opts .= ' rowspan=\"'.$this->_rowspan.'\"';\n\n $this->_rowspan = 0;\n }\n\n // Check if width was set via $this->set_width()\n if ($this->_width > 0) {\n $opts .= ' width=\"'.$this->_width.$this->_wpp.'\"';\n\n $this->_width = 0;\n $this->_wpp = '';\n }\n\n // Check if height was set via $this->set_height()\n if ($this->_height > 0) {\n $opts .= ' height=\"'.$this->_height.$this->_hpp.'\"';\n\n $this->_height = 0;\n $this->_hpp = '';\n }\n\n if ($this->_celltitledata != '') {\n $opts .= ' title=\"'.$this->_celltitledata.'\"';\n\n $this->_celltitledata = '';\n }\n\n if ($this->_newid != '') {\n $opts .= ' id=\"'.$this->_newid.'\"';\n\n $this->_newid = '';\n }\n\n if ($this->_onclickdata != '') {\n $opts .= ' onclick=\"'.$this->_onclickdata.'\"';\n\n $this->_onclickdata = '';\n }\n\n if ($this->_onmouseoverdata != '') {\n $opts .= ' onmouseover=\"'.$this->_onmouseoverdata.'\"';\n\n $this->_onmouseoverdata = '';\n }\n\n if ($css != '') {\n $opts = ' class=\"'.$css.'\"'.$opts;\n }\n\n if ($extras != '') {\n // Allows inline styles to override formatting in the CSS stylesheet\n $opts .= ' '.$extras;\n }\n\n echo '<td'.$opts.'>';\n $this->_cellopen = true;\n }", "function createReportAllProducts($dataMatrix){\n $this->AliasNbPages();\n $this->AddPage();\n\n // Título del reporte\n $this->SetFont($this->font,'B',$this->fontSize - 1);\n $this->Cell(0,$this->fontSize / 2,'Reporte de todos los productos',1,0,'C');\n $this->Ln();\n $this->Ln(3);\n\n //Variables\n $this->font = 'Arial';\n $this->fontSize = 8;\n\n $this->SetFont($this->font,'B',$this->fontSize);\n\n //Body Format\n $header = array( \"ID Inventario\",\n \"No. Serial\",\n \"Color\",\n \"Marca\",\n \"Modelo\",\n \"ID Area\",\n \"ID Ubicacion\",\n \"Estado\"\n );\n\n\n $this->printMatrix($header,$dataMatrix);\n $this->putWaterMarkIMG();\n $this->Output();\n }", "public function setBody()\r\n {\r\n $this->attributeAndValue = $this->bodyInit();\r\n $this->exportTable[] = array_keys($this->attributeAndValue);\r\n\r\n /*\r\n * Initialization of Body of the excel array\r\n * */\r\n $exportField = array();\r\n $itemCount = 0;\r\n foreach ($this->projectCollection as $item){\r\n $itemCount++;\r\n $count = 0;\r\n foreach ($this->attributeAndValue as $index=>$attribute){\r\n $index = array_keys($attribute)[0];\r\n $attribute = array_values($attribute)[0];\r\n if(is_string ($index)){\r\n // true when relation is passed as an array, can be nested relation too.. $project->creator->district->zone->name\r\n $exportField[$count++] = self::getValueFromRelation($item,$index,$attribute,$itemCount);\r\n }else if(strpos( $attribute, \"()\") !== false) {\r\n #passed if it is a function i.e. $project->projectCost();\r\n $method = str_replace(\"()\", \"\", $attribute);\r\n if(!method_exists ( $item , $method)){\r\n throw new Exception(\"Method $method() not found \".get_class($item). \". Check your array declaration in bodyInit() method\");\r\n }\r\n $exportField[$count++] = $item->$method();\r\n }\r\n else{\r\n #passed, direct relation\r\n $exportField[$count++] = $item->$attribute;\r\n }\r\n }\r\n $this->exportTable[] = $exportField;\r\n }\r\n $this->checkFileName();\r\n }", "public function create()\n\t{\n\t\t//\n\t\treturn View::make('dashboard.b.reports.create');\n\t}", "public function create()\n {\n return view('admin.report.create');\n }", "function createSpreadsheet(){\n\t\t\n\t\n\t\terror_reporting(E_ALL);\n\t\tini_set('display_errors', TRUE);\n\t\tini_set('display_startup_errors', TRUE);\n\t\n\t\tdefine('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');\n\t\n\t\t/** Include PHPExcel */\n\t\t//require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';\n\t\t\n\t\trequire_once $GLOBALS['ROOT_PATH'].'Classes/PHPExcel.php';\n\t\n\t\n\t\tPHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() );\n\t\n\t\t// Create new PHPExcel object\n\t\t$objPHPExcel = new PHPExcel();\n\t\t$currentMonth = date('Y-m');\n\t\t$title = $this->getHhName() . ' ' . $currentMonth;\n\t\t\n\t\t// Set document properties\n\t\t$objPHPExcel->getProperties()->setCreator(\"HhManagement\")\n\t\t->setLastModifiedBy(\"HhManagement\")\n\t\t->setTitle($title)\n\t\t->setSubject($currentMonth);\n\t\n\t\t//default styles\n\t\t$objPHPExcel->getDefaultStyle()->getFont()->setName('Calibri');\n\t\t$objPHPExcel->getDefaultStyle()->getFont()->setSize(12);\n\t\n\t\n\t\t//styles....\n\t\n\t\t//fonts\n\t\t//font red bold italic centered\n\t\t$fontRedBoldItalicCenter = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'italic' => true,\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'alignment' => array (\n\t\t\t\t\t\t'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER,\n\t\t\t\t\t\t'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font red bold\n\t\t$fontRedBold = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font red\n\t\t$fontRed = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font Green\n\t\t$fontGreen = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => '0008B448',\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font Bold Italic\n\t\t$fontBoldItalic = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'italic' => true,\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font Bold Italic Centered\n\t\t$fontBoldItalicCenter = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'italic' => true,\n\t\t\t\t),\n\t\t\t\t'alignment' => array (\n\t\t\t\t\t\t'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER,\n\t\t\t\t\t\t'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n\t\t\t\t)\n\t\t);\n\t\n\t\t//background fillings\n\t\t//fill red\n\t\t$fillRed = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill yellow\n\t\t$fillYellow = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF2E500',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill green\n\t\t$fillGreen = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FF92D050',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill gray\n\t\t$fillGray = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFD9D9D9',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill cream\n\t\t$fillCream = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFC4BD97',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//sets the heading for the first table\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1')->applyFromArray($fillCream);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B1','Equal AMT');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B1')->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B1')->applyFromArray($fillCream);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C1','Ind. bills');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C1')->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C1')->applyFromArray($fillCream);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('D1','To rent');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D1')->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D1')->applyFromArray($fillCream);\n\t\n\t\t$numberOfMembers = $this->getNumberOfMembers();\n\t\t$monthTotal = $this->getMonthTotal();\n\t\t$rent = $this->getHhRent();\n\t\t$col = 65;//starts at column A\n\t\t$row = 2;//the table starts at row 2\n\t\n\t\t//array used to associate the bills with the respective user\n\t\t$array =[];\n\t\n\t\t//sets the members names fair amount and value\n\t\t$members = $this->getMembers();\n\t\tforeach ($members as $member) {\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$cellName = chr($col) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cellName,$name);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellName)->applyFromArray($fontBoldItalic);\n\t\n\t\t\t$cellInd = chr($col+2) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cellInd,'0.0');\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellInd)->getNumberFormat()\n\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellInd)->applyFromArray($fillRed);\n\t\n\t\t\t$cellFair = chr($col+1) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellFair)->applyFromArray($fontRed);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellFair)->getNumberFormat()\n\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellFair)->applyFromArray($fillGray);\n\t\n\t\t\t$cellRent = chr($col+3) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cellRent,'=SUM('. $cellFair .'-'. $cellInd .')');\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellRent)->applyFromArray($fontGreen);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellRent)->getNumberFormat()\n\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellInd)->applyFromArray($fillYellow);\n\t\n\t\t\t$array[$name]['cell'] = $cellInd;\n\t\t\t$row++;\n\t\t}\n\t\n\t\t//inserts the sum of the fair amounts to compare to the one below\n\t\t$endCell = chr($col+1) . ($row-1);\n\t\t$cell = chr($col+1) . $row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'=SUM(B2:'.$endCell.')');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRed);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGray);\n\t\n\t\t//insert the rent check values\n\t\t$cell = chr($col+2) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Rent');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalic);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\t$cell = chr($col+3) . $row;\n\t\t$endCell = chr($col+3) .($row-1);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'=SUM(D2:'.$endCell.')');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRedBold);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\n\t\t//inserts the bill and amount labels\n\t\t$row += 2;\n\t\t$cellMergeEnd = chr($col+1) . $row;\n\t\t$cell = chr($col) . $row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'House bills');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->mergeCells($cell.':'.$cellMergeEnd);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillRed);\n\t\n\t\t$cell = chr($col) . $row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Bill');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGreen);\n\t\n\t\t$cell = chr($col+1) . $row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Amount');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGreen);\n\t\n\t\n\t\t//inserts the bills\n\t\t$startCell = chr($col+1) . $row;\n\t\tforeach ($members as $member) {\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$col = 65;\n\t\t\t$bills = $member->getBills();\n\t\t\t$array[$name]['bills'] = [];\n\t\t\tforeach ($bills as $bill) {\n\t\t\t\t$desc = $bill->getBillDescription();\n\t\t\t\t$amount = $bill->getBillAmount();\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue(chr($col) . $row,$desc);\n\t\t\t\t$amountCell = chr($col+1) . $row++;\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($amountCell,$amount);\n\t\t\t\t$objPHPExcel->getActiveSheet()->getStyle($amountCell)->getNumberFormat()\n\t\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t\tarray_push($array[$name]['bills'], $amountCell);\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t\t$col = 65;\n\t\n\t\t//inserts rent\n\t\t$cell = chr($col) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Rent');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\n\t\t$cell = chr($col+1) . $row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,$rent);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\t$endCell = chr($col+1) . ($row-1);\n\t\n\t\t//inserts the total of bills\n\t\t$col = 65;\n\t\t$cell = chr($col) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Total H-B');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillCream);\n\t\n\t\t$cell = chr($col+1) .$row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell, '=SUM('. $startCell .':'. $endCell .')');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillCream);\n\t\n\t\t//inserts the fair amount\n\t\t$cell = chr($col) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Fair Amount if ' . $numberOfMembers);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGray);\n\t\t$cell = chr($col+1) .$row;\n\t\t$objPHPExcel->getActiveSheet()\n\t\t->setCellValue($cell,'='. chr($col+1) .($row-1) . '/' . $numberOfMembers);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGray);\n\t\t$fairAmountCell = chr($col+1) . $row;\n\t\n\t\t$row = 2;\n\t\tforeach ($members as $member) {\n\t\t\t$col = 66;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue(chr($col) . $row++,'='. $fairAmountCell);\n\t\t}\n\t\n\t\t//inserts the individual bills\n\t\tforeach ($array as $value){\n\t\t\t$cell = $value['cell'];\n\t\t\t$sumOfBills = '';\n\t\t\t\t\n\t\t\tif (isset($value['bills'])) {\n\t\t\t\t$bills = $value['bills'];\n\t\t\t\t$counter = 1;\n\t\t\t\tforeach ($bills as $bill){\n\t\t\t\t\tif ($counter == 1){\n\t\t\t\t\t\t$sumOfBills .= $bill;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sumOfBills .= '+' . $bill;\n\t\t\t\t\t}\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'=SUM('. $sumOfBills . ')');\n\t\t}\n\t\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(true);\n\t\n\t\t// Rename worksheet\n\t\t$objPHPExcel->getActiveSheet()->setTitle($title);\n\t\n\t\t// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->setPreCalculateFormulas(true);\n\t\t//$objWriter->save(str_replace('.php', '.xlsx', __FILE__));\n\t\t$objWriter->save(str_replace('.php', '.xlsx', $GLOBALS['ROOT_PATH']. 'spreadsheets/'. $title .'.php'));\n\t\n\t\treturn $title . '.xlsx';\n\t}", "function FrontPageTable(){\r\n //$this->SetFillColor(135,206,250);\r\n $this->SetFillColor(176,196,222);\r\n $this->SetTextColor(0);\r\n $this->SetDrawColor(0,0,0);\r\n $this->SetLineWidth(.3);\r\n $this->SetFont('','B');\r\n // Header\r\n\r\n $this->SetX(35);\r\n $this->Cell(70,7,'Prepared By:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetTextColor(0,0,0);\r\n $this->SetFont('');\r\n $this->Cell(70,7,$this->PreparedBy,1,0,'C',false);\r\n $this->Cell(40,7,'NRAO',1,0,'C',false);\r\n $this->Cell(40,7,$this->MakeDate,1,0,'C',false);\r\n $this->Ln();\r\n\r\n\r\n $this->SetX(35);\r\n $this->SetTextColor(0);\r\n $this->SetFont('','B');\r\n $this->Cell(70,7,'FEIC WP Manager Approval:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetFont('');\r\n $this->Cell(70,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetTextColor(0);\r\n $this->SetFont('','B');\r\n $this->Cell(70,7,'FE System Engineering Approval:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetFont('');\r\n $this->Cell(70,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetTextColor(0);\r\n $this->SetFont('','B');\r\n $this->Cell(70,7,'FE IPT Lead Approval:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetFont('');\r\n $this->Cell(70,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Ln();\r\n\r\n // Color and font restoration\r\n $this->SetFillColor(224,235,255);\r\n $this->SetTextColor(255);\r\n $this->SetFont('');\r\n // Data\r\n $fill = false;\r\n }", "public function displayBuildingTable()\n {\n echo \"\n <tr>\n <td>\" . getBuildingRoomCount( $this->id ) . \"</td>\n <td>\n <a href='helper/buildVncFile.php?buildingId=\" . $this->id . \"' class='btn medium bg-blue-alt tooltip-button' data-placement='top' title='Building Info'>\n <i class='glyph-icon icon-info'></i>\n </a>\n <a href='buildingRooms.php?buildingId=\" . $this->id . \"' class='btn medium bg-black font-white tooltip-button' data-placement='top' title='Rooms in Building'>\n <i class='glyph-icon icon-building-o'></i>\n </a>\n </td>\n <td class='font-bold text-left'>\" . $this->name . \"</td>\n <td class='font-bold text-left'>\" . $this->description . \"</td>\n </tr>\n \";\n }", "function generarReporteExcelCalificacionvspremarcado($arregloCompleto)\r\n{\r\n $libro = new PhpOffice\\PhpSpreadsheet\\Spreadsheet();\r\n //Reporte de indicadores I1\r\n $libro->getActiveSheet()->mergeCells('A1:H1');\r\n $libro->getActiveSheet()->getStyle('A1:H2')->getFont()->setBold(true);\r\n $hoja = $libro->getActiveSheet();\r\n $libro->getSheet(0)->getColumnDimension('A')->setAutoSize(true);\r\n $libro->getSheet(0)->getColumnDimension('B')->setAutoSize(true);\r\n $libro->getSheet(0)->getColumnDimension('C')->setAutoSize(true);\r\n $libro->getSheet(0)->getColumnDimension('D')->setAutoSize(true);\r\n $libro->getSheet(0)->getColumnDimension('E')->setAutoSize(true);\r\n $libro->getSheet(0)->getColumnDimension('G')->setAutoSize(true);\r\n $libro->getSheet(0)->getColumnDimension('H')->setAutoSize(true);\r\n\r\n\r\n $hoja->setTitle('I1');\r\n $libro->getActiveSheet()->getStyle('A1:H2')->getFill()\r\n ->setFillType(\\PhpOffice\\PhpSpreadsheet\\Style\\Fill::FILL_SOLID)\r\n ->getStartColor()->setARGB('0070C0');\r\n $libro->getSheet(0)->getStyle('A1:H2')\r\n ->getFont()->getColor()->setARGB(\\PhpOffice\\PhpSpreadsheet\\Style\\Color::COLOR_WHITE);\r\n $hoja->setCellValue('A1', 'Calificacion vs premarcado');\r\n $hoja->setCellValue('A2', 'Dane');\r\n $hoja->setCellValue('B2', 'Colegio');\r\n $hoja->setCellValue('C2', 'Producto');\r\n $hoja->setCellValue('D2', 'Premarcado');\r\n $hoja->setCellValue('E2', 'Calificado');\r\n $hoja->setCellValue('F2', 'Distribuidor');\r\n $hoja->setCellValue('G2', 'Ciudad');\r\n $hoja->setCellValue('H2', 'Fecha de creacion');\r\n $iterador = 3;\r\n\r\n for ($i = 0; $i < count($arregloCompleto); $i++) {\r\n $hoja->setCellValue('A' . $iterador, $arregloCompleto[$i]['dane']);\r\n $hoja->setCellValue('B' . $iterador, $arregloCompleto[$i]['colegio']);\r\n for ($n = 0; $n < count($arregloCompleto[$i]['cantidad']); $n++) {\r\n $hoja->setCellValue('A' . $iterador, $arregloCompleto[$i]['dane']);\r\n $hoja->setCellValue('B' . $iterador, $arregloCompleto[$i]['colegio']);\r\n $hoja->setCellValue('C' . $iterador, $arregloCompleto[$i]['cantidad'][$n]['producto']);\r\n $hoja->setCellValue('D' . $iterador, $arregloCompleto[$i]['cantidad'][$n]['premarcado']);\r\n $hoja->setCellValue('E' . $iterador, $arregloCompleto[$i]['cantidad'][$n]['calificado']);\r\n $hoja->setCellValue('F' . $iterador, $arregloCompleto[$i]['cantidad'][$n]['distribuidor']);\r\n $hoja->setCellValue('G' . $iterador, $arregloCompleto[$i]['cantidad'][$n]['ciudad']);\r\n $hoja->setCellValue('H' . $iterador, $arregloCompleto[$i]['cantidad'][$n]['fechaCreacion']);\r\n $iterador++;\r\n }\r\n\r\n\r\n }\r\n $styleArray = [\r\n 'borders' => [\r\n 'allBorders' => [\r\n 'borderStyle' => \\PhpOffice\\PhpSpreadsheet\\Style\\Border::BORDER_THIN,\r\n 'color' => ['arg' => '000'],\r\n ],\r\n\r\n ],\r\n 'alignment' => [\r\n 'horizontal' => \\PhpOffice\\PhpSpreadsheet\\Style\\Alignment::HORIZONTAL_CENTER,\r\n ],\r\n ];\r\n\r\n $libro->getSheet(0)->getStyle('A1:H' . $iterador)->applyFromArray($styleArray);\r\n\r\n $excel = new \\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx($libro);\r\n\r\n $excel->save('./App/public/excel/calificacionvspremarcado.xlsx');\r\n\r\n return '/excel/calificacionvspremarcado.xlsx';\r\n}", "public static function formatMonthlyBillsToExcelExport(Project $project, BillElectricitySource $electricity_bill)\n {\n return Excel::create($electricity_bill->date_covered.' '.$project->name, function($excel) use ($project, $electricity_bill) {\n $excel->setTitle($electricity_bill->date_covered.' '.$project->name);\n\n $developer = Developer::getCurrentDeveloper();\n $excel->setCompany($developer->name);\n\n $excel->setDescription(\"Water bills for \".$project->name.' '.$electricity_bill->date_covered);\n $excel->sheet($electricity_bill->date_covered, function($sheet) use ($project, $electricity_bill) {\n \n $sheet->row(1, array('PROPERTY','DATE COVERED','CONSUMPTION','BILL','PAYMENT','DATE','REMARKS'));\n\n $sheet->cells('A1:G1', function($cells) {\n $cells->setAlignment('center');\n $cells->setFontWeight('bold');\n });\n\n $properties = Property::leftJoin('bills_electricity_source_details','bills_electricity_source_details.property_id','=','properties.id')\n ->whereRaw(DB::raw('bills_electricity_source_details.bills_electricity_source_id = '.$electricity_bill->id))\n ->get();\n\n $start = 2;\n for($i=$start;$i<count($properties)+$start;$i++){\n $sheet->row($i, array(\n $properties[$i-$start]->name,\n $properties[$i-$start]->date_covered,\n number_format($properties[$i-$start]->consumption, 4, '.', ','),\n number_format($properties[$i-$start]->bill, 4, '.', ','),\n number_format($properties[$i-$start]->payment, 4, '.', ','),\n ($properties[$i-$start]->date_payment != '0000-00-00') ? $properties[$i-$start]->date_payment : \"\",\n $properties[$i-$start]->remarks));\n\n $sheet->cells('A'.$i.':G'.$i, function($cells){\n $cells->setAlignment('center');\n });\n }\n });\n });\n }", "public function get_cell_info($template) {\n $template['icon-css'] = 'icon-views ont-color-orange ont-icon-22';\n\t\t$template['preview-image-url'] = WPDDL_RES_RELPATH . '/images/post-content.png';\n\t\t$template['name'] = __('Content Template (custom fields, taxonomy and content)', 'ddl-layouts');\n\t\t$template['description'] = __('Display different fields of any page, post or custom type. This cell supports HTML for styling and shortcodes for the different fields.', 'ddl-layouts');\n\t\t$template['button-text'] = __('Assign Content Template Box', 'ddl-layouts');\n\t\t$template['dialog-title-create'] = __('Create a new Content Template Cell', 'ddl-layouts');\n\t\t$template['dialog-title-edit'] = __('Edit Content Template Cell', 'ddl-layouts');\n\t\t$template['dialog-template'] = $this->_dialog_template();\n\t\t$template['category'] = __('Post display', 'ddl-layouts');\n\t\treturn $template;\n\t}", "protected function compile()\n\t{\n\t\t$id = $this->gridtools_grid;\n\t\t$query = $this->Database->prepare(\"SELECT configuration FROM tl_gridtools WHERE id=?\")->limit(1)->execute($id);\n\t\tif($query->numRows)\n\t\t{\n\t\t\t$raw = $query->configuration;\n\t\t}\n\n\t\t$id = $this->id;\n\t\t$objElements = $this->findPublishedByGridToolsParentAndTable($id, 'tl_article');\n\n\t\t$contentElements = array();\n\t\tif($objElements !== null)\n\t\t{\n \t\twhile($objElements->next())\n \t\t{\n \t\t$contentElements[$objElements->gridtools_row][$objElements->gridtools_col][] = $this->getContentGridToolsElement($objElements->id);\n \t\t}\n\t\t}\n\n\t\t$raw = str_replace('\"', '\\\"', $raw);\n\t\t$raw = str_replace('\\'', '\"', $raw);\n\t\t$valArr = json_decode($raw, true);\n\n\t\t$valHtml = '';\n\t\t$gridWrap = explode('|', $valArr['wrap']);\n\t\t$valHtml .= $gridWrap[0];\n\t\tforeach($valArr['rows'] as $rowKey => $rowVal)\n\t\t{\n\t\t\t$rowWrap = explode('|', $rowVal['wrap']);\n\t\t\t$valHtml .= $rowWrap[0];\n\t\t\tforeach($rowVal['columns'] as $colKey => $colVal)\n\t\t\t{\n\t\t\t\t$colWrap = explode('|', $colVal['wrap']);\n\t\t\t\t$valHtml .= $colWrap[0];\n\t\t\t\tif($contentElements[$rowKey][$colKey])\n\t\t\t\t{\n\t\t\t\t\tforeach($contentElements[$rowKey][$colKey] as $contentKey => $contentVal)\n\t\t\t\t\t{\n\t\t\t\t\t\t$valHtml .= $contentVal;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$valHtml .= $colWrap[1];\n\t\t\t}\n\t\t\t$valHtml .= $rowWrap[1];\n\t\t}\n\t\t$valHtml .= $gridWrap[1];\n\n\t\t$this->Template->gridTools = $valHtml;\n\n\t\treturn;\n\t}", "public function create()\n {\n return view('admin.builds.create', ['types' => TypeBuild::all()]);\n }", "public function create()\n {\n return view(\"report.selection_range\")->with(['title'=>'Generating expense report']);\n }", "public function run()\n {\n $year = chartYear();\n $metrics = new \\App\\Helpers\\Report;\n\n $worked = [\n 'jan' => toHours($metrics->workedByMonth(1, $year)),\n 'feb' => toHours($metrics->workedByMonth(2, $year)),\n 'mar' => toHours($metrics->workedByMonth(3, $year)),\n 'apr' => toHours($metrics->workedByMonth(4, $year)),\n 'may' => toHours($metrics->workedByMonth(5, $year)),\n 'jun' => toHours($metrics->workedByMonth(6, $year)),\n 'jul' => toHours($metrics->workedByMonth(7, $year)),\n 'aug' => toHours($metrics->workedByMonth(8, $year)),\n 'sep' => toHours($metrics->workedByMonth(9, $year)),\n 'oct' => toHours($metrics->workedByMonth(10, $year)),\n 'nov' => toHours($metrics->workedByMonth(11, $year)),\n 'dec' => toHours($metrics->workedByMonth(12, $year)),\n ];\n\n $billed = [\n 'jan' => toHours($metrics->workedByMonth(1, $year, 'billed')),\n 'feb' => toHours($metrics->workedByMonth(2, $year, 'billed')),\n 'mar' => toHours($metrics->workedByMonth(3, $year, 'billed')),\n 'apr' => toHours($metrics->workedByMonth(4, $year, 'billed')),\n 'may' => toHours($metrics->workedByMonth(5, $year, 'billed')),\n 'jun' => toHours($metrics->workedByMonth(6, $year, 'billed')),\n 'jul' => toHours($metrics->workedByMonth(7, $year, 'billed')),\n 'aug' => toHours($metrics->workedByMonth(8, $year, 'billed')),\n 'sep' => toHours($metrics->workedByMonth(9, $year, 'billed')),\n 'oct' => toHours($metrics->workedByMonth(10, $year, 'billed')),\n 'nov' => toHours($metrics->workedByMonth(11, $year, 'billed')),\n 'dec' => toHours($metrics->workedByMonth(12, $year, 'billed')),\n ];\n\n return view(\n 'widgets.timetracking.yearly_overview', [\n 'config' => $this->config,\n 'year' => $year,\n 'billed' => $billed,\n 'worked' => $worked\n ]\n );\n }", "public function renderReport($report) {\n $build = [];\n // The report header.\n $build['report_label'] = [\n '#type' => 'html_tag',\n '#tag' => 'h2',\n '#value' => $report->getLabel() . ' ',\n '#attributes' => [\n 'id' => $report->getPluginId(),\n ],\n 'percent' => [\n '#type' => 'html_tag',\n '#tag' => 'span',\n '#value' => $report->getPercent() . '%',\n '#attributes' => [\n 'class' => 'label label-' . $this->getPercentCssClass($report->getPercent()),\n ],\n ],\n ];\n\n $percent = $report->getPercent();\n\n if ($percent != SiteAuditCheckBase::AUDIT_CHECK_SCORE_INFO) {\n // Show percent.\n $build['report_label']['percent'] = [\n '#type' => 'html_tag',\n '#tag' => 'span',\n '#value' => $percent . '%',\n '#prefix' => ' ',\n '#attributes' => [\n 'class' => 'label label-' . $this->getPercentCssClass($percent),\n ],\n ];\n }\n else {\n $build['label']['info'] = [\n '#type' => 'html_tag',\n '#tag' => 'span',\n '#value' => $this->t('Info'),\n '#attributes' => [\n 'class' => 'label label-info',\n ],\n ];\n }\n\n if ($percent == 100) {\n $build['success'] = [\n '#type' => 'html_tag',\n '#tag' => 'p',\n '#value' => '<strong>' . $this->t('Well done!') . '</strong> ' . $this->t('No action required.'),\n '#attributes' => [\n 'class' => 'text-success',\n ],\n ];\n }\n\n if ($this->options['detail'] || $percent != 100) {\n foreach ($report->getCheckObjects() as $check) {\n $checkBuild = [];\n $score = $check->getScore();\n if ($this->options['detail'] || $score < SiteAuditCheckBase::AUDIT_CHECK_SCORE_PASS || $percent == SiteAuditCheckBase::AUDIT_CHECK_SCORE_INFO) {\n // Heading.\n $checkBuild['panel']['panel_heading'] = [\n '#type' => 'html_tag',\n '#tag' => 'div',\n '#value' => '<strong>' . $check->getLabel() . '</strong>',\n '#attributes' => [\n 'class' => 'panel-heading',\n ],\n ];\n\n if ($this->options['detail']) {\n $checkBuild['panel']['panel_heading']['description'] = [\n '#type' => 'html_tag',\n '#tag' => 'small',\n '#value' => '- ' . $check->getDescription(),\n ];\n }\n\n // Result.\n $checkBuild['#result'] = $check->getResult();\n if (is_array($check->getResult())) {\n $checkBuild['result'] = $check->getResult();\n $checkBuild['result']['#attributes']['class'] = 'well result';\n }\n else {\n $checkBuild['detail'] = [\n '#type' => 'html_tag',\n '#tag' => 'p',\n '#value' => $check->getResult(),\n '#attributes' => [\n 'class' => 'well result',\n ],\n ];\n }\n\n // Action.\n if ($action = $check->renderAction()) {\n $checkBuild['action'] = [\n '#type' => 'html_tag',\n '#tag' => 'div',\n '#attributes' => [\n 'class' => 'well action',\n ],\n ];\n if (!is_array($action)) {\n $checkBuild['action']['text'] = [\n '#type' => 'html_tag',\n '#tag' => 'p',\n '#value' => $action,\n ];\n }\n else {\n $checkBuild['action']['rendered'] = $action;\n }\n }\n }\n $build[$check->getPluginId()] = [\n '#type' => 'html_tag',\n '#tag' => 'div',\n // '#value' => '<strong>' . $this->t('Well done!') . '</strong> ' . $this->t('No action required.'),.\n '#attributes' => [\n 'class' => 'panel panel-' . $this->getScoreCssClass($check->getScore()),\n ],\n $checkBuild,\n ];\n }\n }\n return $build;\n }", "public function generateReport()\n {\n $activities = '';\n // General information.\n $totalExecution = $this->getActivityDetails(DFullProfiler::ACTIVITY_TOTAL);\n $report = '<h2>General Performance Details</h2>';\n $report .= '<table><tbody>';\n $report .= sprintf(\"\\t<th width=\\\"180px\\\">Total Execution Time</th><td>%0.4f sec</td></tr>\\n\",\n $totalExecution[ DFullProfiler::ACTIVITY_POINT_END ][ DFullProfiler::ACTIVITY_VALUE_TIME ]);\n $report .= sprintf(\"\\t<th width=\\\"180px\\\">Query Execution Time</th><td>%0.4f sec (%0.1f%%)</td></tr>\\n\",\n $this->queryExecutionTime,\n ($this->queryExecutionTime / $totalExecution[ DFullProfiler::ACTIVITY_POINT_END ][ DFullProfiler::ACTIVITY_VALUE_TIME ] * 100));\n $report .= sprintf(\"\\t<th width=\\\"180px\\\">Query Processing Time</th><td>%0.4f sec (%0.1f%%)</td></tr>\\n\",\n $this->queryProcessingTime,\n ($this->queryProcessingTime / $totalExecution[ DFullProfiler::ACTIVITY_POINT_END ][ DFullProfiler::ACTIVITY_VALUE_TIME ] * 100));\n $report .= sprintf(\"\\t<tr><th width=\\\"180px\\\">Memory Cache Usage</th><td>%0.4f sec (%0.1f%%) [%d Hits, %d Missed, %d Added, %d Removed, %d Invalidations]</td></tr>\\n\",\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_EXECUTION_TIME ],\n ($this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_EXECUTION_TIME ] / $totalExecution[ DFullProfiler::ACTIVITY_POINT_END ][ DFullProfiler::ACTIVITY_VALUE_TIME ] * 100),\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_HIT ],\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_MISS ],\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_ADD ],\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_REMOVE ],\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_INVALIDATION ]);\n $report .= \"\\t<tr><th width=\\\"180px\\\">Peak Memory Usage</th><td>\" . DFile::bytesToString(memory_get_peak_usage(),\n 5) . \" (\" . DFile::bytesToString(DFile::stringToBytes(ini_get('memory_limit'))) . \" available)</td></tr>\\n\";\n $report .= '</tbody></table>';\n // Activity times.\n foreach ($this->activities as $name => $activity) {\n $end =& $activity[ DFullProfiler::ACTIVITY_POINT_END ];\n $length = $end[ DFullProfiler::ACTIVITY_VALUE_TIME ];\n $memory = DFile::bytesToString($end[ DFullProfiler::ACTIVITY_VALUE_MEMORY ], 2);\n $peakMemory = DFile::bytesToString($activity['peakMemory'], 2);\n $queries = $end[ DFullProfiler::ACTIVITY_VALUE_QUERIES ];\n $modelsMemory = $activity[ DFullProfiler::ACTIVITY_POINT_MODEL ][ DFullProfiler::MODEL_LOAD_MEMORY ];\n $modelsCache = $activity[ DFullProfiler::ACTIVITY_POINT_MODEL ][ DFullProfiler::MODEL_LOAD_CACHE ];\n $modelsDatabase = $activity[ DFullProfiler::ACTIVITY_POINT_MODEL ][ DFullProfiler::MODEL_LOAD_DATABASE ];\n $cacheHit = $activity[ DFullProfiler::ACTIVITY_POINT_CACHE ][ DCacheHandler::ACTION_HIT ];\n $cacheMiss = $activity[ DFullProfiler::ACTIVITY_POINT_CACHE ][ DCacheHandler::ACTION_MISS ];\n $iterations = $activity[ DFullProfiler::ACTIVITY_VALUE_ITERATIONS ];\n if ($iterations > 1) {\n $iterationLength = $length / $iterations;\n $iterationMemory = DFile::bytesToString($end[ DFullProfiler::ACTIVITY_VALUE_MEMORY ] / $iterations, 2);\n $iterationQueries = $queries / $iterations;\n $iterationObjectsMemory = $modelsMemory / $iterations;\n $iterationObjectsCache = $modelsCache / $iterations;\n $iterationObjectsDatabase = $modelsDatabase / $iterations;\n $iterationCacheHit = $cacheHit / $iterations;\n $iterationCacheMiss = $cacheMiss / $iterations;\n $activities .= sprintf(\"\\t<tr><th>%s</th><td class=\\\"good\\\">%0.4f sec<br />(%0.4f sec)</td><td class=\\\"good\\\">%s<br />(%s)</td><td class=\\\"good\\\">%s</td><td class=\\\"good\\\">%d<br />(%d)</td><td class=\\\"good\\\">%d<br />(%d)</td><td class=\\\"good\\\">%d<br />(%d)</td><td class=\\\"%s\\\">%d<br />(%d)</td><td class=\\\"good\\\">%d<br />(%d)</td><td class=\\\"%s\\\">%d<br />(%d)</td><td class=\\\"good\\\">%d</td></tr>\\n\",\n $name, $length, $iterationLength, $memory, $iterationMemory, $peakMemory,\n $queries, $iterationQueries, $modelsMemory, $iterationObjectsMemory,\n $modelsCache, $iterationObjectsCache, $modelsDatabase == 0 ? 'good' : 'bad',\n $modelsDatabase, $iterationObjectsDatabase, $cacheHit, $iterationCacheHit,\n $cacheMiss == 0 ? 'good' : 'bad', $cacheMiss, $iterationCacheMiss, $iterations);\n } else {\n $activities .= sprintf(\"\\t<tr><th>%s</th><td class=\\\"good\\\">%0.4f sec</td><td class=\\\"good\\\">%s</td><td class=\\\"good\\\">%s</td><td class=\\\"good\\\">%d</td><td class=\\\"good\\\">%d</td><td class=\\\"good\\\">%d</td><td class=\\\"%s\\\">%d</td><td class=\\\"good\\\">%d</td><td class=\\\"%s\\\">%d</td><td class=\\\"good\\\">%d</td></tr>\\n\",\n $name, $length, $memory, $peakMemory, $queries, $modelsMemory, $modelsCache,\n $modelsDatabase == 0 ? 'good' : 'bad', $modelsDatabase, $cacheHit,\n $cacheMiss == 0 ? 'good' : 'bad', $cacheMiss, $iterations);\n }\n }\n $report .= '<h2>Performance Break-down</h2>';\n $report .= sprintf('<table><thead><tr><th width=\"100px\" rowspan=\"2\">Activity</th><th rowspan=\"2\">Execution Time</td><th rowspan=\"2\">Memory Usage<br />Differential</th><th rowspan=\"2\">Memory Usage<br />Peak</th><th rowspan=\"2\">Queries</th><th colspan=\"3\">Loaded Models</th><th colspan=\"2\">Cache Activity</th><th rowspan=\"2\">Iterations</th></tr><tr><th>Memory</th><th>Cache</th><th>Database</th><th>Hit</th><th>Miss</th></tr></thead><tbody>%s</tbody></table>',\n $activities);\n // Query information.\n $report .= $this->generateQueryReport();\n // Cache information.\n $report .= $this->generateCachesReport() . '<br />';\n $url = DRequest::load()->getUrl();\n\n return \"<h1 id=\\\"\" . count(DErrorHandler::$profiling) . \"\\\">Profiler ({$url})</h1>{$report}\";\n }", "public function generateReport()\n {\n $svn_info = explode(\" \", exec(\"svn info | grep Revision\"));\n $this->result[\"revision\"] = $svn_info[1];\n\n //loop through all files and generate coverage files for them\n $it = new RecursiveDirectoryIterator(Doctrine_Core::getPath());\n $notCoveredArray = array();\n foreach (new RecursiveIteratorIterator($it) as $file) {\n\n if (strpos($file->getPathname(), \"config.php\")) {\n continue;\n }\n\n if (strpos($file->getPathname(), \".svn\")) {\n continue;\n } \n \n $class = $this->getClassNameFromFileName($file->getPathname());\n\n if (strpos($class, '_Interface')) {\n continue;\n }\n\n if ( ! class_exists($class)) {\n continue;\n }\n\n if (isset($this->result['coverage'][$file->getPathname()])) {\n $coverageInfo[$class] = $this->generateCoverageInfoCoveredFile($file->getPathname());\n $this->saveFile($file->getPathname());\n } else {\n $coverageInfo[$class] = $this->generateCoverageInfoNotCoveredFile($class);\n }\n }\n $this->result[\"totals\"] = array(\n \"lines\" => $this->totallines, \n \"notcovered\" => $this->totalnotcovered,\n \"covered\" => $this->totalcovered, \n \"maybe\" => $this->totalmaybe, \n \"percentage\" => $this->calculateTotalPercentage()); \n\n $this->result[\"data\"] = $coverageInfo;\n\n file_put_contents($this->getCoverageDir() . \"coverage.txt\", serialize($this->result));\n return true;\n\n }", "public static function formatMonthlyBillsToPdfExport(Project $project, BillWaterSource $water_bill)\n {\n return Excel::create($water_bill->date_covered.' '.$project->name, function($excel) use ($project, $water_bill) {\n $excel->setTitle($water_bill->date_covered.' '.$project->name);\n\n $developer = Developer::getCurrentDeveloper();\n $excel->setCompany($developer->name);\n\n $excel->setDescription(\"Water bills for \".$project->name.' '.$water_bill->date_covered);\n $excel->sheet($water_bill->date_covered, function($sheet) use ($project, $water_bill) {\n \n $properties = Property::leftJoin('bills_water_source_details','bills_water_source_details.property_id','=','properties.id')\n ->whereRaw(DB::raw('bills_water_source_details.bills_water_source_id = '.$water_bill->id))\n ->get();\n\n $sheet->setPageMargin(array(\n 0.25, 0.10, 0.25, 0.10\n ));\n\n $sheet->setBorder(\"A1:F\".(count($properties)+2), 'none');\n \n $sheet->row(1, array($project->name.' '.$water_bill->date_covered, \"\",\"\",\"\",\"\",\"\"));\n $sheet->row(2, array('PROPERTY','BILL','PAYMENT','DATE','REMARKS'));\n\n $sheet->cells('A2:E2', function($cells) {\n $cells->setAlignment('center');\n $cells->setFontWeight('bold');\n });\n\n $start = 3;\n for($i=$start;$i<count($properties)+$start;$i++){\n $sheet->row($i, array(\n $properties[$i-$start]->name,\n number_format($properties[$i-$start]->bill, 4, '.', ','),\n number_format($properties[$i-$start]->payment, 4, '.', ','),\n ($properties[$i-$start]->date_payment != '0000-00-00') ? $properties[$i-$start]->date_payment : \"\",\n $properties[$i-$start]->remarks));\n\n $sheet->cells('A'.$i.':E'.$i, function($cells){\n $cells->setAlignment('center');\n });\n }\n });\n });\n }", "function render_cell($column, $metadata_property_attribute_type)\n\t{\n\t\tswitch ($column->get_name())\n\t\t{\n\t\t\tcase MetadataPropertyAttributeType :: PROPERTY_ID :\n\t\t\t\treturn $metadata_property_attribute_type->get_id();\n\t\t\tcase MetadataPropertyAttributeType :: PROPERTY_NS_PREFIX :\n\t\t\t\treturn $metadata_property_attribute_type->get_ns_prefix();\n\t\t\tcase MetadataPropertyAttributeType :: PROPERTY_NAME :\n\t\t\t\treturn $metadata_property_attribute_type->get_name();\n\t\t\t\n\t\t\tdefault :\n\t\t\t\treturn '&nbsp;';\n\t\t}\n\t}", "public function testCellRender(): void\n {\n $cell = $this->View->cell('Articles::teaserList');\n $render = \"{$cell}\";\n\n $this->assertSame('teaser_list', $cell->viewBuilder()->getTemplate());\n $this->assertStringContainsString('<h2>Lorem ipsum</h2>', $render);\n $this->assertStringContainsString('<h2>Usectetur adipiscing eli</h2>', $render);\n $this->assertStringContainsString('<h2>Topis semper blandit eu non</h2>', $render);\n $this->assertStringContainsString('<h2>Suspendisse gravida neque</h2>', $render);\n\n $cell = $this->View->cell('Cello');\n $this->assertInstanceOf('TestApp\\View\\Cell\\CelloCell', $cell);\n $this->assertSame(\"Cellos\\n\", $cell->render());\n }", "public function cell($value) {\n return $this->setProperty('cell', $value);\n }", "function generate($results){\n\t\t$this->__allData = $results;\n\t\t$View = $this->_View();\n\t\tif($this->__settings['type'] == 'table'){\n \t$this->Html->css('CakeGrid.cakegrid',null,array('inline' => false));\n\t\t}\n\t\telseif($this->__settings['type'] == 'divGrid'){\n \t$this->Html->css('CakeGrid.divGrid',null,array('inline' => false));\n\t\t}\n $this->Html->script('CakeGrid.cakegrid',array('inline' => false));\n\t\t$directory = $this->__settings['type'];\n\t\t\n\t\tif($this->__settings['type'] == 'csv' && !empty($this->__totals)){\n\t\t\tarray_unshift($this->__columns, array(\n\t\t\t\t'title' => '',\n\t\t\t\t'valuePath' => '',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'type' => 'empty'\n\t\t\t\t)\n\t\t\t));\n\t\t}\n\t\t\n\t\t//-- Build the columns\n\t\t$headers = $View->element($this->elemDir . DS . 'grid_headers', array(\n\t\t\t'plugin' => $this->plugin_name, \n\t\t\t'headers' => $this->__columns,\n\t\t\t'options' => $this->__settings\n\t\t),\n array(\t\t\t'plugin' => $this->plugin_name)\n );\n\t\n//\t\t$colGroup = $View->element($this->elemDir . DS . 'grid_colGroup', array(\n//\t\t\t'plugin' => $this->plugin_name, \n//\t\t\t'headers' => $this->__columns,\n//\t\t\t'options' => $this->__settings\n//\t\t),\n// array(\t\t\t'plugin' => $this->plugin_name)\n// );\n\n $results = $this->results($results);\n\t\t$generated = $View->element($this->elemDir . DS . 'grid_full', array(\n // 'plugin' => $this->plugin_name,\n\t\t\t'headers' => $headers,\n // 'colGroup' => $colGroup,\n\t\t\t'results' => $results,\n\t\t\t'options' => $this->__settings\n\t\t),\n array(\t'plugin' => $this->plugin_name)\n );\n \n \treturn $generated;\n \n\t}", "function dataDashboardExcel ($objPHPExcel,$startCell,$endCell,$techGate){\n\n\n\tif(($techGate==\"1-YTS\"))\n\t$colorCode='33CCCC';\n\telse if(($techGate==\"2-WIP\")||($techGate==\"4-WIP2\"))\n\t$colorCode='FFCCFFCC';\n\telse if(($techGate==\"3-PIR\")||($techGate==\"5-PIR2\"))\n\t$colorCode='FFFF00';\n\telse if(($techGate==\"6-Final\"))\n\t$colorCode='C0C0C0';\n\telse if(($techGate==\"8-On Hold\"))\n\t$colorCode='CC99FF';\n\telse\n\t$colorCode='FFFFFF';\n\t$objPHPExcel->getActiveSheet()->getStyle($startCell.$i.':'.$endCell.$i)->applyFromArray(\n\tarray('fill' \t=> array(\n\t\t\t\t\t\t\t\t'type'\t\t=> PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t\t\t'color'\t\t=> array('argb' => $colorCode)\n\t),\n\t\t 'borders' => array(\t\n\t\t\t\t\t\t\t\t'bottom'\t=> array('style' => PHPExcel_Style_Border::BORDER_THIN),\n\t\t\t\t\t\t\t\t'right'\t\t=> array('style' => PHPExcel_Style_Border::BORDER_MEDIUM)\n\t)\n\t)\n\t);\n\n\n\n}", "public function Header(){\n if(count($this->_groups)){\n $this->SetFont('Arial','B',8);\n $this->SetDrawColor(160,160,160);\n $this->SetTextColor(160,160,160);\n $grp = array();\n foreach(array_keys($this->_groups) as $field){\n if(empty($this->_groups[$field][\"currentMsg\"])||!$this->_changePage){\n $grp[] = \"{grp_$field}\";\n }else{\n $grp[] = $this->_groups[$field][\"currentMsg\"];\n }\n }\n $grp = join($grp,\" / \");\n $this->Cell(0,4,$grp,'B',1,'L');\n $this->Ln(4);\n }\n $date = new Date();\n $this->SetTextColor(100);\n $this->SetFillColor(245);\n $this->SetY(4);\n $this->SetFont('Arial','B',10);\n //$str = \"Elaborado el \".$date->getYear().\" - \".$date->getMonthName().\" - \".$date->getDay().\" del \".date(\"H:i:s\");\n $this->ln();\n $this->ln();\n $this->ln();\n $this->ln();\n $str = \"Fecha: \".$date->getYear().\" - \".$date->getMonth().\" - \".$date->getDay();\n $x = $this->GetStringWidth($str);\n $this->Cell($x+10,5,$str,0,0,'L');\n // $this->Cell(0,5,Session::getData(\"nomcaj\"),\"B\",\"R\",'R');\n $this->ln();\n $this->ln();\n $this->ln();\n $this->SetTextColor(0);\n $this->SetFont('Arial','B',12);\n if(is_array($this->_titulo)){\n foreach($this->_titulo as $titulo){\n $w=$this->GetStringWidth($titulo);\n $this->SetX(($this->w - $w) / 2);\n $this->Cell($w,5,$titulo,0,1,'C');\n }\n }else{\n $w=$this->GetStringWidth($this->_titulo);\n $this->SetX(($this->w - $w) / 2);\n $this->Cell($w,5,$this->_titulo,0,1,'C');\n }\n $this->Ln();\n $this->Ln();\n $this->SetTextColor(100);\n $this->SetFont('Arial','',9);\n $this->Cell(0,2,'',0,1,'C');\n //$this->Image(\"public/img/portal/logo_mercurio_report.jpg\",14,11,60,13);\n //$this->Image(\"public/img/portal/logo_sys_report.jpg\",140,11,60,15);\n if(!count($this->_groups)||$this->_changePage){\n $this->__Header();\n $this->_changePage = false;\n }else{\n $this->__Header();\n }\n }", "function GenerateReport($RESULT, $INFO)\n{\n\t$html \t\t= '\"<div style=\\\"width:100%;text-align:center\\\">';\n\t$html\t .= $INFO['moon']['des'] == 1 ? '\".$LNG[\"sys_destruc_title\"].\" '.date(TDFORMAT, $INFO['fleet_start_time']).'. <br><br>' : '\".$LNG[\"sys_attack_title\"].\" '.date(TDFORMAT, $INFO['fleet_start_time']).'. <br><br>';\n\t\t\n\t$round_no \t= 1;\n\t$des\t\t= array('att' => array(), 'def' => array());\n\t\n\tforeach($RESULT['rw'] as $round => $data1)\n\t{\n\t\t//if($round_no > 6)\n\t\t//\tbreak;\n\n\t\t$html \t\t.= '\".$LNG[\"sys_attack_round\"].\" '.$round_no.' :<br><br>';\n\t\t$attackers1 = $data1['attackers'];\n\t\t$attackers2 = $data1['infoA'];\n\t\t$attackers3 = $data1['attackA'];\n\t\t$defenders1 = $data1['defenders'];\n\t\t$defenders2 = $data1['infoD'];\n\t\t$defenders3 = $data1['defenseA'];\n\t\t$coord4 \t= 0;\n\t\t$coord5 \t= 0;\n\t\t$coord6 \t= 0;\n\t\t$html\t\t.= '<table><tr>';\n\t\tforeach($attackers1 as $fleet_id1 => $data2)\n\t\t{\n\t\t\t$name \t= $data2['user']['username'];\n\t\t\t$coord1 = $data2['fleet']['fleet_start_galaxy'];\n\t\t\t$coord2 = $data2['fleet']['fleet_start_system'];\n\t\t\t$coord3 = $data2['fleet']['fleet_start_planet'];\n\t\t\t$coord4 = $data2['fleet']['fleet_end_galaxy'];\n\t\t\t$coord5 = $data2['fleet']['fleet_end_system'];\n\t\t\t$coord6 = $data2['fleet']['fleet_end_planet'];\n\t\t\t$weap \t= $data2['techs'][0] * 100;\n\t\t\t$shie \t= $data2['techs'][1] * 100;\n\t\t\t$armr \t= $data2['techs'][2] * 100;\n\n\t\t\t$fl_info1 \t= '<td class=\\\"transparent\\\"><table><tr><td>\".$LNG[\"sys_attack_attacker_pos\"].\" '.$name.' (['.$coord1.':'.$coord2.':'.$coord3.'])<br>\".$LNG[\"sys_ship_weapon\"].\" '.$weap.'% - \".$LNG[\"sys_ship_shield\"].\" '.$shie.'% - \".$LNG[\"sys_ship_armour\"].\" '.$armr.'%';\n\t\t\t$table1 \t= '<table width=\\'100%\\'>';\n\n\t\t\tif (array_sum($data2['detail']) != 0)\n\t\t\t{\n\t\t\t\t$ships1 = '<tr><td class=\\\"transparent\\\">\".$LNG[\"sys_ship_type\"].\"</td>';\n\t\t\t\t$count1 = '<tr><td class=\\\"transparent\\\">\".$LNG[\"sys_ship_count\"].\"</td>';\n\n\t\t\t\tforeach($data2['detail'] as $ship_id1 => $ship_count1)\n\t\t\t\t{\n\t\t\t\t\tif ($ship_count1 <= 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t$ships1 .= '<td class=\\\"transparent\\\">\".$LNG[\"tech\"]['.$ship_id1.'].\"</td>';\n\t\t\t\t\t$count1 .= '<td class=\\\"transparent\\\">'.pretty_number($ship_count1).'</td>';\n\t\t\t\t}\n\n\t\t\t\t$ships1 .= '</tr>';\n\t\t\t\t$count1 .= '</tr>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$des['att'][] = 1;\n\t\t\t\t$ships1 = '<tr><td class=\\\"transparent\\\"><br><br>\". $LNG[\"sys_destroyed\"].\"<br></td></tr>';\n\t\t\t\t$count1 = '';\n\t\t\t}\n\n\t\t\t$info_part1[$fleet_id1] = $fl_info1.$table1.$ships1.$count1;\n\t\t}\n\n\t\tforeach($attackers2 as $fleet_id2 => $data3)\n\t\t{\n\t\t\t$weap1\t\t= '<tr><td class=\\\"transparent\\\">\".$LNG[\"sys_ship_weapon\"].\"</td>';\n\t\t\t$shields1\t= '<tr><td class=\\\"transparent\\\">\".$LNG[\"sys_ship_shield\"].\"</td>';\n\t\t\t$armour1\t= '<tr><td class=\\\"transparent\\\">\".$LNG[\"sys_ship_armour\"].\"</td>';\n\t\t\tforeach($data3 as $ship_id2 => $ship_points1)\n\t\t\t{\n\t\t\t\tif($ship_points1['shield'] <= 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$weap1 \t\t.= '<td class=\\\"transparent\\\">'.pretty_number($ship_points1['att']).'</td>';\n\t\t\t\t$shields1 \t.= '<td class=\\\"transparent\\\">'.pretty_number($ship_points1['def']).'</td>';\n\t\t\t\t$armour1 \t.= '<td class=\\\"transparent\\\">'.pretty_number($ship_points1['shield']).'</td>';\n\t\t\t}\n\n\t\t\t$weap1 \t\t.= '</tr>';\n\t\t\t$shields1 \t.= '</tr>';\n\t\t\t$armour1 \t.= '</tr>';\n\t\t\t$endtable1 \t= '</table></td></tr></table></td>';\n\n\t\t\t$info_part2[$fleet_id2] = $weap1.$shields1.$armour1.$endtable1;\n\n\t\t\tif (array_sum($attackers1[$fleet_id2]['detail']) != 0)\n\t\t\t{\n\t\t\t\t$html .= $info_part1[$fleet_id2].$info_part2[$fleet_id2];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$html .= $info_part1[$fleet_id2];\n\t\t\t\t$html .= '</table></td></tr></table><br><br>';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$html .= '</tr></table>';\n\t\t$html .= '<br><br>';\n\t\t$html .= '<table><tr>';\n\t\tforeach($defenders1 as $fleet_id1 => $data2)\n\t\t{\n\t\t\t$name = $data2['user']['username'];\n\t\t\t$weap \t= $data2['techs'][0] * 100;\n\t\t\t$shie \t= $data2['techs'][1] * 100;\n\t\t\t$armr \t= $data2['techs'][2] * 100;\n\n\t\t\t$fl_info1\t= '<td class=\\\"transparent\\\"><table><tr><td>\".$LNG[\"sys_attack_defender_pos\"].\" '.$name.' (['.$coord4.':'.$coord5.':'.$coord6.'])<br>\".$LNG[\"sys_ship_weapon\"].\" '.$weap.'% - \".$LNG[\"sys_ship_shield\"].\" '.$shie.'% - \".$LNG[\"sys_ship_armour\"].\" '.$armr.'%';\n\t\t\t$table1 \t= '<table border=\\'1\\' align=\\'center\\' width=\\'100%\\'>';\n\n\t\t\tif (array_sum($data2['def']) != 0)\n\t\t\t{\n\t\t\t\t$ships1 = '<tr><td class=\\\"transparent\\\">\".$LNG[\"sys_ship_type\"].\"</td>';\n\t\t\t\t$count1 = '<tr><td class=\\\"transparent\\\">\".$LNG[\"sys_ship_count\"].\"</td>';\n\n\t\t\t\tforeach($data2['def'] as $ship_id1 => $ship_count1)\n\t\t\t\t{\n\t\t\t\t\tif ($ship_count1 == 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t$ships1 .= '<td class=\\\"transparent\\\">\".$LNG[\"tech\"]['.$ship_id1.'].\"</td>';\n\t\t\t\t\t$count1 .= '<td class=\\\"transparent\\\">'.pretty_number($ship_count1).'</td>';\n\t\t\t\t}\n\n\t\t\t\t$ships1 .= '</tr>';\n\t\t\t\t$count1 .= '</tr>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$des['def'][] = 1;\n\t\t\t\t$ships1 = '<tr><td class=\\\"transparent\\\"><br><br>\".$LNG[\"sys_destroyed\"].\"<br></td></tr>';\n\t\t\t\t$count1 = '';\n\t\t\t}\n\n\t\t\t$info_part1[$fleet_id1] = $fl_info1.$table1.$ships1.$count1;\n\t\t}\n\n\t\tforeach($defenders2 as $fleet_id2 => $data3)\n\t\t{\n\t\t\t$weap1 \t= '<tr><td class=\\\"transparent\\\">\".$LNG[\"sys_ship_weapon\"].\"</td>';\n\t\t\t$shields1 \t= '<tr><td class=\\\"transparent\\\">\".$LNG[\"sys_ship_shield\"].\"</td>';\n\t\t\t$armour1 \t= '<tr><td class=\\\"transparent\\\">\".$LNG[\"sys_ship_armour\"].\"</td>';\n\n\t\t\tforeach( $data3 as $ship_id2 => $ship_points1)\n\t\t\t{\n\t\t\t\tif($ship_points1['shield'] <= 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$weap1 \t\t.= '<td class=\\\"transparent\\\">'.pretty_number($ship_points1['att']).'</td>';\n\t\t\t\t$shields1 \t.= '<td class=\\\"transparent\\\">'.pretty_number($ship_points1['def']).'</td>';\n\t\t\t\t$armour1 \t.= '<td class=\\\"transparent\\\">'.pretty_number($ship_points1['shield']).'</td>';\n\t\t\t}\n\n\t\t\t$weap1 \t\t.= '</tr>';\n\t\t\t$shields1 \t.= '</tr>';\n\t\t\t$armour1 \t.= '</tr>';\n\t\t\t$endtable1 \t= '</table></td></tr></table>';\n\n\t\t\t$info_part2[$fleet_id2] = $weap1.$shields1.$armour1.$endtable1;\n\n\t\t\tif (array_sum($defenders1[$fleet_id2]['def']) != 0)\n\t\t\t{\n\t\t\t\t$html .= $info_part1[$fleet_id2].$info_part2[$fleet_id2];\n\t\t\t\t$html .= '<br><br>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$html .= $info_part1[$fleet_id2];\n\t\t\t\t$html .= '</table></td></tr></table><br><br>';\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t$html .= '</tr></table>';\n\t\t//if (array_sum($des['att']) == count($attackers2) || array_sum($des['def']) == count($defenders2)) break;\n if (!isset($RESULT['rw'][$round +1])) break; // fix: show remain ships without shotting enemy info\n\t\t\n $attackAmount = number_format($data1['attackAmount'],0,',',\"'\");\n $defendAmount = number_format($data1['defendAmount'],0,',',\"'\");\n $attack = number_format($data1['attack'],0,',',\"'\");\n $defense = number_format($data1['defense'],0,',',\"'\");\n $defShield = number_format($data1['defShield'],0,',',\"'\");\n $attackShield = number_format($data1['attackShield'],0,',',\"'\");\n \n $a1 = 'str_replace(array(\"{count}\",\"{damage}\"),array(\"'.$attackAmount.'\",\"'.$attack.'\"),$LNG[\"fleet_attack_1\"])';\n $a2 = 'str_replace(array(\"{damage}\"),array(\"'.$defShield.'\"),$LNG[\"fleet_attack_2\"])';\n \n $d1 = 'str_replace(array(\"{count}\",\"{damage}\"),array(\"'.$defendAmount.'\",\"'.$defense.'\"),$LNG[\"fleet_defs_1\"])';\n $d2 = 'str_replace(array(\"{damage}\"),array(\"'.$attackShield.'\"),$LNG[\"fleet_defs_2\"])';\n \t\t\n\t\t$html .= \"\\\".$a1.\\\"<br>\";\n $html .= \"\\\".$a2.\\\"<br>\";\n $html .= '<br>';\n $html .= \"\\\".$d1.\\\"<br>\";\n $html .= \"\\\".$d2.\\\"<br>\";\n\t\t$html .= '<br>';\n $html .= '<br>';\n $html .= '<br>';\n\t\t$round_no++;\t\t\t\n\t}\n\n\tswitch($RESULT['won'])\n\t{\n\t\tcase 'r':\n\t\t\t$result1 = '\".$LNG[\"sys_defender_won\"].\"<br>';\n\t\tbreak;\n\t\tcase 'a':\n\t\t\t$result1 = '\".$LNG[\"sys_attacker_won\"].\"<br>\".$LNG[\"sys_stealed_ressources\"].\" '.pretty_number($INFO['steal']['metal']).' \".$LNG[\"Metal\"].\", '.pretty_number($INFO['steal']['crystal']).' \".$LNG[\"Crystal\"].\" \".$LNG[\"and\"].\" '.pretty_number($INFO['steal']['deuterium']).' \".$LNG[\"Deuterium\"].\"<br>';\n\t\tbreak;\n\t\tdefault:\n\t\t\t$result1 = '\".$LNG[\"sys_both_won\"].\".<br>';\n\t\tbreak;\n\t}\n\n\t$html .= '<br><br>'.$result1.'<br>';\n\t$html .= '\".$LNG[\"sys_attacker_lostunits\"].\" '.pretty_number($RESULT['lost']['att']).' \".$LNG[\"sys_units\"].\"<br>';\n\t$html .= '\".$LNG[\"sys_defender_lostunits\"].\" '.pretty_number($RESULT['lost']['def']).' \".$LNG[\"sys_units\"].\"<br>';\n\t$html .= '\".$LNG[\"debree_field_1\"].\" '.pretty_number($RESULT['debree']['att'][0] + $RESULT['debree']['def'][0]).' \".$LNG[\"Metal\"].\" \".$LNG[\"sys_and\"].\" '.pretty_number($RESULT['debree']['att'][1] + $RESULT['debree']['def'][1]).' \".$LNG[\"Crystal\"].\" \".$LNG[\"debree_field_2\"].\"<br><br>';\n\t\t\n\tif($INFO['moon']['des'] == 1) {\n\t\t$html .= '\".sprintf($LNG[\"sys_destruc_mess\"], \"'.$INFO['start_galaxy'].'\", \"'.$INFO['start_system'].'\", \"'.$INFO['start_planet'].'\", \"'.$INFO['end_galaxy'].'\", \"'.$INFO['end_system'].'\", \"'.$INFO['end_planet'].'\").\"<br>';\t\n\t\tif($INFO['moon']['desfail'] == 1) {\n\t\t\t$html .= '\".$LNG[\"sys_destruc_stop\"].\"<br>';\n\t\t} else {\n\t\t\t$html .= '\".sprintf($LNG[\"sys_destruc_lune\"], \"'.$INFO['moon']['chance'].'\").\"<br>\".$LNG[\"sys_destruc_mess1\"].\"';\n\t\t\t$html .= $INFO['moon']['desfail'] == 0 ? '\".$LNG[\"sys_destruc_reussi\"].\"' : '\".$LNG[\"sys_destruc_null\"].\"';\t\t\t\n\t\t\t$html .= '<br>\".sprintf($LNG[\"sys_destruc_rip\"], \"'.$INFO['moon']['chance2'].'\").\"';\n\t\t\tif($INFO['moon']['fleetfail'] == 1) {\n\t\t\t\t$html .= '<br>\".$LNG[\"sys_destruc_echec\"].\"';\n\t\t\t}\t\t\t\n\t\t}\n\t} else {\n\t\t$html .= '\".$LNG[\"sys_moonproba\"].\" '.$INFO['moon']['chance'].' %<br>';\n\t\tif(!empty($INFO['moon']['name']))\n\t\t{\n\t\t\t$html .= '\".sprintf($LNG[\"sys_moonbuilt\"], \"'.$INFO['moon']['name'].'\", \"'.$INFO['end_galaxy'].'\", \"'.$INFO['end_system'].'\", \"'.$INFO['end_planet'].'\").\"';\n\t\t}\n\t}\n\t\n\tif(isset($INFO['moon']['battlesim'])) {\n\t\t$html .= $INFO['moon']['battlesim'];\n\t}\n\t$html .= '</div><script type=\\\"text/javascript\\\">RaportInfo = '.addcslashes(json_encode(array($RESULT['won'], ($RESULT['lost']['att'] + $RESULT['lost']['def']), $RESULT['debree']['att'][0], $RESULT['debree']['def'][0], $INFO['attvsdef'])), '\"').';</script>\"';\n\treturn $html;\n}", "function blank_cell($num=1, $css='', $extras='') {\n $this->end_cell();\n\n if (!is_numeric($num)) {\n $num = 1;\n }\n\n for($i=1;$i<=$num;$i++) {\n $this->new_cell($css,$extras);\n echo '&nbsp;';\n }\n }", "public static function reportSale($objPHPExcel)\n {\n $objPHPExcel->getActiveSheet()->mergeCells('A1:B1');\n $objPHPExcel->getActiveSheet()->setCellValue(\"A1\", 'Speed Printz Pte. Ltd', true);\n\n $objPHPExcel->getActiveSheet()->setCellValue(\"A2\", 'Sales Report', true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"A3\", 'Report Generated on:', true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"B3\", date('d-m-Y'), true);\n\n $objPHPExcel->getActiveSheet()->setCellValue(\"A4\", 'Date from:', true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"B4\", Yii::app()->session['from_date'], true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"C4\", 'Date to:', true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"D4\", Yii::app()->session['to_date'], true);\n\n\n $objPHPExcel->getActiveSheet()->setCellValue(\"A6\", 'S/N', true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"B6\", 'Order Date', true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"C6\", 'Order No', true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"D6\", 'Client Name', true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"E6\", 'Sub Total ($)', true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"F6\", 'Delivery Fee ($)', true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"G6\", 'GST ($)', true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"H6\", 'Total ($)', true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"I6\", 'Order Status', true);\n $objPHPExcel->getActiveSheet()->getStyle('A6:I6')->getFont()->setSize(13)->setBold(true);\n $objPHPExcel->getActiveSheet()->getStyle('A6:I6')->getFont()->getColor()->setRGB('000000');\n\n\n $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('G')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('H')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('I')->setAutoSize(true);\n\n $objPHPExcel->getActiveSheet()->getStyle(\"A\")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n $objPHPExcel->getActiveSheet()->getStyle(\"B\")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n $objPHPExcel->getActiveSheet()->getStyle(\"C\")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n $objPHPExcel->getActiveSheet()->getStyle(\"D\")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n $objPHPExcel->getActiveSheet()->getStyle(\"E\")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n $objPHPExcel->getActiveSheet()->getStyle(\"F\")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n $objPHPExcel->getActiveSheet()->getStyle(\"G\")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n $objPHPExcel->getActiveSheet()->getStyle(\"H\")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n $objPHPExcel->getActiveSheet()->getStyle(\"I\")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\n\n $objPHPExcel->getActiveSheet()->getStyle(\"A6:I6\")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n $styleArray2 = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM),));\n $objPHPExcel->getActiveSheet()->getStyle('A6:I6')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);\n $objPHPExcel->getActiveSheet()->getStyle('A6:I6')->applyFromArray($styleArray2);\n\n $models = Yii::app()->session['reportSale'];\n\n $index = 7;\n if(!empty($models))\n {\n foreach ($models as $one) \n {\n if( empty($one) ) continue;\n $objPHPExcel->getActiveSheet()->setCellValue(\"A\" . $index, $index-5 , true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"B\" . $index, Yii::app()->format->date($one->created_date) , true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"C\" . $index, $one->order_no , true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"D\" . $index, $one->user_name , true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"E\" . $index, $one->sub_total, true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"F\" . $index, $one->shipping_fee , true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"G\" . $index, $one->gst , true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"H\" . $index, $one->total , true);\n $objPHPExcel->getActiveSheet()->setCellValue(\"I\" . $index, SpOrders::getStatusOrder($one), true);\n $index++;\n\n \n }\n }\n\n //format size cho tung Column\n $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('G')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('H')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('I')->setAutoSize(true);\n\n $objPHPExcel->getActiveSheet()->getStyle('A6:I'.($index-1))->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);\n $objPHPExcel->getActiveSheet()->getStyle('A6:I'.($index-1))->applyFromArray($styleArray2);\n // $styleArray2 = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM),));\n // $objPHPExcel->getActiveSheet()->getStyle('A1:I1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);\n // $objPHPExcel->getActiveSheet()->getStyle('A1:I1')->applyFromArray($styleArray2);\n\n // $styleArray = array(\n // 'borders' => array(\n // 'right' => array(\n // 'style' => PHPExcel_Style_Border::BORDER_THIN,\n // 'color' => array(\n // 'argb' => '000000',\n // ),\n // ),\n // 'left' => array(\n // 'style' => PHPExcel_Style_Border::BORDER_THIN,\n // 'color' => array(\n // 'argb' => '000000',\n // ),\n // ),\n // )\n // );\n\n // $styleBottom = array(\n // 'borders' => array(\n // 'bottom' => array(\n // 'style' => PHPExcel_Style_Border::BORDER_THIN,\n // 'color' => array(\n // 'argb' => '000000',\n // ),\n // )\n // )\n // );\n // $objPHPExcel->getActiveSheet()->getStyle('A1:I'.($index-1))->applyFromArray($styleArray, false);\n // $objPHPExcel->getActiveSheet()->getStyle('A'.($index-1).':I'.($index-1))->applyFromArray($styleBottom, false);\n return $objPHPExcel;\n }", "public function createDiagnosticPdf() {\n\n $pdf = new DiagnosticPDF($this);\n\n $pdf->AliasNbPages();\n $pdf->AddPage();\n $pdf->SetFont('Times','',12);\n\n // Add a title for the section\n $pdf->Cell(60,15,utf8_decode('Server summary'),0,0,'L');\n $pdf->Ln(15);\n // Add php version\n $pdf->addPHPVersion();\n // Add server software\n $pdf->addServerApi();\n // Add addEcommerceInfo and plugin info\n $pdf->addEcommerceInfo();\n // Add merchant info\n $pdf->addMerchantInfo();\n //Add extension info\n $pdf->addExtensionsInfo();\n $pdf->addLogs();\n\n //Some tricks for FPDF to work with joomla.\n ob_start(); //needed to prevent the error(FPDF error: Some data has already been output, can't send PDF file)\n $pdf->Output();\n die(); //needed to break process render of joomla and download the file pdf correctly\n }", "public function create()\n {\n return view('company.company_buildings.create');\n }", "private function createTemplate()\n\t{\n\t\t$this->objPHPExcel = new PHPExcel();\n\t\t$this->objPHPExcel->setActiveSheetIndex(0);\n\t\t$this->objWorksheet = $this->objPHPExcel->getActiveSheet();\n\t\t//TODO: other parameters\n\t\t$this->objWorksheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT);\n\t\t$this->objWorksheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);\n\t\t$this->objWorksheet->getPageSetup()->setHorizontalCentered(true);\n\t\t$this->objWorksheet->getPageSetup()->setVerticalCentered(false);\n\n $this->_usingTemplate=false;\n\t}", "public function create()\n {\n $retail_sale_data=RetailSaleChildModel::join('customer','customer.customer_id','=','retail_sale_child.customer_name')->get();\n return view('Admin.Sale.retail_sale_report',['retail_sale_data'=>$retail_sale_data]);\n }", "public function create()\n {\n return View('nguoi_choi.xl_nguoi_choi');\n }", "private function render_css(): void {\r\n echo JKNCSS::tag('\r\n tr .'.self::cl_dropdown.' {\r\n display: inline-table;\r\n height: 80px;\r\n }\r\n\r\n tr .'.self::cl_dropdown.' th {\r\n width: auto;\r\n max-width: 180px;\r\n height: 40px;\r\n vertical-align: middle;\r\n padding-left: 10px;\r\n }\r\n\r\n .form-table tr {\r\n border-bottom: 1px dashed;\r\n margin-top: 0;\r\n }\r\n \r\n .'.self::cl_intro.' {\r\n background: #fdfdfd;\r\n border: 1px dashed #ddd;\r\n margin-bottom: 5px;\r\n }\r\n\r\n .'.self::cl_p_report.' {\r\n padding: 10px;\r\n }\r\n\r\n .'.self::cl_p_report.' .button {\r\n margin: 0 3px 0 3px;\r\n vertical-align: middle;\r\n }\r\n\r\n .'.self::cl_p_report.' .button:first-child {\r\n margin-left: 0;\r\n }\r\n\r\n .'.self::cl_p_report.' tr {\r\n height: 50px;\r\n vertical-align: middle;\r\n }\r\n\r\n .'.self::cl_p_report.' select {\r\n margin-left: 10px;\r\n margin-right: 25px;\r\n vertical-align: middle;\r\n }\r\n \r\n a.disabled, a.disabled:hover {\r\n color: #222;\r\n cursor: wait;\r\n }\r\n \r\n .'.self::cl_lg_report_true.' {\r\n color: #21a847;\r\n }\r\n \r\n .'.self::cl_lg_report_false.' {\r\n color: #ad0f0f;\r\n }\r\n \r\n #'.self::id_main.' {\r\n background: #dedede;\r\n }\r\n\r\n .'.self::cl_p_report_table.' {\r\n background: #fefefe;\r\n width: 100%;\r\n padding-bottom: 10px;\r\n padding-top: 10px;\r\n border-bottom: 5px solid #dedede;\r\n }\r\n\r\n #'.self::id_main.' {\r\n padding: 5px;\r\n }\r\n\r\n .'.self::cl_p_report.' tr:nth-child(3) td,\r\n .'.self::cl_p_report.' tr:nth-child(4) td {\r\n border-top: 1px dashed #555;\r\n padding-top: 10px;\r\n }\r\n\r\n .'.self::cl_p_report.' tr:nth-child(3) td {\r\n padding-bottom: 10px;\r\n }\r\n\r\n\r\n #'.self::id_main.' table:first-child {\r\n padding-top: 0;\r\n }\r\n\r\n .'.self::cl_p_report_table.':last-child {\r\n border-bottom: none;\r\n }\r\n .'.self::cl_preload_note.' {\r\n display: inline-block;\r\n padding: 10px;\r\n vertical-align: middle;\r\n border-left: 1px solid #ddd;\r\n }\r\n\r\n #'.self::id_main.' tr:first-child {\r\n height: 30px;\r\n }\r\n\r\n #'.self::id_main.' tr:first-child td {\r\n padding-top: 0;\r\n padding-bottom: 0;\r\n height: 15px;\r\n }\r\n\r\n #'.self::id_main.' h2 {\r\n margin-top: 0;\r\n margin-bottom: 0;\r\n }\r\n ');\r\n }", "private function create_reports_table($db) {\n\t\t$this->company_forge = $this->load->dbforge($db, TRUE);\n\t\t// Load fields to create the Reports table\n\t\t$fields = array(\n\t\t\t'id' => array(\n\t\t\t\t'type'\t\t\t\t=> 'INT',\n\t\t\t\t'constraint'\t\t=> 11,\n\t\t\t\t'unsigned'\t\t\t=> TRUE,\n\t\t\t\t'null'\t\t\t\t=> FALSE,\n\t\t\t\t'auto_increment'\t=> TRUE\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'type'\t\t\t\t=> 'VARCHAR',\n\t\t\t\t'constraint'\t\t=> 100,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t\t'map' => array(\n\t\t\t\t'type'\t\t\t\t=> 'VARCHAR',\n\t\t\t\t'constraint'\t\t=> 18,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t\t'type' => array(\n\t\t\t\t'type'\t\t\t\t=> 'INT',\n\t\t\t\t'constraint'\t\t=> 11,\n\t\t\t\t'unsigned'\t\t\t=> TRUE,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t\t'day' => array(\n\t\t\t\t'type'\t\t\t\t=> 'INT',\n\t\t\t\t'constraint'\t\t=> 11,\n\t\t\t\t'unsigned'\t\t\t=> TRUE,\n\t\t\t\t'null'\t\t\t\t=> TRUE\n\t\t\t),\n\t\t\t'time' => array(\n\t\t\t\t'type'\t\t\t\t=> 'VARCHAR',\n\t\t\t\t'constraint'\t\t=> 10,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t\t'creator' => array(\n\t\t\t\t'type'\t\t\t\t=> 'INT',\n\t\t\t\t'constraint'\t\t=> 11,\n\t\t\t\t'unsigned'\t\t\t=> TRUE,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t\t'private' => array(\n\t\t\t\t'type'\t\t\t\t=> 'TINYINT',\n\t\t\t\t'constraint'\t\t=> 1,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t\t'active' => array(\n\t\t\t\t'type'\t\t\t\t=> 'TINYINT',\n\t\t\t\t'default'\t\t\t=> 1,\n\t\t\t\t'constraint'\t\t=> 1,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t);\n\t\t// Add the fields before creating the Reports table\n\t\t$this->company_forge->add_field($fields);\n\t\t// Make the id the primary key of the Reports table\n\t\t$this->company_forge->add_key('id', TRUE);\n\t\t// Attempt to create the Reports table and return success or failure\n\t\tif ($this->company_forge->create_table('reports'))\n\t\t\treturn TRUE;\n\t\telse\n\t\t\treturn FALSE;\n\t}", "public function genHTMLCronograma(){\n \n //Usuario conectado ==========================================================================\n $_solicitudes = $this->cdaSolicitudesOpen(Yii::$app->user->identity->id_usuario);\n $_tramites = $this->cdaTramitesOpen();\n $_tecnicos = $this->cdaTecnicos();\n $j_user=0;\n \n $string=\"\";\n \n $string.=\"<table class='tablecronograma'>\";\n \n foreach($_solicitudes[1] as $valor){\n \n $_drhidricos = $valor[0];\n \n if($j_user>0){\n $string.=\"<tr>\";\n $string.=\"<td colspan='7' class='noborders'>&nbsp;</td>\";\n $string.=\"</tr>\";\n }\n \n $string.=\"<tr>\";\n $string.=\"<td rowspan='2'>\".$valor[1].\"</td>\";\n \n //Sacando la fila de solicitudes asociadas al usuario ===================================================\n foreach($_solicitudes[2][$valor[0]] as $numsolicitud){\n $string.=\"<td colspan='6'>\".$numsolicitud.\"</td>\";\n }\n \n $string.=\"</tr>\";\n \n $string.=\"<tr>\";\n \n //Armando cuadro de casillas por solicitud ===================================================\n foreach($_solicitudes[2][$valor[0]] as $idSol=>$numsolicitud){\n $string.=\"<td bgcolor='\".$_solicitudes[3][$idSol][0].\"'>1</td>\";\n $string.=\"<td bgcolor='\".$_solicitudes[3][$idSol][1].\"'>2</td>\";\n $string.=\"<td bgcolor='\".$_solicitudes[3][$idSol][2].\"'>3</td>\";\n $string.=\"<td bgcolor='\".$_solicitudes[3][$idSol][3].\"'>4</td>\";\n $string.=\"<td bgcolor='\".$_solicitudes[3][$idSol][4].\"'>5</td>\";\n $string.=\"<td bgcolor='\".$_solicitudes[3][$idSol][5].\"'>6</td>\";\n }\n $string.=\"</tr>\";\n \n //Organizando segunda parate la de TECNICOS ======================================================================\n \n foreach($_tecnicos as $tecnicosRH){\n \n $string.=\"<tr>\";\n $string.=\"<td>\".$tecnicosRH['nombres'].\"</td>\";\n foreach($_solicitudes[2][$valor[0]] as $idSol=>$numsolicitud){\n \n if (!empty($tecnicosRH['id_usuario']) ){\n $_idusuario = $tecnicosRH['id_usuario'];\n }else{\n $string.=\"<td></td>\"; \n $string.=\"<td></td>\"; \n $string.=\"<td></td>\"; \n $string.=\"<td></td>\"; \n $string.=\"<td></td>\"; \n $string.=\"<td></td>\"; \n continue;\n }\n \n if(!empty( $_tramites[$_idusuario] )){\n \n if(!empty($_tramites[$_idusuario][$idSol]['tip1'])){\n $string.=\"<td bgcolor='blue'>&nbsp;</td>\";\n }else{\n $string.=\"<td></td>\"; \n }\n \n if(!empty($_tramites[$_idusuario][$idSol]['tip2'])){\n $string.=\"<td bgcolor='blue'>&nbsp;</td>\";\n }else{\n $string.=\"<td></td>\"; \n }\n \n if(!empty($_tramites[$_idusuario][$idSol]['tip3'])){\n $string.=\"<td bgcolor='blue'>&nbsp;</td>\";\n }else{\n $string.=\"<td></td>\"; \n }\n \n if(!empty($_tramites[$_idusuario][$idSol]['tip4'])){\n $string.=\"<td bgcolor='blue'>&nbsp;</td>\";\n }else{\n $string.=\"<td></td>\"; \n }\n \n if(!empty($_tramites[$_idusuario][$idSol]['tip5'])){\n $string.=\"<td bgcolor='blue'>&nbsp;</td>\";\n }else{\n $string.=\"<td></td>\"; \n }\n \n if(!empty($_tramites[$_idusuario][$idSol]['tip6'])){\n $string.=\"<td bgcolor='blue'>&nbsp;</td>\";\n }else{\n $string.=\"<td></td>\"; \n }\n \n }else{\n $string.=\"<td></td>\"; \n $string.=\"<td></td>\"; \n $string.=\"<td></td>\"; \n $string.=\"<td></td>\"; \n $string.=\"<td></td>\"; \n $string.=\"<td></td>\"; \n \n }\n }\n $string.=\"</tr>\";\n }\n \n $j_user+=1;\n }\n \n \n \n $string.=\"</table>\";\n \n \n return $string;\n }", "function add_cell($val, $link = \"\")\n\t{\n\t\tif(!empty($link))\n\t\t{\n\t\t\t$this->tpl->setCurrentBlock(\"begin_link\");\n\t\t\t$this->tpl->setVariable(\"LINK_TARGET\", $link);\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t\t$this->tpl->touchBlock(\"end_link\");\n\t\t}\n\n\t\t$this->tpl->setCurrentBlock(\"text\");\n\t\t$this->tpl->setVariable(\"TEXT_CONTENT\", $val);\n\t\t$this->tpl->parseCurrentBlock();\n\t\t$this->tpl->setCurrentBlock(\"table_cell\");\n\t\t$this->tpl->parseCurrentBlock();\n\t}", "public function html()\n {\n return $this->builder()\n \n ->columns($this->getColumns())\n ->minifiedAjax()\n ->addAction(['width' => '10%'])\n ->addCheckbox(['width'=> '10px'],true)\n ->parameters($this->getBuilderParameters())\n ->parameters([\n 'order' => [\n 5, // here is the column number\n 'desc'\n ],\n // 'scrollX' => true,\n 'extend' => 'collection',\n 'text' => 'Export',\n 'dom' => 'Bfrtipl',\n // 'buttons' => ['csv', 'excel', 'pdf' , 'print'],\n // 'initComplete' => \"function () {\n // this.api().columns().every(function () {\n // var column = this;\n // var input = document.createElement(\\\"input\\\");\n // $(input).appendTo($(column.footer()).empty())\n // .on('change', function () {\n // column.search($(this).val(), false, false, true).draw();\n // });\n // });\n // }\",\n ]);\n }", "function perform_export()\n {\n global $CFG;\n require_once($CFG->dirroot.'/blocks/bcgt/lib.php');\n global $CFG, $USER;\n $name = preg_replace(\"/[^a-z 0-9]/i\", \"\", $this->get_name());\n \n ob_clean();\n header(\"Pragma: public\");\n header('Content-Type: application/vnd.ms-excel; charset=utf-8');\n header('Content-Disposition: attachment; filename=\"'.$name.'.xlsx\"'); \n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: private\", false);\n\n require_once $CFG->dirroot . '/blocks/bcgt/lib/PHPExcel/Classes/PHPExcel.php';\n \n $objPHPExcel = new \\PHPExcel();\n $objPHPExcel->getProperties()\n ->setCreator(fullname($USER))\n ->setLastModifiedBy(fullname($USER))\n ->setTitle($this->get_name())\n ->setSubject($this->get_name())\n ->setDescription($this->get_description());\n\n // Remove default sheet\n $objPHPExcel->removeSheetByIndex(0);\n \n $sheetIndex = 0;\n \n // Set current sheet\n $objPHPExcel->createSheet($sheetIndex);\n $objPHPExcel->setActiveSheetIndex($sheetIndex);\n $objPHPExcel->getActiveSheet()->setTitle(\"Report\");\n \n $rowNum = 1;\n\n // Headers\n if(isset($this->header))\n {\n if(!$this->has_split_header())\n {\n $col = 0;\n foreach($this->header AS $head)\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $head);\n $col++;\n }\n $rowNum++;\n }\n else\n {\n //foreach row\n foreach($this->header AS $row)\n {\n $col = 0;\n foreach($row AS $rowObj)\n {\n $columnCount = $rowObj->colCount;\n $columnContent = $rowObj->content;\n //add all the cells, \n //thenmerge\n $startCol = $col;\n for($i=0;$i<$columnCount;$i++)\n {\n if($i == 0)\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $columnContent);\n }\n else\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, '');\n }\n $col++;\n }\n $endCol = $col;\n if($columnCount != 1)\n {\n $objPHPExcel->getActiveSheet()->mergeCells(''.PHPExcel_Cell::stringFromColumnIndex($startCol).\n ''.$rowNum.':'.PHPExcel_Cell::stringFromColumnIndex($endCol - 1).''.$rowNum);\n }\n \n \n }\n $rowNum++;\n }\n } \n \n }\n //data\n if(isset($this->data))\n {\n foreach($this->data AS $data)\n {\n $col = 0;\n foreach($data AS $cell)\n { \n if(is_a($cell, 'stdClass'))\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $this->build_excell_cell($cell));\n $objPHPExcel->getActiveSheet()->getStyle(''.PHPExcel_Cell::stringFromColumnIndex($col).''.$rowNum)->applyFromArray(\n array(\n 'fill' => array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'color' => $this->get_excell_cell_color($cell)\n ),\n 'borders' => array(\n 'outline' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array('rgb'=>'cfcfcf')\n )\n )\n )\n ); \n if(isset($cell->colspan) && $cell->colspan > 1)\n {\n $objPHPExcel->getActiveSheet()->mergeCells(''.PHPExcel_Cell::stringFromColumnIndex($col).\n ''.$rowNum.':'.PHPExcel_Cell::stringFromColumnIndex($col + ($cell->colspan - 1)).''.$rowNum);\n \n $col = $col + ($cell->colspan - 1);\n }\n }\n else\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $rowNum, $cell);\n }\n \n $col++;\n } \n $rowNum++;\n }\n }\n \n // Freeze rows and cols (everything to the left of D and above 2)\n $objPHPExcel->getActiveSheet()->freezePane($this->get_frozen_panes());\n \n // End\n $objPHPExcel->setActiveSheetIndex(0);\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\n ob_clean();\n $objWriter->save('php://output');\n \n exit;\n }", "public function makeTable($header, $data) {\n $this->SetFillColor(255, 0, 0);\n $this->SetTextColor(255);\n $this->SetDrawColor(128, 0, 0);\n $this->SetLineWidth(.3);\n $this->SetFont('', 'B');\n // Header\n $w = array(10, 25, 40, 10, 25, 15, 60, 10, 10, 10, 10, 10, 10, 10, 10, 10);\n for ($i = 0; $i < count($header); $i++)\n if ($i == 0) {\n $this->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);\n } else {\n $this->Cell($w[$i], 7, $header[$i], 1, 0, 'L', true);\n }\n $this->Ln();\n // Color and font restoration\n $this->SetFillColor(224, 235, 255);\n $this->SetTextColor(0);\n $this->SetFont('');\n // Data\n $fill = false;\n\n foreach ($data as $row) {\n $this->nr++;\n $this->Cell($w[0], 6, $this->nr, 'LR', 0, 'C', $fill);\n $this->Cell($w[1], 6, $row['article'], 'LR', 0, 'L', $fill);\n $this->Cell($w[2], 6, $row['brand'], 'LR', 0, 'L', $fill);\n $this->Cell($w[3], 6, $row['inch'], 'LR', 0, 'L', $fill);\n $this->Cell($w[4], 6, $row['size'], 'LR', 0, 'L', $fill);\n $this->Cell($w[5], 6, $row['lisi'], 'LR', 0, 'L', $fill);\n $this->Cell($w[6], 6, $row['design'], 'LR', 0, 'L', $fill);\n $this->Cell($w[7], 6, $row['onhand'], 'LR', 0, 'C', $fill);\n $this->Cell($w[8], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[9], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[10], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[11], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[12], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[13], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[14], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[15], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Ln();\n $fill = !$fill;\n }\n // Closing line\n $this->Cell(array_sum($w), 0, '', 'T');\n }", "function add_cell($val, $link = \"\")\n\t{\n\t\tif (!empty($link))\n\t\t{\n\t\t\t$this->tpl->setCurrentBlock(\"begin_link\");\n\t\t\t$this->tpl->setVariable(\"LINK_TARGET\", $link);\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t\t$this->tpl->touchBlock(\"end_link\");\n\t\t}\n\n\t\t$this->tpl->setCurrentBlock(\"text\");\n\t\t$this->tpl->setVariable(\"TEXT_CONTENT\", $val);\n\t\t$this->tpl->parseCurrentBlock();\n\t\t$this->tpl->setCurrentBlock(\"table_cell\");\n\t\t$this->tpl->parseCurrentBlock();\n\t}", "public function html()\n {\n if($this->filter_type == 'Weekly') {\n $payout_columns = array(\n ['data' => 'company_id', 'name' => 'trips.company_id', 'title' => 'Company Id'],\n ['data' => 'company_name', 'name' => 'company_name', 'title' => 'Company Name'],\n ['data' => 'week_day', 'name' => 'week_day', 'title' => 'Week Day'],\n ['data' => 'company_payout', 'name' => 'company_payout', 'title' => 'Payout Amount'],\n \n ); \n }\n else {\n $payout_columns = array(\n ['data' => 'company_id', 'name' => 'trips.company_id', 'title' => 'Company Id'],\n ['data' => 'company_name', 'name' => 'company_name', 'title' => 'Company Name'],\n ['data' => 'company_payout', 'name' => 'company_payout', 'title' => 'Payout Amount'],\n );\n }\n \n return $this->builder()\n ->columns($payout_columns)\n ->addColumn(['data' => 'action', 'name' => 'action', 'title' => 'Action', 'orderable' => false, 'searchable' => false])\n ->parameters([\n 'dom' => 'lBfrtip',\n 'buttons' => ['csv', 'excel', 'print', 'reset'],\n 'order' => [0, 'desc'],\n ]);\n }", "function CanvassProgressReport($iFYID)\n{\n $pdf = new PDF_CanvassBriefingReport();\n\n $curY = 10;\n\n $pdf->SetFont('Times', '', 24);\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, gettext('Canvass Progress Report').' '.date(SystemConfig::getValue(\"sDateFormatLong\")));\n $pdf->SetFont('Times', '', 14);\n\n $curY += 10;\n\n $pdf->SetFont('Times', '', 12);\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchName'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchAddress'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchCity').', '.SystemConfig::getValue('sChurchState').' '.SystemConfig::getValue('sChurchZip'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchPhone').' '.SystemConfig::getValue('sChurchEmail'));\n $curY += 10;\n $pdf->SetFont('Times', '', 14);\n\n $nameX = 20;\n $doneX = 70;\n $toDoX = 85;\n $percentX = 110;\n\n $pdf->SetFont('Times', 'B', 14);\n $pdf->WriteAt($nameX, $curY, gettext('Name'));\n $pdf->WriteAt($doneX, $curY, gettext('Done'));\n $pdf->WriteAt($toDoX, $curY, gettext('Assigned'));\n $pdf->WriteAt($percentX, $curY, gettext('Percent'));\n $pdf->SetFont('Times', '', 14);\n\n $curY += 6;\n\n $totalToDo = 0;\n $totalDone = 0;\n\n // Get all the canvassers\n $canvassGroups = ['Canvassers', 'BraveCanvassers'];\n foreach ($canvassGroups as $cgName) {\n $rsCanvassers = CanvassGetCanvassers(gettext($cgName));\n if ($rsCanvassers == 0) {\n continue;\n }\n\n while ($aCanvasser = mysqli_fetch_array($rsCanvassers)) {\n // Get all the families for this canvasser\n $sSQL = 'SELECT fam_ID from family_fam WHERE fam_Canvasser = '.$aCanvasser['per_ID'];\n $rsCanvassees = RunQuery($sSQL);\n\n $thisCanvasserToDo = mysqli_num_rows($rsCanvassees);\n $thisCanvasserDone = 0;\n\n while ($aCanvassee = mysqli_fetch_array($rsCanvassees)) {\n // Get all the canvass input entered so far by this canvasser\n $sSQL = 'SELECT can_ID from canvassdata_can WHERE can_famID='.$aCanvassee['fam_ID'].\n ' AND can_FYID='.$iFYID;\n $rsCanvassData = RunQuery($sSQL);\n\n if (mysqli_num_rows($rsCanvassData) == 1) {\n ++$thisCanvasserDone;\n }\n }\n\n $totalToDo += $thisCanvasserToDo;\n $totalDone += $thisCanvasserDone;\n\n // Write the status output line for this canvasser\n $pdf->WriteAt($nameX, $curY, $aCanvasser['per_FirstName'].' '.$aCanvasser['per_LastName']);\n $pdf->WriteAt($doneX, $curY, $thisCanvasserDone);\n $pdf->WriteAt($toDoX, $curY, $thisCanvasserToDo);\n if ($thisCanvasserToDo > 0) {\n $percentStr = sprintf('%.0f%%', ($thisCanvasserDone / $thisCanvasserToDo) * 100);\n } else {\n $percentStr = 'N/A';\n }\n $pdf->WriteAt($percentX, $curY, $percentStr);\n $curY += 6;\n }\n }\n\n // Summary status\n $pdf->SetFont('Times', 'B', 14);\n\n $pdf->WriteAt($nameX, $curY, gettext('Total'));\n $pdf->WriteAt($doneX, $curY, $totalDone);\n $pdf->WriteAt($toDoX, $curY, $totalToDo);\n $percentStr = sprintf('%.0f%%', ($totalDone / $totalToDo) * 100);\n $pdf->WriteAt($percentX, $curY, $percentStr);\n\n $pdf->Output('CanvassProgress'.date(SystemConfig::getValue(\"sDateFormatLong\")).'.pdf', 'D');\n}", "public static function createBoard()\n {\n $board = \"<div class='board'>\\n\";\n\n // 11 rows (first row for X axis labels)\n for ($i = 0; $i < 11; $i++) {\n $board .= \" <div>\\n\";\n\n // 11 divs/column in each row (first column for Y axis labels)\n for ($j = 0; $j < 11; $j++) {\n if ($i == 0 && $j > 0) {\n $text = self::$axisY[($j - 1)];\n } elseif ($j == 0 && $i > 0) {\n $text = self::$axisX[($i - 1)];\n } else {\n $text = \"\";\n }\n\n $board .= \" <div>\" . $text . \"</div>\\n\";\n }\n\n $board .= \" </div>\\n\";\n }\n\n $board .= \"</div>\";\n\n return $board;\n }", "function OutputCell($width,$height,$htmlContent,$border=0,$LineFeedHeight=0,$align='',$fill=0,$cellmargin=3){\r\n\t$this->Cell($width, $height, '', $border, 0, $align, $fill);\r\n\t// on note la position apres la cellule\r\n\t$x = $this->x; $y = $this->y;\r\n\t$lmargin = $this->lMargin;\r\n\t$rmargin = $this->rMargin;\r\n\r\n\t// on se remet en debut de cellule\r\n\t$this->x-=$width;\r\n\t$this->x = $this->x+$cellmargin/2;\r\n\t$this->lMargin = $this->x; // pour que les retour ligne se fassent correctement dans la cellule\r\n\t$this->rMargin = $this->w-$this->x-$width+$cellmargin/2;\r\n\r\n\t$this -> WriteHTML($htmlContent,$LineFeedHeight);\r\n\t// on se remet a la fin de la cellule\r\n\t$this->x = $x; $this->y = $y;\r\n\t$this->lMargin = $lmargin;\r\n\t$this->rMargin = $rmargin;\r\n}", "private function buildHeader()\n {\n $month_name = $this->monthLabels[$this->month - 1] . ' ' . $this->year;\n $vclass = strtolower($this->view);\n $h = \"<table class='\" . $this->tableClass . \" \" . $vclass . \"'>\";\n $h .= \"<thead>\";\n $h .= \"<tr class='\" . $this->headClass . \"'>\";\n $cs = 5;\n if ($this->view == 'week' || $this->view == 'day') {\n $h .= \"<th>&nbsp;</th>\";\n }\n if ($this->view == 'day') {\n $cs = 1;\n }\n\n if ($this->nav) {\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->prevClass . \"' href='\" . $this->prevLink() . \"'>\" . $this->prevIco . \"</a>\";\n $h .= \"</th>\";\n $h .= \"<th colspan='$cs'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->nextClass . \"' href='\" . $this->nextLink() . \"'>\" . $this->nextIco . \"</a>\";\n $h .= \"</th>\";\n } else {\n $h .= \"<th colspan='7'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n }\n $h .= \"</tr>\";\n $h .= \"</thead>\";\n\n $h .= \"<tbody>\";\n if ($this->view != 'day' && $this->view != 'week') {\n $h .= \"<tr class='\" . $this->labelsClass . \"'>\";\n\n for ($i = 0; $i <= 6; $i++) {\n $h .= \"<td>\";\n $h .= $this->dayLabels[$i];\n $h .= \"</td>\";\n }\n\n $h .= \"</tr>\";\n }\n if ($this->view == 'day' || $this->view == 'week') {\n $h .= self::getWeekDays();\n }\n\n $this->html .= $h;\n }", "function generate_report($req, $res, $isMonthly = true, $timeUnit = null, $uid = 1) {\r\n\tif ($isMonthly) {\r\n\t\tif (is_null ( $timeUnit ) || ! is_numeric ( $timeUnit ) || $timeUnit > 12 || $timeUnit < 1) {\r\n\t\t\t$timeUnit = date ( 'M' );\r\n\t\t}\r\n\t} else {\r\n\t\tif (is_null ( $timeUnit )) {\r\n\t\t\t$timeUnit = date ( 'Y' );\r\n\t\t}\r\n\t}\r\n\t\r\n\trequire_once 'PHPExcel/PHPExcel.php';\r\n\t$objPHPExcel = new PHPExcel ();\r\n\t\r\n\theader ( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' );\r\n\theader ( 'Content-Disposition: attachment;filename=\"report_' . ($isMonthly ? 'monthly' : 'yearly') . date ( 'YMDhm' ) . '.xlsx\"' );\r\n\theader ( 'Cache-Control: max-age=0' );\r\n\t\r\n\t// Set properties\r\n\t$objPHPExcel->getProperties ()->setCreator ( \"Roy Ganor\" )->setTitle ( \"Doctors Report\" )->setSubject ( \"Doctors Report\" )->setDescription ( \"Doctors Report\" );\r\n\t\r\n\twriteSurgeries ( $req, $res, $uid, $objPHPExcel );\r\n\twriteShifts ( $req, $res, $uid, $objPHPExcel );\r\n\twriteSessions ( $req, $res, $uid, $objPHPExcel );\r\n\twriteSurgeons ( $req, $res, $uid, $objPHPExcel );\r\n\twriteOperations ( $req, $res, $uid, $objPHPExcel );\r\n\t\r\n\t$objPHPExcel->setActiveSheetIndex ( 0 );\r\n\t\r\n\t$objWriter = PHPExcel_IOFactory::createWriter ( $objPHPExcel, 'Excel2007' );\r\n\t$objWriter->save ( 'php://output' );\r\n}", "public function create()\n\t{\n\t\tglobal $ilUser,$lng;\n\t\t\n\n\t\t// Write on task (fillPdfTemplate for every candidate) and finally merge them in one PDF.\n\t\tinclude_once './Services/ADN/Report/classes/class.adnTaskScheduleWriter.php';\n\t\t$writer = new adnTaskScheduleWriter();\n\t\t$writer->xmlStartTag('tasks');\n\n\t\t$this->createAssignments($writer);\n\t\t\n\t\t$writer->xmlEndTag('tasks');\n\t\t#$GLOBALS['ilLog']->write($writer->xmlDumpMem(true));\n\t\t\n\t\ttry\n\t\t{\n\t\t\tinclude_once './Services/ADN/Base/classes/class.adnRpcAdapter.php';\n\t\t\t$adapter = new adnRpcAdapter();\n\t\t\t$adapter->transformationTaskScheduler(\n\t\t\t\t$writer->xmlDumpMem()\n\t\t\t);\n\t\t\t\n\t\t}\n\t\tcatch(adnReportException $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function createGridDataHorizontalDates()\n {\n $aPeriods = $this->getGridDataPeriods();\n $aLevels = $this->getGridDataLevels();\n if (empty($aPeriods) || empty($aLevels)) {\n $this->aErrors[] = 'No period or level data provided';\n\n return false;\n }\n $aAllPeriodLevels = $this->getAllGridDataPeriodLevels($aPeriods, $aLevels);\n ?>\n <table id=\"dimension_table\" border=\"1\" class=\"dim_table\">\n <tbody><tr><th></th>\n <?php\n foreach ($aPeriods as $nPeriodId => $aPeriod) {\n echo \"<th>{$aPeriod['period_name_x_axis']}</th>\\n\";\n }\n ?>\n </tr></tbody>\n <?php\n foreach ($aLevels as $nLevelId => $aLevel) {\n $nLevelId = $aLevel['id'];\n echo \"<tr>\\n\";\n ?>\n <td>\n <?php\n if (!empty($aLevel['link_exists'])) {\n ?>\n <a class=\"more\" title=\"<?=$aLevel['label']?>\" \n href=\"?year=<?=$aLevel['nYear']?>&amp;level=<?=$aLevel['level']\n ?>&amp;parent_level_id=<?=$aLevel['level_id']?>\"><?=$aLevel['code']?></a>\n <?php\n } else {\n echo $aLevel['code'];\n }\n ?>\n </td>\n <?php\n foreach ($aPeriods as $nPeriodId => $sPeriod) {\n ?>\n <td>\n <?php\n if (!empty($aAllPeriodLevels[$nPeriodId][$nLevelId]['link_exists'])) {\n ?>\n <a class=\"more\" title=\"<?=$aLevel['label']?>\" \n href=\"?year=<?=$aLevel['nYear']?>&amp;period_id=<?=\n $aAllPeriodLevels[$nPeriodId][$nLevelId]['period_id']?>&amp;level=<?=\n $aAllPeriodLevels[$nPeriodId][$nLevelId]['level']?>&amp;parent_level_id=<?=\n $aAllPeriodLevels[$nPeriodId][$nLevelId]['parent_level_id']?>&amp;level_id=<?=\n $aAllPeriodLevels[$nPeriodId][$nLevelId]['level_id']?>\"><?=\n $this->getFormattedAmt($aAllPeriodLevels[$nPeriodId][$nLevelId]['amt'])?></a>\n <?php\n } else {\n echo '0';\n }\n ?>\n </td>\n <?php\n }\n echo \"</tr>\\n\";\n }\n\n echo '</table>';\n }", "public function build()\n\t{\n\t\t$script = \"\";\n\t\t$this->addTable($script);\n\t\t$this->addIndices($script);\n\t\t$this->addForeignKeys($script);\n\t\treturn $script;\n\t}", "static public function _(Grid $grid)\n\t{\n $code = '\n <tbody>';\n $columns = array_keys($grid->getColumns());\n $data = $grid->getDataWithRenderValues();\n foreach ($data['data'] as $row) {\n $rowCode = '\n <tr>';\n foreach ($columns as $key) {\n $rowCode .= '\n <td>'.$row[$key].'</td>';\n }\n $rowCode .= '\n </tr>';\n $code .= $rowCode;\n }\n\n $code .= '\n </tbody>';\n\n return $code;\n\t}" ]
[ "0.6500202", "0.615256", "0.58895713", "0.5836996", "0.5825629", "0.581223", "0.57863814", "0.57828224", "0.5696107", "0.5694339", "0.56219083", "0.5608443", "0.55924875", "0.5535631", "0.55146754", "0.5476028", "0.5475541", "0.54647565", "0.54646266", "0.545714", "0.545316", "0.5442542", "0.5432491", "0.5427075", "0.541057", "0.5407907", "0.54029787", "0.5388302", "0.5350388", "0.5349704", "0.534322", "0.5326917", "0.5301503", "0.5289925", "0.52744526", "0.52531654", "0.5220066", "0.5213901", "0.52100277", "0.52005833", "0.5089998", "0.5061311", "0.5047167", "0.5031995", "0.5019052", "0.5018738", "0.50163984", "0.5009017", "0.5003787", "0.5001965", "0.49844947", "0.49506843", "0.4947848", "0.49410746", "0.49332783", "0.49324095", "0.4912012", "0.49014425", "0.48964593", "0.4893796", "0.48919514", "0.48852766", "0.4879857", "0.48788565", "0.4877832", "0.487307", "0.48659804", "0.48642454", "0.48581028", "0.48495328", "0.48394853", "0.4838612", "0.48376456", "0.48348615", "0.48343095", "0.48336884", "0.48318556", "0.4831109", "0.48281536", "0.48172703", "0.48129413", "0.4812749", "0.48068142", "0.48062685", "0.4801867", "0.48009962", "0.4795755", "0.47924587", "0.47894108", "0.47881702", "0.4784798", "0.4778395", "0.47750998", "0.47743145", "0.47732714", "0.47732636", "0.47715977", "0.47690874", "0.47540042", "0.47528157" ]
0.5199917
40
Creates a cell object
protected function create_header_cell($content, $collCount) { return $this->create_cell(array('content'=>$content,'colCount'=>$collCount)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateCell()\n {\n $object = new \\stdClass();\n $object->title = 'barfoo';\n $cell = $this->createFactory()->createCell('title', PropertyColumn::class, $object, []);\n\n $this->assertInstanceOf(Cell::class, $cell);\n $this->assertEquals('barfoo', $cell->value);\n $this->assertEquals('Property', $cell->getTemplate());\n }", "protected function create_cell($params = array())\n {\n $cellObj = new stdClass();\n if($params)\n {\n foreach($params AS $name=>$value)\n {\n $cellObj->$name = $value;\n }\n }\n return $cellObj;\n }", "protected function set_up_blank_object()\n {\n return $this->create_cell(array('content'=>'','colCount'=>1));\n }", "public function cell($value) {\n return $this->setProperty('cell', $value);\n }", "public function setCell($row, $column)\n\t{\n\t\t$this->cells[] = new Hypertable_ThriftGen_Cell(array('key' => new Hypertable_ThriftGen_Key( array('row'=> $row, 'column_family'=> $column, 'flag' => 1))));\n\t\treturn $this;\n\t}", "public function testConstructWithStyleArray()\n {\n $oCell = new Cell(null, array('valign' => 'center'));\n\n $this->assertInstanceOf('PhpOffice\\\\PhpWord\\\\Style\\\\Cell', $oCell->getStyle());\n $this->assertNull($oCell->getWidth());\n }", "function generateCell($type) {\n\t\t\n\t\tif($this->getV()) {\n\t\t\n\t\t\t$str = \"{v: \";\n\t\t\t\n\t\t\tif($type==\"string\") {\n\t\t\t\t$str.= \"'\".$this->escapeJSChars($this->getV()).\"',\";\n\t\t\t} elseif($type==\"boolean\") {\n\t\t\t\t$str.= \"'\".$this->getV().\"',\";\n\t\t\t} elseif($type==\"date\") {\n\t\t\t\t$str.= \"new Date(\".substr($this->getV(),0,4).\",\".(substr($this->getV(),5,2) - 1).\",\".substr($this->getV(),8,2).\"),\";\n\t\t\t} elseif($type==\"datetime\") {\n\t\t\t\t$str.= \"new Date(\".substr($this->getV(),0,4).\",\".(substr($this->getV(),5,2) - 1).\",\".substr($this->getV(),8,2).\",\".substr($this->getV(),11,2).\",\".substr($this->getV(),14,2).\",\".substr($this->getV(),17,2).\"),\";\n\t\t\t} elseif($type==\"timeofday\") {\n\t\t\t\t$str.= \"[\".substr($this->getV(),11,2).\",\".substr($this->getV(),14,2).\",\".substr($this->getV(),17,2).\"],\";\n\t\t\t} else {\t\t\n\t\t\t\t$str.= $this->escapeJSChars($this->getV()).\",\";\n\t\t\t}\n\t\t\t\n\t\t\tif($this->getF()) {\n\t\t\t\t$str.= \"f: '\".$this->getF().\"',\";\n\t\t\t}\t\t\n\t\t\t\n\t\t\tif($this->getClassName()) {\n\t\t\t\t$str.=\"p: {'className': '\".$this->getClassName().\"'},\";\n\t\t\t}\n\t\t\t\n\t\t\t$str = substr($str,0,-1);\n\t\t\t$str.= \"}\";\n\n\t\t} else {\n\t\t\n\t\t\t$str = \"\";\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $str;\n\t\t\n\t}", "public function setToCell(Cell &$Cell);", "public function new_cell($css = '', $extras='') {\n\n $opts = '';\n\n if ($css == '') {\n $cssfirst = true;\n } else {\n $cssfirst = false;\n }\n\n // Close the previous cell if needed\n if ($this->_cellopen) {\n $this->end_cell();\n }\n\n // Check if column span was set via $this->set_colspan()\n if ($this->_colspan > 1) {\n $opts .= ' colspan=\"'.$this->_colspan.'\"';\n\n $this->_colspan = 0;\n }\n\n // Check if row span was set via $this->set_rowspan()\n if ($this->_rowspan > 1) {\n $opts .= ' rowspan=\"'.$this->_rowspan.'\"';\n\n $this->_rowspan = 0;\n }\n\n // Check if width was set via $this->set_width()\n if ($this->_width > 0) {\n $opts .= ' width=\"'.$this->_width.$this->_wpp.'\"';\n\n $this->_width = 0;\n $this->_wpp = '';\n }\n\n // Check if height was set via $this->set_height()\n if ($this->_height > 0) {\n $opts .= ' height=\"'.$this->_height.$this->_hpp.'\"';\n\n $this->_height = 0;\n $this->_hpp = '';\n }\n\n if ($this->_celltitledata != '') {\n $opts .= ' title=\"'.$this->_celltitledata.'\"';\n\n $this->_celltitledata = '';\n }\n\n if ($this->_newid != '') {\n $opts .= ' id=\"'.$this->_newid.'\"';\n\n $this->_newid = '';\n }\n\n if ($this->_onclickdata != '') {\n $opts .= ' onclick=\"'.$this->_onclickdata.'\"';\n\n $this->_onclickdata = '';\n }\n\n if ($this->_onmouseoverdata != '') {\n $opts .= ' onmouseover=\"'.$this->_onmouseoverdata.'\"';\n\n $this->_onmouseoverdata = '';\n }\n\n if ($css != '') {\n $opts = ' class=\"'.$css.'\"'.$opts;\n }\n\n if ($extras != '') {\n // Allows inline styles to override formatting in the CSS stylesheet\n $opts .= ' '.$extras;\n }\n\n echo '<td'.$opts.'>';\n $this->_cellopen = true;\n }", "public function cells();", "function helper_pdf_add_cell($pdf, $largura, $altura, $texto, $bordas, $pula_linha, $alinhamento){\n\t$pdf->Cell($largura, $altura, $texto, $bordas, $pula_linha, $alinhamento);\n}", "private function BuildCell($_RowNo, $_ColNo, $_Cell) {\r\n if(is_string($_Cell)) {\r\n $Len_ = strlen($_Cell);\r\n return(pack(\"S*\", 0x0204, $Len_ + 8, $_RowNo, $_ColNo, 0x00, $Len_).$_Cell);\r\n }\r\n if(is_int($_Cell))\r\n return(pack(\"S*\", 0x027E, 10, $_RowNo, $_ColNo, 0x00).pack(\"I\", ($_Cell<<2) | 2));\r\n if(is_float($_Cell))\r\n return(pack(\"S*\", 0x0203, 14, $_RowNo, $_ColNo, 0x00).pack(\"d\", $_Cell));\r\n if(is_bool($_Cell))\r\n return($this->BuildCell($_RowNo, $_ColNo, (int)($_Cell ? 1 : 0)));\r\n // Returns a null cell\r\n return(pack(\"S*\", 0x0201, 6, $_RowNo, $_ColNo, 0x17));\r\n }", "public function cell($key, Cell $cell);", "public function getCell()\n {\n return $this->cell;\n }", "public function addCell($value, $type = null, $styleName = null)\n {\n if (!$type) {\n $type = $this->guessType($value);\n }\n $value = htmlentities($value, ENT_COMPAT, $this->encoding);\n $this->data .= \"<Cell\" . ($styleName ? \" ss:StyleID=\\\"\" . $styleName . \"\\\"\" : \"\") . \"><Data ss:Type=\\\"\" . $type . \"\\\">\" . $value . \"</Data></Cell>\";\n return $this;\n }", "public function cell() {\r\n\t\t$argKeys = ['cell', 'header', 'headerSort', 'skipId', 'cellOptions'];\r\n\t\t$totalArgs = count($argKeys);\r\n\t\t$totalArgKey = $lastArgKey = $totalArgs - 1;\r\n\t\t$args = func_get_args();\r\n\t\t$numArgs = count($args);\r\n\t\tfor ($i = $totalArgKey; $i > 0; $i--) {\r\n\t\t\tif (!empty($args[$i])) {\r\n\t\t\t\t$lastArgKey = $i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($lastArgKey < $totalArgKey) {\r\n\t\t\t// The last passed argument can always be cell options\r\n\t\t\tif (is_array($args[$lastArgKey])) {\r\n\t\t\t\t$args[$totalArgKey] = $args[$lastArgKey];\r\n\t\t\t\tfor ($i = $lastArgKey; $i < $totalArgKey; $i++) {\r\n\t\t\t\t\t$args[$i] = null;\r\n\t\t\t\t}\r\n\t\t\t\tksort($args);\r\n\t\t\t}\r\n\t\t}\r\n\t\textract(array_combine($argKeys, $args + array_fill(0, $totalArgs, null)));\r\n\t\t\r\n\t\t// Checks if the skipId is in the skip array\r\n\t\tif (!empty($skipId) && $this->_checkSkip($skipId)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$formAddCell = '&nbsp;';\r\n\t\tif ($this->getHeader) {\r\n\t\t\t$this->columnCount++;\r\n\t\t\t//Stores first instance of non-blank header\r\n\t\t\tif (!empty($header) && !$this->hasHeader) {\r\n\t\t\t\t$this->hasHeader = true;\r\n\t\t\t}\r\n\t\t\tif ($headerSort) {\r\n\t\t\t\tif ($headerSort === true) {\r\n\t\t\t\t\t$headerSort = null;\r\n\t\t\t\t}\r\n\t\t\t\t$header = $this->thSort($header, $headerSort);\r\n\t\t\t}\r\n\t\t\t$thOptions = isset($cellOptions['th']) ? $cellOptions['th'] : $cellOptions;\r\n\t\t\t$this->headers[] = [$header => $thOptions];\r\n\t\t\t\r\n\t\t}\r\n\t\t/*\r\n\t\tif ($editCell = Param::keyCheck($cellOptions, 'edit', true)) {\r\n\t\t\t$formAddCell = $editCell;\r\n\t\t\t$cell = $this->_editCell($cell, $editCell);\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\tif (is_array($cellOptions)) {\r\n\t\t\t$cell = [$cell, $cellOptions];\r\n\t\t}\r\n\t\t$this->row[] = $cell;\r\n\t\tif ($this->trCount == 0) {\r\n\t\t\t$this->formAddRow[] = $formAddCell;\r\n\t\t}\r\n\t}", "public function addCell($key, Cell $cell);", "final private function initCells(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\tif (@$this->contents[$i]->contents[$j] and\n\t\t\t\t\t@!$this->markspan[$i][$j] and\n\t\t\t\t\tcount(@$this->contents[$i]->contents[$j]->contents) == 0)\n\t\t\t$this->cellContent($i,$j,'&nbsp;');\n\n\t}", "private function create()\n {\n //echo date('H:i:s') , \" Create new PHPExcel object\" , EOL;\n $objPHPExcel = new PHPExcel();\n\n // Set document properties\n //echo date('H:i:s') , \" Set document properties\" , EOL;\n $objPHPExcel->getProperties()->setCreator(\"Maarten Balliauw\")\n ->setLastModifiedBy(\"Maarten Balliauw\")\n ->setTitle(\"PHPExcel Test Document\")\n ->setSubject(\"PHPExcel Test Document\")\n ->setDescription(\"Test document for PHPExcel, generated using PHP classes.\")\n ->setKeywords(\"office PHPExcel php\")\n ->setCategory(\"Test result file\");\n\n return $objPHPExcel;\n }", "function fcell($c_width,$c_height,$x_axis,$text){\n $w_w=$c_height/3;\n $w_w_1=$w_w+2;\n $w_w1=$w_w+$w_w+$w_w+3;\n $len=strlen($text); \n if($len>10){\n $w_text=str_split($text,10);\n $this->SetX($x_axis);\n $this->Cell($c_width,$w_w_1,$w_text[0],'','','');\n $this->SetX($x_axis);\n $this->Cell($c_width,$w_w1,$w_text[1],'','','');\n $this->SetX($x_axis);\n $this->Cell($c_width,$c_height,'','LTRB',0,'C',0);\n }\n else{\n $this->SetX($x_axis);\n $this->Cell($c_width,$c_height,$text,'LTRB',0,'C',0);\n }\n }", "function Cell2($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') {\n // $this->Cell($w, $h, $txt, $border, $ln, $align, $fill, $link, $stretch, $ignore_min_height, $calign, $valign);\n $h = 5;\n $this->StartTransform();\n $this->Rect($this->x, $this->y, $w, $h, 'CNZ');\n $this->writeHTMLCell($w, $h, $this->x, $this->y, $txt);\n $this->StopTransform();\n }", "public function setCell($cell)\n {\n $this->cell = $cell;\n\n return $this;\n }", "public function testAccessArray()\n {\n $data = [\n 'foobar' => 'barfoo',\n ];\n $cell = $this->createFactory()->createCell('foobar', PropertyColumn::class, $data, []);\n }", "public function callbackCreatedCell($bodyOrParams = []) {\n\t\tValidator::getInstance()->validateBodyOrParams($bodyOrParams);\n\t\t$this->_config = Hash::insert($this->_config, 'createdCell', $bodyOrParams);\n\n\t\treturn $this;\n\t}", "protected function build_cell($cell, $classes, $colspan=null, $rowspan=null, $header=false) {\n if (!($cell instanceof html_table_cell)) {\n $cell = new html_table_cell($cell);\n }\n $cell->header = $header;\n $cell->scope = 'col';\n\n if (!empty($colspan) && $colspan > 1) {\n $cell->colspan = $colspan;\n }\n\n if (!empty($rowspan) && $rowspan > 1) {\n $cell->rowspan = $rowspan;\n }\n\n if (!empty($classes)) {\n $classes = implode(' ', $classes);\n if (empty($cell->attributes['class'])) {\n $cell->attributes['class'] = $classes;\n } else {\n $cell->attributes['class'] .= ' ' . $classes;\n }\n }\n\n return $cell;\n }", "public function getCellPrototype()\n\t{\n\t\treturn $this->cell;\n\t}", "public static function createInstance()\n {\n return new MoneyBoundGridColumn('ISerializable', 'ISerializable');\n }", "public function create()\n {\n parent::create();\n\n $sheet = $this->add_sheet();\n\n $this->add_table($sheet, $this->database, $this->generate_table());\n }", "public static function createInstance()\n {\n return new NumberBoundGridColumn('ISerializable', 'ISerializable');\n }", "private function createTemplate()\n\t{\n\t\t$this->objPHPExcel = new PHPExcel();\n\t\t$this->objPHPExcel->setActiveSheetIndex(0);\n\t\t$this->objWorksheet = $this->objPHPExcel->getActiveSheet();\n\t\t//TODO: other parameters\n\t\t$this->objWorksheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT);\n\t\t$this->objWorksheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);\n\t\t$this->objWorksheet->getPageSetup()->setHorizontalCentered(true);\n\t\t$this->objWorksheet->getPageSetup()->setVerticalCentered(false);\n\n $this->_usingTemplate=false;\n\t}", "function getCell() {\n \tglobal $synAbsolutePath;\n $ext = $this->translate($this->value);\n $mat=$this->translatePath($this->mat);\n $filename=$mat.$this->createFilename().\".\".$ext;\n $file_exists=file_exists($synAbsolutePath.$filename);\n $isImg=$this->isImage($filename);\n if ($ext and $file_exists and $isImg) $ret=\"<div style='overflow: hidden; height: 25px; display:inline;background: url($filename) no-repeat center;width: 100%' onMouseOver=\\\"openbox('$filename')\\\" onMouseOut=\\\"closebox()\\\"></div>\";\n else if ($ext and $file_exists and !$isImg) $ret=\"<span style='color: gray'>Document $ext</span>\";\n else if ($ext and !$file_exists) $ret=\"<span style='color: gray'>Error $ext</span>\";\n else $ret=\"<span style='color: gray'>Empty</span>\";\n return $ret;\n //die;\n }", "function add_cell($val, $link = \"\")\n\t{\n\t\tif(!empty($link))\n\t\t{\n\t\t\t$this->tpl->setCurrentBlock(\"begin_link\");\n\t\t\t$this->tpl->setVariable(\"LINK_TARGET\", $link);\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t\t$this->tpl->touchBlock(\"end_link\");\n\t\t}\n\n\t\t$this->tpl->setCurrentBlock(\"text\");\n\t\t$this->tpl->setVariable(\"TEXT_CONTENT\", $val);\n\t\t$this->tpl->parseCurrentBlock();\n\t\t$this->tpl->setCurrentBlock(\"table_cell\");\n\t\t$this->tpl->parseCurrentBlock();\n\t}", "function add_cell($val, $link = \"\")\n\t{\n\t\tif (!empty($link))\n\t\t{\n\t\t\t$this->tpl->setCurrentBlock(\"begin_link\");\n\t\t\t$this->tpl->setVariable(\"LINK_TARGET\", $link);\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t\t$this->tpl->touchBlock(\"end_link\");\n\t\t}\n\n\t\t$this->tpl->setCurrentBlock(\"text\");\n\t\t$this->tpl->setVariable(\"TEXT_CONTENT\", $val);\n\t\t$this->tpl->parseCurrentBlock();\n\t\t$this->tpl->setCurrentBlock(\"table_cell\");\n\t\t$this->tpl->parseCurrentBlock();\n\t}", "public function createWorksheet() {\n // load vendor classes\n App::import('Vendor', 'PhpExcel.PHPExcel');\n\n $this->_xls = new PHPExcel();\n $this->_row = 1;\n\n return $this;\n }", "public function cellType($row, $column) {\n\t}", "public function __construct(int $width = 0, int $height = 0) {\n $this->width = $width;\n $this->height = $height;\n\n // Field structure:\n //\n // NOTE: width -> any positive number\n // height -> odd positive number\n\n // o o o o\n // o o o\n // o o o o\n // o o o\n // o o o o\n //\n $this->cells = new SplFixedArray($this->width * $this->height - intdiv($this->height, 2));\n\n for ($i = 0; $i < count($this->cells); $i++) {\n $this->cells[$i] = new Cell(0, Colors::randomColorString());\n }\n }", "public function setRow($row)\n\t{\n\t\t$this->cells[] = new Hypertable_ThriftGen_Cell(array('key' => new Hypertable_ThriftGen_Key( array('row'=> $row, 'flag' => 0))));\n\t\treturn $this;\n\t}", "public static function createInstance()\n {\n return new TextBoundGridColumn('ISerializable', 'ISerializable');\n }", "public function __construct($values = array())\n {\n for ($index = 0; $index < 9; ++$index) {\n $this->sections[] = $this->rows[$index] = new Row($index, $this);\n $this->sections[] = $this->columns[$index] = new Column($index, $this);\n $this->sections[] = $this->blocks[$index] = new Block($index, $this);\n }\n\n // Create cells\n foreach ($this->rows as $row) {\n $this->cells[$row->index] = array();\n foreach ($this->columns as $column) {\n $this->cells[$row->index][$column->index] = new Cell($row, $column, $this->blocks[intval(floor($row->index / 3) * 3 + floor($column->index / 3))], $this);\n }\n }\n\n // Set adjacent cells\n foreach ($this->rows as $row) {\n foreach ($this->columns as $column) {\n $this->cells[$row->index][$column->index]->setAdjacentCells();\n }\n }\n\n // Set values if given\n $this->setValues($values);\n }", "public function get_cell_info($template) {\n $template['icon-css'] = 'icon-views ont-color-orange ont-icon-22';\n\t\t$template['preview-image-url'] = WPDDL_RES_RELPATH . '/images/post-content.png';\n\t\t$template['name'] = __('Content Template (custom fields, taxonomy and content)', 'ddl-layouts');\n\t\t$template['description'] = __('Display different fields of any page, post or custom type. This cell supports HTML for styling and shortcodes for the different fields.', 'ddl-layouts');\n\t\t$template['button-text'] = __('Assign Content Template Box', 'ddl-layouts');\n\t\t$template['dialog-title-create'] = __('Create a new Content Template Cell', 'ddl-layouts');\n\t\t$template['dialog-title-edit'] = __('Edit Content Template Cell', 'ddl-layouts');\n\t\t$template['dialog-template'] = $this->_dialog_template();\n\t\t$template['category'] = __('Post display', 'ddl-layouts');\n\t\treturn $template;\n\t}", "public function testCellRender(): void\n {\n $cell = $this->View->cell('Articles::teaserList');\n $render = \"{$cell}\";\n\n $this->assertSame('teaser_list', $cell->viewBuilder()->getTemplate());\n $this->assertStringContainsString('<h2>Lorem ipsum</h2>', $render);\n $this->assertStringContainsString('<h2>Usectetur adipiscing eli</h2>', $render);\n $this->assertStringContainsString('<h2>Topis semper blandit eu non</h2>', $render);\n $this->assertStringContainsString('<h2>Suspendisse gravida neque</h2>', $render);\n\n $cell = $this->View->cell('Cello');\n $this->assertInstanceOf('TestApp\\View\\Cell\\CelloCell', $cell);\n $this->assertSame(\"Cellos\\n\", $cell->render());\n }", "function __construct($data_label = \"\", $shared_data = \"\")//check to see if there is already a shared_memory \"cell\" by this name, if not, create it\n\t{\n\t\ttry\n\t\t{\n\t\t\tif(0 != strlen($data_label))\n\t\t\t{\n\t\t\t\tif($this->checkRegister($data_label))\n\t\t\t\t{\n\t\t\t\t\t ;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception('No data label supplied.\\n'.serialize(debug_backtrace()));\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tthrow $e ;\n\t\t}\n\t}", "public static function createInstance()\n {\n return new RowCommandGridColumn('ISerializable', 'ISerializable', 'ISerializable', 'ISerializable');\n }", "private function newCol( $row, $cell, $value ) {\n\n if ( count( $row->c ) > 0 ) {\n\n $rowCopy = clone $row;\n unset( $row->c );\n\n // SimpleXML does not seem to allow adding XML objects directly into other XML objects, and so some trickery must be used to insert a column between\n // already existing columns. We must redraw the entire columns ('c') section of the xml object but insert our new column in the correct place as we redraw.\n foreach ( $rowCopy as $col ) {\n\n if ( $cell < $col->attributes()->r && empty( $inserted ) ) {\n $insertedCol = $row->addChild( 'c' );\n $insertedCol->addAttribute( 'r', $cell );\n $insertedCol->addChild( 'v', $value );\n\n $inserted = true;\n }\n\n $copiedCol = $row->addChild( 'c' );\n $copiedCol->addAttribute( 'r', $col->attributes()->r );\n $copiedCol->addChild( 'v', $col->v );\n }\n\n if ( ! empty( $inserted ) )\n return $insertedCol;\n }\n\n $insertedCol = $row->addChild( 'c' );\n $insertedCol->addAttribute( 'r', $cell );\n $insertedCol->addChild( 'v', $value );\n\n return $insertedCol;\n }", "private function newRow(){\n\t\t$r = new HtmlBox('tr');\n\t\tfor($i=0;$i<$this->col;$i++)\n\t\t\t$r->add(new HtmlBox('td')) ;\n\t\t$this->row++;\n\t\t$this->add($r);\n\t\treturn $this;\n\t}", "public static function createInstance()\n {\n return new CheckBoxGridColumn('ISerializable', 'ISerializable');\n }", "private function newRow( $cell ) {\n\n $sheetDataRef = $this->sheet->contents->sheetData;\n $rowCol = $this->cellToRowAndColumn( $cell );\n\n // SimpleXML does not seem to allow adding XML objects directly into other XML objects, and so some trickery must be used to insert a row between\n // already existing rows. We must redraw the entire rows section of the xml object but insert our new row in the correct place as we redraw.\n if ( count( $sheetDataRef->row ) > 0 ) {\n\n $rowsCopy = clone $this->sheet->contents->sheetData;\n unset( $this->sheet->contents->sheetData->row );\n\n foreach ( $rowsCopy->row as $row ) {\n\n if ( (int) $row->attributes()->r > $rowCol[0] && empty( $inserted ) ) {\n\n $insertedRow = $sheetDataRef->addChild( 'row' );\n $insertedRow->addAttribute( 'r', $rowCol[0] );\n $insertedRow->addAttribute( 'spans', '1:2' );\n\n $inserted = true;\n }\n\n $copiedRow = $sheetDataRef->addChild( 'row' );\n $copiedRow->addAttribute( 'r', $row->attributes()->r );\n $copiedRow->addAttribute( 'spans', $row->attributes()->spans );\n\n foreach( $row->c as $col ) {\n\n $this->newCol( $copiedRow, $col->attributes()->r, $col->v );\n }\n }\n\n if ( ! empty( $inserted ) )\n return $insertedRow;\n }\n\n $insertedRow = $sheetDataRef->addChild( 'row' );\n $insertedRow->addAttribute( 'r', $rowCol[0] );\n $insertedRow->addAttribute( 'spans', '1:2' );\n\n return $insertedRow;\n }", "public static function createTable(){\n if (RBModel::recreateTable(get_called_class()) == false){\n return;\n }\n\n $bean = R::dispense( strtolower(get_called_class()));\n $fields = get_class_vars(get_called_class());\n \n foreach( $fields as $field=>$value){\n\n \n //ignora as variaveis que começam com _\n if ($field[0] == \"_\" || $field == \"id\"){\n continue;\n }\n\n $r = new ReflectionProperty(get_called_class(), $field);\n $comment = strtolower($r->getDocComment());\n\n if (strstr($comment,\"@varchar\")){\n $value = \"\";\n } else\n if (strstr($comment,\"@int\")){\n $value = 0;\n } else\n if (strstr($comment,\"@date\")){\n $value = \"1990-01-01\";\n } else\n if (strstr($comment,\"@datetime\")){\n $value = \"1990-01-01 00:00:00\";\n } else\n if (strstr($comment,\"@double\")){\n $value = 0.0;\n } else\n if (strstr($comment,\"@bool\")){\n $value = false;\n } else\n if (strstr($comment,\"@money\")){\n $value = \"10.00\";\n }\n \n \n $bean->$field = $value;\n }\n \n R::store($bean);\n R::trash($bean);\n }", "public function __construct() {\n\t\t// Initialise worksheet collection\n\t\t$this->workSheetCollection = array();\n\t\t$this->activeSheetIndex = -1;\n\t\t$this->activeSheet = NULL;\n\n\t\t// Create document properties\n\t\t$this->properties = new DocumentProperties();\n\n\t\t// Create the cellXf supervisor\n\t\t$this->cellXfSupervisor = new Style(true);\n\t\t$this->cellXfSupervisor->bindParent($this);\n\n\t\t// Create the default style\n\t\t$this->addCellXf(new Style());\n\t\t$this->addCellStyleXf(new Style());\n\t}", "function generateHTMLCell($type) {\n\t\t\n\t\t$str = \"\";\n\t\t\n\t\tif($this->getClassName()) {\n\t\t\t$str.=\"<td class=\\\"googleTableCell \".$this->getClassName().\"\\\">\";\n\t\t}\telse {\n\t\t\t$str.=\"<td class=\\\"googleTableCell\\\">\";\n\t\t}\n\t\t\n\t\tif($this->getV()) {\n\n\t\t\tif($type==\"string\") {\n\t\t\t\t$str.= $this->getV();\n\t\t\t} elseif($type==\"boolean\") {\n\t\t\t\t$str.= $this->getV();\n\t\t\t} elseif($type==\"date\") {\n\t\t\t\t$str.= substr($this->getV(),8,2).\"/\".(substr($this->getV(),5,2) - 1).\"/\".substr($this->getV(),0,4);\n\t\t\t} elseif($type==\"datetime\") {\n\t\t\t\t$str.= substr($this->getV(),8,2).\"/\".(substr($this->getV(),5,2) - 1).\"/\".substr($this->getV(),0,4).\" \".substr($this->getV(),11,2).\":\".substr($this->getV(),14,2).\":\".substr($this->getV(),17,2);\n\t\t\t} elseif($type==\"timeofday\") {\n\t\t\t\t$str.= substr($this->getV(),11,2).\":\".substr($this->getV(),14,2).\":\".substr($this->getV(),17,2);\n\t\t\t} else {\t\t\n\t\t\t\t$str.= $this->getV();\n\t\t\t}\t\t\n\n\t\t} else {\n\t\t\n\t\t\t$str.= \"&nbsp;\";\n\t\t\t\n\t\t}\n\t\t\n\t\t$str.= \"</td>\";\n\t\t\n\t\treturn $str;\n\t\t\n\t}", "function setCellAttribute($name, $value)\n\t{\n\t\t$this->attrs[$name] = $value;\n\t\treturn $this;\n\t}", "function setCellAttribute($name, $value)\n\t{\n\t\t$this->attrs[$name] = $value;\n\t\treturn $this;\n\t}", "final public function setCell($key,string $class):self\n {\n $key = $this->onPrepareKey(['cell',$key]);\n $data =& $this->arr();\n $data[$key] = $class;\n\n return $this;\n }", "public function __construct($insideOf, $pCount, $width = null, $style = null)\n {\n $this->_insideOf = $insideOf;\n $this->_pCount = $pCount;\n $this->_width = $width;\n $this->_style = new \\PhpOffice\\PhpWord\\Style\\Cell();\n\n if (!is_null($style)) {\n if (is_array($style)) {\n foreach ($style as $key => $value) {\n if (substr($key, 0, 1) != '_') {\n $key = '_' . $key;\n }\n $this->_style->setStyleValue($key, $value);\n }\n } else {\n $this->_style = $style;\n }\n }\n }", "public function write() {\n\t\tif (!($this->_page instanceof Zend_Pdf_Page)) {\n\t\t\tthrow new Zend_Pdf_Exception(\"The PDF page that the cell is attempting to write to is not a valid page.\");\n\t\t}\n\t\tif (!($this->_font instanceof Zend_Pdf_Resource_Font)) {\n\t\t\tthrow new Zend_Pdf_Exception('No font has been set');\n\t\t}\n\t\tif ($this->isAutoHeight()) {\n\t\t\t$this->_height=$this->_autoHeight;\n\t\t}\n\t\tif ($this->isAutoWidth()) {\n\t\t\t$this->_width=$this->_autoWidth;\n\t\t}\n\t\t\n\t\t//positions of the cell's box\n\n\t\t//initalize the diminsions to defaults\n\t\t$top=$this->_y;\n\t\t$left=$this->_x;\n\t\t$right=$left+$this->getWidth();\n\t\t$bottom=$top+$this->getHeight();\n\t\t\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_BOTTOM) {\n\t\t\t$top=$this->getHeight();\n\t\t\t$bottom=$top+$this->getHeight();\n\t\t}\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_CENTER_X) {\n\t\t\t$left=$this->_page->getWidth()/2 - $this->getWidth()/2 + $this->_x;\n\t\t\t$right=$left+$this->getWidth();\n\t\t}\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_CENTER_Y) {\n\t\t\t$top=$this->_page->getHeight()/2 + $this->getHeight()/2 - $this->_y;\t\t\t\n\t\t\t$bottom=$top-$this->getHeight();\t\t\n\t\t}\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_TOP ) {\n\t\t\t$top=$this->_page->getHeight();\n\t\t\t$bottom=$top+$this->getHeight();\n\t\t}\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_RIGHT) {\n\t\t\t$left=$this->_page->getWidth() - $this->getWidth();\n\t\t\t$right=$left+$this->getWidth();\n\t\t}\n\t\t$currentY=$top;\n\t\t//save the page's font so we can put it back after writing the cell\n\t\t$pageFont=$this->_page->getFont();\n\t\t$fontSize=$this->_page->getFontSize();\n\t\t\n\t\t\t\t\n\t\t//restore old size and font\n\t\t$this->_page->setFont($pageFont,$fontSize);\n\t\t//draw the border\n\t\tif ($this->_border['size']>0) {\n\t\t\t$style=new Zend_Pdf_Style();\n\t\t\t$style->setLineColor($this->getBorderColor());\n\t\t\t$style->setFillColor(new Zend_Pdf_Color_RGB(255,255,255));\n\t\t\t$style->setLineDashingPattern($this->getBorderPattern());\n\t\t\t$this->_page->setStyle($style);\n\t\t\t$this->_page->drawRectangle($right,$top,$left,$bottom);\n\t\t\t$style->setFillColor(new Zend_Pdf_Color_RGB(0,0,0));\n\t\t\t$this->_page->setStyle($style);\n\t\t}\n\t\t\n\t\t//draw every section of every page.\n\t\tfor ($i=0;$i<count($this->_text);$i++) {\n\t\t\t$currentX=0;\n\t\t\tswitch ($this->_text[$i]['alignment']) {\n\t\t\t\tcase Zend_Pdf_Cell::ALIGN_RIGHT:\n\t\t\t\t\t$currentX=$right - $this->_text[$i]['width'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase Zend_Pdf_Cell::ALIGN_CENTER:\n\t\t\t\t\t$currentX=($right-$left)/2+$left-$this->_text[$i]['width']/2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Zend_Pdf_Cell::ALIGN_JUSTIFY:\n\t\t\t\t\t//@todo\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$currentX=$left;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t//add the offset\n\t\t\t$currentX+=$this->_text[$i]['x'];\n\t\t\t$currentY-=$this->_text[$i]['height'];\n\t\t\t//count() - 4 because of the 4 properties to this text.\n\t\t\tfor ($j=0;$j<count($this->_text[$i])-4;$j++) {\t\t\t\t\n\t\t\t\t$this->_page->setFont($this->_text[$i][$j]['font'],$this->_text[$i][$j]['fontSize']);\n\t\t\t\t$this->_page->drawText($this->_text[$i][$j]['text'],$currentX,$currentY,$this->_text[$i][$j]['encoding']);\n\t\t\t\t$currentX+=$this->_text[$i][$j]['width'];\t\t\n\t\t\t}\n\t\t}\n\t}", "private function createCells($data){\r\n $html = '';\r\n foreach ($data AS $index => $row) {\r\n $html .= '<tr class=\"ctable-rows\">';\r\n foreach ($row as $rownr => $data) {\r\n $html .= '<td>' . $data . '</td>';\r\n }\r\n $html .= '</tr>';\r\n }\r\n return $html;\r\n }", "public static function createInstance()\n {\n return new Grid('ISerializable', 'ISerializable');\n }", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: cell properties');\r\n\r\n $this->addElement('text', 'cellid', 'Id mask:', array('size' => 32));\r\n $this->addElement('text', 'cellclass', 'CSS class:', array('size' => 32));\r\n\r\n $cellvalue['min'] =& $this->createElement('text',\r\n 'min', 'minimum',\r\n array('size' => 4));\r\n $cellvalue['max'] =& $this->createElement('text',\r\n 'max', 'maximum',\r\n array('size' => 4));\r\n $cellvalue['inc'] =& $this->createElement('text',\r\n 'inc', 'increment',\r\n array('size' => 4));\r\n $this->addGroup($cellvalue, 'cellvalue', 'Value:', ' ');\r\n\r\n $cellsize['width'] =& $this->createElement('text',\r\n 'width', 'width',\r\n array('size' => 4));\r\n $cellsize['height'] =& $this->createElement('text',\r\n 'height', 'height',\r\n array('size' => 4));\r\n $cellsize['spacing'] =& $this->createElement('text',\r\n 'spacing', 'spacing',\r\n array('size' => 2));\r\n $cellsize['count'] =& $this->createElement('text',\r\n 'count', 'count',\r\n array('size' => 2));\r\n $this->addGroup($cellsize, 'cellsize', 'Size:', ' ');\r\n\r\n $cellcolor['active'] =& $this->createElement('text',\r\n 'active', 'active',\r\n array('size' => 7));\r\n $cellcolor['inactive'] =& $this->createElement('text',\r\n 'inactive', 'inactive',\r\n array('size' => 7));\r\n $cellcolor['bgcolor'] =& $this->createElement('text',\r\n 'bgcolor', 'background',\r\n array('size' => 7));\r\n $this->addGroup($cellcolor, 'cellcolor', 'Color:', ' ');\r\n\r\n $cellfont['family'] =& $this->createElement('text',\r\n 'family', 'family',\r\n array('size' => 32));\r\n $cellfont['size'] =& $this->createElement('text',\r\n 'size', 'size',\r\n array('size' => 2));\r\n $cellfont['color'] =& $this->createElement('text',\r\n 'color', 'color',\r\n array('size' => 7));\r\n $this->addGroup($cellfont, 'cellfont', 'Font:', ' ');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('apply','process'));\r\n }", "public function getCells();", "function blank_cell($num=1, $css='', $extras='') {\n $this->end_cell();\n\n if (!is_numeric($num)) {\n $num = 1;\n }\n\n for($i=1;$i<=$num;$i++) {\n $this->new_cell($css,$extras);\n echo '&nbsp;';\n }\n }", "public function cell($x = null, $y = null, $w = null, $h = null, $txt = '', $style = null, $options = [])\n {\n if (!isset($x)) $x = $this->getCursorX();\n if (!isset($y)) $y = $this->getCursorY();\n if (!isset($w)) $w = $this->getInnerWidth() - $x;\n if (!isset($h)) $h = $this->getInnerHeight() - $y;\n\n $style = Style::merged($this->getStyle('body'), $this->getStyle('cell'), $style);\n\n $originalY = $this->pdf->getCursorY();\n $originalPage = $this->pdf->getPage();\n\n $this->pdf->cell(\n $this->moveToGlobal_h($x),\n $this->moveToGlobal_v($y),\n $this->scaleToGlobal_h($w),\n $this->scaleToGlobal_v($h),\n $txt,\n $this->scaledStyle($style),\n $options\n );\n\n // If a automatic page-break is detected, move the entire view accordingly\n $newPage = $this->pdf->getPage();\n\n if ($newPage != $originalPage) {\n\n // TODO: Maybe just use the inner page height? The view moved one page backwards?\n $newY = $this->pdf->getCursorY();\n\n // For Multiline cells, assume 'bottom left' cursor placement, else 'top right'\n $default = Style::value($style, Multiline::ATTRIBUTE, false) ? CursorPlacement::BOTTOM_LEFT : CursorPlacement::TOP_RIGHT;\n $cursorPlacement = Style::value($style, CursorPlacement::ATTRIBUTE, $default);\n\n if ($cursorPlacement === CursorPlacement::BOTTOM_LEFT || $cursorPlacement === CursorPlacement::BOTTOM_RIGHT || $cursorPlacement === CursorPlacement::NEWLINE) {\n // If the cursor is at the bottom of the cell, subtract the cell height to determine\n // where the cell would have started on the new page.\n $newY -= $this->scaleToGlobal_v($h);\n }\n\n // Then move our view up accordingly.\n $this->y += $newY - $originalY;\n\n }\n\n return $this;\n }", "public function addcell( $row, $col, $string, $raw = '' ) {\n\t\t$this->sheets[ $this->sn ]['maxrow'] = max( $this->sheets[ $this->sn ]['maxrow'], $row + $this->rowoffset );\n\t\t$this->sheets[ $this->sn ]['maxcol'] = max( $this->sheets[ $this->sn ]['maxcol'], $col + $this->colOffset );\n\t\t$this->sheets[ $this->sn ]['cells'][ $row + $this->rowoffset ][ $col + $this->colOffset ] = $string;\n\t\tif ( $raw ) {\n\t\t\t$this->sheets[ $this->sn ]['cellsInfo'][ $row + $this->rowoffset ][ $col + $this->colOffset ]['raw'] = $raw;\n\t\t}\n\t\tif ( isset( $this->recType ) ) {\n\t\t\t$this->sheets[ $this->sn ]['cellsInfo'][ $row + $this->rowoffset ][ $col + $this->colOffset ]['type'] = $this->recType;\n\t\t}\n\n\t}", "public function instantiate($bean)\n {\n\n if(count($this->properties))\n {\n foreach($this->properties as $key => $val)\n { \n ($val == Bean::TYPE_STRING) ? $this->data[$key] = '' : ($val == Bean::TYPE_INTEGER ) ? $this->data[$key] = 0 : (Bean::TYPE_FLOAT) ? $this->data[$key] = 0.0 : $this->data[$key] = null;\n }\n }\n//var_dump($this->data);\n $this->bean = $bean;\n $this->update = array();\n\t $this->insert1 = array();\n }", "function OutputCell($width,$height,$htmlContent,$border=0,$LineFeedHeight=0,$align='',$fill=0,$cellmargin=3){\r\n\t$this->Cell($width, $height, '', $border, 0, $align, $fill);\r\n\t// on note la position apres la cellule\r\n\t$x = $this->x; $y = $this->y;\r\n\t$lmargin = $this->lMargin;\r\n\t$rmargin = $this->rMargin;\r\n\r\n\t// on se remet en debut de cellule\r\n\t$this->x-=$width;\r\n\t$this->x = $this->x+$cellmargin/2;\r\n\t$this->lMargin = $this->x; // pour que les retour ligne se fassent correctement dans la cellule\r\n\t$this->rMargin = $this->w-$this->x-$width+$cellmargin/2;\r\n\r\n\t$this -> WriteHTML($htmlContent,$LineFeedHeight);\r\n\t// on se remet a la fin de la cellule\r\n\t$this->x = $x; $this->y = $y;\r\n\t$this->lMargin = $lmargin;\r\n\t$this->rMargin = $rmargin;\r\n}", "public function makeTableur()\n {\n return $this->setDocumentPropertiesWithMetas(new Spreadsheet());\n }", "function setCellAttributes(array $values)\n\t{\n\t\t$this->attrs = $values;\n\t\treturn $this;\n\t}", "function setCellAttributes(array $values)\n\t{\n\t\t$this->attrs = $values;\n\t\treturn $this;\n\t}", "public function createExcel() {\n\n $this->objPHPExcel = new \\PHPExcel; // Make excel object, globally accessable\n\n $this->objWorksheet = $this->objPHPExcel->getActiveSheet(); // Make current sheet object, globally accessable\n $this->objWorksheet->setTitle($this->defaults['sheet1Name']);\n return $this->objPHPExcel;\n }", "public function makeTable($header, $data) {\n $this->SetFillColor(255, 0, 0);\n $this->SetTextColor(255);\n $this->SetDrawColor(128, 0, 0);\n $this->SetLineWidth(.3);\n $this->SetFont('', 'B');\n // Header\n $w = array(10, 25, 40, 10, 25, 15, 60, 10, 10, 10, 10, 10, 10, 10, 10, 10);\n for ($i = 0; $i < count($header); $i++)\n if ($i == 0) {\n $this->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);\n } else {\n $this->Cell($w[$i], 7, $header[$i], 1, 0, 'L', true);\n }\n $this->Ln();\n // Color and font restoration\n $this->SetFillColor(224, 235, 255);\n $this->SetTextColor(0);\n $this->SetFont('');\n // Data\n $fill = false;\n\n foreach ($data as $row) {\n $this->nr++;\n $this->Cell($w[0], 6, $this->nr, 'LR', 0, 'C', $fill);\n $this->Cell($w[1], 6, $row['article'], 'LR', 0, 'L', $fill);\n $this->Cell($w[2], 6, $row['brand'], 'LR', 0, 'L', $fill);\n $this->Cell($w[3], 6, $row['inch'], 'LR', 0, 'L', $fill);\n $this->Cell($w[4], 6, $row['size'], 'LR', 0, 'L', $fill);\n $this->Cell($w[5], 6, $row['lisi'], 'LR', 0, 'L', $fill);\n $this->Cell($w[6], 6, $row['design'], 'LR', 0, 'L', $fill);\n $this->Cell($w[7], 6, $row['onhand'], 'LR', 0, 'C', $fill);\n $this->Cell($w[8], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[9], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[10], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[11], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[12], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[13], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[14], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[15], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Ln();\n $fill = !$fill;\n }\n // Closing line\n $this->Cell(array_sum($w), 0, '', 'T');\n }", "public function generateNewCrossReferenceTableEntry(): CrossReferenceTableEntry\n {\n // Neue Nummer am \"Ende\" der CrossReferenceTable\n $objectNumber = $this->trailerDictionary->getObject(\"Size\")->getValue();\n $this->trailerDictionary->setObject(\"Size\", new PdfNumber($objectNumber + 1));\n\n $entry = new CrossReferenceTableEntry($objectNumber, 0, false, 0);\n $this->crossReferenceTable->setEntry($entry);\n return $entry;\n }", "function tdcell($colclass, $slots)\n{\n global $times_along_top;\n \n $html = '';\n if (func_num_args() > 2)\n {\n $data = func_get_arg(2);\n }\n \n $html .= \"<td class=\\\"$colclass\\\"\";\n if ($slots > 1)\n // No need to output more HTML than necessary\n {\n $html .= \" \" . (($times_along_top) ? \"colspan\" : \"rowspan\") . \"=\\\"$slots\\\"\";\n }\n if (isset($data))\n {\n $html .= \" data-\" . $data['name'] . \"=\\\"\" . $data['value'] . \"\\\"\";\n }\n $html .= \">\\n\";\n \n return $html;\n}", "public function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link=''){\n $txt = html_entity_decode(utf8_decode($txt));\n parent::Cell($w, $h, $txt, $border, $ln, $align, $fill, $link);\n }", "public function Cell($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = false, $link = ''): void\n {\n }", "public function addCell(Cell $cell)\n {\n if (!isset($this->kitCells[$cell->getPosition()])) {\n ExceptionFactory::positionOutOfRangeException($cell->getPosition());\n }\n\n if (!empty($this->kitCells[$cell->getPosition()])) {\n ExceptionFactory::positionAlreadyExistException($cell->getPosition());\n }\n\n $this->kitCells[$cell->getPosition()] = $cell;\n }", "function create()\n {\n $this->definitions['columns'] =& $this->columns;\n return $this->connection->create_table($this->name, $this->definitions);\n }", "public function newCObj() {}", "function &getRowInstance() {\n\t\t$row = new MastheadGridRow();\n\t\treturn $row;\n\t}", "public function setCellWithQualifier($row, $column, $qualifier)\n\t{\n\t\t$this->cells[] = new Hypertable_ThriftGen_Cell(array('key' => new Hypertable_ThriftGen_Key( array('column_qualifier' => $qualifier, 'row'=> $row, 'column_family'=> $column, 'flag' => 1))));\n\t\treturn $this;\n\t}", "public static function createInstance()\n {\n return new DateTimeBoundGridColumn('ISerializable', 'ISerializable');\n }", "public static function create($value, $label = ''){\n $value = (string)$value;\n $column = new Column();\n $column -> setDefaultValue($value);\n $column -> setLabel($label);\n return $column;\n }", "public function makeExcelSheet($data)\n\t{\n\t\t/** Reading Excel with PHPExcel_IOFactory */\n\t\trequire_once 'PHPExcel/IOFactory.php';\n\n\t\t$objReader = PHPExcel_IOFactory::createReader('Excel5');\n\t\t\n\t\t// template file\n\t\t$objPHPExcel = $objReader->load(APPLICATION_PATH . '/../data/templates/com-tpl.xls');\n\n\t\t$baseRow = 11; // base row in template file\n\t\t\n\t\tforeach($data as $r => $dataRow) {\n\t\t\t$row = $baseRow + ($r+1);\n\t\t\t\n\t\t\t$objPHPExcel->getActiveSheet()->insertNewRowBefore($row,1);\n\t\t\t\n\t\t\tif (!empty($dataRow)){\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row, ucfirst($dataRow['zone']));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row, ucfirst($dataRow['village']));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('C'.$row, ucfirst($dataRow['prod_name']));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('D'.$row, $dataRow['unit_measure']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$row, $dataRow['quantity']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('F'.$row, ucfirst($dataRow['quality']));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('G'.$row, $dataRow['price']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('H'.$row,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t ucfirst($dataRow['contact_fname']).' '.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t ucfirst($dataRow['contact_lname']).' '.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t 'TEL: ' . $dataRow['contact_tel']);\n\t\t\t}\n\t\t}\n\t\t$objPHPExcel->getActiveSheet()->removeRow($baseRow-1,1);\n\t\t\n\t\t// fill data area with white color\n\t\t$objPHPExcel->getActiveSheet()\n\t\t\t\t\t->getStyle('A'.$baseRow .':'.'H'.$row)\n\t\t\t\t\t->getFill()\n\t\t\t\t\t->applyFromArray(\n \t\t\t\t\t\t\t array(\n \t\t \t\t 'type' \t=> PHPExcel_Style_Fill::FILL_SOLID,\n \t\t\t\t\t\t 'startcolor' \t=> array('rgb' => 'FFFFFF'),\n \t\t\t\t \t 'endcolor' \t=> array('rgb' => 'FFFFFF')\n \t\t\t\t\t ));\n\t\t\n\t\t$comNo = $dataRow['com_number'];\n\t\t$deliveryDate = date('d-m-Y', strtotime($dataRow['ts_date_delivered']));\n\t\t\n\t\t$ComTitle = \"INFORMATION SUR LES PRODUITS FORESTIERS NON LIGNEUX DU \" .\n\t\t \"CERCLE DE TOMINIAN No: $comNo Du $deliveryDate\";\n\t\t\n\t\t$titleRow = $baseRow-1;\n\t\t// create new row\n\t\t$objPHPExcel->getActiveSheet()->insertNewRowBefore($titleRow,1);\n\t\t$objPHPExcel->getActiveSheet()\n\t\t\t\t\t->mergeCells('A'.$titleRow. ':'.'H'.$titleRow)\n\t\t\t\t\t->setCellValue('A'.$titleRow, $ComTitle)\n\t\t\t\t\t->getStyle('A'.$titleRow)->getFont()\n\t\t\t\t\t->setBold(true)\n\t\t\t\t\t->setSize(13)\n\t\t\t\t\t->setColor(new PHPExcel_Style_Color());\n\t\t\t\t\t\n\t//\t$objPHPExcel->getActiveSheet()->getRowDimension('A'.$titleRow)->setRowHeight(10);\n\t\t\t\t\t\n\t\t$title = 'ComNo'.$comNo;\n\t\t// set title of sheet\n\t\t$objPHPExcel->getActiveSheet()->setTitle($title);\n\n\t\t// Redirect output to a client’s web browser (Excel5)\n\t\theader('Content-Type: application/vnd.ms-excel');\n\t\theader('Content-Disposition: attachment;filename=\"communique.xls\"');\n\t\theader('Cache-Control: max-age=0');\n\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n\t\t$objWriter->save('php://output');\n\t\texit;\n\t}", "function createSpreadsheet(){\n\t\t\n\t\n\t\terror_reporting(E_ALL);\n\t\tini_set('display_errors', TRUE);\n\t\tini_set('display_startup_errors', TRUE);\n\t\n\t\tdefine('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');\n\t\n\t\t/** Include PHPExcel */\n\t\t//require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';\n\t\t\n\t\trequire_once $GLOBALS['ROOT_PATH'].'Classes/PHPExcel.php';\n\t\n\t\n\t\tPHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() );\n\t\n\t\t// Create new PHPExcel object\n\t\t$objPHPExcel = new PHPExcel();\n\t\t$currentMonth = date('Y-m');\n\t\t$title = $this->getHhName() . ' ' . $currentMonth;\n\t\t\n\t\t// Set document properties\n\t\t$objPHPExcel->getProperties()->setCreator(\"HhManagement\")\n\t\t->setLastModifiedBy(\"HhManagement\")\n\t\t->setTitle($title)\n\t\t->setSubject($currentMonth);\n\t\n\t\t//default styles\n\t\t$objPHPExcel->getDefaultStyle()->getFont()->setName('Calibri');\n\t\t$objPHPExcel->getDefaultStyle()->getFont()->setSize(12);\n\t\n\t\n\t\t//styles....\n\t\n\t\t//fonts\n\t\t//font red bold italic centered\n\t\t$fontRedBoldItalicCenter = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'italic' => true,\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'alignment' => array (\n\t\t\t\t\t\t'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER,\n\t\t\t\t\t\t'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font red bold\n\t\t$fontRedBold = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font red\n\t\t$fontRed = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font Green\n\t\t$fontGreen = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => '0008B448',\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font Bold Italic\n\t\t$fontBoldItalic = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'italic' => true,\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font Bold Italic Centered\n\t\t$fontBoldItalicCenter = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'italic' => true,\n\t\t\t\t),\n\t\t\t\t'alignment' => array (\n\t\t\t\t\t\t'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER,\n\t\t\t\t\t\t'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n\t\t\t\t)\n\t\t);\n\t\n\t\t//background fillings\n\t\t//fill red\n\t\t$fillRed = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill yellow\n\t\t$fillYellow = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF2E500',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill green\n\t\t$fillGreen = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FF92D050',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill gray\n\t\t$fillGray = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFD9D9D9',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill cream\n\t\t$fillCream = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFC4BD97',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//sets the heading for the first table\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1')->applyFromArray($fillCream);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B1','Equal AMT');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B1')->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B1')->applyFromArray($fillCream);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C1','Ind. bills');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C1')->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C1')->applyFromArray($fillCream);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('D1','To rent');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D1')->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D1')->applyFromArray($fillCream);\n\t\n\t\t$numberOfMembers = $this->getNumberOfMembers();\n\t\t$monthTotal = $this->getMonthTotal();\n\t\t$rent = $this->getHhRent();\n\t\t$col = 65;//starts at column A\n\t\t$row = 2;//the table starts at row 2\n\t\n\t\t//array used to associate the bills with the respective user\n\t\t$array =[];\n\t\n\t\t//sets the members names fair amount and value\n\t\t$members = $this->getMembers();\n\t\tforeach ($members as $member) {\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$cellName = chr($col) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cellName,$name);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellName)->applyFromArray($fontBoldItalic);\n\t\n\t\t\t$cellInd = chr($col+2) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cellInd,'0.0');\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellInd)->getNumberFormat()\n\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellInd)->applyFromArray($fillRed);\n\t\n\t\t\t$cellFair = chr($col+1) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellFair)->applyFromArray($fontRed);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellFair)->getNumberFormat()\n\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellFair)->applyFromArray($fillGray);\n\t\n\t\t\t$cellRent = chr($col+3) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cellRent,'=SUM('. $cellFair .'-'. $cellInd .')');\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellRent)->applyFromArray($fontGreen);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellRent)->getNumberFormat()\n\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellInd)->applyFromArray($fillYellow);\n\t\n\t\t\t$array[$name]['cell'] = $cellInd;\n\t\t\t$row++;\n\t\t}\n\t\n\t\t//inserts the sum of the fair amounts to compare to the one below\n\t\t$endCell = chr($col+1) . ($row-1);\n\t\t$cell = chr($col+1) . $row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'=SUM(B2:'.$endCell.')');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRed);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGray);\n\t\n\t\t//insert the rent check values\n\t\t$cell = chr($col+2) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Rent');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalic);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\t$cell = chr($col+3) . $row;\n\t\t$endCell = chr($col+3) .($row-1);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'=SUM(D2:'.$endCell.')');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRedBold);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\n\t\t//inserts the bill and amount labels\n\t\t$row += 2;\n\t\t$cellMergeEnd = chr($col+1) . $row;\n\t\t$cell = chr($col) . $row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'House bills');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->mergeCells($cell.':'.$cellMergeEnd);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillRed);\n\t\n\t\t$cell = chr($col) . $row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Bill');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGreen);\n\t\n\t\t$cell = chr($col+1) . $row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Amount');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGreen);\n\t\n\t\n\t\t//inserts the bills\n\t\t$startCell = chr($col+1) . $row;\n\t\tforeach ($members as $member) {\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$col = 65;\n\t\t\t$bills = $member->getBills();\n\t\t\t$array[$name]['bills'] = [];\n\t\t\tforeach ($bills as $bill) {\n\t\t\t\t$desc = $bill->getBillDescription();\n\t\t\t\t$amount = $bill->getBillAmount();\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue(chr($col) . $row,$desc);\n\t\t\t\t$amountCell = chr($col+1) . $row++;\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($amountCell,$amount);\n\t\t\t\t$objPHPExcel->getActiveSheet()->getStyle($amountCell)->getNumberFormat()\n\t\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t\tarray_push($array[$name]['bills'], $amountCell);\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t\t$col = 65;\n\t\n\t\t//inserts rent\n\t\t$cell = chr($col) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Rent');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\n\t\t$cell = chr($col+1) . $row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,$rent);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\t$endCell = chr($col+1) . ($row-1);\n\t\n\t\t//inserts the total of bills\n\t\t$col = 65;\n\t\t$cell = chr($col) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Total H-B');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillCream);\n\t\n\t\t$cell = chr($col+1) .$row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell, '=SUM('. $startCell .':'. $endCell .')');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillCream);\n\t\n\t\t//inserts the fair amount\n\t\t$cell = chr($col) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Fair Amount if ' . $numberOfMembers);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGray);\n\t\t$cell = chr($col+1) .$row;\n\t\t$objPHPExcel->getActiveSheet()\n\t\t->setCellValue($cell,'='. chr($col+1) .($row-1) . '/' . $numberOfMembers);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGray);\n\t\t$fairAmountCell = chr($col+1) . $row;\n\t\n\t\t$row = 2;\n\t\tforeach ($members as $member) {\n\t\t\t$col = 66;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue(chr($col) . $row++,'='. $fairAmountCell);\n\t\t}\n\t\n\t\t//inserts the individual bills\n\t\tforeach ($array as $value){\n\t\t\t$cell = $value['cell'];\n\t\t\t$sumOfBills = '';\n\t\t\t\t\n\t\t\tif (isset($value['bills'])) {\n\t\t\t\t$bills = $value['bills'];\n\t\t\t\t$counter = 1;\n\t\t\t\tforeach ($bills as $bill){\n\t\t\t\t\tif ($counter == 1){\n\t\t\t\t\t\t$sumOfBills .= $bill;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sumOfBills .= '+' . $bill;\n\t\t\t\t\t}\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'=SUM('. $sumOfBills . ')');\n\t\t}\n\t\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(true);\n\t\n\t\t// Rename worksheet\n\t\t$objPHPExcel->getActiveSheet()->setTitle($title);\n\t\n\t\t// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->setPreCalculateFormulas(true);\n\t\t//$objWriter->save(str_replace('.php', '.xlsx', __FILE__));\n\t\t$objWriter->save(str_replace('.php', '.xlsx', $GLOBALS['ROOT_PATH']. 'spreadsheets/'. $title .'.php'));\n\t\n\t\treturn $title . '.xlsx';\n\t}", "public static function create($data = [])\n {\n $table = new static();\n\n return $table->createRow((array) $data);\n }", "public function constructNotSquare(){\n $this->nbRows = 0;\n $this->nbSeatsPerRow = 0;\n $this->rowLabel = 1;\n $this->seatLabel = 1;\n }", "public function get()\r\n\t{\r\n\t\t$objPHPExcel = new PHPExcel();\r\n\r\n\t\t$worksheet = $objPHPExcel->createSheet(0);\r\n\r\n\t for ($cell='A'; $cell <= 'G'; $cell++)\r\n\t {\r\n\t $worksheet->getStyle($cell.'1')->getFont()->setBold(true);\r\n\t }\r\n\r\n\t $worksheet->getStyle('A1:G1')->applyFromArray(\r\n\t \tarray(\r\n\t\t 'alignment' => array(\r\n\t\t 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,\r\n\t\t ),\r\n\t\t 'borders' => array(\r\n\t\t 'allborders' => array(\r\n\t\t 'style' => PHPExcel_Style_Border::BORDER_THIN,\r\n\t\t 'color' => array('rgb' => '000000')\r\n\t\t )\r\n\t\t ),\r\n\t\t 'fill' => array(\r\n\t\t 'type' => PHPExcel_Style_Fill::FILL_SOLID,\r\n\t\t 'color' => array('rgb' => 'F2F2F2')\r\n\t\t )\r\n\t \t)\r\n\t );\r\n\r\n\t\t// Header dokumen\r\n\t\t $worksheet->setCellValue('A1', 'NO.')\r\n\t\t \t\t ->setCellValue('B1', 'Kode MK')\r\n\t\t \t\t ->setCellValue('C1', 'Mata Kuliah')\r\n\t\t \t\t ->setCellValue('D1', 'Mata Kuliah (Asing)')\r\n\t\t \t\t ->setCellValue('E1', 'Jumlah SKS')\r\n\t\t \t\t ->setCellValue('F1', 'Semester')\r\n\t\t \t\t ->setCellValue('G1', 'Konsentrasi');\r\n\r\n\t\t$this->db->join('concentration', 'course.concentration_id = concentration.concentration_id', 'left');\r\n\t\t$row_cell = 2;\r\n\t\tforeach($this->db->get('course')->result() as $key => $value)\r\n\t\t{\r\n\t\t\t $worksheet->setCellValue('A'.$row_cell, ++$key)\r\n\t\t\t \t\t ->setCellValue('B'.$row_cell, $value->course_code)\r\n\t\t\t \t\t ->setCellValue('C'.$row_cell, $value->course_name)\r\n\t\t\t \t\t ->setCellValue('D'.$row_cell, $value->course_name_english)\r\n\t\t\t \t\t ->setCellValue('E'.$row_cell, $value->sks)\r\n\t\t\t \t\t ->setCellValue('F'.$row_cell, ucfirst($value->semester))\r\n\t\t\t \t\t ->setCellValue('G'.$row_cell, $value->concentration_name);\r\n\t\t\t$row_cell++;\r\n\t\t}\r\n\r\n\t\t// Sheet Title\r\n\t\t$worksheet->setTitle(\"DATA MATA KULIAH\");\r\n\r\n\t\t$objPHPExcel->setActiveSheetIndex(0);\r\n\r\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\r\n header(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\r\n header(\"Cache-Control: no-store, no-cache, must-revalidate\");\r\n header(\"Cache-Control: post-check=0, pre-check=0\", false);\r\n header(\"Pragma: no-cache\");\r\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\\\r\n header('Content-Disposition: attachment; filename=\"DATA-MATA-KULIAH.xlsx\"');\r\n $objWriter->save(\"php://output\");\r\n\t}", "public static function createRow(array $data = [])\n\t{\n\t\t$row = new static(static::$_defaultValues, false, false);\n\t\t$row->setFromArray($data);\n\t\treturn $row;\n\t}", "public function __construct($pIndex = 'A')\n {\n \t// Initialise values\n \t$this->_columnIndex\t\t= $pIndex;\n \t$this->_width\t\t\t= -1;\n \t$this->_autoSize\t\t= false;\n \t$this->_visible\t\t\t= true;\n \t$this->_outlineLevel\t= 0;\n \t$this->_collapsed\t\t= false;\n\n\t\t// set default index to cellXf\n\t\t$this->_xfIndex = 0;\n }", "function build_row($row)\n{\n\t$name = $row->getColumnVal('Name');\n\t$id = $row->getColumnVal('Id');\n\n\t// Setup the columns you want to work with\n\t$idCol = $row->getCol('Id');\n\t$nameCol = $row->getCol('Name');\n\t$actionCol = $row->getCol('Action');\n\t$typeCol = $row->getCol('Type');\n\n\t// Set some HTML properties on the give column\n\t$idCol->setProp('width','50');\n\t$typeCol->setProp('width','50');\n\t$typeCol->addClass('center');\n\n\t// Add some CSS classes to the action column\n\t$actionCol\n\t\t-> addClass('center')\n\t\t-> addClass('btn');\n\n\t// Add an action link to the Action column\n\t$row->addLink('Action', \"examples.php?id=$id\", '[edit]', \"\", \"no-un\");\n\t$row->addLink('Action', \"examples.php?id=$id\", '[delete]', \"\", \"no-un\");\n\n\t// Set an ID on the row\n\t$row->setProp('id', \"tr_$id\");\n\n\t// set the background of the strawberry column to black\n\tif($name == \"Strawberry\")\n\t{\n\t\t// get an instance of the column and set a css class\n\t\t$nameCol->addClass('strawberry');\n\t}\n\n\t// set the background of the entire shoe row to red\n\tif($name == \"Chocolate\")\t\n\t{\n\t\t$row->addClass('chocolate');\n\t}\n\n\t// change one of the cell values\n\tif($name == \"Banana\")\t\n\t{\n\t\t$row->setVal('Name', $name . \" (favorite) <img src='https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcROTNegrNoPzMFMcpQ4pl7tko9LMwgoXuZyjTmX8vpUuPS_RfZr' />\");\n\t}\n\n\treturn $row;\n}", "function __construct( $objParams = NULL){\n $this->setHtml('table');\n \n //Define os parâmetros específicos da classe atual:\n $this->addParam('cellPadding'); \n $this->addParam('cellSpacing'); \n $this->addParam('border'); \n $this->addParam('width');\n $this->addParam('height');\n $this->addParam('columns');\n $this->addParam('rows');\n \n //Carrega as propriedades do objeto atual a partir de objParams:\n $this->popParams($objParams); \n }", "public static function createInstance()\n {\n return new EditCommandGridColumn('ISerializable', 'ISerializable');\n }", "function &getRowInstance() {\n\t\t$row = new IssueGridRow();\n\t\treturn $row;\n\t}", "function NewRow() {\n\t\t$row = array();\n\t\t$row['row_id'] = NULL;\n\t\t$row['auc_date'] = NULL;\n\t\t$row['auc_number'] = NULL;\n\t\t$row['auc_place'] = NULL;\n\t\t$row['start_bid'] = NULL;\n\t\t$row['close_bid'] = NULL;\n\t\t$row['auc_notes'] = NULL;\n\t\t$row['total_sack'] = NULL;\n\t\t$row['total_netto'] = NULL;\n\t\t$row['total_gross'] = NULL;\n\t\t$row['auc_status'] = NULL;\n\t\t$row['rate'] = NULL;\n\t\treturn $row;\n\t}", "public function printCells($zebra = false, $title = false) {\n $options = array();\n if ($this->_zebra && $zebra) {\n if (!$this->_colorZebra) {\n $options['backgroundColor'] = '#FFFFFF';\n $this->_colorZebra = 1;\n } else {\n $options['backgroundColor'] = '#efefef';\n $this->_colorZebra = 0;\n }\n }\n for ($iLine = 0; $iLine < $this->_cells['maxLine']; $iLine++) {\n $defaultWidth = $this->_pageWidth / count($this->_cells['cell']);\n if ($this->_cells['cell']) {\n foreach ($this->_cells['cell'] as $key => $celula) {\n $values = $this->_cells['values'][$key][$iLine];\n $celulaOk = $this->_driver->makeCell($celula, $options);\n $borders = $celulaOk['border'];\n if ($iLine != ($this->_cells['maxLine'] - 1)) {\n $borders = str_ireplace('B', '', $borders);\n }\n if ($iLine != 0) {\n $borders = str_ireplace('T', '', $borders);\n }\n if (!$celulaOk['celula']->getWidth()) {\n $celulaOk['celula']->setWidth($defaultWidth);\n }\n $celulaOk['url'] = $celulaOk['celula']->getUrl();\n if ($celulaOk['url']) {\n if (strpos($celulaOk['url'], \"typeModal\") === false) {\n $celulaOk['url'].= '&typeModal=PDF#zoom=120';\n }\n }\n\n $cell = array();\n $cell['width'] = $this->_pxToCm($celulaOk['celula']->getWidth());\n $cell['height'] = $celulaOk['celula']->getHeight();\n $cell['value'] = $values;\n $cell['border'] = $borders;\n $cell['align'] = $celulaOk['celula']->getTextAlign();\n $cell['color'] = $celulaOk['color'];\n $cell['url'] = $celulaOk['url'];\n $cell['fontName'] = $celulaOk['celula']->getFontName();\n $cell['style'] = $celulaOk['celula']->getStyle();\n $cell['fontSize'] = $celulaOk['celula']->getFontSize();\n\n $this->_driver->Cell($cell['width'], $cell['height'], $cell['value'], $cell['border'], 0, $cell['align'], $cell['color'], $cell['url']);\n if ($title) {\n $this->_driver->addCellTitle($cell);\n }\n }\n }\n $this->_driver->Ln();\n if ($title) {\n $this->_driver->addLineTitle();\n }\n }\n $this->_cells = array();\n return $this;\n }", "public function setCellLocation($value)\n {\n return $this->set('CellLocation', $value);\n }", "public function render()\n {\n return view('avored::system.components.table.cell');\n }", "public function setCellWithQualifier($row, $column, $qualifier, $value)\n\t{\n\t\t$key = new Hypertable_ThriftGen_Key(\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'row'=> $row,\n\t\t\t\t\t\t\t\t\t\t\t'column_family'=> $column, \n\t\t\t\t\t\t\t\t\t\t\t'column_qualifier' => $qualifier,\n\t\t\t\t\t\t\t\t\t\t\t'flag' => 2\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$this->cells[] = new Hypertable_ThriftGen_Cell(\n\t\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'key' => $key, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'value'=> $value\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t);\n\t\treturn $this;\n\t}", "public function setCellType(?string $cellType) {\n\t\tif (!in_array($cellType, ['td', 'th']) && !empty($cellType)) {\n\t\t\tthrow new InvalidArgumentException(\"\\$cellType must be 'td' or 'th'. Found: $cellType.\");\n\t\t}\n\t\t$this->_config = Hash::insert($this->_config, 'cellType', $cellType);\n\n\t\treturn $this;\n\t}", "public function cell ($text,$options=NULL) { print $this->cell_html ($text,$options); }", "function FancyTable($header, $data)\n{\n $this->SetFillColor(255,0,0);\n $this->SetTextColor(255);\n $this->SetDrawColor(128,0,0);\n $this->SetLineWidth(.3);\n $this->SetFont('','B');\n // Header\n $w = array(40, 35, 40, 45);\n for($i=0;$i<count($header);$i++)\n $this->Cell($w[$i],7,$header[$i],1,0,'C',true);\n $this->Ln();\n // Color and font restoration\n $this->SetFillColor(224,235,255);\n $this->SetTextColor(0);\n $this->SetFont('');\n // Data\n $fill = false;\n foreach($data as $row)\n {\n $this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);\n $this->Cell($w[1],6,$row[1],'LR',0,'L',$fill);\n $this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);\n $this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);\n $this->Ln();\n $fill = !$fill;\n }\n // Closing line\n $this->Cell(array_sum($w),0,'','T');\n}", "public function hasCell(){\n return $this->_has(1);\n }" ]
[ "0.7641631", "0.7278254", "0.69648564", "0.6454816", "0.6204502", "0.60486346", "0.60446584", "0.5939064", "0.5904844", "0.58957237", "0.5877901", "0.5830291", "0.5808562", "0.5778044", "0.5772847", "0.5704984", "0.5629285", "0.5624459", "0.5614759", "0.56047297", "0.5582794", "0.5577411", "0.55754536", "0.5530016", "0.55287254", "0.5485396", "0.545619", "0.54487073", "0.54102516", "0.53958654", "0.5385481", "0.5382357", "0.5371314", "0.53192544", "0.52905965", "0.5284932", "0.5271133", "0.5237049", "0.5220294", "0.5202952", "0.5196241", "0.5173705", "0.5158566", "0.51468766", "0.5132091", "0.51227677", "0.5119619", "0.51125413", "0.51046145", "0.5096376", "0.5077394", "0.5077394", "0.50759465", "0.5074311", "0.5072769", "0.5071875", "0.50654817", "0.50438595", "0.50416815", "0.503488", "0.4984819", "0.49740005", "0.4944953", "0.49418667", "0.49139103", "0.49106959", "0.49106959", "0.4906587", "0.49054942", "0.49039423", "0.49036622", "0.4869699", "0.48643827", "0.48487633", "0.48460364", "0.48445022", "0.48435226", "0.4839148", "0.48297346", "0.48249537", "0.48203975", "0.48135188", "0.48130104", "0.47978896", "0.4797446", "0.47735357", "0.47663304", "0.4759118", "0.4755972", "0.47539517", "0.475311", "0.4751898", "0.4741577", "0.47302184", "0.47237906", "0.4713265", "0.4708587", "0.4703458", "0.47003156", "0.46984577" ]
0.47721666
86
Creates a blank cell/object for the tables/excell
protected function set_up_blank_object() { return $this->create_cell(array('content'=>'','colCount'=>1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateCell()\n {\n $object = new \\stdClass();\n $object->title = 'barfoo';\n $cell = $this->createFactory()->createCell('title', PropertyColumn::class, $object, []);\n\n $this->assertInstanceOf(Cell::class, $cell);\n $this->assertEquals('barfoo', $cell->value);\n $this->assertEquals('Property', $cell->getTemplate());\n }", "function blank_cell($num=1, $css='', $extras='') {\n $this->end_cell();\n\n if (!is_numeric($num)) {\n $num = 1;\n }\n\n for($i=1;$i<=$num;$i++) {\n $this->new_cell($css,$extras);\n echo '&nbsp;';\n }\n }", "public function blank() {\r\n\t\treturn $this->blankObject(self::table);\r\n\t}", "public function blank() {\n\t\treturn $this->blankObject(self::table);\n\t}", "protected function getEmptyCellHTML()\n {\n return '<td class=\"blank\">&nbsp;&nbsp;&nbsp;</td>';\n }", "protected function create_cell($params = array())\n {\n $cellObj = new stdClass();\n if($params)\n {\n foreach($params AS $name=>$value)\n {\n $cellObj->$name = $value;\n }\n }\n return $cellObj;\n }", "private function createDummyTable() {}", "final private function initCells(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\tif (@$this->contents[$i]->contents[$j] and\n\t\t\t\t\t@!$this->markspan[$i][$j] and\n\t\t\t\t\tcount(@$this->contents[$i]->contents[$j]->contents) == 0)\n\t\t\t$this->cellContent($i,$j,'&nbsp;');\n\n\t}", "public function makeTableur()\n {\n return $this->setDocumentPropertiesWithMetas(new Spreadsheet());\n }", "private function createTemplate()\n\t{\n\t\t$this->objPHPExcel = new PHPExcel();\n\t\t$this->objPHPExcel->setActiveSheetIndex(0);\n\t\t$this->objWorksheet = $this->objPHPExcel->getActiveSheet();\n\t\t//TODO: other parameters\n\t\t$this->objWorksheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT);\n\t\t$this->objWorksheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);\n\t\t$this->objWorksheet->getPageSetup()->setHorizontalCentered(true);\n\t\t$this->objWorksheet->getPageSetup()->setVerticalCentered(false);\n\n $this->_usingTemplate=false;\n\t}", "public function create()\n {\n parent::create();\n\n $sheet = $this->add_sheet();\n\n $this->add_table($sheet, $this->database, $this->generate_table());\n }", "function set_empty($value)\n\t{\n\t\t$this->empty_cells = $value;\n\t}", "public function testDefaultCellAction(): void\n {\n $appCell = $this->View->cell('Articles');\n\n $this->assertSame('display', $appCell->viewBuilder()->getTemplate());\n $this->assertStringContainsString('dummy', \"{$appCell}\");\n\n $pluginCell = $this->View->cell('TestPlugin.Dummy');\n $this->assertStringContainsString('dummy', \"{$pluginCell}\");\n $this->assertSame('display', $pluginCell->viewBuilder()->getTemplate());\n }", "public function cells();", "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 testResultCellReturnsNull(): void\n {\n $this->assertNull($this->class->result_cell('cell'));\n }", "function createTableModel()\r\n {\r\n?>\r\n // table model\r\n var <?php echo $this->Name; ?>_tableModel = new qx.ui.table.SimpleTableModel();\r\n <?php\r\n if ($this->owner!=null)\r\n {\r\n ?>\r\n <?php echo $this->owner->Name.\".\".$this->Name; ?>_tableModel=<?php echo $this->Name; ?>_tableModel;\r\n <?php\r\n }\r\n ?>\r\n<?php\r\n }", "public function testNonExistentCell(): void\n {\n $this->expectException(MissingCellException::class);\n $this->View->cell('Void::echoThis', ['arg1' => 'v1', 'arg2' => 'v2']);\n }", "protected function blankTable()\n {\n return [\n 'meta' => ['created' => time(), 'modified' => time()],\n 'data' => []\n ];\n }", "function helper_pdf_add_cell($pdf, $largura, $altura, $texto, $bordas, $pula_linha, $alinhamento){\n\t$pdf->Cell($largura, $altura, $texto, $bordas, $pula_linha, $alinhamento);\n}", "function\temptyTableRow ( $_height) {\n\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm->currVerPos\t+=\tmmToPt( $_height) ;\t\t// now add the height of everythign we have output'\n\t}", "abstract public function makeBlankItem();", "function FrontPageTable(){\r\n //$this->SetFillColor(135,206,250);\r\n $this->SetFillColor(176,196,222);\r\n $this->SetTextColor(0);\r\n $this->SetDrawColor(0,0,0);\r\n $this->SetLineWidth(.3);\r\n $this->SetFont('','B');\r\n // Header\r\n\r\n $this->SetX(35);\r\n $this->Cell(70,7,'Prepared By:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetTextColor(0,0,0);\r\n $this->SetFont('');\r\n $this->Cell(70,7,$this->PreparedBy,1,0,'C',false);\r\n $this->Cell(40,7,'NRAO',1,0,'C',false);\r\n $this->Cell(40,7,$this->MakeDate,1,0,'C',false);\r\n $this->Ln();\r\n\r\n\r\n $this->SetX(35);\r\n $this->SetTextColor(0);\r\n $this->SetFont('','B');\r\n $this->Cell(70,7,'FEIC WP Manager Approval:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetFont('');\r\n $this->Cell(70,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetTextColor(0);\r\n $this->SetFont('','B');\r\n $this->Cell(70,7,'FE System Engineering Approval:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetFont('');\r\n $this->Cell(70,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetTextColor(0);\r\n $this->SetFont('','B');\r\n $this->Cell(70,7,'FE IPT Lead Approval:',1,0,'C',true);\r\n $this->Cell(40,7,'Organization',1,0,'C',true);\r\n $this->Cell(40,7,'Date',1,0,'C',true);\r\n $this->Ln();\r\n $this->SetX(35);\r\n $this->SetFont('');\r\n $this->Cell(70,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Cell(40,27,'',1,0,'C',false);\r\n $this->Ln();\r\n\r\n // Color and font restoration\r\n $this->SetFillColor(224,235,255);\r\n $this->SetTextColor(255);\r\n $this->SetFont('');\r\n // Data\r\n $fill = false;\r\n }", "protected function createEmpty(Game $game, $row, $col)\n {\n }", "function BorderlessTable($header, $data)\n\t{\n\t $this->SetFillColor(128,128,128);\n\t $this->SetTextColor(255);\n\t $this->SetDrawColor(0,0,0);\n\t $this->SetLineWidth(.3);\n\t // Color and font restoration\n\t $this->SetFillColor(224,235,255);\n\t $this->SetTextColor(0);\n\t $this->SetFont('Arial','',12);\n\t // Data\n\t $this->SetWidths(array(40, 65, 50, 60, ));\n\t foreach($data as $row){\n\t\t$this->BorderlessRow($row);\n\t }\n\t // Closing line\n\t // $this->Cell(array_sum($w),0,'','T');\n\t}", "public function constructNotSquare(){\n $this->nbRows = 0;\n $this->nbSeatsPerRow = 0;\n $this->rowLabel = 1;\n $this->seatLabel = 1;\n }", "function tabelKoppenVeilingen(){\n\tprint(\"<table class='ui celled fixed basic table' border='1px'> \n\t <tr>\n\t\t <td>Object Nr</td> \n\t\t <td>Titel</td>\n\t\t <td>Verkoper</td>\n\t\t <td>Koper</td>\n\t\t <td></td>\n\t\t <td></td>\n\t </tr>\"); \n}", "function get_empty_object()\n { \n $obj = new stdClass();\n \n $fields = $this->db->list_fields( $this->table_name );\n foreach ( $fields as $field ) {\n $obj->$field = '';\n }\n $obj->is_empty_object = true;\n return $obj;\n }", "private function populateDummyTable() {}", "function __construct( $objParams = NULL){\n $this->setHtml('table');\n \n //Define os parâmetros específicos da classe atual:\n $this->addParam('cellPadding'); \n $this->addParam('cellSpacing'); \n $this->addParam('border'); \n $this->addParam('width');\n $this->addParam('height');\n $this->addParam('columns');\n $this->addParam('rows');\n \n //Carrega as propriedades do objeto atual a partir de objParams:\n $this->popParams($objParams); \n }", "public function makeTable($header, $data) {\n $this->SetFillColor(255, 0, 0);\n $this->SetTextColor(255);\n $this->SetDrawColor(128, 0, 0);\n $this->SetLineWidth(.3);\n $this->SetFont('', 'B');\n // Header\n $w = array(10, 25, 40, 10, 25, 15, 60, 10, 10, 10, 10, 10, 10, 10, 10, 10);\n for ($i = 0; $i < count($header); $i++)\n if ($i == 0) {\n $this->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);\n } else {\n $this->Cell($w[$i], 7, $header[$i], 1, 0, 'L', true);\n }\n $this->Ln();\n // Color and font restoration\n $this->SetFillColor(224, 235, 255);\n $this->SetTextColor(0);\n $this->SetFont('');\n // Data\n $fill = false;\n\n foreach ($data as $row) {\n $this->nr++;\n $this->Cell($w[0], 6, $this->nr, 'LR', 0, 'C', $fill);\n $this->Cell($w[1], 6, $row['article'], 'LR', 0, 'L', $fill);\n $this->Cell($w[2], 6, $row['brand'], 'LR', 0, 'L', $fill);\n $this->Cell($w[3], 6, $row['inch'], 'LR', 0, 'L', $fill);\n $this->Cell($w[4], 6, $row['size'], 'LR', 0, 'L', $fill);\n $this->Cell($w[5], 6, $row['lisi'], 'LR', 0, 'L', $fill);\n $this->Cell($w[6], 6, $row['design'], 'LR', 0, 'L', $fill);\n $this->Cell($w[7], 6, $row['onhand'], 'LR', 0, 'C', $fill);\n $this->Cell($w[8], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[9], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[10], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[11], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[12], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[13], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[14], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Cell($w[15], 6, \"\", 'LR', 0, 'C', $fill);\n $this->Ln();\n $fill = !$fill;\n }\n // Closing line\n $this->Cell(array_sum($w), 0, '', 'T');\n }", "public function new_cell($css = '', $extras='') {\n\n $opts = '';\n\n if ($css == '') {\n $cssfirst = true;\n } else {\n $cssfirst = false;\n }\n\n // Close the previous cell if needed\n if ($this->_cellopen) {\n $this->end_cell();\n }\n\n // Check if column span was set via $this->set_colspan()\n if ($this->_colspan > 1) {\n $opts .= ' colspan=\"'.$this->_colspan.'\"';\n\n $this->_colspan = 0;\n }\n\n // Check if row span was set via $this->set_rowspan()\n if ($this->_rowspan > 1) {\n $opts .= ' rowspan=\"'.$this->_rowspan.'\"';\n\n $this->_rowspan = 0;\n }\n\n // Check if width was set via $this->set_width()\n if ($this->_width > 0) {\n $opts .= ' width=\"'.$this->_width.$this->_wpp.'\"';\n\n $this->_width = 0;\n $this->_wpp = '';\n }\n\n // Check if height was set via $this->set_height()\n if ($this->_height > 0) {\n $opts .= ' height=\"'.$this->_height.$this->_hpp.'\"';\n\n $this->_height = 0;\n $this->_hpp = '';\n }\n\n if ($this->_celltitledata != '') {\n $opts .= ' title=\"'.$this->_celltitledata.'\"';\n\n $this->_celltitledata = '';\n }\n\n if ($this->_newid != '') {\n $opts .= ' id=\"'.$this->_newid.'\"';\n\n $this->_newid = '';\n }\n\n if ($this->_onclickdata != '') {\n $opts .= ' onclick=\"'.$this->_onclickdata.'\"';\n\n $this->_onclickdata = '';\n }\n\n if ($this->_onmouseoverdata != '') {\n $opts .= ' onmouseover=\"'.$this->_onmouseoverdata.'\"';\n\n $this->_onmouseoverdata = '';\n }\n\n if ($css != '') {\n $opts = ' class=\"'.$css.'\"'.$opts;\n }\n\n if ($extras != '') {\n // Allows inline styles to override formatting in the CSS stylesheet\n $opts .= ' '.$extras;\n }\n\n echo '<td'.$opts.'>';\n $this->_cellopen = true;\n }", "function FancyTable($header, $data)\n{\n $this->SetFillColor(255,0,0);\n $this->SetTextColor(255);\n $this->SetDrawColor(128,0,0);\n $this->SetLineWidth(.3);\n $this->SetFont('','B');\n // Header\n $w = array(40, 35, 40, 45);\n for($i=0;$i<count($header);$i++)\n $this->Cell($w[$i],7,$header[$i],1,0,'C',true);\n $this->Ln();\n // Color and font restoration\n $this->SetFillColor(224,235,255);\n $this->SetTextColor(0);\n $this->SetFont('');\n // Data\n $fill = false;\n foreach($data as $row)\n {\n $this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);\n $this->Cell($w[1],6,$row[1],'LR',0,'L',$fill);\n $this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);\n $this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);\n $this->Ln();\n $fill = !$fill;\n }\n // Closing line\n $this->Cell(array_sum($w),0,'','T');\n}", "public function testConstructWithStyleArray()\n {\n $oCell = new Cell(null, array('valign' => 'center'));\n\n $this->assertInstanceOf('PhpOffice\\\\PhpWord\\\\Style\\\\Cell', $oCell->getStyle());\n $this->assertNull($oCell->getWidth());\n }", "private function createCells($data){\r\n $html = '';\r\n foreach ($data AS $index => $row) {\r\n $html .= '<tr class=\"ctable-rows\">';\r\n foreach ($row as $rownr => $data) {\r\n $html .= '<td>' . $data . '</td>';\r\n }\r\n $html .= '</tr>';\r\n }\r\n return $html;\r\n }", "function as_table() \n {\n #$str = \"<table> \\n\";\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n $str .= \"<tr>\\n\\t<td>\".$obj->label().\"</td>\\n\\t\";\n $str .= \"<td>\".$obj.\"</td>\\n</tr>\\n\";\n }\n }\n #$str .= \"</table>\\n\";\n return $str;\n }", "public function add_cells($cells = []){\n if(empty($cells)){\n $this -> add_cell(new HTMLCellElement(\"\"));\n }else{\n foreach ($cells as $cell) {\n $this -> add_cell($cell);\n }\n }\n }", "public function emptyLine()\n\t{\n\t\t//return \"\\t\\t\\t\".'<td colspan=\"2\">&nbsp;</td>'.\"\\n\";\n\t}", "function Cell2($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') {\n // $this->Cell($w, $h, $txt, $border, $ln, $align, $fill, $link, $stretch, $ignore_min_height, $calign, $valign);\n $h = 5;\n $this->StartTransform();\n $this->Rect($this->x, $this->y, $w, $h, 'CNZ');\n $this->writeHTMLCell($w, $h, $this->x, $this->y, $txt);\n $this->StopTransform();\n }", "public function __construct() {\n\t\t// Initialise worksheet collection\n\t\t$this->workSheetCollection = array();\n\t\t$this->activeSheetIndex = -1;\n\t\t$this->activeSheet = NULL;\n\n\t\t// Create document properties\n\t\t$this->properties = new DocumentProperties();\n\n\t\t// Create the cellXf supervisor\n\t\t$this->cellXfSupervisor = new Style(true);\n\t\t$this->cellXfSupervisor->bindParent($this);\n\n\t\t// Create the default style\n\t\t$this->addCellXf(new Style());\n\t\t$this->addCellStyleXf(new Style());\n\t}", "function getCell() {\n \tglobal $synAbsolutePath;\n $ext = $this->translate($this->value);\n $mat=$this->translatePath($this->mat);\n $filename=$mat.$this->createFilename().\".\".$ext;\n $file_exists=file_exists($synAbsolutePath.$filename);\n $isImg=$this->isImage($filename);\n if ($ext and $file_exists and $isImg) $ret=\"<div style='overflow: hidden; height: 25px; display:inline;background: url($filename) no-repeat center;width: 100%' onMouseOver=\\\"openbox('$filename')\\\" onMouseOut=\\\"closebox()\\\"></div>\";\n else if ($ext and $file_exists and !$isImg) $ret=\"<span style='color: gray'>Document $ext</span>\";\n else if ($ext and !$file_exists) $ret=\"<span style='color: gray'>Error $ext</span>\";\n else $ret=\"<span style='color: gray'>Empty</span>\";\n return $ret;\n //die;\n }", "private function create()\n {\n //echo date('H:i:s') , \" Create new PHPExcel object\" , EOL;\n $objPHPExcel = new PHPExcel();\n\n // Set document properties\n //echo date('H:i:s') , \" Set document properties\" , EOL;\n $objPHPExcel->getProperties()->setCreator(\"Maarten Balliauw\")\n ->setLastModifiedBy(\"Maarten Balliauw\")\n ->setTitle(\"PHPExcel Test Document\")\n ->setSubject(\"PHPExcel Test Document\")\n ->setDescription(\"Test document for PHPExcel, generated using PHP classes.\")\n ->setKeywords(\"office PHPExcel php\")\n ->setCategory(\"Test result file\");\n\n return $objPHPExcel;\n }", "public function beginLabelSheet ()\r\n {\r\n $this->label_column = 1;\r\n $this->label_row = 1;\r\n return '\r\n <div class=\"labelpage\">\r\n <div class=\"labelrow\">\r\n <div class=\"labelbody\">';\r\n }", "public function cell($value) {\n return $this->setProperty('cell', $value);\n }", "function tablecell_close() {\n $this->doc .= '</td>';\n }", "public function action_createblank(){\n\t\t\n\t\t\t$userinfo = array();\n\t\t\t\n\t\t\t$userinfo['mis'] = '';\n\t\t\t$userinfo['name'] = '';\n\t\t\t$userinfo['username'] = '';\n\t\t\t$userinfo['iohid'] = '';\n\t\t\t$userinfo['password'] = '';\n\t\t\t\n\t\t\t$userinfo['email'] = '';\n\t\t\t$userinfo['mobileno'] = '';\n\t\t\t$userinfo['dob'] = 'DD / MM / YYYY';\n\t\t\t$userinfo['gender'] = '';\n\t\t\t$userinfo['year'] = '';\n\t\t\t$userinfo['stream']= '';\n\t\t\t\n\t\t\t$userinfo['age'] = ''; \n\t\t\t$userinfo['orderid'] = '';\n\t\t\t$year = 'blank';\n\t\t\t$stream = 'blank';\n\t\t\t//$this->placepdfvalue(json_encode($userinfo),str_replace('coep2013_', '', $user->username).'_1', 'studentinfo.php');\n\t\t\t$this->placepdfvalue(json_encode($userinfo),'blank', 'stjohnhealthcard.php',$year,$stream );\n\t\t\tdie;\n\t}", "public function makeExcelSheet($data)\n\t{\n\t\t/** Reading Excel with PHPExcel_IOFactory */\n\t\trequire_once 'PHPExcel/IOFactory.php';\n\n\t\t$objReader = PHPExcel_IOFactory::createReader('Excel5');\n\t\t\n\t\t// template file\n\t\t$objPHPExcel = $objReader->load(APPLICATION_PATH . '/../data/templates/com-tpl.xls');\n\n\t\t$baseRow = 11; // base row in template file\n\t\t\n\t\tforeach($data as $r => $dataRow) {\n\t\t\t$row = $baseRow + ($r+1);\n\t\t\t\n\t\t\t$objPHPExcel->getActiveSheet()->insertNewRowBefore($row,1);\n\t\t\t\n\t\t\tif (!empty($dataRow)){\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row, ucfirst($dataRow['zone']));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row, ucfirst($dataRow['village']));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('C'.$row, ucfirst($dataRow['prod_name']));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('D'.$row, $dataRow['unit_measure']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$row, $dataRow['quantity']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('F'.$row, ucfirst($dataRow['quality']));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('G'.$row, $dataRow['price']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('H'.$row,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t ucfirst($dataRow['contact_fname']).' '.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t ucfirst($dataRow['contact_lname']).' '.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t 'TEL: ' . $dataRow['contact_tel']);\n\t\t\t}\n\t\t}\n\t\t$objPHPExcel->getActiveSheet()->removeRow($baseRow-1,1);\n\t\t\n\t\t// fill data area with white color\n\t\t$objPHPExcel->getActiveSheet()\n\t\t\t\t\t->getStyle('A'.$baseRow .':'.'H'.$row)\n\t\t\t\t\t->getFill()\n\t\t\t\t\t->applyFromArray(\n \t\t\t\t\t\t\t array(\n \t\t \t\t 'type' \t=> PHPExcel_Style_Fill::FILL_SOLID,\n \t\t\t\t\t\t 'startcolor' \t=> array('rgb' => 'FFFFFF'),\n \t\t\t\t \t 'endcolor' \t=> array('rgb' => 'FFFFFF')\n \t\t\t\t\t ));\n\t\t\n\t\t$comNo = $dataRow['com_number'];\n\t\t$deliveryDate = date('d-m-Y', strtotime($dataRow['ts_date_delivered']));\n\t\t\n\t\t$ComTitle = \"INFORMATION SUR LES PRODUITS FORESTIERS NON LIGNEUX DU \" .\n\t\t \"CERCLE DE TOMINIAN No: $comNo Du $deliveryDate\";\n\t\t\n\t\t$titleRow = $baseRow-1;\n\t\t// create new row\n\t\t$objPHPExcel->getActiveSheet()->insertNewRowBefore($titleRow,1);\n\t\t$objPHPExcel->getActiveSheet()\n\t\t\t\t\t->mergeCells('A'.$titleRow. ':'.'H'.$titleRow)\n\t\t\t\t\t->setCellValue('A'.$titleRow, $ComTitle)\n\t\t\t\t\t->getStyle('A'.$titleRow)->getFont()\n\t\t\t\t\t->setBold(true)\n\t\t\t\t\t->setSize(13)\n\t\t\t\t\t->setColor(new PHPExcel_Style_Color());\n\t\t\t\t\t\n\t//\t$objPHPExcel->getActiveSheet()->getRowDimension('A'.$titleRow)->setRowHeight(10);\n\t\t\t\t\t\n\t\t$title = 'ComNo'.$comNo;\n\t\t// set title of sheet\n\t\t$objPHPExcel->getActiveSheet()->setTitle($title);\n\n\t\t// Redirect output to a client’s web browser (Excel5)\n\t\theader('Content-Type: application/vnd.ms-excel');\n\t\theader('Content-Disposition: attachment;filename=\"communique.xls\"');\n\t\theader('Cache-Control: max-age=0');\n\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n\t\t$objWriter->save('php://output');\n\t\texit;\n\t}", "public static function createTable(){\n if (RBModel::recreateTable(get_called_class()) == false){\n return;\n }\n\n $bean = R::dispense( strtolower(get_called_class()));\n $fields = get_class_vars(get_called_class());\n \n foreach( $fields as $field=>$value){\n\n \n //ignora as variaveis que começam com _\n if ($field[0] == \"_\" || $field == \"id\"){\n continue;\n }\n\n $r = new ReflectionProperty(get_called_class(), $field);\n $comment = strtolower($r->getDocComment());\n\n if (strstr($comment,\"@varchar\")){\n $value = \"\";\n } else\n if (strstr($comment,\"@int\")){\n $value = 0;\n } else\n if (strstr($comment,\"@date\")){\n $value = \"1990-01-01\";\n } else\n if (strstr($comment,\"@datetime\")){\n $value = \"1990-01-01 00:00:00\";\n } else\n if (strstr($comment,\"@double\")){\n $value = 0.0;\n } else\n if (strstr($comment,\"@bool\")){\n $value = false;\n } else\n if (strstr($comment,\"@money\")){\n $value = \"10.00\";\n }\n \n \n $bean->$field = $value;\n }\n \n R::store($bean);\n R::trash($bean);\n }", "public function Clear() {\n $this->_row = '';\n $this->_table = '';\n $this->_itemcount = 0;\n $this->_rown = 0;\n }", "function generateCell($type) {\n\t\t\n\t\tif($this->getV()) {\n\t\t\n\t\t\t$str = \"{v: \";\n\t\t\t\n\t\t\tif($type==\"string\") {\n\t\t\t\t$str.= \"'\".$this->escapeJSChars($this->getV()).\"',\";\n\t\t\t} elseif($type==\"boolean\") {\n\t\t\t\t$str.= \"'\".$this->getV().\"',\";\n\t\t\t} elseif($type==\"date\") {\n\t\t\t\t$str.= \"new Date(\".substr($this->getV(),0,4).\",\".(substr($this->getV(),5,2) - 1).\",\".substr($this->getV(),8,2).\"),\";\n\t\t\t} elseif($type==\"datetime\") {\n\t\t\t\t$str.= \"new Date(\".substr($this->getV(),0,4).\",\".(substr($this->getV(),5,2) - 1).\",\".substr($this->getV(),8,2).\",\".substr($this->getV(),11,2).\",\".substr($this->getV(),14,2).\",\".substr($this->getV(),17,2).\"),\";\n\t\t\t} elseif($type==\"timeofday\") {\n\t\t\t\t$str.= \"[\".substr($this->getV(),11,2).\",\".substr($this->getV(),14,2).\",\".substr($this->getV(),17,2).\"],\";\n\t\t\t} else {\t\t\n\t\t\t\t$str.= $this->escapeJSChars($this->getV()).\",\";\n\t\t\t}\n\t\t\t\n\t\t\tif($this->getF()) {\n\t\t\t\t$str.= \"f: '\".$this->getF().\"',\";\n\t\t\t}\t\t\n\t\t\t\n\t\t\tif($this->getClassName()) {\n\t\t\t\t$str.=\"p: {'className': '\".$this->getClassName().\"'},\";\n\t\t\t}\n\t\t\t\n\t\t\t$str = substr($str,0,-1);\n\t\t\t$str.= \"}\";\n\n\t\t} else {\n\t\t\n\t\t\t$str = \"\";\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $str;\n\t\t\n\t}", "abstract protected function createDefaultBody();", "public function printCells($zebra = false, $title = false) {\n $options = array();\n if ($this->_zebra && $zebra) {\n if (!$this->_colorZebra) {\n $options['backgroundColor'] = '#FFFFFF';\n $this->_colorZebra = 1;\n } else {\n $options['backgroundColor'] = '#efefef';\n $this->_colorZebra = 0;\n }\n }\n for ($iLine = 0; $iLine < $this->_cells['maxLine']; $iLine++) {\n $defaultWidth = $this->_pageWidth / count($this->_cells['cell']);\n if ($this->_cells['cell']) {\n foreach ($this->_cells['cell'] as $key => $celula) {\n $values = $this->_cells['values'][$key][$iLine];\n $celulaOk = $this->_driver->makeCell($celula, $options);\n $borders = $celulaOk['border'];\n if ($iLine != ($this->_cells['maxLine'] - 1)) {\n $borders = str_ireplace('B', '', $borders);\n }\n if ($iLine != 0) {\n $borders = str_ireplace('T', '', $borders);\n }\n if (!$celulaOk['celula']->getWidth()) {\n $celulaOk['celula']->setWidth($defaultWidth);\n }\n $celulaOk['url'] = $celulaOk['celula']->getUrl();\n if ($celulaOk['url']) {\n if (strpos($celulaOk['url'], \"typeModal\") === false) {\n $celulaOk['url'].= '&typeModal=PDF#zoom=120';\n }\n }\n\n $cell = array();\n $cell['width'] = $this->_pxToCm($celulaOk['celula']->getWidth());\n $cell['height'] = $celulaOk['celula']->getHeight();\n $cell['value'] = $values;\n $cell['border'] = $borders;\n $cell['align'] = $celulaOk['celula']->getTextAlign();\n $cell['color'] = $celulaOk['color'];\n $cell['url'] = $celulaOk['url'];\n $cell['fontName'] = $celulaOk['celula']->getFontName();\n $cell['style'] = $celulaOk['celula']->getStyle();\n $cell['fontSize'] = $celulaOk['celula']->getFontSize();\n\n $this->_driver->Cell($cell['width'], $cell['height'], $cell['value'], $cell['border'], 0, $cell['align'], $cell['color'], $cell['url']);\n if ($title) {\n $this->_driver->addCellTitle($cell);\n }\n }\n }\n $this->_driver->Ln();\n if ($title) {\n $this->_driver->addLineTitle();\n }\n }\n $this->_cells = array();\n return $this;\n }", "function blank() {\n $this->checksession();\n $this->notification();\n $this->breadcrumbs();\n $this->userimage = 'http:/' . ROOT . \"Views/AdminLTE/dist/img/user2-160x160.jpg\";\n $this->userimage2 = 'http:/' . ROOT . \"Views/AdminLTE/dist/img/user2-160x160.jpg\";\n $this->h1 = \"\n <h1>\n Blank page\n <small>it all starts here</small>\n </h1>\n \";\n\n $this->title = \"Title\";\n\n $this->body = \"Start creating your amazing application!\";\n $this->footer = \"Footer\";\n }", "function prepareDefaultHeader()\n {\n $this->formatBuffer .= \"p.normalText, li.normalText, div.normalText{\\n\";\n $this->formatBuffer .= \" mso-style-parent: \\\"\\\";\\n\";\n $this->formatBuffer .= \" margin: 0cm;\\n\";\n $this->formatBuffer .= \" margin-bottom: 6pt;\\n\";\n $this->formatBuffer .= \" mso-pagination: widow-orphan;\\n\";\n $this->formatBuffer .= \" font-size: {$this->fontSize}pt;\\n\";\n $this->formatBuffer .= \" font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \" mso-fareast-font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \"}\\n\\n\";\n \n $this->formatBuffer .= \"table.normalTable{\\n\";\n $this->formatBuffer .= \" mso-style-name: \\\"Tabela com grade\\\";\\n\";\n $this->formatBuffer .= \" mso-tstyle-rowband-size: 0;\\n\";\n $this->formatBuffer .= \" mso-tstyle-colband-size: 0;\\n\";\n $this->formatBuffer .= \" border-collapse: collapse;\\n\";\n $this->formatBuffer .= \" mso-border-alt: solid windowtext {$this->tableBorderAlt}pt;\\n\";\n $this->formatBuffer .= \" mso-yfti-tbllook: 480;\\n\";\n $this->formatBuffer .= \" mso-padding-alt: 0cm {$this->tablePaddingAltRight}pt 0cm {$this->tablePaddingAltLeft}pt;\\n\";\n $this->formatBuffer .= \" mso-border-insideh: {$this->tableBorderInsideH}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-border-insidev: {$this->tableBorderInsideV}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-para-margin: 0cm;\\n\";\n $this->formatBuffer .= \" mso-para-margin-bottom: .0001pt;\\n\";\n $this->formatBuffer .= \" mso-pagination: widow-orphan;\\n\";\n $this->formatBuffer .= \" font-size: {$this->fontSize}pt;\\n\";\n $this->formatBuffer .= \" font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \"}\\n\";\n $this->formatBuffer .= \"table.normalTable td{\\n\";\n $this->formatBuffer .= \" border: solid windowtext 1.0pt;\\n\";\n $this->formatBuffer .= \" border-left: none;\\n\";\n $this->formatBuffer .= \" mso-border-left-alt: solid windowtext .5pt;\\n\";\n $this->formatBuffer .= \" mso-border-alt: solid windowtext .5pt;\\n\";\n $this->formatBuffer .= \" padding: 0cm 5.4pt 0cm 5.4pt;\\n\";\n $this->formatBuffer .= \"}\\n\\n\";\n \n $this->formatBuffer .= \"table.tableWithoutGrid{\\n\";\n $this->formatBuffer .= \" mso-style-name: \\\"Tabela sem grade\\\";\\n\";\n $this->formatBuffer .= \" mso-tstyle-rowband-size: 0;\\n\";\n $this->formatBuffer .= \" mso-tstyle-colband-size: 0;\\n\";\n $this->formatBuffer .= \" border-collapse: collapse;\\n\";\n $this->formatBuffer .= \" border: none;\\n\";\n $this->formatBuffer .= \" mso-border-alt: none;\\n\";\n $this->formatBuffer .= \" mso-yfti-tbllook: 480;\\n\";\n $this->formatBuffer .= \" mso-padding-alt: 0cm {$this->tablePaddingAltRight}pt 0cm {$this->tablePaddingAltLeft}pt;\\n\";\n $this->formatBuffer .= \" mso-border-insideh: {$this->tableBorderInsideH}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-border-insidev: {$this->tableBorderInsideV}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-para-margin: 0cm;\\n\";\n $this->formatBuffer .= \" mso-para-margin-bottom: .0001pt;\\n\";\n $this->formatBuffer .= \" mso-pagination: widow-orphan;\\n\";\n $this->formatBuffer .= \" font-size: {$this->fontSize}pt;\\n\";\n $this->formatBuffer .= \" font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \"}\\n\\n\";\n \n if ($this->cssFile != '') {\n if (file_exists($this->cssFile))\n $this->formatBuffer .= file_get_contents($this->cssFile);\n }\n }", "protected function createObjects() {\n\t\t$this->lblId = $this->mctHut->lblId_Create();\n\t\t$this->lstPosition = $this->mctHut->lstPosition_Create();\n\t\t$this->txtName = $this->mctHut->txtName_Create();\n\t}", "private function newRow(){\n\t\t$r = new HtmlBox('tr');\n\t\tfor($i=0;$i<$this->col;$i++)\n\t\t\t$r->add(new HtmlBox('td')) ;\n\t\t$this->row++;\n\t\t$this->add($r);\n\t\treturn $this;\n\t}", "function verifyCreateTableWithNoSpecialEffects(){\n $WIKI_TABLE_ROW = \"6\";\n $WIKI_TABLE_COL = \"2\";\n parent::doExpandAdvanceSection();\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_ADDTABLE);\n $this->click(CHK_BOARDER);\n $this->click(CHK_HEADER);\n $this->type(TEXT_ROW, $WIKI_TABLE_ROW);\n $this->type(TEXT_COL, $WIKI_TABLE_COL);\n $this->click(BUTTON_INSERTABLE);\n $this->click(CHK_BOARDER);\n $this->click(CHK_HEADER);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertTrue($this->isElementPresent(TEXT_TABLEID_OTHER . \n TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .\n TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .\n TEXT_VALIDATE_TABLE_PART3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "function CreateDefaultHeadingEntity()\n {\n\t\t$result = $this->sendRequest(\"CreateDefaultHeadingEntity\", array());\n\t\treturn $this->getResultFromResponse($result);\n }", "private function createTables() {\n \n foreach($this->G->tableInfo as $table) {\n $this->tables[$table[\"title\"]] = new IdaTable($table[\"title\"]);\n } \n }", "function create($tableName)\n{\n\t$this->createFromTable($tableName, PCLIB_DIR.'assets/default-tpl.tpl');\n}", "function initialize () {\n $this->set_openingtag ( \"<TD[attributes]>\" );\n\t$this->set_closingtag ( \"</TD>\" );\n }", "private function blank(): void\n {\n $width = $this->getRenderWidth();\n $height = $this->getRenderHeight();\n\n for ($h = 0; $h <= $this->height && $h < $height; ++$h) {\n $this->cli->jump($this->pos['x'], $this->pos['y'] + $h);\n $this->cli->write(str_repeat(' ', $width));\n }\n }", "protected function startTable() {}", "public static function createTables()\n\t{\n\t\treturn (self::createContentTable());\n\t}", "public static function createCMSBlockTable()\n\t{\n\t}", "public function blankPage()\n {\n $this->_sidebar = false;\n $this->_layout = false;\n $this->_render = false;\n }", "public function testRenderWithNoData()\n {\n $bookmark = new PolicePeople();\n $bookmark->setData([]);\n\n $this->assertEquals(\n PolicePeople::HEADING_LINE . PolicePeople::NO_ENTRIES,\n $bookmark->render()\n );\n }", "public function testCellRender(): void\n {\n $cell = $this->View->cell('Articles::teaserList');\n $render = \"{$cell}\";\n\n $this->assertSame('teaser_list', $cell->viewBuilder()->getTemplate());\n $this->assertStringContainsString('<h2>Lorem ipsum</h2>', $render);\n $this->assertStringContainsString('<h2>Usectetur adipiscing eli</h2>', $render);\n $this->assertStringContainsString('<h2>Topis semper blandit eu non</h2>', $render);\n $this->assertStringContainsString('<h2>Suspendisse gravida neque</h2>', $render);\n\n $cell = $this->View->cell('Cello');\n $this->assertInstanceOf('TestApp\\View\\Cell\\CelloCell', $cell);\n $this->assertSame(\"Cellos\\n\", $cell->render());\n }", "function createSpreadsheet(){\n\t\t\n\t\n\t\terror_reporting(E_ALL);\n\t\tini_set('display_errors', TRUE);\n\t\tini_set('display_startup_errors', TRUE);\n\t\n\t\tdefine('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');\n\t\n\t\t/** Include PHPExcel */\n\t\t//require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';\n\t\t\n\t\trequire_once $GLOBALS['ROOT_PATH'].'Classes/PHPExcel.php';\n\t\n\t\n\t\tPHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() );\n\t\n\t\t// Create new PHPExcel object\n\t\t$objPHPExcel = new PHPExcel();\n\t\t$currentMonth = date('Y-m');\n\t\t$title = $this->getHhName() . ' ' . $currentMonth;\n\t\t\n\t\t// Set document properties\n\t\t$objPHPExcel->getProperties()->setCreator(\"HhManagement\")\n\t\t->setLastModifiedBy(\"HhManagement\")\n\t\t->setTitle($title)\n\t\t->setSubject($currentMonth);\n\t\n\t\t//default styles\n\t\t$objPHPExcel->getDefaultStyle()->getFont()->setName('Calibri');\n\t\t$objPHPExcel->getDefaultStyle()->getFont()->setSize(12);\n\t\n\t\n\t\t//styles....\n\t\n\t\t//fonts\n\t\t//font red bold italic centered\n\t\t$fontRedBoldItalicCenter = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'italic' => true,\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'alignment' => array (\n\t\t\t\t\t\t'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER,\n\t\t\t\t\t\t'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font red bold\n\t\t$fontRedBold = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font red\n\t\t$fontRed = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font Green\n\t\t$fontGreen = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'argb' => '0008B448',\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font Bold Italic\n\t\t$fontBoldItalic = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'italic' => true,\n\t\t\t\t)\n\t\t);\n\t\n\t\t//font Bold Italic Centered\n\t\t$fontBoldItalicCenter = array (\n\t\t\t\t'font' => array (\n\t\t\t\t\t\t'bold' => true,\n\t\t\t\t\t\t'italic' => true,\n\t\t\t\t),\n\t\t\t\t'alignment' => array (\n\t\t\t\t\t\t'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER,\n\t\t\t\t\t\t'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER\n\t\t\t\t)\n\t\t);\n\t\n\t\t//background fillings\n\t\t//fill red\n\t\t$fillRed = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF40202',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill yellow\n\t\t$fillYellow = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFF2E500',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill green\n\t\t$fillGreen = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FF92D050',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill gray\n\t\t$fillGray = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFD9D9D9',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//fill cream\n\t\t$fillCream = array (\n\t\t\t\t'fill' => array(\n\t\t\t\t\t\t'type' => PHPExcel_Style_Fill::FILL_SOLID,\n\t\t\t\t\t\t'startcolor' => array(\n\t\t\t\t\t\t\t\t'argb' => 'FFC4BD97',\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t);\n\t\n\t\t//sets the heading for the first table\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1')->applyFromArray($fillCream);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B1','Equal AMT');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B1')->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B1')->applyFromArray($fillCream);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C1','Ind. bills');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C1')->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C1')->applyFromArray($fillCream);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('D1','To rent');\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D1')->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D1')->applyFromArray($fillCream);\n\t\n\t\t$numberOfMembers = $this->getNumberOfMembers();\n\t\t$monthTotal = $this->getMonthTotal();\n\t\t$rent = $this->getHhRent();\n\t\t$col = 65;//starts at column A\n\t\t$row = 2;//the table starts at row 2\n\t\n\t\t//array used to associate the bills with the respective user\n\t\t$array =[];\n\t\n\t\t//sets the members names fair amount and value\n\t\t$members = $this->getMembers();\n\t\tforeach ($members as $member) {\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$cellName = chr($col) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cellName,$name);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellName)->applyFromArray($fontBoldItalic);\n\t\n\t\t\t$cellInd = chr($col+2) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cellInd,'0.0');\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellInd)->getNumberFormat()\n\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellInd)->applyFromArray($fillRed);\n\t\n\t\t\t$cellFair = chr($col+1) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellFair)->applyFromArray($fontRed);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellFair)->getNumberFormat()\n\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellFair)->applyFromArray($fillGray);\n\t\n\t\t\t$cellRent = chr($col+3) . $row;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cellRent,'=SUM('. $cellFair .'-'. $cellInd .')');\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellRent)->applyFromArray($fontGreen);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellRent)->getNumberFormat()\n\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle($cellInd)->applyFromArray($fillYellow);\n\t\n\t\t\t$array[$name]['cell'] = $cellInd;\n\t\t\t$row++;\n\t\t}\n\t\n\t\t//inserts the sum of the fair amounts to compare to the one below\n\t\t$endCell = chr($col+1) . ($row-1);\n\t\t$cell = chr($col+1) . $row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'=SUM(B2:'.$endCell.')');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRed);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGray);\n\t\n\t\t//insert the rent check values\n\t\t$cell = chr($col+2) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Rent');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalic);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\t$cell = chr($col+3) . $row;\n\t\t$endCell = chr($col+3) .($row-1);\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'=SUM(D2:'.$endCell.')');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRedBold);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\n\t\t//inserts the bill and amount labels\n\t\t$row += 2;\n\t\t$cellMergeEnd = chr($col+1) . $row;\n\t\t$cell = chr($col) . $row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'House bills');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->mergeCells($cell.':'.$cellMergeEnd);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillRed);\n\t\n\t\t$cell = chr($col) . $row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Bill');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGreen);\n\t\n\t\t$cell = chr($col+1) . $row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Amount');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGreen);\n\t\n\t\n\t\t//inserts the bills\n\t\t$startCell = chr($col+1) . $row;\n\t\tforeach ($members as $member) {\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$col = 65;\n\t\t\t$bills = $member->getBills();\n\t\t\t$array[$name]['bills'] = [];\n\t\t\tforeach ($bills as $bill) {\n\t\t\t\t$desc = $bill->getBillDescription();\n\t\t\t\t$amount = $bill->getBillAmount();\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue(chr($col) . $row,$desc);\n\t\t\t\t$amountCell = chr($col+1) . $row++;\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($amountCell,$amount);\n\t\t\t\t$objPHPExcel->getActiveSheet()->getStyle($amountCell)->getNumberFormat()\n\t\t\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t\t\tarray_push($array[$name]['bills'], $amountCell);\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t\t$col = 65;\n\t\n\t\t//inserts rent\n\t\t$cell = chr($col) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Rent');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\n\t\t$cell = chr($col+1) . $row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,$rent);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillYellow);\n\t\t$endCell = chr($col+1) . ($row-1);\n\t\n\t\t//inserts the total of bills\n\t\t$col = 65;\n\t\t$cell = chr($col) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Total H-B');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillCream);\n\t\n\t\t$cell = chr($col+1) .$row++;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell, '=SUM('. $startCell .':'. $endCell .')');\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fontRedBoldItalicCenter);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillCream);\n\t\n\t\t//inserts the fair amount\n\t\t$cell = chr($col) .$row;\n\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'Fair Amount if ' . $numberOfMembers);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGray);\n\t\t$cell = chr($col+1) .$row;\n\t\t$objPHPExcel->getActiveSheet()\n\t\t->setCellValue($cell,'='. chr($col+1) .($row-1) . '/' . $numberOfMembers);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()\n\t\t->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);\n\t\t$objPHPExcel->getActiveSheet()->getStyle($cell)->applyFromArray($fillGray);\n\t\t$fairAmountCell = chr($col+1) . $row;\n\t\n\t\t$row = 2;\n\t\tforeach ($members as $member) {\n\t\t\t$col = 66;\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue(chr($col) . $row++,'='. $fairAmountCell);\n\t\t}\n\t\n\t\t//inserts the individual bills\n\t\tforeach ($array as $value){\n\t\t\t$cell = $value['cell'];\n\t\t\t$sumOfBills = '';\n\t\t\t\t\n\t\t\tif (isset($value['bills'])) {\n\t\t\t\t$bills = $value['bills'];\n\t\t\t\t$counter = 1;\n\t\t\t\tforeach ($bills as $bill){\n\t\t\t\t\tif ($counter == 1){\n\t\t\t\t\t\t$sumOfBills .= $bill;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sumOfBills .= '+' . $bill;\n\t\t\t\t\t}\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue($cell,'=SUM('. $sumOfBills . ')');\n\t\t}\n\t\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(true);\n\t\n\t\t// Rename worksheet\n\t\t$objPHPExcel->getActiveSheet()->setTitle($title);\n\t\n\t\t// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n\t\t$objPHPExcel->setActiveSheetIndex(0);\n\t\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->setPreCalculateFormulas(true);\n\t\t//$objWriter->save(str_replace('.php', '.xlsx', __FILE__));\n\t\t$objWriter->save(str_replace('.php', '.xlsx', $GLOBALS['ROOT_PATH']. 'spreadsheets/'. $title .'.php'));\n\t\n\t\treturn $title . '.xlsx';\n\t}", "protected abstract function createTestTable();", "private function set_template() {\n\t\t$table_open = $this->check_template(@$this->template->table_open, '<table border=\"1\">');\n\t\t$table_close = $this->check_template(@$this->template->table_close, '</table>');\n\t\t$thead_open = $this->check_template(@$this->template->thead_open, '<thead>');\n\t\t$thead_close = $this->check_template(@$this->template->thead_close, '</thead>');\n\t\t$tbody_open = $this->check_template(@$this->template->tbody_open, '<tbody>');\n\t\t$tbody_close = $this->check_template(@$this->template->tbody_close, '</tbody>');\n\t\t$tfoot_open = $this->check_template(@$this->template->tfoot_open, '<tfoot>');\n\t\t$tfoot_close = $this->check_template(@$this->template->tfoot_close, '</tfoot>');\n\t\t$tr_open = $this->check_template(@$this->template->tr_open, '<tr>');\n\t\t$tr_close = $this->check_template(@$this->template->tr_close, '</tr>');\n\n\t\t$table_structure = array(\n\t\t\t'table_open'=>$table_open,\n\t\t\t'table_close'=>$table_close,\n\t\t\t'thead_open'=>$thead_open,\n\t\t\t'thead_close'=>$thead_close,\n\t\t\t'tbody_open'=>$tbody_open,\n\t\t\t'tbody_close'=>$tbody_close,\n\t\t\t'tfoot_open'=>$tfoot_open,\n\t\t\t'tfoot_close'=>$tfoot_close,\n\t\t\t'tr_open'=>$tr_open,\n\t\t\t'tr_close'=>$tr_close\n\t\t);\n\t\t$table_structure = json_encode($table_structure);\n\t\t$table_structure = json_decode($table_structure);\n\n\t\treturn $table_structure;\n\t}", "public static function createEmpty(): self\n {\n return new self(null);\n }", "public function write() {\n\t\tif (!($this->_page instanceof Zend_Pdf_Page)) {\n\t\t\tthrow new Zend_Pdf_Exception(\"The PDF page that the cell is attempting to write to is not a valid page.\");\n\t\t}\n\t\tif (!($this->_font instanceof Zend_Pdf_Resource_Font)) {\n\t\t\tthrow new Zend_Pdf_Exception('No font has been set');\n\t\t}\n\t\tif ($this->isAutoHeight()) {\n\t\t\t$this->_height=$this->_autoHeight;\n\t\t}\n\t\tif ($this->isAutoWidth()) {\n\t\t\t$this->_width=$this->_autoWidth;\n\t\t}\n\t\t\n\t\t//positions of the cell's box\n\n\t\t//initalize the diminsions to defaults\n\t\t$top=$this->_y;\n\t\t$left=$this->_x;\n\t\t$right=$left+$this->getWidth();\n\t\t$bottom=$top+$this->getHeight();\n\t\t\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_BOTTOM) {\n\t\t\t$top=$this->getHeight();\n\t\t\t$bottom=$top+$this->getHeight();\n\t\t}\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_CENTER_X) {\n\t\t\t$left=$this->_page->getWidth()/2 - $this->getWidth()/2 + $this->_x;\n\t\t\t$right=$left+$this->getWidth();\n\t\t}\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_CENTER_Y) {\n\t\t\t$top=$this->_page->getHeight()/2 + $this->getHeight()/2 - $this->_y;\t\t\t\n\t\t\t$bottom=$top-$this->getHeight();\t\t\n\t\t}\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_TOP ) {\n\t\t\t$top=$this->_page->getHeight();\n\t\t\t$bottom=$top+$this->getHeight();\n\t\t}\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_RIGHT) {\n\t\t\t$left=$this->_page->getWidth() - $this->getWidth();\n\t\t\t$right=$left+$this->getWidth();\n\t\t}\n\t\t$currentY=$top;\n\t\t//save the page's font so we can put it back after writing the cell\n\t\t$pageFont=$this->_page->getFont();\n\t\t$fontSize=$this->_page->getFontSize();\n\t\t\n\t\t\t\t\n\t\t//restore old size and font\n\t\t$this->_page->setFont($pageFont,$fontSize);\n\t\t//draw the border\n\t\tif ($this->_border['size']>0) {\n\t\t\t$style=new Zend_Pdf_Style();\n\t\t\t$style->setLineColor($this->getBorderColor());\n\t\t\t$style->setFillColor(new Zend_Pdf_Color_RGB(255,255,255));\n\t\t\t$style->setLineDashingPattern($this->getBorderPattern());\n\t\t\t$this->_page->setStyle($style);\n\t\t\t$this->_page->drawRectangle($right,$top,$left,$bottom);\n\t\t\t$style->setFillColor(new Zend_Pdf_Color_RGB(0,0,0));\n\t\t\t$this->_page->setStyle($style);\n\t\t}\n\t\t\n\t\t//draw every section of every page.\n\t\tfor ($i=0;$i<count($this->_text);$i++) {\n\t\t\t$currentX=0;\n\t\t\tswitch ($this->_text[$i]['alignment']) {\n\t\t\t\tcase Zend_Pdf_Cell::ALIGN_RIGHT:\n\t\t\t\t\t$currentX=$right - $this->_text[$i]['width'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase Zend_Pdf_Cell::ALIGN_CENTER:\n\t\t\t\t\t$currentX=($right-$left)/2+$left-$this->_text[$i]['width']/2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Zend_Pdf_Cell::ALIGN_JUSTIFY:\n\t\t\t\t\t//@todo\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$currentX=$left;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t//add the offset\n\t\t\t$currentX+=$this->_text[$i]['x'];\n\t\t\t$currentY-=$this->_text[$i]['height'];\n\t\t\t//count() - 4 because of the 4 properties to this text.\n\t\t\tfor ($j=0;$j<count($this->_text[$i])-4;$j++) {\t\t\t\t\n\t\t\t\t$this->_page->setFont($this->_text[$i][$j]['font'],$this->_text[$i][$j]['fontSize']);\n\t\t\t\t$this->_page->drawText($this->_text[$i][$j]['text'],$currentX,$currentY,$this->_text[$i][$j]['encoding']);\n\t\t\t\t$currentX+=$this->_text[$i][$j]['width'];\t\t\n\t\t\t}\n\t\t}\n\t}", "function build_form_table_begin($width='100%', $height='', $cellpadding=1, $cellspacing=1, $class='outer')\n{\n\t$text = $this->build_html_table_tag_begin($width, $height, $cellpadding, $cellspacing, $class);\n\treturn $text;\n}", "protected function createTestTables()\n {\n $db = $this->getDb();\n\n $table = 'EmailTemplateAr';\n $columns = [\n 'id' => 'pk',\n 'name' => 'string',\n 'subject' => 'string',\n 'bodyHtml' => 'text',\n ];\n $db->createCommand()->createTable($table, $columns)->execute();\n\n $columns = [\n 'name' => 'TestActiveMessage',\n 'subject' => 'test subject',\n 'bodyHtml' => 'test body HTML',\n ];\n $db->createCommand()->insert($table, $columns)->execute();\n }", "function minitable($Array){\n\t$table='<table class=\"mini\">';\n\tforeach ($Array as $row=>$Cells){\n\t\t$table.='<tr>'.\"\\n\";\n\t\tforeach ($Cells as $column=>$value){\n\t\t\t$class=setclass($row,$column,$value);\n\t\t\t$value=htmlSafe($value);\n\t\t\tif (strlen($value)>1){$value='&nbsp;';}\n\t\t\tif (strlen($value)==0){$value='x';}\n\t\t\t$table.='<td class=\"'.$class.'\">'.$value.'</td>'.\"\\n\";\n\t\t}\n\t\t$table.='</tr>'.\"\\n\";\n\t}\n\t$table.='</table>';\n\treturn $table;\n}", "function libExcel() {\n\t\t$this->objPHPExcel = new PHPExcel();\n\t\t// Set document properties\n\t\t// echo date('H:i:s') , \" Set document properties\" , EOL;\n\t\t$this->objPHPExcel->getProperties()->setCreator(\"Maarten Balliauw\")\n\t\t\t\t\t\t\t ->setLastModifiedBy(\"Maarten Balliauw\")\n\t\t\t\t\t\t\t ->setTitle(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t ->setSubject(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t ->setDescription(\"Test document for Office 2007 XLSX, generated using PHP classes.\")\n\t\t\t\t\t\t\t ->setKeywords(\"office 2007 openxml php\")\n\t\t\t\t\t\t\t ->setCategory(\"Test result file\");\n\n\t}", "public function generate_screen() {\n\t\t\t$bootstrap = new HTMLWriter();\n\t\t\t$content = '';\n\t\t\t$columns = array_keys($this->json['columns']);\n\t\t\t$count = 0; \n\t\t\t$array = array(); \n\t\t\tforeach ($this->json['columns'] as $column) {\n\t\t\t\tif ($column['sortavailable'] == 'n') { $array[] = $count; }\n\t\t\t\t$count++;\n\t\t\t}\n\t\t\t\n\t\t\t$tb = new Table(\"class=table table-striped table-bordered table-condensed table-excel|id=table\");\n\t\t\t$tb->tablesection('thead');\n\t\t\t\t$tb->tr();\n\t\t\t\tforeach($this->json['columns'] as $column) {\n\t\t\t\t\t$class = DplusWire::wire('config')->textjustify[$column['headingjustify']];\n\t\t\t\t\t$tb->th(\"class=$class\", $column['heading']);\n\t\t\t\t}\n\t\t\t$tb->closetablesection('thead');\n\t\t\t$tb->tablesection('tbody');\n\t\t\t\tforeach ($this->json['data']['lots'] as $lot) {\n\t\t\t\t\t$tb->tr();\n\t\t\t\t\tforeach($columns as $column) {\n\t\t\t\t\t\t$class = DplusWire::wire('config')->textjustify[$this->json['columns'][$column]['datajustify']];\n\t\t\t\t\t\t$tb->td(\"class=$class\", $lot[$column]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t$tb->closetablesection('tbody');\n\t\t\t$content = $tb->close();\n\t\t\treturn $content;\n\t\t}", "function verifyCreateTableWithBorders(){\n $WIKI_TABLE_ROW = \"4\";\n $WIKI_TABLE_COL = \"6\";\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_ADDTABLE);\n $this->click(CHK_HEADER);\n $this->type(TEXT_ROW,$WIKI_TABLE_ROW);\n $this->type(TEXT_COL,$WIKI_TABLE_COL);\n $this->click(BUTTON_INSERTABLE);\n $this->click(CHK_HEADER);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertTrue($this->isElementPresent(TEXT_TABLEID_OTHER . \n TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .\n TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .\n TEXT_VALIDATE_TABLE_PART3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: cell properties');\r\n\r\n $this->addElement('text', 'cellid', 'Id mask:', array('size' => 32));\r\n $this->addElement('text', 'cellclass', 'CSS class:', array('size' => 32));\r\n\r\n $cellvalue['min'] =& $this->createElement('text',\r\n 'min', 'minimum',\r\n array('size' => 4));\r\n $cellvalue['max'] =& $this->createElement('text',\r\n 'max', 'maximum',\r\n array('size' => 4));\r\n $cellvalue['inc'] =& $this->createElement('text',\r\n 'inc', 'increment',\r\n array('size' => 4));\r\n $this->addGroup($cellvalue, 'cellvalue', 'Value:', ' ');\r\n\r\n $cellsize['width'] =& $this->createElement('text',\r\n 'width', 'width',\r\n array('size' => 4));\r\n $cellsize['height'] =& $this->createElement('text',\r\n 'height', 'height',\r\n array('size' => 4));\r\n $cellsize['spacing'] =& $this->createElement('text',\r\n 'spacing', 'spacing',\r\n array('size' => 2));\r\n $cellsize['count'] =& $this->createElement('text',\r\n 'count', 'count',\r\n array('size' => 2));\r\n $this->addGroup($cellsize, 'cellsize', 'Size:', ' ');\r\n\r\n $cellcolor['active'] =& $this->createElement('text',\r\n 'active', 'active',\r\n array('size' => 7));\r\n $cellcolor['inactive'] =& $this->createElement('text',\r\n 'inactive', 'inactive',\r\n array('size' => 7));\r\n $cellcolor['bgcolor'] =& $this->createElement('text',\r\n 'bgcolor', 'background',\r\n array('size' => 7));\r\n $this->addGroup($cellcolor, 'cellcolor', 'Color:', ' ');\r\n\r\n $cellfont['family'] =& $this->createElement('text',\r\n 'family', 'family',\r\n array('size' => 32));\r\n $cellfont['size'] =& $this->createElement('text',\r\n 'size', 'size',\r\n array('size' => 2));\r\n $cellfont['color'] =& $this->createElement('text',\r\n 'color', 'color',\r\n array('size' => 7));\r\n $this->addGroup($cellfont, 'cellfont', 'Font:', ' ');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('apply','process'));\r\n }", "public function render()\n {\n return view('avored::system.components.table.cell');\n }", "function clsTable($aConfiguration=array())\r\n\t{\r\n\t\t$this->clearEvent_AddHeader();\r\n\t\t$this->clearEvent_AddHeaderRow();\r\n\t\t$this->clearEvent_AddHeaderRowCell();\r\n\t\t$this->clearEvent_AddBody();\r\n\t\t$this->clearEvent_AddBodyRow();\r\n\t\t$this->clearEvent_AddBodyRowCell();\r\n\t\t$this->clearEvent_AddFooter();\r\n\t\t$this->clearEvent_AddFooterRow();\r\n\t\t$this->clearEvent_AddFooterRowCell();\r\n\t\t\r\n\t\txajaxControlContainer::xajaxControlContainer('table', $aConfiguration);\r\n\r\n\t\t$this->sClass = '%block';\r\n\t}", "public function testAccessArray()\n {\n $data = [\n 'foobar' => 'barfoo',\n ];\n $cell = $this->createFactory()->createCell('foobar', PropertyColumn::class, $data, []);\n }", "public function generateNewCrossReferenceTableEntry(): CrossReferenceTableEntry\n {\n // Neue Nummer am \"Ende\" der CrossReferenceTable\n $objectNumber = $this->trailerDictionary->getObject(\"Size\")->getValue();\n $this->trailerDictionary->setObject(\"Size\", new PdfNumber($objectNumber + 1));\n\n $entry = new CrossReferenceTableEntry($objectNumber, 0, false, 0);\n $this->crossReferenceTable->setEntry($entry);\n return $entry;\n }", "function add_cell($val, $link = \"\")\n\t{\n\t\tif(!empty($link))\n\t\t{\n\t\t\t$this->tpl->setCurrentBlock(\"begin_link\");\n\t\t\t$this->tpl->setVariable(\"LINK_TARGET\", $link);\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t\t$this->tpl->touchBlock(\"end_link\");\n\t\t}\n\n\t\t$this->tpl->setCurrentBlock(\"text\");\n\t\t$this->tpl->setVariable(\"TEXT_CONTENT\", $val);\n\t\t$this->tpl->parseCurrentBlock();\n\t\t$this->tpl->setCurrentBlock(\"table_cell\");\n\t\t$this->tpl->parseCurrentBlock();\n\t}", "public function __construct(int $width = 0, int $height = 0) {\n $this->width = $width;\n $this->height = $height;\n\n // Field structure:\n //\n // NOTE: width -> any positive number\n // height -> odd positive number\n\n // o o o o\n // o o o\n // o o o o\n // o o o\n // o o o o\n //\n $this->cells = new SplFixedArray($this->width * $this->height - intdiv($this->height, 2));\n\n for ($i = 0; $i < count($this->cells); $i++) {\n $this->cells[$i] = new Cell(0, Colors::randomColorString());\n }\n }", "private function init()\n\t{\n\t\tfor ($i = 0 ; $i < $this->row ; $i++) {\n\t\t\tfor($j = 0 ; $j < $this->col ; $j++) {\n\t\t\t\t$this->arr[$i][$j] = \" \";\n\t\t\t}\n\t\t}\n\t}", "public function cell() {\r\n\t\t$argKeys = ['cell', 'header', 'headerSort', 'skipId', 'cellOptions'];\r\n\t\t$totalArgs = count($argKeys);\r\n\t\t$totalArgKey = $lastArgKey = $totalArgs - 1;\r\n\t\t$args = func_get_args();\r\n\t\t$numArgs = count($args);\r\n\t\tfor ($i = $totalArgKey; $i > 0; $i--) {\r\n\t\t\tif (!empty($args[$i])) {\r\n\t\t\t\t$lastArgKey = $i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($lastArgKey < $totalArgKey) {\r\n\t\t\t// The last passed argument can always be cell options\r\n\t\t\tif (is_array($args[$lastArgKey])) {\r\n\t\t\t\t$args[$totalArgKey] = $args[$lastArgKey];\r\n\t\t\t\tfor ($i = $lastArgKey; $i < $totalArgKey; $i++) {\r\n\t\t\t\t\t$args[$i] = null;\r\n\t\t\t\t}\r\n\t\t\t\tksort($args);\r\n\t\t\t}\r\n\t\t}\r\n\t\textract(array_combine($argKeys, $args + array_fill(0, $totalArgs, null)));\r\n\t\t\r\n\t\t// Checks if the skipId is in the skip array\r\n\t\tif (!empty($skipId) && $this->_checkSkip($skipId)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$formAddCell = '&nbsp;';\r\n\t\tif ($this->getHeader) {\r\n\t\t\t$this->columnCount++;\r\n\t\t\t//Stores first instance of non-blank header\r\n\t\t\tif (!empty($header) && !$this->hasHeader) {\r\n\t\t\t\t$this->hasHeader = true;\r\n\t\t\t}\r\n\t\t\tif ($headerSort) {\r\n\t\t\t\tif ($headerSort === true) {\r\n\t\t\t\t\t$headerSort = null;\r\n\t\t\t\t}\r\n\t\t\t\t$header = $this->thSort($header, $headerSort);\r\n\t\t\t}\r\n\t\t\t$thOptions = isset($cellOptions['th']) ? $cellOptions['th'] : $cellOptions;\r\n\t\t\t$this->headers[] = [$header => $thOptions];\r\n\t\t\t\r\n\t\t}\r\n\t\t/*\r\n\t\tif ($editCell = Param::keyCheck($cellOptions, 'edit', true)) {\r\n\t\t\t$formAddCell = $editCell;\r\n\t\t\t$cell = $this->_editCell($cell, $editCell);\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\tif (is_array($cellOptions)) {\r\n\t\t\t$cell = [$cell, $cellOptions];\r\n\t\t}\r\n\t\t$this->row[] = $cell;\r\n\t\tif ($this->trCount == 0) {\r\n\t\t\t$this->formAddRow[] = $formAddCell;\r\n\t\t}\r\n\t}", "public function __construct($values = array())\n {\n for ($index = 0; $index < 9; ++$index) {\n $this->sections[] = $this->rows[$index] = new Row($index, $this);\n $this->sections[] = $this->columns[$index] = new Column($index, $this);\n $this->sections[] = $this->blocks[$index] = new Block($index, $this);\n }\n\n // Create cells\n foreach ($this->rows as $row) {\n $this->cells[$row->index] = array();\n foreach ($this->columns as $column) {\n $this->cells[$row->index][$column->index] = new Cell($row, $column, $this->blocks[intval(floor($row->index / 3) * 3 + floor($column->index / 3))], $this);\n }\n }\n\n // Set adjacent cells\n foreach ($this->rows as $row) {\n foreach ($this->columns as $column) {\n $this->cells[$row->index][$column->index]->setAdjacentCells();\n }\n }\n\n // Set values if given\n $this->setValues($values);\n }", "function add_cell($val, $link = \"\")\n\t{\n\t\tif (!empty($link))\n\t\t{\n\t\t\t$this->tpl->setCurrentBlock(\"begin_link\");\n\t\t\t$this->tpl->setVariable(\"LINK_TARGET\", $link);\n\t\t\t$this->tpl->parseCurrentBlock();\n\t\t\t$this->tpl->touchBlock(\"end_link\");\n\t\t}\n\n\t\t$this->tpl->setCurrentBlock(\"text\");\n\t\t$this->tpl->setVariable(\"TEXT_CONTENT\", $val);\n\t\t$this->tpl->parseCurrentBlock();\n\t\t$this->tpl->setCurrentBlock(\"table_cell\");\n\t\t$this->tpl->parseCurrentBlock();\n\t}", "private function _generateBlankRow(){\n\n $blankRow = array();\n foreach ($this->_fileHeader as $value){\n\n $blankRow[strtolower(str_replace(' ', '-', $value))] = '';\n }\n\n return $blankRow;\n }", "function OutputCell($width,$height,$htmlContent,$border=0,$LineFeedHeight=0,$align='',$fill=0,$cellmargin=3){\r\n\t$this->Cell($width, $height, '', $border, 0, $align, $fill);\r\n\t// on note la position apres la cellule\r\n\t$x = $this->x; $y = $this->y;\r\n\t$lmargin = $this->lMargin;\r\n\t$rmargin = $this->rMargin;\r\n\r\n\t// on se remet en debut de cellule\r\n\t$this->x-=$width;\r\n\t$this->x = $this->x+$cellmargin/2;\r\n\t$this->lMargin = $this->x; // pour que les retour ligne se fassent correctement dans la cellule\r\n\t$this->rMargin = $this->w-$this->x-$width+$cellmargin/2;\r\n\r\n\t$this -> WriteHTML($htmlContent,$LineFeedHeight);\r\n\t// on se remet a la fin de la cellule\r\n\t$this->x = $x; $this->y = $y;\r\n\t$this->lMargin = $lmargin;\r\n\t$this->rMargin = $rmargin;\r\n}", "function box_uphd ($a) {\r\n\t $text=$a[text];\r\n\t $thead=$a[thead];\r\n\t $BOXCOLOR=$a[BOXCOLOR];\r\n\t $ALIGN=$a[ALIGN];\r\n\t $theadalign=$a[theadalign];\r\n\t $INCOLOR=$a[INCOLOR];\r\n\r\n\t\t$this->defval($ALIGN, $this->simptext_def['ALIGN']);\r\n\t\t$this->defval($theadalign, $this->simptext_def['ALIGN']);\r\n\t\t$this->defval($BOXCOLOR, $this->color_def['color2']);\r\n\t\t$this->defval($INCOLOR, $this->color_def['color1']);\r\n\r\n\t\t$this->_debug2('box_uphd');\r\n\t\treturn(\r\n\t\t $this->doc_table(\r\n\t\t $this->beg_table(ARRAY(\r\n\t\t WIDTH=>'NULL',\r\n\t\t CELLPADDING=>2,\r\n\t\t BGCOLOR=>$BOXCOLOR)).\r\n\t\t $this->doc_tabrow(\r\n\t\t $this->beg_tabrow().\r\n\t\t $this->doc_tabcell(\r\n\t\t $this->beg_tabcell(ARRAY(ALIGN=>$theadalign)).\r\n\t\t $this->simptex(ARRAY(\r\n\t\t text=>$this->box_def[BOXPREHEAD].$thead,\r\n\t\t ALIGN=>$theadalign)).\r\n\t\t $this->end_tabcell()\r\n\t\t ).\r\n\t\t $this->end_tabrow().\r\n\t\t $this->beg_tabrow().\r\n\t\t $this->doc_tabcell(\r\n\t\t $this->beg_tabcell(ARRAY(\r\n\t\t ALIGN=>$theadalign)).\r\n\t\t $this->doc_table(\r\n\t\t $this->beg_table (ARRAY(\r\n\t\t WIDTH=>'100%',\r\n\t\t CELLPADDING=>5,\r\n\t\t BGCOLOR=>$INCOLOR)).\r\n\t\t $this->doc_tabrow(\r\n\t\t $this->beg_tabrow().\r\n\t\t $this->doc_tabcell(\r\n\t\t $this->beg_tabcell(ARRAY(\r\n\t\t ALIGN=>$ALIGN)).\r\n\t\t $this->simptex(ARRAY(\r\n\t\t text=>$text)).\r\n\t\t $this->end_tabcell()\r\n\t\t ).\r\n\t\t $this->end_tabrow()\r\n\t\t ).\r\n\t\t $this->end_table()\r\n\t\t ).\r\n\t\t $this->end_tabcell()\r\n\t\t ).\r\n\t\t $this->end_tabrow()\r\n\t\t ).\r\n\t\t $this->end_table()\r\n\t\t));\r\n\t}", "function printCell($data,$total,$col,$field,$file_name,$module,$data2,$incentive_ytd,$incentive_type,$period,$created_date,$modified_date){\n\t\t$j = 1;\n\t\t$total = $total;\n\t\t$field_count = count($field);\n\t\t$c_count = $field_count-1;\n\t\t$k = 0;\n\t\t\n\t\t// for view incentive 1\n\t\tif($module == 'view_incentive1'){\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A1', 'Employee');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A1')->setAutoSize(true);\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B1', $data2['employee']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A2', 'Incentive Type');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A2')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A2')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B2', $incentive_type);\n\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A3', 'Period');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A3')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A3')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B3', $period);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A4', 'Productivity %');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A4')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A4')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B4', $data2['productivity']);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('B4')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A5', 'Incentive Amount (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A5')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A5')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B5', $data2['eligible_incentive_amt']);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('B5')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C1', 'No. of Candidates Interviewed');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C1')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C1')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D1', $data2['interview_candidate']);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('D1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C2', 'Individual Contribution - YTD (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C2')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C2')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D2', $incentive_ytd);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('D2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C3', 'Created Date');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C3')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C3')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D3', $created_date);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C4', 'Modified Date');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C4')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C4')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D4', $modified_date);\n\n\t\t\t// iterate the multiple rows\n\t\t\tfor($i = 8; $i <= $total+7; $i++){\n\t\t\t\tfor($j = 0; $j < $field_count; $j++){\n\t\t\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue($col[$j] . $i, strip_tags($data[$k][$field[$j]]));\n\t\t\t\t}\n\t\t\t\t$k++;\n\t\t\t}\n\t\t\n\t\t}elseif($module == 'view_incentive2'){\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A1', 'Employee');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A1')->setAutoSize(true);\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B1', $data2['employee']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A2', 'Incentive Type');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A2')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A2')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B2', $incentive_type);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A3', 'Period');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A3')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A3')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B3', $period);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A4', 'Min. Performance Target (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A4')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A4')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B4', $data2['incentive_target_amt']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('A5', 'Actual Individual Contribution (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('A5')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('A5')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('B5', $data2['achievement_amt']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C1', 'Incentive Amount (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C1')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C1')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D1', $data2['eligible_incentive_amt']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C2', 'No. of Candidates Billed');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C2')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C2')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D2', $data2['candidate_billed']);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C3', 'Individual Contribution - YTD (In Rs.)');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C3')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C3')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D3', $incentive_ytd);\n\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C4', 'Created Date');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C4')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C4')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D4', $created_date);\n\t\t\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('C5', 'Modified Date');\n\t\t\t$this->objPHPExcel->getActiveSheet()->getStyle('C5')->getFont()->setBold(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension('C5')->setAutoSize(true);\t\n\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue('D5', $modified_date);\n\t\t\n\t\t\t// iterate the multiple rows\n\t\t\tfor($i = 9; $i <= $total+8; $i++){\n\t\t\t\tfor($j = 0; $j < $field_count; $j++){\n\t\t\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue($col[$j] . $i, strip_tags($data[$k][$field[$j]]));\n\t\t\t\t}\n\t\t\t\t$k++;\n\t\t\t}\n\t\t}else{\n\t\t\tfor($i = 2; $i <= $total+1; $i++){\n\t\t\t\tfor($j = 0; $j < $field_count; $j++){ \n\t\t\t\t\t$this->objPHPExcel->getActiveSheet()->setCellValue($col[$j] . $i, strip_tags($data[$k][$field[$j]]));\n\t\t\t\t}\n\t\t\t\t$k++;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t// auto size for columns \n\t\tforeach(range('A',\"$col[$c_count]\") as $columnID) {\n\t\t\t$this->objPHPExcel->getActiveSheet()->getColumnDimension($columnID)->setAutoSize(true);\n\t\t}\t\n\t\t// set the header\n\t\t$this->setHeader($file_name);\n\t}", "protected function _initsTable() {}", "protected function setUp()\n\t {\n\t\t$tex = \"\\\\documentclass[10pt]{article}\\n\";\n\t\t$tex .= \"\\\\usepackage{graphicx}\\n\";\n\t\t$tex .= \"\\\\usepackage[left=0mm,top=5mm,landscape,twoside=false]{geometry}\\n\";\n\t\t$tex .= \"\\\\special{papersize=220mm,110mm}\\n\";\n\t\t$tex .= \"\\\\setlength\\\\parskip{0pt}\\n\";\n\t\t$tex .= \"\\\\pagestyle{empty}\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \"\\\\begin{document}\\n\";\n\t\t$tex .= \" \\\\begin{minipage}[b]{100mm}\\n\";\n\t\t$tex .= \" \\\\footnotesize\\n\";\n\t\t$tex .= \" If undelivered please return to:\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \" Gefest Australia Pty Ltd\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \" 19 North Terrace\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \" Hackney SA 5069\\n\";\n\t\t$tex .= \" \\\\end{minipage}\\n\";\n\t\t$tex .= \" \\\\hfill\\n\";\n\t\t$tex .= \" \\\\begin{minipage}[b]{96mm}\\n\";\n\t\t$tex .= \" \\\\includegraphics[width=26mm,height=26mm]{\\$eps1\\$}\\n\";\n\t\t$tex .= \" \\\\end{minipage}\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \"\\\\vspace{1.0in}\\\\LARGE\\n\";\n\t\t$tex .= \"\\\\setlength\\\\parindent{60mm}\\n\";\n\t\t$tex .= \"\\\\textsf{JOE BLOGGS}\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \"\\\\textsf{BIG COMPANY PTY LTD}\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \"\\\\textsf{1 KING WILLIAM STREET}\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \"\\\\textsf{ADELAIDE SA 5000}\\n\";\n\t\t$tex .= \"\\\\end{document}\\n\";\n\n\t\t$this->object = new TeX($tex);\n\t }", "public function getCellPrototype()\n\t{\n\t\treturn $this->cell;\n\t}", "public function create() {\n $this->createPersonHeader();\n $this->createRecipientHeader();\n $this->createBody();\n $this->createText();\n $this->createFooter();\n }", "public function renderTableBody()\n {\n $models = array_values($this->dataProvider->getModels());\n $keys = $this->dataProvider->getKeys();\n $rows = [];\n foreach ($models as $index => $model) {\n $key = $keys[$index];\n if ($this->beforeRow !== null) {\n $row = call_user_func($this->beforeRow, $model, $key, $index, $this);\n if (!empty($row)) {\n $rows[] = $row;\n }\n }\n\n $rows[] = $this->renderTableRow($model, $key, $index);\n\n if ($this->afterRow !== null) {\n $row = call_user_func($this->afterRow, $model, $key, $index, $this);\n if (!empty($row)) {\n $rows[] = $row;\n }\n }\n }\n\n if (empty($rows) && $this->emptyText !== false) {\n $colspan = count($this->columns);\n\n return \"<tbody>\\n<tr><td colspan=\\\"$colspan\\\">\" . $this->renderEmpty() . \"</td></tr>\\n</tbody>\";\n }\n\n return \"<tbody>\\n\" . implode(\"\\n\", $rows) . \"\\n</tbody>\";\n }", "protected function makeEntries()\n {\n $this->setY($this->getY() + $this->layout['entriesPaddingTop']);\n $widths = $this->layout['entriesColumnWidths'];\n $alignment = $this->layout['entriesColumnAlignment'];\n\n $makeHeader = function ($widths, $alignment) {\n $header = [\n $this->t('quantity'),\n $this->t('item'),\n $this->t('price'),\n $this->t('total'),\n ];\n $this->setFont('', 'b');\n foreach ($widths as $index => $width) {\n $this->cell($width, $this->layout['titleCellHeight'], utf8_decode($header[$index]), 'BT', 0, $alignment[$index]);\n }\n $this->setFont('', '');\n $this->ln();\n };\n\n $makeHeader($widths, $alignment);\n $currentY = 0;\n $nextY = $this->getY();\n\n foreach ($this->entries as $entry) {\n $this->setY($nextY);\n if ($this->needsNewPage()) {\n $this->newPage();\n $makeHeader($widths, $alignment);\n $nextY = $this->getY();\n }\n $currentY = $nextY;\n $this->cell($widths[0], $this->layout['contentCellHeight'], $this->numberFormat($entry['quantity']), '', 0, $alignment[0]);\n $this->multiCell($widths[1], $this->layout['contentCellHeight'], utf8_decode($entry['description']), 0, $alignment[1]);\n $nextY = max($nextY, $this->getY());\n $this->setXY($this->layout['pagePaddingLeft'] + $widths[0] + $widths[1], $currentY);\n $this->cell($widths[2], $this->layout['contentCellHeight'], $this->numberFormat($entry['price']), '', 0, $alignment[2]);\n $total = $entry['quantity'] * $entry['price'];\n $this->cell($widths[3], $this->layout['contentCellHeight'], $this->numberFormat($total), '', 1, $alignment[3]);\n }\n\n $this->setY($nextY);\n $this->setFont('', 'b');\n $this->cell($widths[0], $this->layout['contentCellHeight'], '', 'BT');\n $this->cell($widths[1], $this->layout['contentCellHeight'], '', 'BT');\n $this->cell($widths[2], $this->layout['contentCellHeight'], '', 'BT');\n $this->cell($widths[3], $this->layout['contentCellHeight'], $this->variables['total'], 'BT', 0, $alignment[3]);\n $this->setFont('', '');\n }" ]
[ "0.661955", "0.6579929", "0.6475878", "0.64359766", "0.64234424", "0.6166463", "0.6143382", "0.61267924", "0.5845498", "0.579732", "0.5758643", "0.57569206", "0.57472616", "0.5743905", "0.57292324", "0.5712072", "0.5679854", "0.5667306", "0.55989164", "0.5590504", "0.5588566", "0.5540711", "0.5519123", "0.5493879", "0.54824173", "0.5482415", "0.5446013", "0.5437169", "0.54066694", "0.53597814", "0.5355247", "0.53202176", "0.53144276", "0.5311647", "0.5302277", "0.5301581", "0.5249797", "0.5237623", "0.52312577", "0.52131236", "0.5184745", "0.5162671", "0.51358724", "0.5121902", "0.51211977", "0.5117617", "0.51153725", "0.51080614", "0.50928265", "0.5090726", "0.50879216", "0.50870705", "0.5075406", "0.50681216", "0.5052476", "0.50399405", "0.50312626", "0.5024951", "0.5020756", "0.5005519", "0.50039166", "0.4994923", "0.497884", "0.49501222", "0.49491325", "0.49462917", "0.49441838", "0.49361277", "0.492493", "0.49235177", "0.49143556", "0.49128315", "0.49080348", "0.49046442", "0.49043894", "0.49015102", "0.48988903", "0.4895521", "0.48938566", "0.4890197", "0.4890086", "0.48727325", "0.4864782", "0.48630494", "0.4854175", "0.4852281", "0.48455676", "0.48422384", "0.48323607", "0.4832061", "0.48318365", "0.4828295", "0.48246986", "0.4823983", "0.48219976", "0.48199907", "0.48187467", "0.48176384", "0.4811258", "0.48111135" ]
0.84076047
0